summaryrefslogtreecommitdiff
path: root/passlib/utils/pbkdf2.py
Commit message (Collapse)AuthorAgeFilesLines
* cleanup old python compat -- removed "unicode_or_str" and ↵Eli Collins2020-10-061-3/+2
| | | | "native_string_types" aliases
* cleanup old python compat -- removed all "from __future__" importsEli Collins2020-10-061-1/+0
|
* general: went ahead and removed a bunch of deprecated features that were ↵Eli Collins2016-11-281-12/+1
| | | | | | | | | scheduled for removal in v1.8. this removes CryptPolicy, unix_fallback, some old HtpasswdFile methods, and more. tests were updated as well. see history/1.8 for a complete list.
* passlib.utils: relocated a bunch of properties & decorators to .utils.decorEli Collins2016-11-221-1/+1
|
* pbkdf2: removed support for M2Crypto backend -- was only useful for sha1Eli Collins2016-06-201-4/+0
| | | | | (a border case anyways), and hashlib or fastpbkdf2 are much better choices for this use case.
* relocated many of the crypto routes inside passlib.utils,Eli Collins2016-02-101-422/+64
| | | | | | | | | | | | | | | | | | | and moved them to a separate passlib.crypto subpackage. along with this move, made a few api cleanups: * unified all code that's looking up hashes to use new passlib.crypto.lookup_hash() wrapper, which takes care of hash name normalization, loading fallback implementations, and alg metadata inspection, all hidden behind a memoized function. * deprecated pbkdf2() in favor of pbkdf2_hmac() -- only real use, and new signature matches stdlib function. additionally, this version is a bit faster, due to some assumptions that can be made due to the PRF always being HMAC based. * added compile_hmac() helper which does an even more efficient job of pre-compiling a keyed HMAC function; this helped speed up pbkdf2 a bit more.
* misc test bugfixesEli Collins2015-07-261-0/+1
| | | | | | | | | | | | | | | | | | | | | * test_handlers: fix py3 u() compat issue * test_totp: clean norm_hash_name() caches so warnings repeat per-test, added/fixed some warnings checks. * HandlerCase: HasRounds.using() test: hack so bsdi_crypt can pass (the 'odd rounds only' was playing havoc w/ the test's expectations) * HandlerCase: effective_rounds() / effective_ident() helpers now unwrap PrefixWrappers first; wrappers aren't callable like classes. * HandlerCase: HasRounds.using() test: don't check min_rounds-1 if min_rounds is 0. * HandlerCase: multithreaded fuzz test -- detect & log errors if stalled thread, rather than main thread stalling forever. reduced thread count down to 10. * reset_warning_filter() context manager -- simplified __exit__() cleanup code
* removed a LOT of compatibility shims -- dropped python 2.5, 3.0, and 3.1 ↵Eli Collins2015-01-101-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | support; as well as PyPy 1.x and Jython 2.5. shims removed ------------- * b() shim replaced with b'' (py25) * 'bytes' alias no longer needed (py25) * callable() shim no longer needed (py30,31) * PY_MIN_32 flag replaced with PY3 flag (py30,31) * removed 'abc' module stub used by passlib.ifc (py25) * removed chain_from_iterable() backport (py25) * tests: removed catch_warnings() backport, replaced refs with real warnings.catch_warnings() (py25) * tests: removed unittest2 backports (py25, py30, py31) -- now throw hard error if unittest2 not present under py26 (the only release remaining which lacks the unittest2 features) * removed SUPPORTS_DIR_METHOD conditional (py25, pypy 1.x) * some other minor workarounds other ----- * added check in passlib.compat which now throws error telling user version isn't supported (to prevent spurious errors later)
* pbkdf cleanupsEli Collins2013-04-101-32/+24
| | | | | * updated sha1_crypt to use get_keyed_prf(), should be ~10% faster * documented get_hash_info() and get_keyed_prf()
* style cleanupsEli Collins2013-04-091-8/+8
|
* minor py3 bugfix in get_hash_info()Eli Collins2013-04-091-1/+1
|
* massive cleanup of documentation typos, thanks to Thomas Waldmann (issue 27, ↵Eli Collins2013-04-061-2/+2
| | | | comment 7)
* UT & bugfix for get_hash_info()Eli Collins2013-01-231-5/+6
|
* pbkdf2() sped up ~20% by precomputing intermediate hmac hashesEli Collins2013-01-231-98/+247
| | | | | | | * also added get_hash_info(), get_keyed_prf() helpers (which still need their own docs & unittests) * a few more tweaks to simplify code paths in pbkdf2.py
* project-wide whitespace & comment cleanup (it's been a couple of years)Eli Collins2012-08-011-26/+26
|
* loads of documentation updatesEli Collins2012-05-011-10/+11
|
* better coverage of crypto routines, fixed some bugsEli Collins2012-04-301-54/+61
|
* added some missing tests; fixed a bunch of bugsEli Collins2012-04-281-26/+21
|
* assorted small details that weren't covered in the last few mergesEli Collins2012-04-271-2/+6
|
* updated front matter and other documentationEli Collins2012-04-271-1/+1
|
* sped up pbkdf2 implementation by 60% or so - upped the rounds for all pbkdf2 ↵Eli Collins2012-04-191-31/+38
| | | | hashes
* clarify behavior for secret=None and hash=NoneEli Collins2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * passing a non-string secret or non-string hash to any CryptContext or handler method will now reliably result in a TypeError. previously, passing hash=None to many handler identify() and verify() methods would return False, while others would raise a TypeError. other handler methods would alternately throw ValueError or TypeError when passed a value that wasn't unicode or bytes. the various CryptContext methods also behaved inconsistently, depending on the behavior of the underlying handler. all of these behaviors are gone, they should all raise the same TypeError. * redid many of the from_string() methods to verify the hash type. * moved secret type & size validation to GenericHandler's encrypt/genhash/verify methods. this cheaply made the secret validation global to all hashes, and lets _calc_digest() implementations trust that the secret is valid. * updated the CryptContext and handler unittests to verify the above behavior is adhered to.
* fixed issue 29 - m2crypto crash may be triggered by keylen > 32, not > 41 as ↵Eli Collins2012-04-091-5/+7
| | | | I previously thought
* cleanup of scram hash; improved norm_digest_name() and moved it to utils.pbkdf2Eli Collins2012-03-101-1/+104
|
* split exceptions/warnings to separate module; added some additional warning ↵Eli Collins2012-01-181-1/+3
| | | | classes to make filtering easier
* import cleanupsEli Collins2012-01-181-3/+2
| | | | | | | | | | | | | | | * moved bytes compat functions from utils to utils.compat (bord, bjoin, bjoin_ints, bjoin_elems, ujoin) * renamed bord -> belem_ord for clarify * a bunch of to_native_str() always use ascii, and have fixed input types (always bytes or always unicode). these don't need overhead of to_native_str(), so replaced those calls with two new funcs: compat.bascii_to_str() / compat.uascii_to_str() * cleaned up a lot of imports from utils/utils.compat to pull from correct module * simplified the to_string() logic of a bunch of handlers to reduce unicode<->byte transitions
* lots of work on scram hashEli Collins2012-01-091-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | handler ------- * added 'scram' to default registry list * handler 'algs' keyword now parsed & validated correctly * digest names normalized -> IANA spec * saslprep() integrated into code * added config string format related ------- * added documentation (still needs cleaning up though) * added majority of UTs, still need to add a few edge cases other ----- * redid context->handler deprecation link - code now looks for handler._deprecated_detector(settings) to generate a callable, should be more efficient, and allow errors to be throw at bind-time instead of call-time. * pbkdf2() function now treats keylen = -1 as request for keylen = PRF digest size.
* deprecated to_hash_str, replaced all instances with to_native_strEli Collins2011-12-281-3/+3
| | | | | | decided that to_hash_str will always return native string, feature of hashes being returned as unicode under python 2 is better done through a CryptContext option.
* added compat.aliased lazy-loading module, aliases for BytesIO/StringIOEli Collins2011-12-061-6/+1
|
* replaced (int,long) instance checks with compat.int_typesEli Collins2011-12-061-4/+4
|
* added callable shim for 3.0-3.1Eli Collins2011-12-061-1/+1
|
* replaced xrange() instances with compat.irange() aliasEli Collins2011-12-061-1/+2
|
* branch exploring feasibility of removing need for 2to3Eli Collins2011-12-061-1/+2
| | | | this commit just fixes some error raises
* misc documentation tweaksEli Collins2011-06-301-18/+20
|
* removed 'encoding' kwd from pbkdf1 / pbkdf2 - unused, uneeded, and ↵Eli Collins2011-06-201-13/+10
| | | | complicates things - kdfs should all use bytes only.
* rest of utils now py3 compatEli Collins2011-06-171-34/+22
| | | | | | | * kdfs, md4, and utils proper * updated UTs * added to_native_str helper * added some UTs for new to_bytes / to_unicode etc methods
* kdf enhancementsEli Collins2011-06-021-53/+185
| | | | | | | * renamed _resolve_prf() to get_prf(), documented interface * added pbkdf1 support * added 'encoding' kwd to pbkdf1 & pbkdf2, for easier handling of unicode inputs *
* minor additions to documentationEli Collins2011-04-061-10/+10
|
* removed a bunch of "L" suffixes from ints (per 2to3)Eli Collins2011-03-281-1/+1
|
* replaced "raise exc, msg" with "raise exc(msg)" everywhere (working on py3k ↵Eli Collins2011-03-281-5/+5
| | | | compat, changes made by 2to3)
* misc bugfixes & tweaks for win32 compatEli Collins2011-03-251-3/+9
|
* bugfixes, tweaks, test casesEli Collins2011-03-181-1/+1
| | | | | | | | | | | | | | | | | ============================ * now at 99% coverage * changed some error types * bugfix to min_verify_time code * tests for registry, some cryptcontext border cases * ldap hash tests * tests for rest of utils * tests for skeleton hash classes in passlib.utils.drivers * moved validate_class code from skeleton hash classes to HandlerCase main things still needing testing: * category support for CryptContext/Policy * some bits of registry
* coverage workEli Collins2011-03-181-1/+1
| | | | | | | | | | | ============= * restored "default" mode for set_backend() * bugfix: HandlerCase now sets backend explicitly, incorrect backend checks were previously happening * added UT for genhash(secret, None) * enabled HandlerCase.supports_unicode for all hashes * added some needed test cases revealed by coverage check * added "pragma: no cover" for a select few branches that don't need testing * all UTs pass, 92% coverage
* converted NTHash, PostgresMD5, SHA256Crypt, SunMD5Crypt to classesEli Collins2011-02-141-1/+20
|
* import cleanupsEli Collins2011-01-191-1/+1
|
* rearranging some moreEli Collins2011-01-191-0/+148
===================== * moved unix style algorithms into passlib.unix package * renamed unix-crypt to des-crypt * moved a bunch of utils into new utils pacakge * NOTE: imports currently broken