Codeigniter: How can i encrypt password before submitting the form to the controller?

前端 未结 5 671
隐瞒了意图╮
隐瞒了意图╮ 2020-12-28 12:06

I have a simple html login form

5条回答
  •  佛祖请我去吃肉
    2020-12-28 12:20

    Go through http://codeigniter.com/user_guide/libraries/encryption.html . Everything about the encryption and decryption is described here.

    Performs the data encryption and returns it as a string. Example:

    $pass_word = $this->encrypt->encode(input->post('pass_word'));  
    

    Decrypts an encoded string. Example:

    $encrypted_pass_word = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
    
    $plaintext_pass_word = $this->encrypt->decode($encrypted_pass_word);
    

    You can optionally pass your encryption key via the second parameter if you don't want to use the one in your config file. Go through the link to read the detail explanation about it.

提交回复
热议问题