News for hackers. Stuff that matters.
Re:Django-bcrypt by marcinw on Thursday February 03, 2011 @07:10PM (#2177661)
Unfortunately, for a lot of us working in locked down environments, this code makes use of the py-bcrypt module which uses the bcrypt C implementation. If you're running on GAE, you're out of luck. I keep telling myself to port to pure Python, but haven't had time. Anyone interested?
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)
Re:Django-bcrypt by amalcon on Thursday February 03, 2011 @07:26PM (#2177709)
There's a pure-Python implementation of PBKDF2. I know it's not as good as bcrypt or scrypt, but at least it's better than MD5 or one of the SHA's.
Re:Django-bcrypt by koenigdavidmj on Thursday February 03, 2011 @07:52PM (#2177797)
I saw a Twitter discussion with Colin a couple weeks ago here he pointed out that Python no longer guarantees constant time for all of the basic binary operations like addition (since fixed width integers can spill over to arbitrary precision math if you overflow them, or breathe on them wrong).

Be careful.

Re:Django-bcrypt by dfox on Thursday February 03, 2011 @08:09PM (#2177849)
Password hashing function almost by definition does not handle any data that must be protected from the user, so side channel leaks do not make much sense. Only secret information comes into play in final comparison of hash of user supplied password and your stored hash and I don't see any way of exploiting possible timing leak in that comparison that does not require breaking the hash in the first place.
Re:Django-bcrypt by tptacek on Thursday February 03, 2011 @10:02PM (#2178154)
Side channels don't matter for bcrypt.
Re:Django-bcrypt by koenigdavidmj on Friday February 04, 2011 @11:04AM (#2179880)
Can you explain why this is? (Not doubting you; just curious.)
Re:Django-bcrypt by tptacek on Friday February 04, 2011 @12:14PM (#2180176)
The online operations exposed to an attacker in a bcrypt system are done almost entirely on attacker-known data.
Re:Django-bcrypt by amalcon on Thursday February 03, 2011 @08:03PM (#2177824)
Oh boy. That could get messy.