diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2015-07-25 14:00:23 -0400 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2015-07-25 14:00:23 -0400 |
| commit | 23b8945f00e7a296445e7bea29426f94ec6c1c8a (patch) | |
| tree | 9b5b0a2d33a4b32598ee17f988c14e5c41d7298a | |
| parent | 7669a1d7a43ea2aa65363d3fd4bd101b22b50813 (diff) | |
| download | passlib-23b8945f00e7a296445e7bea29426f94ec6c1c8a.tar.gz | |
retuned/updated default rounds settings for all hashes
| -rw-r--r-- | docs/password_hash_api.rst | 4 | ||||
| -rw-r--r-- | passlib/apps.py | 8 | ||||
| -rw-r--r-- | passlib/handlers/django.py | 4 | ||||
| -rw-r--r-- | passlib/handlers/fshp.py | 4 | ||||
| -rw-r--r-- | passlib/handlers/pbkdf2.py | 6 | ||||
| -rw-r--r-- | passlib/handlers/phpass.py | 4 | ||||
| -rw-r--r-- | passlib/handlers/scram.py | 4 | ||||
| -rw-r--r-- | passlib/handlers/sha1_crypt.py | 4 | ||||
| -rw-r--r-- | passlib/handlers/sha2_crypt.py | 8 | ||||
| -rw-r--r-- | passlib/handlers/sun_md5_crypt.py | 4 |
10 files changed, 25 insertions, 25 deletions
diff --git a/docs/password_hash_api.rst b/docs/password_hash_api.rst index 8d20dbf..4e78932 100644 --- a/docs/password_hash_api.rst +++ b/docs/password_hash_api.rst @@ -740,5 +740,5 @@ However, some older algorithms (e.g. :class:`~passlib.hash.bsdi_crypt`) are weak a tradeoff must be made, choosing "secure but intolerably slow" over "fast but unacceptably insecure". For this reason, it is strongly recommended to not use a value much lower than Passlib's default. -.. [#avgsys] For Passlib 1.6.2, all hashes were retuned to take ~300ms on a - system with a 2.5 ghz 64 bit CPU. +.. [#avgsys] For Passlib 1.6.3, all hashes were retuned to take ~300ms on a + system with a 3.0 ghz 64 bit CPU. diff --git a/passlib/apps.py b/passlib/apps.py index da5f2b0..ceb5e1f 100644 --- a/passlib/apps.py +++ b/passlib/apps.py @@ -77,12 +77,12 @@ custom_app_context = LazyCryptContext( all__vary_rounds = 0.1, # set a good starting point for rounds selection - sha512_crypt__min_rounds = 60000, - sha256_crypt__min_rounds = 80000, + sha512_crypt__min_rounds = 535000, + sha256_crypt__min_rounds = 535000, # if the admin user category is selected, make a much stronger hash, - admin__sha512_crypt__min_rounds = 120000, - admin__sha256_crypt__min_rounds = 160000, + admin__sha512_crypt__min_rounds = 1024000, + admin__sha256_crypt__min_rounds = 1024000, ) #============================================================================= diff --git a/passlib/handlers/django.py b/passlib/handlers/django.py index cdb853b..59574a1 100644 --- a/passlib/handlers/django.py +++ b/passlib/handlers/django.py @@ -270,7 +270,7 @@ class django_pbkdf2_sha256(DjangoVariableHash): :type rounds: int :param rounds: Optional number of rounds to use. - Defaults to 20000, but must be within ``range(1,1<<32)``. + Defaults to 29000, but must be within ``range(1,1<<32)``. :type relaxed: bool :param relaxed: @@ -323,7 +323,7 @@ class django_pbkdf2_sha1(django_pbkdf2_sha256): :type rounds: int :param rounds: Optional number of rounds to use. - Defaults to 60000, but must be within ``range(1,1<<32)``. + Defaults to 131000, but must be within ``range(1,1<<32)``. :type relaxed: bool :param relaxed: diff --git a/passlib/handlers/fshp.py b/passlib/handlers/fshp.py index 6efc782..920283f 100644 --- a/passlib/handlers/fshp.py +++ b/passlib/handlers/fshp.py @@ -40,7 +40,7 @@ class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): :param rounds: Optional number of rounds to use. - Defaults to 100000, must be between 1 and 4294967295, inclusive. + Defaults to 480000, must be between 1 and 4294967295, inclusive. :param variant: Optionally specifies variant of FSHP to use. @@ -79,7 +79,7 @@ class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): #--HasRounds-- # FIXME: should probably use different default rounds # based on the variant. setting for default variant (sha256) for now. - default_rounds = 100000 # current passlib default, FSHP uses 4096 + default_rounds = 480000 # current passlib default, FSHP uses 4096 min_rounds = 1 # set by FSHP max_rounds = 4294967295 # 32-bit integer limit - not set by FSHP rounds_cost = "linear" diff --git a/passlib/handlers/pbkdf2.py b/passlib/handlers/pbkdf2.py index caf793d..fd5fbad 100644 --- a/passlib/handlers/pbkdf2.py +++ b/passlib/handlers/pbkdf2.py @@ -135,9 +135,9 @@ def create_pbkdf2_hash(hash_name, digest_size, rounds=12000, ident=None, module= #------------------------------------------------------------------------ # derived handlers #------------------------------------------------------------------------ -pbkdf2_sha1 = create_pbkdf2_hash("sha1", 20, 60000, ident=u("$pbkdf2$")) -pbkdf2_sha256 = create_pbkdf2_hash("sha256", 32, 20000) -pbkdf2_sha512 = create_pbkdf2_hash("sha512", 64, 19000) +pbkdf2_sha1 = create_pbkdf2_hash("sha1", 20, 131000, ident=u("$pbkdf2$")) +pbkdf2_sha256 = create_pbkdf2_hash("sha256", 32, 29000) +pbkdf2_sha512 = create_pbkdf2_hash("sha512", 64, 25000) ldap_pbkdf2_sha1 = uh.PrefixWrapper("ldap_pbkdf2_sha1", pbkdf2_sha1, "{PBKDF2}", "$pbkdf2$", ident=True) ldap_pbkdf2_sha256 = uh.PrefixWrapper("ldap_pbkdf2_sha256", pbkdf2_sha256, "{PBKDF2-SHA256}", "$pbkdf2-sha256$", ident=True) diff --git a/passlib/handlers/phpass.py b/passlib/handlers/phpass.py index c1e8a5f..7db32b0 100644 --- a/passlib/handlers/phpass.py +++ b/passlib/handlers/phpass.py @@ -42,7 +42,7 @@ class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): :type rounds: int :param rounds: Optional number of rounds to use. - Defaults to 17, must be between 7 and 30, inclusive. + Defaults to 19, must be between 7 and 30, inclusive. This value is logarithmic, the actual number of iterations used will be :samp:`2**{rounds}`. :type ident: str @@ -75,7 +75,7 @@ class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): salt_chars = uh.HASH64_CHARS #--HasRounds-- - default_rounds = 17 + default_rounds = 19 min_rounds = 7 max_rounds = 30 rounds_cost = "log2" diff --git a/passlib/handlers/scram.py b/passlib/handlers/scram.py index d5f6708..02133cd 100644 --- a/passlib/handlers/scram.py +++ b/passlib/handlers/scram.py @@ -49,7 +49,7 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): :type rounds: int :param rounds: Optional number of rounds to use. - Defaults to 20000, but must be within ``range(1,1<<32)``. + Defaults to 100000, but must be within ``range(1,1<<32)``. :type algs: list of strings :param algs: @@ -102,7 +102,7 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): max_salt_size = 1024 #--HasRounds-- - default_rounds = 20000 + default_rounds = 100000 min_rounds = 1 max_rounds = 2**32-1 rounds_cost = "linear" diff --git a/passlib/handlers/sha1_crypt.py b/passlib/handlers/sha1_crypt.py index 885c67f..b243bc0 100644 --- a/passlib/handlers/sha1_crypt.py +++ b/passlib/handlers/sha1_crypt.py @@ -47,7 +47,7 @@ class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler :type rounds: int :param rounds: Optional number of rounds to use. - Defaults to 64000, must be between 1 and 4294967295, inclusive. + Defaults to 480000, must be between 1 and 4294967295, inclusive. :type relaxed: bool :param relaxed: @@ -77,7 +77,7 @@ class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler salt_chars = uh.HASH64_CHARS #--HasRounds-- - default_rounds = 64000 # current passlib default + default_rounds = 480000 # current passlib default min_rounds = 1 # really, this should be higher. max_rounds = 4294967295 # 32-bit integer limit rounds_cost = "linear" diff --git a/passlib/handlers/sha2_crypt.py b/passlib/handlers/sha2_crypt.py index 11b485e..3c3dd66 100644 --- a/passlib/handlers/sha2_crypt.py +++ b/passlib/handlers/sha2_crypt.py @@ -374,7 +374,7 @@ class sha256_crypt(_SHA2_Common): :type rounds: int :param rounds: Optional number of rounds to use. - Defaults to 110000, must be between 1000 and 999999999, inclusive. + Defaults to 535000, must be between 1000 and 999999999, inclusive. :type implicit_rounds: bool :param implicit_rounds: @@ -402,7 +402,7 @@ class sha256_crypt(_SHA2_Common): ident = u("$5$") checksum_size = 43 # NOTE: using 25/75 weighting of builtin & os_crypt backends - default_rounds = 110000 + default_rounds = 535000 #=================================================================== # backends @@ -435,7 +435,7 @@ class sha512_crypt(_SHA2_Common): :type rounds: int :param rounds: Optional number of rounds to use. - Defaults to 100000, must be between 1000 and 999999999, inclusive. + Defaults to 656000, must be between 1000 and 999999999, inclusive. :type implicit_rounds: bool :param implicit_rounds: @@ -465,7 +465,7 @@ class sha512_crypt(_SHA2_Common): checksum_size = 86 _cdb_use_512 = True # NOTE: using 25/75 weighting of builtin & os_crypt backends - default_rounds = 100000 + default_rounds = 656000 #=================================================================== # backend diff --git a/passlib/handlers/sun_md5_crypt.py b/passlib/handlers/sun_md5_crypt.py index 9ba3908..a6a966d 100644 --- a/passlib/handlers/sun_md5_crypt.py +++ b/passlib/handlers/sun_md5_crypt.py @@ -193,7 +193,7 @@ class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): :type rounds: int :param rounds: Optional number of rounds to use. - Defaults to 5500, must be between 0 and 4294963199, inclusive. + Defaults to 34000, must be between 0 and 4294963199, inclusive. :type bare_salt: bool :param bare_salt: @@ -231,7 +231,7 @@ class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): max_salt_size = None salt_chars = uh.HASH64_CHARS - default_rounds = 5500 # current passlib default + default_rounds = 34000 # current passlib default min_rounds = 0 max_rounds = 4294963199 ##2**32-1-4096 # XXX: ^ not sure what it does if past this bound... does 32 int roll over? |
