From 0db4ea7949997265fcaae406a26070af86d4bb65 Mon Sep 17 00:00:00 2001 From: Eli Collins Date: Thu, 26 Dec 2013 10:50:07 -0500 Subject: added passlib.hash.bcrypt_sha256 * not too much trouble, and definitely needed. after considering options, decided to use sha256 + base64. * added note re: bcrypt password truncation * HasBackend mixin -- changed to use _calc_checksum_backend() as the attribute it patches, instead of _calc_checksum(). makes it easier to consolidate code common to all backends (e.g. bcrypt) * test_60_secret_size: changed hardcoded exception list to a class flag * added registry test to make sure all hashes are being tested (with a few known exceptions) * clarified names inside builtin bcrypt backend * updated changelog --- docs/lib/passlib.hash.bcrypt.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/lib/passlib.hash.bcrypt.rst') diff --git a/docs/lib/passlib.hash.bcrypt.rst b/docs/lib/passlib.hash.bcrypt.rst index b94dfa8..eafe7ac 100644 --- a/docs/lib/passlib.hash.bcrypt.rst +++ b/docs/lib/passlib.hash.bcrypt.rst @@ -93,6 +93,21 @@ While BCrypt's basic algorithm is described in it's design document [#f1]_, the OpenBSD implementation [#f2]_ is considered the canonical reference, even though it differs from the design document in a few small ways. +Security Issues +=============== + +.. _bcrypt-password-truncation: + +* Password Truncation. + + While not a security issue per-se, bcrypt does have one major limitation: + password are truncated on the first NULL byte (if any), + and only the first 72 bytes of a password are hashed... all the rest are ignored. + Furthermore, bytes 55-72 are not fully mixed into the resulting hash (citation needed!). + To work around both these issues, many applications first run the password through a message + digest such as SHA2-256. Passlib offers the premade :doc:`passlib.hash.bcrypt_sha256` + to take care of this issue. + Deviations ========== This implementation of bcrypt differs from others in a few ways: -- cgit v1.2.1