diff options
author | Terry Chia <terrycwk1994@gmail.com> | 2015-08-29 22:28:51 +0800 |
---|---|---|
committer | Terry Chia <terrycwk1994@gmail.com> | 2015-08-29 22:28:51 +0800 |
commit | 7126e61fc31d9684314c3749f4b552f6d43e39fc (patch) | |
tree | 169db9e83e44960a642b521b165f5b72bf046bd7 | |
parent | 4678604fe39078e89e9a20931e64e1a2ac48bab5 (diff) | |
download | cryptography-7126e61fc31d9684314c3749f4b552f6d43e39fc.tar.gz cryptography-7126e61fc31d9684314c3749f4b552f6d43e39fc.tar.bz2 cryptography-7126e61fc31d9684314c3749f4b552f6d43e39fc.zip |
Fix imports and wordings.
-rw-r--r-- | docs/fernet.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/fernet.rst b/docs/fernet.rst index d4a7d284..18aab439 100644 --- a/docs/fernet.rst +++ b/docs/fernet.rst @@ -111,17 +111,18 @@ Using passwords with Fernet --------------------------- It is possible to use passwords with Fernet. To do this, you need to run the -password through a key derivation function like +password through a key derivation function such as :class:`~cryptography.hazmat.primitives.kdf.pbkdf2.PBKDF2HMAC`: .. code-block:: python import base64 import os + + from cryptography.fernet import Fernet + from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC - from cryptography.hazmat.backends import default_backend - from cryptography.fernet import Fernet password = b"password" salt = os.urandom(16) @@ -140,8 +141,8 @@ In this scheme, the salt has to be stored in a retrievable location in order to derive the same key from the password in the future. The iteration count used should be adjusted to be as high as your server can -tolerate. A good default is at least 100k iterations which is what Django -`recommends`_. +tolerate. A good default is at least 100,000 iterations which is what Django +`recommends`_ in 2014. Implementation -------------- |