Skip to content

Commit c792c83

Browse files
committed
Merge pull request django#1062 from dstufft/switch-bcrypt-recommendations
Recommend using the bcrypt library instead of py-bcrypt
2 parents 8035533 + 8f0a466 commit c792c83

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

django/contrib/auth/hashers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,13 @@ class BCryptSHA256PasswordHasher(BasePasswordHasher):
263263
Secure password hashing using the bcrypt algorithm (recommended)
264264
265265
This is considered by many to be the most secure algorithm but you
266-
must first install the py-bcrypt library. Please be warned that
266+
must first install the bcrypt library. Please be warned that
267267
this library depends on native C code and might cause portability
268268
issues.
269269
"""
270270
algorithm = "bcrypt_sha256"
271271
digest = hashlib.sha256
272-
library = ("py-bcrypt", "bcrypt")
272+
library = ("bcrypt", "bcrypt")
273273
rounds = 12
274274

275275
def salt(self):
@@ -329,7 +329,7 @@ class BCryptPasswordHasher(BCryptSHA256PasswordHasher):
329329
Secure password hashing using the bcrypt algorithm
330330
331331
This is considered by many to be the most secure algorithm but you
332-
must first install the py-bcrypt library. Please be warned that
332+
must first install the bcrypt library. Please be warned that
333333
this library depends on native C code and might cause portability
334334
issues.
335335

django/contrib/auth/tests/test_hashers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_crypt(self):
9292
self.assertFalse(check_password('lètmeiz', encoded))
9393
self.assertEqual(identify_hasher(encoded).algorithm, "crypt")
9494

95-
@skipUnless(bcrypt, "py-bcrypt not installed")
95+
@skipUnless(bcrypt, "bcrypt not installed")
9696
def test_bcrypt_sha256(self):
9797
encoded = make_password('lètmein', hasher='bcrypt_sha256')
9898
self.assertTrue(is_password_usable(encoded))
@@ -108,7 +108,7 @@ def test_bcrypt_sha256(self):
108108
self.assertTrue(check_password(password, encoded))
109109
self.assertFalse(check_password(password[:72], encoded))
110110

111-
@skipUnless(bcrypt, "py-bcrypt not installed")
111+
@skipUnless(bcrypt, "bcrypt not installed")
112112
def test_bcrypt(self):
113113
encoded = make_password('lètmein', hasher='bcrypt')
114114
self.assertTrue(is_password_usable(encoded))

docs/topics/auth/passwords.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ use it Django supports bcrypt with minimal effort.
7676

7777
To use Bcrypt as your default storage algorithm, do the following:
7878

79-
1. Install the `py-bcrypt`_ library (probably by running ``sudo pip install
80-
py-bcrypt``, or downloading the library and installing it with ``python
79+
1. Install the `bcrypt library`_ (probably by running ``sudo pip install
80+
bcrypt``, or downloading the library and installing it with ``python
8181
setup.py install``).
8282

8383
2. Modify :setting:`PASSWORD_HASHERS` to list ``BCryptSHA256PasswordHasher``
@@ -185,7 +185,7 @@ mentioned algorithms won't be able to upgrade.
185185
.. _pbkdf2: http://en.wikipedia.org/wiki/PBKDF2
186186
.. _nist: http://csrc.nist.gov/publications/nistpubs/800-132/nist-sp800-132.pdf
187187
.. _bcrypt: http://en.wikipedia.org/wiki/Bcrypt
188-
.. _py-bcrypt: http://pypi.python.org/pypi/py-bcrypt/
188+
.. _`bcrypt library`: https://pypi.python.org/pypi/bcrypt/
189189

190190

191191
Manually managing a user's password

0 commit comments

Comments
 (0)