I have this script that encrypts a password but I don\'t know how to reverse it and decrypt it. This may be a very simple answer but I don\'t understand how to do it.
<
To answer the original posters question.... to 'decrypt' the password, you have to do what a password cracker would do.
In other words, you'd run a program to read from a large list of potential passwords (a password dictionary) and you'd hash each one using bcrypt
and the salt and complexity from the password you're trying to decipher. If you're lucky you'll find a match, but if the password is a strong one then you likely won't find a match.
Bcrypt
has the added security characteristic of being a slow hash. If your password had been hashed with md5 (terrible choice) then you'd be able to check billions of passwords per second, but since it's hashed using bcrypt
you will be able to check far fewer per second.
The fact that bcrypt
is slow to hash and salted is what makes it a good choice for password storage even today. That being said I believe NIST
recommends the PBKDF2 for password hashing.