crypt for javascript

0

I'm working on a project that I need to use crypt as a method to encrypt the password, but what password do I need to use on the mobile, how do I use something that crypt will understand and which web will it also?

What I need is that wherever he is, he can easily encrypt and decrypt.

Another question adjacent to this one is.

Let's suppose that I encrypted the password, and now I want to check a test to testify that the password is correct. What is the right way to do it? Below is my example.

 $sql = "select USU.* from ( select COD_IDENT_IGREJ, COD_IDENT_PESSO, TXT_NOMEX_PESSO, TXT_FONEX_PESSO from tbl_PESSOAS where COD_IDENT_IGREJ = :COD_IDENT_IGREJ and TXT_EMAIL_PESSO = :TXT_EMAIL_PESSO and TXT_SENHA_USUAR = :TXT_SENHA_USUAR and FLG_STATU_PESSO = 'A' ) USU left join ( select COD_IDENT_IGREJ, FLG_STATU_IGREJ from tbl_IGREJA ) IGR on USU.COD_IDENT_IGREJ = IGR.COD_IDENT_IGREJ where IGR.FLG_STATU_IGREJ = 'A'";

    if (isset($this->params['email']) && isset($this->params['senha']) && isset($this->params['codIgreja'])) {
        $dataInput = array();
        $dataInput[':COD_IDENT_IGREJ'] = $this->params['codIgreja'];
        $dataInput[':TXT_EMAIL_PESSO'] = $this->params['email'];
        $dataInput[':TXT_SENHA_USUAR'] = crypt($this->params['senha']);
        $data = $this->conexao->fetchNaoRestritivo($sql, $dataInput);

After doing this I check $data to see if it exists or not. But as I've been reading about crypt every time it creates a different algorithm to encrypt and decrypt a password.

In these PDO cases, how can I check if the password is correct?

    
asked by anonymous 11.05.2016 / 15:42

0 answers