Weird behavior of crypt
Alexandre Garnier
zigarn@gmail.com
Fri Jan 29 12:03:00 GMT 2016
Hello.
I'm trying to do SHA-512 password encryption, but the result is really
weird on Cygwin:
# On Cygwin(either 32 or 64) 2.4.1-1, latest updates with crypt 1.1-1,
libcrypt0 1.1-1, libcrypt-devel 1.1-1
$ crypt '$6$7dl4B0fKUimdnR$' test_value
$6wOs/zKP2jDM
$ python -c 'import crypt; print crypt.crypt("test_value",
"$6$7dl4B0fKUimdnR$")' # Python 2.7.10
$6wOs/zKP2jDM
$ perl -e 'print crypt("test_value", "\$6\$7dl4B0fKUimdnR\$")."\n"' #
Perl v5.22.1
$6wOs/zKP2jDM
Am I missing something?
On other system, I get a more expected result:
# On Ubuntu 15.04
$ mkpasswd --method=SHA-512 test_value 7dl4B0fKUimdnR
$6$7dl4B0fKUimdnR$f6gCu.3IfrxhsnJKFnusDH.UudC.lLOSB1G3D1bIboWxlixzBy2xO/3rCKHmzfwekCTvmQd11bPdcsJOaLkCJ.
$ python -c 'import crypt; print crypt.crypt("test_value",
"$6$7dl4B0fKUimdnR$")' # Python 2.7.10
$6$7dl4B0fKUimdnR$f6gCu.3IfrxhsnJKFnusDH.UudC.lLOSB1G3D1bIboWxlixzBy2xO/3rCKHmzfwekCTvmQd11bPdcsJOaLkCJ.
$ perl -e 'print crypt("test_value", "\$6\$7dl4B0fKUimdnR\$")."\n"' #
Perl v5.20.2
$6$7dl4B0fKUimdnR$f6gCu.3IfrxhsnJKFnusDH.UudC.lLOSB1G3D1bIboWxlixzBy2xO/3rCKHmzfwekCTvmQd11bPdcsJOaLkCJ.
# On RHEL 6.6
$ python -c 'import crypt; print crypt.crypt("test_value",
"$6$7dl4B0fKUimdnR$")' # Python 2.6.6
$6$7dl4B0fKUimdnR$f6gCu.3IfrxhsnJKFnusDH.UudC.lLOSB1G3D1bIboWxlixzBy2xO/3rCKHmzfwekCTvmQd11bPdcsJOaLkCJ.
$ perl -e 'print crypt("test_value", "\$6\$7dl4B0fKUimdnR\$")."\n"' #
Perl v5.10.1
$6$7dl4B0fKUimdnR$f6gCu.3IfrxhsnJKFnusDH.UudC.lLOSB1G3D1bIboWxlixzBy2xO/3rCKHmzfwekCTvmQd11bPdcsJOaLkCJ.
--
Alex
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list