I’m writing a very simple login system for a Rails app. I’m using RESTful authentication. It’s a fairly conventional setup, where I’m sending the email and password to authenticate the user.
Here, I used REMEMBER ME?, if same user again wanna login then by using cookie, user can re-login. Now thing is like, I want to print email and password in its respective text-box. Email is inserted into the textbox but I am facing a problem to show password in text-field.
At the time of login, such condition is used
@person.password_hash == BCrypt::Engine.hash_secret(@password, @person.password_salt)
How can I get my password in text form?
After a lot of searching the web, I found that
BCrypt::Engine.hash_secretis one-way encryption of password. This means there is no way to reverse the process. So if you are trying to make password text from BCrypt::Engine.hash_secret, you cannot do it.