Skip to content

Commit b9ae871

Browse files
committed
gh-104773: PEP 594: Remove the crypt module
Remove the crypt module and its private _crypt extension, deprecated in Python 3.11.
1 parent dbcdbf1 commit b9ae871

28 files changed

+35
-991
lines changed

Diff for: Doc/library/crypt.rst

-182
This file was deleted.

Diff for: Doc/library/crypto.rst

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Cryptographic Services
88

99
The modules described in this chapter implement various algorithms of a
1010
cryptographic nature. They are available at the discretion of the installation.
11-
On Unix systems, the :mod:`crypt` module may also be available.
1211
Here's an overview:
1312

1413

Diff for: Doc/library/pwd.rst

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ raised if the entry asked for cannot be found.
3939

4040
.. note::
4141

42-
.. index:: pair: module; crypt
43-
4442
In traditional Unix the field ``pw_passwd`` usually contains a password
45-
encrypted with a DES derived algorithm (see module :mod:`crypt`). However most
43+
encrypted with a DES derived algorithm. However most
4644
modern unices use a so-called *shadow password* system. On those unices the
4745
*pw_passwd* field only contains an asterisk (``'*'``) or the letter ``'x'``
4846
where the encrypted password is stored in a file :file:`/etc/shadow` which is

Diff for: Doc/library/superseded.rst

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ backwards compatibility. They have been superseded by other modules.
1313
aifc.rst
1414
audioop.rst
1515
chunk.rst
16-
crypt.rst
1716
imghdr.rst
1817
msilib.rst
1918
optparse.rst

Diff for: Doc/license.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ copyright and licensing notice::
655655
OpenSSL
656656
-------
657657

658-
The modules :mod:`hashlib`, :mod:`posix`, :mod:`ssl`, :mod:`crypt` use
658+
The modules :mod:`hashlib`, :mod:`posix` and :mod:`ssl` use
659659
the OpenSSL library for added performance if made available by the
660660
operating system. Additionally, the Windows and macOS installers for
661661
Python may include a copy of the OpenSSL libraries, so we include a copy

Diff for: Doc/whatsnew/3.11.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ Modules
17331733
+---------------------+---------------------+---------------------+---------------------+---------------------+
17341734
| :mod:`aifc` | :mod:`chunk` | :mod:`msilib` | :mod:`!pipes` | :mod:`!telnetlib` |
17351735
+---------------------+---------------------+---------------------+---------------------+---------------------+
1736-
| :mod:`audioop` | :mod:`crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`uu` |
1736+
| :mod:`audioop` | :mod:`!crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`uu` |
17371737
+---------------------+---------------------+---------------------+---------------------+---------------------+
17381738
| :mod:`!cgi` | :mod:`imghdr` | :mod:`!nntplib` | :mod:`!spwd` | :mod:`!xdrlib` |
17391739
+---------------------+---------------------+---------------------+---------------------+---------------------+

Diff for: Doc/whatsnew/3.12.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ Modules (see :pep:`594`):
891891
* :mod:`!cgi`
892892
* :mod:`!cgitb`
893893
* :mod:`chunk`
894-
* :mod:`crypt`
894+
* :mod:`!crypt`
895895
* :mod:`imghdr`
896896
* :mod:`!mailcap`
897897
* :mod:`msilib`

Diff for: Doc/whatsnew/3.13.rst

+16
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,22 @@ Removed
198198
* :pep:`594`: Remove the :mod:`!xdrlib` module, deprecated in Python 3.11.
199199
(Contributed by Victor Stinner in :gh:`104773`.)
200200

201+
* :pep:`594`: Remove the :mod:`!crypt` module and its private :mod:`!_crypt`
202+
extension, deprecated in Python 3.11.
203+
The :mod:`hashlib` module is a potential replacement for certain use cases.
204+
Otherwise, the following PyPI projects can be used:
205+
206+
* `bcrypt <https://pypi.org/project/bcrypt/>`_:
207+
Modern password hashing for your software and your servers.
208+
* `passlib <https://pypi.org/project/passlib/>`_:
209+
Comprehensive password hashing framework supporting over 30 schemes.
210+
* `argon2-cffi <https://pypi.org/project/argon2-cffi/>`_:
211+
The secure Argon2 password hashing algorithm.
212+
* `legacycrypt <https://pypi.org/project/legacycrypt/>`_:
213+
Wrapper to the POSIX crypt library call and associated functionality.
214+
215+
(Contributed by Victor Stinner in :gh:`104773`.)
216+
201217

202218
Porting to Python 3.13
203219
======================

Diff for: Doc/whatsnew/3.3.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,8 @@ their ``__init__`` method (for example, file objects) or in their
10521052
crypt
10531053
-----
10541054

1055-
Addition of salt and modular crypt format (hashing method) and the :func:`~crypt.mksalt`
1056-
function to the :mod:`crypt` module.
1055+
Addition of salt and modular crypt format (hashing method) and the :func:`~!crypt.mksalt`
1056+
function to the :mod:`!crypt` module.
10571057

10581058
(:issue:`10924`)
10591059

Diff for: Doc/whatsnew/3.6.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,7 @@ Changes in the Python API
22742274
:class:`~collections.OrderedDict`.
22752275
(Contributed by Steve Holden in :issue:`27842`.)
22762276

2277-
* The :const:`crypt.METHOD_CRYPT` will no longer be added to ``crypt.methods``
2277+
* The :const:`!crypt.METHOD_CRYPT` will no longer be added to ``crypt.methods``
22782278
if unsupported by the platform.
22792279
(Contributed by Victor Stinner in :issue:`25287`.)
22802280

Diff for: Doc/whatsnew/3.7.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,10 @@ alternative to script path. (Contributed by Sanyam Khurana in :issue:`21862`.)
848848
crypt
849849
-----
850850

851-
The :mod:`crypt` module now supports the Blowfish hashing method.
851+
The :mod:`!crypt` module now supports the Blowfish hashing method.
852852
(Contributed by Serhiy Storchaka in :issue:`31664`.)
853853

854-
The :func:`~crypt.mksalt` function now allows specifying the number of rounds
854+
The :func:`~!crypt.mksalt` function now allows specifying the number of rounds
855855
for hashing. (Contributed by Serhiy Storchaka in :issue:`31702`.)
856856

857857

Diff for: Doc/whatsnew/3.9.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Interpreter improvements:
8383
now sped up using :pep:`590` vectorcall;
8484
* garbage collection does not block on resurrected objects;
8585
* a number of Python modules (:mod:`_abc`, :mod:`audioop`, :mod:`_bz2`,
86-
:mod:`_codecs`, :mod:`_contextvars`, :mod:`_crypt`, :mod:`_functools`,
86+
:mod:`_codecs`, :mod:`_contextvars`, :mod:`!_crypt`, :mod:`_functools`,
8787
:mod:`_json`, :mod:`_locale`, :mod:`math`, :mod:`operator`, :mod:`resource`,
8888
:mod:`time`, :mod:`_weakref`) now use multiphase initialization as defined
8989
by PEP 489;

0 commit comments

Comments
 (0)