Encrypt word X to /etc/shadow encryption

encryptionopensslpassword

I've changed my password to X and the shadow file has changed to:

ahmad:$1$oYINSKjP$eCkCtJV/2dXerAD57WQPj/:15425:0:99999:7:::

I see the encrypted X as $1$oYINSKjP$eCkCtJV/2dXerAD57WQPj/. How can I retrieve the encrypted X without changing the password? openssl or any other command to use?

Best Answer

Your password isn't encrypted. It is hashed.

A salted MD5 hash has been generated and written to /etc/shadow. You cannot retrieve original value.

The original value X has been hashed in this format: $id$salt$encrypted - id == 1 stands for MD5 (see NOTES on manpage of crypt(3))

Related Question