diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2012-04-19 16:17:13 -0400 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2012-04-19 16:17:13 -0400 |
| commit | aa4e6eec42ff77956a612f0f8b2312f3131106b6 (patch) | |
| tree | 026af88299652f8a8c916c07b4342caa73aa8382 /admin | |
| parent | 686e98f28b539f1ba7ed977c61505c54391041e5 (diff) | |
| download | passlib-aa4e6eec42ff77956a612f0f8b2312f3131106b6.tar.gz | |
sped up pbkdf2 implementation by 60% or so - upped the rounds for all pbkdf2 hashes
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/benchmarks.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/admin/benchmarks.py b/admin/benchmarks.py index 4b73ef2..4526a4e 100644 --- a/admin/benchmarks.py +++ b/admin/benchmarks.py @@ -8,7 +8,7 @@ parsing was being sped up. it could definitely be improved. #============================================================================= import os, sys root = os.path.join(os.path.dirname(__file__), os.path.pardir) -sys.path.insert(0, root) +sys.path.insert(0, os.curdir) #============================================================================= # imports @@ -236,6 +236,19 @@ def test_ldap_salted_md5(): yield helper #============================================================================= +# crypto utils +#============================================================================= +@benchmark.constructor() +def test_pbkdf2(): +# from passlib.hash import pbkdf2_sha1 + from passlib.hash import pbkdf2_sha256 as hash + def helper(): +# hash.encrypt("password", salt="salt", rounds=10000) + result = pbkdf2_sha1.encrypt("password", salt="salt", rounds=10000) + assert result == '$pbkdf2-sha256$10240$c2FsdA$FUGp71zmshcv1IwX1DV3ADWDyP66H/ANJZwmoGuF7FA' + yield helper + +#============================================================================= # main #============================================================================= def main(*args): |
