[issue41890] crypt produces wrong hashes for passwords containing newline character

Serhiy Storchaka report at bugs.python.org
Wed Sep 30 07:22:58 EDT 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

For openssl and mkpasswd the password does not contain the newline character. It contains a pair of characters "\" and "n". And the crypt module produces the same output for it:

$ python3 -c 'import crypt; print(crypt.crypt(r"password\n","$6$saltySalt"))'
$6$saltySalt$v.6rXp74bIjKX42ufuY7/KWnngOAgFReenROiPODOQYzlRuE2NT4/Bgs8s4ULd3BgKNZQQ7i9GqlibMhRw2SV1

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41890>
_______________________________________


More information about the Python-bugs-list mailing list