How does storing encrypted password provide secure authentication?
Actually, storing an unencrypted password can be OK in certain circumstances, depending on what the password is used for and the threat model you are trying to defend against.

In any case, if you are authenticating to a remote system, you probably should be using public-key cryptography instead of a password if you possibly can.

Some relevant readings: 


https://security.stackexchange.com/q/12332/971
https://stackoverflow.com/q/2283937/781723
https://security.stackexchange.com/q/184021/971
https://security.stackexchange.com/q/20294/971
https://security.stackexchange.com/q/143338/971
https://security.stackexchange.com/q/129776/971
https://security.stackexchange.com/q/22760/971