Suppose I want develop a authetication/user system, and I'd like to be able to recover original users passwords if I need, what are the disvantages to encrypt password vs hashing from the security point of view?
Of course the application will use just the public key, and the authetication will be executed just comparing the encrypted strings with the public key.
The private key can be used in two way:
- I keep the private key on my offline devices for special manual password recovery operation.
- The private key is in the application but encrypted with a password.
Considering nobody (except me) can access the private key, what are the security weakness of these implementation choices rather than hashing password?
About the second option, potentially a hacker can hack the application server and wait I insert the password to decrypt the private key, but I think in this case the hacker can already do many more bad actions than to wait the private key decryption (as wait just user send their password when login and others...)
Thanks
EDIT: What I would mainly understand, is if using encryption is as safe as using hashing (of course supposing the cracker can't get private key).