Rails Devise, how to unencrypt a password?

前端 未结 4 982
醉梦人生
醉梦人生 2021-01-02 21:28

in rails 3 devise, a user record has an encrypted_password and a password_salt.

How in the console, can I obtain a user\'s password? How to unencrypt?

4条回答
  •  执念已碎
    2021-01-02 21:49

    I think those passwords are one way encrypted: you can take a password provided by user, encrypt it and compare it to the encrypted one in the database (if matches - successful attempt). But un-encrypting the one in database is not possible, so that noone can get all passwords out. It is a security feature.

提交回复
热议问题