I'm learning about encryption and decryption on linux and php. So I have three questions about openssl and how it generates password hashes.
1- So say I generated a password with the linux command
My first observation is that every time I generate a hash, it's different! Why is that? Is it because of salt? That's my first question.
2- Now my second question is about testing this password. Say I want to test the correctness of this password and get a binary answer, whether it's correct or not. How do I do that with openssl? If my question doesn't make sense, then how is
openssl passwd useful?
3- If I encrypt my password with a hash using
openssl passwd, and every time there's a random salt added to it, how does openssl decrypt it (or any other program for that matter)?