summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2016-09-06 18:22:28 (GMT)
committerChristian Heimes <christian@python.org>2016-09-06 18:22:28 (GMT)
commit39093e9e6836b98dc67979e4e888e4bc639caa07 (patch)
treec5be5c5ad31e520580ca9f30d019c47cebb66886 /Doc
parentac041c0aa721e2672dfb684562b08ad5465b76b1 (diff)
downloadcpython-39093e9e6836b98dc67979e4e888e4bc639caa07.zip
cpython-39093e9e6836b98dc67979e4e888e4bc639caa07.tar.gz
cpython-39093e9e6836b98dc67979e4e888e4bc639caa07.tar.bz2
Issue #27928: Add scrypt (password-based key derivation function) to hashlib module (requires OpenSSL 1.1.0).
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/hashlib.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst
index f6d4808..cf6b8ff 100644
--- a/Doc/library/hashlib.rst
+++ b/Doc/library/hashlib.rst
@@ -225,6 +225,23 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
Python implementation uses an inline version of :mod:`hmac`. It is about
three times slower and doesn't release the GIL.
+.. function:: scrypt(password, *, salt, n, r, p, maxmem=0, dklen=64)
+
+ The function provides scrypt password-based key derivation function as
+ defined in :rfc:`7914`.
+
+ *password* and *salt* must be bytes-like objects. Applications and
+ libraries should limit *password* to a sensible length (e.g. 1024). *salt*
+ should be about 16 or more bytes from a proper source, e.g. :func:`os.urandom`.
+
+ *n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization
+ factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MB).
+ *dklen* is the length of the derived key.
+
+ Availability: OpenSSL 1.1+
+
+ .. versionadded:: 3.6
+
.. seealso::