I wondered that it might be possible to put something like a two-way hash.
Here's why that would not work: hashing is one way. You can hash the password but you cannot unhash it.
You could encrypt the password but you'd need to store the clear password for decrypting the password in a file or the database. That would out you back to square one and doesn't add any security. ;)