Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
c792c83c
Kaydet (Commit)
c792c83c
authored
May 14, 2013
tarafından
Donald Stufft
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1062 from dstufft/switch-bcrypt-recommendations
Recommend using the bcrypt library instead of py-bcrypt
üst
80355335
8f0a4665
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
hashers.py
django/contrib/auth/hashers.py
+3
-3
test_hashers.py
django/contrib/auth/tests/test_hashers.py
+2
-2
passwords.txt
docs/topics/auth/passwords.txt
+3
-3
No files found.
django/contrib/auth/hashers.py
Dosyayı görüntüle @
c792c83c
...
...
@@ -263,13 +263,13 @@ class BCryptSHA256PasswordHasher(BasePasswordHasher):
Secure password hashing using the bcrypt algorithm (recommended)
This is considered by many to be the most secure algorithm but you
must first install the
py-
bcrypt library. Please be warned that
must first install the bcrypt library. Please be warned that
this library depends on native C code and might cause portability
issues.
"""
algorithm
=
"bcrypt_sha256"
digest
=
hashlib
.
sha256
library
=
(
"
py-
bcrypt"
,
"bcrypt"
)
library
=
(
"bcrypt"
,
"bcrypt"
)
rounds
=
12
def
salt
(
self
):
...
...
@@ -329,7 +329,7 @@ class BCryptPasswordHasher(BCryptSHA256PasswordHasher):
Secure password hashing using the bcrypt algorithm
This is considered by many to be the most secure algorithm but you
must first install the
py-
bcrypt library. Please be warned that
must first install the bcrypt library. Please be warned that
this library depends on native C code and might cause portability
issues.
...
...
django/contrib/auth/tests/test_hashers.py
Dosyayı görüntüle @
c792c83c
...
...
@@ -92,7 +92,7 @@ class TestUtilsHashPass(unittest.TestCase):
self
.
assertFalse
(
check_password
(
'lètmeiz'
,
encoded
))
self
.
assertEqual
(
identify_hasher
(
encoded
)
.
algorithm
,
"crypt"
)
@skipUnless
(
bcrypt
,
"
py-
bcrypt not installed"
)
@skipUnless
(
bcrypt
,
"bcrypt not installed"
)
def
test_bcrypt_sha256
(
self
):
encoded
=
make_password
(
'lètmein'
,
hasher
=
'bcrypt_sha256'
)
self
.
assertTrue
(
is_password_usable
(
encoded
))
...
...
@@ -108,7 +108,7 @@ class TestUtilsHashPass(unittest.TestCase):
self
.
assertTrue
(
check_password
(
password
,
encoded
))
self
.
assertFalse
(
check_password
(
password
[:
72
],
encoded
))
@skipUnless
(
bcrypt
,
"
py-
bcrypt not installed"
)
@skipUnless
(
bcrypt
,
"bcrypt not installed"
)
def
test_bcrypt
(
self
):
encoded
=
make_password
(
'lètmein'
,
hasher
=
'bcrypt'
)
self
.
assertTrue
(
is_password_usable
(
encoded
))
...
...
docs/topics/auth/passwords.txt
Dosyayı görüntüle @
c792c83c
...
...
@@ -76,8 +76,8 @@ use it Django supports bcrypt with minimal effort.
To use Bcrypt as your default storage algorithm, do the following:
1. Install the `
py-bcrypt`_ library
(probably by running ``sudo pip install
py-
bcrypt``, or downloading the library and installing it with ``python
1. Install the `
bcrypt library`_
(probably by running ``sudo pip install
bcrypt``, or downloading the library and installing it with ``python
setup.py install``).
2. Modify :setting:`PASSWORD_HASHERS` to list ``BCryptSHA256PasswordHasher``
...
...
@@ -185,7 +185,7 @@ mentioned algorithms won't be able to upgrade.
.. _pbkdf2: http://en.wikipedia.org/wiki/PBKDF2
.. _nist: http://csrc.nist.gov/publications/nistpubs/800-132/nist-sp800-132.pdf
.. _bcrypt: http://en.wikipedia.org/wiki/Bcrypt
.. _
py-bcrypt: http://pypi.python.org/pypi/py-
bcrypt/
.. _
`bcrypt library`: https://pypi.python.org/pypi/
bcrypt/
Manually managing a user's password
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment