From b9658a26003ebfcfce1804a2363a29354799b47e Mon Sep 17 00:00:00 2001 From: "Dwayne C. Litzenberger" Date: Tue, 11 Oct 2011 00:51:30 -0400 Subject: Add a note to the documentation about not using .encrypt() and .decrypt() on the same object --- Doc/pycrypt.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Doc') 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 ======================= -- cgit v1.2.1