summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorDwayne C. Litzenberger <dlitz@dlitz.net>2011-10-11 00:51:30 -0400
committerDwayne C. Litzenberger <dlitz@dlitz.net>2011-10-11 00:51:35 -0400
commitb9658a26003ebfcfce1804a2363a29354799b47e (patch)
tree06dea1350b6fbb57bfaa4895f1dee73e84695d43 /Doc
parent25a055334e5cd9d22777864d2a5c0fd8a88bbcff (diff)
downloadpycrypto-b9658a26003ebfcfce1804a2363a29354799b47e.tar.gz
Add a note to the documentation about not using .encrypt() and .decrypt() on the same object
Diffstat (limited to 'Doc')
-rw-r--r--Doc/pycrypt.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/pycrypt.rst b/Doc/pycrypt.rst
index 2fab0d1..3789bba 100644
--- a/Doc/pycrypt.rst
+++ b/Doc/pycrypt.rst
@@ -422,6 +422,10 @@ multiple of the algorithm's block size. Returns a string containing
the plaintext.
Python 3.x: decrypt() will return a bytes object.
+Note: Do not use the same cipher object for both encryption an
+decryption, since both operations share the same IV buffer, so the results
+will probably not be what you expect.
+
**encrypt(string)**:
Encrypts a non-null ``string``, using the key-dependent data in the
@@ -432,6 +436,10 @@ the ciphertext.
Python 3.x: ```string``` must be an object interpretable as a buffer of bytes.
encrypt() will return a bytes object.
+Note: Do not use the same cipher object for both encryption an
+decryption, since both operations share the same IV buffer, so the results
+will probably not be what you expect.
+
Security Notes
=======================