In general, you shouldn't be doing this yourself, but following
the guidelines for the system you are using. The "correct" way
of storing passwords is with a "one-way" hash, with "salt" and
"key strengthening". The term "one-way" means just that. Once
you hash it, you can never recover the password yourself.
There's no way to ever recover the password. But, you can still
check if the user has entered the correct password by repeating
the hash on what they typed in, and see if it matches the one
stored in the database. If hackers steal your password hashes,
they can crack them offline. The most common crack is to pre-
calculate a zillion password hashes. When they steal hashes from
your site, they look them up in a table, and instantly find the
original password. To defeat that, you "salt" the password. You
generate some random text, and hash that text with the password.
You then store that salt+hash in your database. This forces the
hackers to "brute-force" your passwords instead of using a
"table lookup". Hac