Title: Add support of new crypt methods
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, dstufft, gregory.p.smith, jafo, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-10-02 09:24 by serhiy.storchaka, last changed 2017-10-05 12:33 by serhiy.storchaka.

Pull Requests
URL Status Linked Edit
PR 3854 open serhiy.storchaka, 2017-10-02 09:50
Messages (4)
msg303516 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-02 09:24
Proposed PR adds support of three new methods in the crypt module.

1. Blowfish. It is considered as strong as SSH512 for crypt() purpose. There are several variants of this method: '2', '2a', '2b' and '2y'. '2y' looks the same as '2b', other variants have different flaws. All four are supported on FreeBSD. '2b' is the only method available on OpenBSD, hence this change also fixes crypt on OpenBSD (see issue25287). Blowfish is not supported in glibc, but it is added in some Linux distributions (not in Ubuntu). The most strong of the available variants is chosen.

2. Extended DES. In contrary to traditional default algorithm it uses salt longer than 2 characters. It is supported on FreeBSD.

3. NT-Hash. It doesn't use salt and is compatible with Microsoft's NT scheme. It is supported on FreeBSD.

mksalt() now takes the log_rounds argument for Blowfish. I'm not sure this is the best solution. And what should be a default value?
msg303527 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2017-10-02 10:17
-1 on DES and NT Hash

These are very old, very bad algorithms and should no longer be used. We are in the 21th century.
msg303545 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-02 15:42
I concur. Initially I implemented all three methods, then removed they except Blowfish, and then re-added they back just for showing they to security experts.
msg303761 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-05 12:33
In issue31702 I propose related improvement for the SHA-* methods.
Date User Action Args
2017-10-05 12:33:47serhiy.storchakasetmessages: + msg303761
2017-10-02 15:42:19serhiy.storchakasetmessages: + msg303545
2017-10-02 10:17:40christian.heimessetmessages: + msg303527
2017-10-02 09:53:47serhiy.storchakasetnosy: + gregory.p.smith, jafo, christian.heimes, dstufft

type: enhancement
components: + Library (Lib)
versions: + Python 3.7
2017-10-02 09:50:17serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request3834
2017-10-02 09:24:48serhiy.storchakacreate