[issue27928] Add hashlib.scrypt

2021-10-12 Thread Christian Heimes
Change by Christian Heimes : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue27928] Add hashlib.scrypt

2016-09-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: PEP 466 is explicitly not blanket approval for backporting All The Things to 2.7. The only justification for pbkdf2 in PEP 466 is to "lower the barriers to secure password storage and checking in Python 2 server applications". While scrypt is probably a bit be

[issue27928] Add hashlib.scrypt

2016-09-07 Thread Alex Gaynor
Alex Gaynor added the comment: OpenSSL supports scrypt On Sep 7, 2016 12:28 PM, "Benjamin Peterson" wrote: > > Benjamin Peterson added the comment: > > Why are we adding scrypt and not argon2 anyway? > > On Wed, Sep 7, 2016, at 03:25, Christian Heimes wrote: > > > > Christian Heimes added the

[issue27928] Add hashlib.scrypt

2016-09-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: Why are we adding scrypt and not argon2 anyway? On Wed, Sep 7, 2016, at 03:25, Christian Heimes wrote: > > Christian Heimes added the comment: > > Benjamin, what's your take on Alex's suggestion? > > gutworth: Alex_Gaynor has asked me if hashlib.scrypt()

[issue27928] Add hashlib.scrypt

2016-09-07 Thread Alex Gaynor
Alex Gaynor added the comment: PEP466 includes hashlib.pbkdf2_hmac(). Any reasoning that includes that surely is applicable to scrypt as well. -- ___ Python tracker ___

[issue27928] Add hashlib.scrypt

2016-09-07 Thread Gregory P. Smith
Gregory P. Smith added the comment: No, scrypt is a simple new feature. An extension module on PyPI is the appropriate place for that for 2.6 through 3.5. Wholly unrelated to PEP466. -- ___ Python tracker __

[issue27928] Add hashlib.scrypt

2016-09-07 Thread Christian Heimes
Christian Heimes added the comment: Benjamin, what's your take on Alex's suggestion? gutworth: Alex_Gaynor has asked me if hashlib.scrypt() can go into 2.7, too. It's a password-based KDF like hashlib.pbkdf2() but more secure than PBKDF2. It requires OpenSSL 1.1.0. gutworth: I think it'd be

[issue27928] Add hashlib.scrypt

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset d926fa1a833c by Christian Heimes in branch 'default': Issue #27928: Add scrypt (password-based key derivation function) to hashlib module (requires OpenSSL 1.1.0). https://hg.python.org/cpython/rev/d926fa1a833c -- nosy: +python-dev ___

[issue27928] Add hashlib.scrypt

2016-09-05 Thread Christian Heimes
Changes by Christian Heimes : Added file: http://bugs.python.org/file44380/hashlib.scrypt.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue27928] Add hashlib.scrypt

2016-09-05 Thread Christian Heimes
Changes by Christian Heimes : Removed file: http://bugs.python.org/file44351/Add-hashlib.scrypt-3.patch ___ Python tracker ___ ___ Python-bugs

[issue27928] Add hashlib.scrypt

2016-09-05 Thread Christian Heimes
Changes by Christian Heimes : Removed file: http://bugs.python.org/file44326/Add-hashlib.scrypt.patch ___ Python tracker ___ ___ Python-bugs-l

[issue27928] Add hashlib.scrypt

2016-09-05 Thread Christian Heimes
Changes by Christian Heimes : Removed file: http://bugs.python.org/file44344/Add-hashlib.scrypt-2.patch ___ Python tracker ___ ___ Python-bugs

[issue27928] Add hashlib.scrypt

2016-09-04 Thread Christian Heimes
Changes by Christian Heimes : Added file: http://bugs.python.org/file44361/Add-hashlib.scrypt-4.patch ___ Python tracker ___ ___ Python-bugs-l

[issue27928] Add hashlib.scrypt

2016-09-04 Thread Christian Heimes
Christian Heimes added the comment: Thanks Alex, multiple is the wrong term. The argument 'n' must be 2^m for m > 1. -- ___ Python tracker ___ ___

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Alex Gaynor
Alex Gaynor added the comment: Bug in the error message "n must be a multiple of 2." it should say "n must be a power of 2." -- nosy: +alex ___ Python tracker ___ __

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Christian Heimes
Christian Heimes added the comment: It's not a limitation of the argument clinic. PyArg_Parse*() does not support required, keyword-only arguments without a default value. I'm using None as default value, require PyLong_Type and added some extra checks. -- Added file: http://bugs.pytho

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: It looks good. But Christian, may I ask how do you generate the argument clinic? It looks from me that the declaration cannot give you such a format "y*|$y*O!O!O!ll:scrypt". I rerun clinic.py and the .c.h file is altered. Maybe it's better to abandon AC for right

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Christian Heimes
Christian Heimes added the comment: You are right. Let's try this again. How do you like: >>> hashlib.scrypt(b'', n=2, r=2, p=3) Traceback (most recent call last): File "", line 1, in TypeError: salt is required >>> hashlib.scrypt(b'', salt=b'') Traceback (most recent call last): File "", l

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Xiang Zhang
Xiang Zhang added the comment: It looks that new patch when used like this hashlib.scrypt(b'password') will generate a "an integer is required" exception message which is misleading. I don't test it since I don't get openssl 1.1. And the phrase "interpreted as buffers of bytes" in the doc may

[issue27928] Add hashlib.scrypt

2016-09-02 Thread Christian Heimes
Christian Heimes added the comment: Here is a new patch with argument clinic, more tests and required keyword arguments. -- Added file: http://bugs.python.org/file44344/Add-hashlib.scrypt-2.patch ___ Python tracker

[issue27928] Add hashlib.scrypt

2016-09-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: If clinic doesn't support required keyword only args then don't worry about it for now. :) -- ___ Python tracker ___

[issue27928] Add hashlib.scrypt

2016-09-01 Thread Christian Heimes
Christian Heimes added the comment: Argument is easy. Your second request is a very good idea but also harder to implement. Neither PyArg_Parse nor clinic have a way to declare arguments that required and keyword only but have no default value. I have a workaround but it ain't beautiful. ---

[issue27928] Add hashlib.scrypt

2016-09-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: Rather than PyArg_ParseTupleAndKeywords can you have it use argument clinic? Also, how about making all arguments other than password be keyword only so that code calling the function is more clear. Otherwise it's a bit of positional argument soup with a lot

[issue27928] Add hashlib.scrypt

2016-09-01 Thread Christian Heimes
Changes by Christian Heimes : -- keywords: +patch Added file: http://bugs.python.org/file44326/Add-hashlib.scrypt.patch ___ Python tracker ___ ___

[issue27928] Add hashlib.scrypt

2016-09-01 Thread Christian Heimes
New submission from Christian Heimes: OpenSSL 1.1 has EVP_PBE_scrypt(). hashlib.scrypt() is a low-hanging fruit for Python 3.6. I have a working patch with some tests. I need to write more tests and documentation: https://github.com/tiran/cpython/commits/feature/openssl110_scrypt -- m