in rails 3, the user record has encrypted_material and password_salt.
How can I get the user password in the console? How to decrypt?
When developing, the default algorithm is BCrypt, which AFAIK is not able to decrypt. If you need to decrypt passwords, you need to use a different algorithm, such as AES .
There is a gem that extends AES support for Devise.
. . , BCrypt. , - .
Devise BCrypt. encrypted_password USERS .
- : http://www.bcrypt-generator.com/
, : , , ( - ). , . .
class User < ActiveRecord::Base devise :database_authenticatable... def verify_password?(password) encryptor_class = Devise::Encryptors.const_get(Devise.encryptor.to_s.classify) encryptor_digest = encryptor_class.digest(password, Devise.stretches, self.password_salt, Devise.pepper) encryptor_digest == self.encrypted_password end end