News for hackers. Stuff that matters.
Re:Django-bcrypt by js2 on Thursday February 03, 2011 @08:03PM (#2177827)
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)

There are no comments on this comment yet.