[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-11-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset cede8c9edb408321b493d8d5e73be9e1018020e4 by Serhiy Storchaka in 
branch 'master':
bpo-31702: Allow to specify rounds for SHA-2 hashing in crypt.mksalt(). (#4110)
https://github.com/python/cpython/commit/cede8c9edb408321b493d8d5e73be9e1018020e4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-11-16 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-25 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I'd stick with ValueError in that case as well.  if someone dislikes the
valueerrors because they _want_ to use an invalid one, they can file a bug
and we'll reconsider only if they have a meaningful use case.

On Wed, Oct 25, 2017 at 9:36 AM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> What to do with values outside of the valid range (2**4 to 2**31 for
> Blowfish, 1000 to 9 for SHA*). Raise ValueError, OverflowError, or
> bound it, or just generate an invalid salt and allow crypt() to handle it?
>
> --
> nosy: +haypo, pitrou
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What to do with values outside of the valid range (2**4 to 2**31 for Blowfish, 
1000 to 9 for SHA*). Raise ValueError, OverflowError, or bound it, or 
just generate an invalid salt and allow crypt() to handle it?

--
nosy: +haypo, pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-24 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I'd raise a ValueError in that case.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4080
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Blowfish salt should contain the binary logarithm of the number of rounds (from 
4 to 31) (see issue31664). SHA-* salt can contain an explicit number of rounds 
in the form '$rounds={value}$'. It is bound to the range from 1000 to 
9, the default is 5000.

I propose to allow to specify the number of rounds in generated salt for SHA-* 
methods as well as for Blowfish. For unifying interface we can specify the 
number of rounds instead of its logarithm for Blowfish, and calculate the 
logarithm internally.

The question is what to do with the value that is not a power of two for 
Blowfish. Should we raise an error or silently replace it with the upper power 
of two?

--
components: Library (Lib)
messages: 303760
nosy: christian.heimes, dstufft, gregory.p.smith, jafo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Allow to specify the number of rounds for SHA-* hashing in crypt
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com