Skip to content

Commit

Permalink
gh-104773: PEP 594: Remove the crypt module (#104908)
Browse files Browse the repository at this point in the history
Remove the crypt module and its private _crypt extension, deprecated
in Python 3.11.
  • Loading branch information
vstinner authored May 25, 2023
1 parent 38539ef commit e4127ea
Show file tree
Hide file tree
Showing 28 changed files with 35 additions and 991 deletions.
182 changes: 0 additions & 182 deletions Doc/library/crypt.rst

This file was deleted.

1 change: 0 additions & 1 deletion Doc/library/crypto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Cryptographic Services

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


Expand Down
4 changes: 1 addition & 3 deletions Doc/library/pwd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ raised if the entry asked for cannot be found.

.. note::

.. index:: pair: module; crypt

In traditional Unix the field ``pw_passwd`` usually contains a password
encrypted with a DES derived algorithm (see module :mod:`crypt`). However most
encrypted with a DES derived algorithm. However most
modern unices use a so-called *shadow password* system. On those unices the
*pw_passwd* field only contains an asterisk (``'*'``) or the letter ``'x'``
where the encrypted password is stored in a file :file:`/etc/shadow` which is
Expand Down
1 change: 0 additions & 1 deletion Doc/library/superseded.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ backwards compatibility. They have been superseded by other modules.
aifc.rst
audioop.rst
chunk.rst
crypt.rst
imghdr.rst
optparse.rst
uu.rst
2 changes: 1 addition & 1 deletion Doc/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ copyright and licensing notice::
OpenSSL
-------

The modules :mod:`hashlib`, :mod:`posix`, :mod:`ssl`, :mod:`crypt` use
The modules :mod:`hashlib`, :mod:`posix` and :mod:`ssl` use
the OpenSSL library for added performance if made available by the
operating system. Additionally, the Windows and macOS installers for
Python may include a copy of the OpenSSL libraries, so we include a copy
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ Modules
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`aifc` | :mod:`chunk` | :mod:`!msilib` | :mod:`!pipes` | :mod:`!telnetlib` |
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`audioop` | :mod:`crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`uu` |
| :mod:`audioop` | :mod:`!crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`uu` |
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`!cgi` | :mod:`imghdr` | :mod:`!nntplib` | :mod:`!spwd` | :mod:`!xdrlib` |
+---------------------+---------------------+---------------------+---------------------+---------------------+
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ Modules (see :pep:`594`):
* :mod:`!cgi`
* :mod:`!cgitb`
* :mod:`chunk`
* :mod:`crypt`
* :mod:`!crypt`
* :mod:`imghdr`
* :mod:`!mailcap`
* :mod:`!msilib`
Expand Down
16 changes: 16 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,22 @@ Removed
* :pep:`594`: Remove the :mod:`!msilib` module, deprecated in Python 3.11.
(Contributed by Zachary Ware in :gh:`104773`.)

* :pep:`594`: Remove the :mod:`!crypt` module and its private :mod:`!_crypt`
extension, deprecated in Python 3.11.
The :mod:`hashlib` module is a potential replacement for certain use cases.
Otherwise, the following PyPI projects can be used:

* `bcrypt <https://pypi.org/project/bcrypt/>`_:
Modern password hashing for your software and your servers.
* `passlib <https://pypi.org/project/passlib/>`_:
Comprehensive password hashing framework supporting over 30 schemes.
* `argon2-cffi <https://pypi.org/project/argon2-cffi/>`_:
The secure Argon2 password hashing algorithm.
* `legacycrypt <https://pypi.org/project/legacycrypt/>`_:
Wrapper to the POSIX crypt library call and associated functionality.

(Contributed by Victor Stinner in :gh:`104773`.)


Porting to Python 3.13
======================
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1052,8 +1052,8 @@ their ``__init__`` method (for example, file objects) or in their
crypt
-----

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

(:issue:`10924`)

Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,7 @@ Changes in the Python API
:class:`~collections.OrderedDict`.
(Contributed by Steve Holden in :issue:`27842`.)

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

Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -848,10 +848,10 @@ alternative to script path. (Contributed by Sanyam Khurana in :issue:`21862`.)
crypt
-----

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

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


Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Interpreter improvements:
now sped up using :pep:`590` vectorcall;
* garbage collection does not block on resurrected objects;
* a number of Python modules (:mod:`_abc`, :mod:`audioop`, :mod:`_bz2`,
:mod:`_codecs`, :mod:`_contextvars`, :mod:`_crypt`, :mod:`_functools`,
:mod:`_codecs`, :mod:`_contextvars`, :mod:`!_crypt`, :mod:`_functools`,
:mod:`_json`, :mod:`_locale`, :mod:`math`, :mod:`operator`, :mod:`resource`,
:mod:`time`, :mod:`_weakref`) now use multiphase initialization as defined
by PEP 489;
Expand Down
Loading

0 comments on commit e4127ea

Please sign in to comment.