|author||emboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>||2012-02-08 00:29:26 +0000|
|committer||emboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>||2012-02-08 00:29:26 +0000|
* ext/openssl/ossl_cipher.c: Add warning about key as IV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index 101ea052fa..4e758b6a26 100644
@@ -686,6 +686,12 @@ Init_ossl_cipher(void)
* key = cipher.random_key
* iv = cipher.random_iv # also sets the generated IV on the Cipher
+ * Although the key is generally a random value, too, it is a bad choice
+ * as an IV. There are elaborate ways how an attacker can take advantage
+ * of such an IV. As a general rule of thumb, exposing the key directly
+ * or indirectly should be avoided at all cost and exceptions only be
+ * made with good reason.
* === Calling Cipher#final
* ECB (which should not be used) and CBC are both block-based modes.