aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-22 13:08:58 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-22 13:08:58 -0800
commit797dd83d81915d5bab8791e513fcb26051870eb7 (patch)
treeca295d629df60d022e4d13d6ffc15ccbdc84e8df /docs
parent0ab3e44b0512a6cbab845a65759a21787bf15d27 (diff)
downloadcryptography-797dd83d81915d5bab8791e513fcb26051870eb7.tar.gz
cryptography-797dd83d81915d5bab8791e513fcb26051870eb7.tar.bz2
cryptography-797dd83d81915d5bab8791e513fcb26051870eb7.zip
Documentation!
Diffstat (limited to 'docs')
-rw-r--r--docs/hazmat/primitives/symmetric-encryption.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index eef359d6..35b0d9a8 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -75,6 +75,15 @@ an "encrypt-then-MAC" formulation as `described by Colin Percival`_.
everything into the context. Once that is done call ``finalize()`` to
finish the operation and obtain the remainder of the data.
+ Block ciphers require that plaintext or ciphertext always be a multiple of
+ their block size, because of that **padding** is often required to make a
+ message the correct size. ``CipherContext`` will not automatically apply
+ any padding; you'll need to add your own. For block ciphers the reccomended
+ padding is :class:`cryptography.hazmat.primitives.padding.PKCS7`. If you
+ are using a stream cipher mode (such as
+ :class:`cryptography.hazmat.primitives.modes.CTR`) you don't have to worry
+ about this.
+
.. method:: update(data)
:param bytes data: The data you wish to pass into the context.
@@ -90,6 +99,13 @@ an "encrypt-then-MAC" formulation as `described by Colin Percival`_.
.. method:: finalize()
:return bytes: Returns the remainder of the data.
+ :raises cryptography.exceptions.IncorrectPadding: This is raised when
+ the data provided
+ isn't correctly
+ padded to be a
+ multiple of the
+ algorithm's block
+ size.
Once ``finalize`` is called this object can no longer be used and
:meth:`update` and :meth:`finalize` will raise