[Python-Dev] Right place for PBKDF2 wrapper

Gregory P. Smith greg at krypto.org
Sun Oct 13 00:27:00 CEST 2013


On Sat, Oct 12, 2013 at 2:31 PM, Christian Heimes <christian at python.org>wrote:

> Am 12.10.2013 23:04, schrieb Gregory P. Smith:
> > agreed with any of these three.
>
> I'm going for hashlib.pbkdf2_hmac() for now. Right now it's just one
> function. We can always add a new module for a high level interface later.
>
> > that also makes sense...
> >
> > I'd leave hmac.py around through at least 3.6 but going ahead and moving
> > the implementation into hashlib in 3.4 makes sense.
>
> That gives us the opportunity th provide a faster implementation based
> on OpenSSL's HMAC API http://www.openssl.org/docs/crypto/hmac.html . I'm
> also tempted to provide a fast one-shot-wonder function that returns the
> MAC as bytes: hmac(name, key, value) -> result
>

It'd be more consistent with the other hashlib constructors if the one
liner was:

hashlib.hmac(hash_name_or_func, key, initial_data).digest() (or
.hexdigest() for people who want str rather than bytes).

-gps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131012/031eb9ca/attachment.html>


More information about the Python-Dev mailing list