I use require 'digest/sha1' to encrypt my password and save it to the database. During login, I authenticate by matching the encrypted password stored in the database, and again encrypts the one that is used to enter the password in the field. At the moment, everything is working fine, but now I want to use the "Forgot Password" functionality. To do this, I need to decrypt the password that is stored in the database in order to find the original one. How to decrypt using digest/sha1 ? Or does anyone know any algorithm that also supports encryption and decryption?
I use ruby ββon rails, so I need Ruby to execute it.
ruby ruby-on-rails encryption
Salil
source share