diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-08-08 15:30:56 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-08-08 15:30:56 -0700 |
commit | 51758ff8f09a054af9300ce96c6ec119ff92df4d (patch) | |
tree | 2b289be9a439683b1380a27a64f0e82f9213e443 /docs/primitives | |
parent | c2ae2be66ccbdb5ddb9c103ea922679f5b4a7925 (diff) | |
download | cryptography-51758ff8f09a054af9300ce96c6ec119ff92df4d.tar.gz cryptography-51758ff8f09a054af9300ce96c6ec119ff92df4d.tar.bz2 cryptography-51758ff8f09a054af9300ce96c6ec119ff92df4d.zip |
A padding example
Diffstat (limited to 'docs/primitives')
-rw-r--r-- | docs/primitives/symmetric-encryption.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/primitives/symmetric-encryption.rst b/docs/primitives/symmetric-encryption.rst index 08724a01..779f087a 100644 --- a/docs/primitives/symmetric-encryption.rst +++ b/docs/primitives/symmetric-encryption.rst @@ -12,8 +12,8 @@ where the encrypter and decrypter both use the same key. .. code-block:: pycon - >>> from cryptography.primitives.block import BlockCipher, cipher, mode - >>> cipher = BlockCipher(cipher.AES(key), mode.CBC(iv)) + >>> from cryptography.primitives.block import BlockCipher, cipher, mode, padding + >>> cipher = BlockCipher(cipher.AES(key), mode.CBC(iv, padding.PKCS7())) >>> cipher.encrypt("my secret message") + cipher.finalize() # The ciphertext [...] @@ -65,3 +65,5 @@ Modes Paddings ~~~~~~~~ + +.. class:: cryptography.primitives.block.padding.PKCS7() |