3 ms·
But it does not have a function to use libc-style password hashes, so that doesn't help.
by hannob 3y ago
But it does not have a function to use libc-style password hashes, so that doesn't help.
- maxbond 3y agoOut of curiosity, why are people storing SHA512 hashes in that format? Is there a protocol or tool that requires it? I'm going out on a limb and assuming they aren't using it to check passwords.
- fullspectrumdev 3y agoIn my case (old style DES hashes) it’s to interact with some old crusty garbage. Unfortunately a lot of that old crusty shit is still in production in many places, despite being EoL for years, with no plans to replace it this side of 2038.
- eesmith 3y agoCan you switch to ctypes? >>> from ctypes.util import find_library >>> find_library("c") '/usr/lib/libc.dylib' >>> from ctypes import cdll >>> libc = cdll.LoadLibrary(find_library("c")) >>> import ctypes >>> libc.crypt.argtypes = [ctypes.c_char_p, ctypes.c_char_p] >>> libc.crypt.restype = ctypes.c_char_p >>> libc.crypt(b"toomanysecrets", b"az") b'azi4LBG1VJohQ' Here is what Python's own _crypt does: >>> import _crypt >>> _crypt.crypt("toomanysecrets", "az") 'azi4LBG1VJohQ'