2

For some reason using the crypt module uses the 13 char hash rather than sha-512 no matter what I try. I have seen countless questions about problems, but none of them match mine. Is there simply no way to change the crypt method?

>>> import crypt
>>> print(crypt.crypt("password", salt="$6$saltsalt"))
$6FMi11BJFsAc
>>> print(crypt.crypt("password", crypt.METHOD_SHA512))
$6FMi11BJFsAc
>>> 

Not sure exactly what is going on. If this is a case-specific thing, are there alternatives to crypt that have the same crypt(3) functionality?

Thanks in advance!

UnsignedByte
  • 849
  • 10
  • 29

1 Answers1

0

This is, unfortunately, an issue with the crypt(3) implementation on Macs. There is a cross-platform crypt library, passlib, but it doesn't seem to have received any updates in over a year; still, it's one Ansible recommends in it's FAQ, for example.

ModZero
  • 36
  • 2