python glibc crypt() function

geremy condra debatem1 at gmail.com
Wed Apr 21 09:49:01 EDT 2010


On Wed, Apr 21, 2010 at 2:29 AM, luca72 <lucaberto at libero.it> wrote:
> On 20 Apr, 19:38, Peter Otten <__pete... at web.de> wrote:
>> luca72 wrote:
>> > Hello i have to do this :
>> > glibc crypt() function, using salt $1$abcdefgh$
>>
>> > cryptPw = crypt(plainPw, "$1$abcdefgh$")
> Thanks
> The result is correct i obtain the same with ctypes and crypt module,
> so i think that is better to use the crypt module is correct?
>
> Luca

Be aware that the beginning of the salt string determines the
type of hash you're using, and it looks to me like that's the
old-style MD5-based hash. It's far from 'broken', but it has a
few issues. Better would be to move to the SHA512-based
$6$ if your platform supports it.

Geremy Condra



More information about the Python-list mailing list