omz / Pythonista-Issues

Issue tracker for Pythonista (iOS)
168 stars 14 forks source link

crypt module truncating salt to first two chars. #540

Open Razewolf opened 6 years ago

Razewolf commented 6 years ago

import crypt crypt.crypt('password',salt=crypt.METHOD_SHA256)

Expected result (changes at each run): $5$PlBwxO.5q9bk9Vas$99rywcrh1Og9aRKcH3/NdKP/YphCqTAe8Ts16eYMCu3

Pythonista3 result (same at each run): $5vvFjbkJCcrk

System Details:

jsbain commented 6 years ago

crypt.methods A list of available password hashing algorithms, as crypt.METHOD_* objects. This list is sorted from strongest to weakest, and is guaranteed to have at least crypt.METHOD_CRYPT.

Not all methods are guaranteed on all platforms. only METHOD_CRYPT is available in pythonista on ios

jsbain commented 6 years ago

you might look into passlib, which purportedly has a pure python implementation of sha256.