Skip to content

Comment on Django-bcryptparent

Comments

I see that Google allows you to use the crypt module, and I would wager that their Python is linked against glibc, in which case, you might be able to use sha-crypt. It's worth checking. e.g.:

  def encode_password(password):
    """Return crypt() encoded password"""
    # Uses glibc SHA-crypt extension via $6$
    salt = b64encode(os.urandom(8)).rstrip('=')
    return crypt(password, '$6$' + salt)
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.