Hi,
I've spent a good deal of time trying to code php to match the shadow password encryption file that comes with the latest Linux distributions. Unfortunately, I've not succeeded in matching the requirements for sha-512 password encryption with a salt with php.
I did find two other ways to generate the proper password, first with mkpasswd:
$ mkpasswd -m sha-512 a_password AndSaltOn16Bytes
$6$AndSaltOn16Bytes$EANS9RTpU/IxJ2kLyN3/WtpqFuMBOorC/Pl9p.CqpMJ6yD3GfJdSPdkPHXcUvSPcTEZd6zxKSQ6Z1N9dewjkq1
and second with python:
python -c "import crypt; \
print crypt.crypt('a_password','\$6\$AndSaltOn16Bytes\$')"
$6$AndSaltOn16Bytes$EANS9RTpU/IxJ2kLyN3/WtpqFuMBOorC/Pl9p.CqpMJ6yD3GfJdSPdkPHXcUvSPcTEZd6zxKSQ6Z1N9dewjkq1
Aside from the trivial format of $6$SALT$PASSWORD+SALT, can someone translate the python to equivalent php? I've spent a lot of time on this and never had the php to match these encryptions.
Thanks in advance!
Jeff