Encryption-Decryption in Rails

前端 未结 5 1101
悲哀的现实
悲哀的现实 2020-12-18 04:09

I am using require \'digest/sha1\' to encrypt my password and save into database. During login I authenticate by matching the encrypted password saved in databa

5条回答
  •  离开以前
    2020-12-18 04:24

    As Horace Ho explained, you should never encrypt a password but always store a crypted salt.

    However, it's perfectly fine to crypt other kind of data, such as confidential information. Encryptor it's a simple but powerful wrapper for OpenSSL. It provides the ability to encrypt/decrypt attributes in any class.

提交回复
热议问题