aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-20 13:21:30 -0700
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-20 13:21:30 -0700
commit2918db0b72f841ace8561bc0f85d8d4c190bc169 (patch)
tree765696acc84a04d5f1134bb34857d32311715f2d
parentf2646557cbe6ee7dc8c338ad60b188a8ab1978ab (diff)
parent0bef7722f4d394a7fa67f724d9f13eca2eaf7d41 (diff)
downloadcryptography-2918db0b72f841ace8561bc0f85d8d4c190bc169.tar.gz
cryptography-2918db0b72f841ace8561bc0f85d8d4c190bc169.tar.bz2
cryptography-2918db0b72f841ace8561bc0f85d8d4c190bc169.zip
Merge pull request #1985 from eeshangarg/documentation-1971
Docs for CTR and GCM should say that IV/nonce must be unique
-rw-r--r--docs/glossary.rst8
-rw-r--r--docs/hazmat/primitives/symmetric-encryption.rst13
-rw-r--r--docs/spelling_wordlist.txt1
3 files changed, 15 insertions, 7 deletions
diff --git a/docs/glossary.rst b/docs/glossary.rst
index dc6f3ebf..202fa2de 100644
--- a/docs/glossary.rst
+++ b/docs/glossary.rst
@@ -64,3 +64,11 @@ Glossary
text
This type corresponds to ``unicode`` on Python 2 and ``str`` on Python
3. This is equivalent to ``six.text_type``.
+
+ nonce
+ A nonce is a **n**\ umber used **once**. Nonces are used in many
+ cryptographic protocols. Generally, a nonce does not have to be secret
+ or unpredictable, but it must be unique. A nonce is often a random
+ or pseudo-random number (see :doc:`Random number generation
+ </random-numbers>`). Since a nonce does not have to be unpredictable,
+ it can also take a form of a counter.
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index 47486895..309c6fd0 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -240,7 +240,7 @@ Modes
**This mode does not require padding.**
- :param bytes nonce: Should be :doc:`random bytes </random-numbers>`. It is
+ :param bytes nonce: Should be unique, a :term:`nonce`. It is
critical to never reuse a ``nonce`` with a given key. Any reuse of a
nonce with the same key compromises the security of every message
encrypted with that key. Must be the same number of bytes as the
@@ -305,12 +305,11 @@ Modes
**This mode does not require padding.**
- :param bytes initialization_vector: Must be :doc:`random bytes
- </random-numbers>`. They do not need to be kept secret and they can be
- included in a transmitted message. NIST `recommends a 96-bit IV
- length`_ for performance critical situations but it can be up to
- 2\ :sup:`64` - 1 bits. Do not reuse an ``initialization_vector`` with a
- given ``key``.
+ :param bytes initialization_vector: Must be unique, a :term:`nonce`.
+ They do not need to be kept secret and they can be included in a
+ transmitted message. NIST `recommends a 96-bit IV length`_ for
+ performance critical situations but it can be up to 2\ :sup:`64` - 1
+ bits. Do not reuse an ``initialization_vector`` with a given ``key``.
.. note::
diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt
index badb500c..81510134 100644
--- a/docs/spelling_wordlist.txt
+++ b/docs/spelling_wordlist.txt
@@ -40,6 +40,7 @@ multi
naïve
namespace
namespaces
+Nonces
online
paddings
pickleable