Skip to content

Commit ae7dbb1

Browse files
committed
crypto: stronger description for IV reuse
1 parent 9943718 commit ae7dbb1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/api/crypto.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,8 +1198,11 @@ rapidly.
11981198
In line with OpenSSL's recommendation to use pbkdf2 instead of
11991199
[`EVP_BytesToKey`][] it is recommended that developers derive a key and IV on
12001200
their own using [`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][]
1201-
to create the `Cipher` object. A warning is emitted when counter mode (e.g. CTR,
1202-
GCM or CCM) is used in `crypto.createCipher()` in order to avoid IV reuse.
1201+
to create the `Cipher` object. Users should not use ciphers with counter mode
1202+
(e.g. CTR, GCM or CCM) in `crypto.createCipher()`. A warning is emitted when
1203+
they are used in order to avoid the risk of IV reuse that causes
1204+
vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting
1205+
Adversaries][] for details.
12031206

12041207
### crypto.createCipheriv(algorithm, key, iv)
12051208
- `algorithm` {string}
@@ -2241,6 +2244,7 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
22412244
[HTML5's `keygen` element]: http://www.w3.org/TR/html5/forms.html#the-keygen-element
22422245
[NIST SP 800-131A]: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf
22432246
[NIST SP 800-132]: http://csrc.nist.gov/publications/nistpubs/800-132/nist-sp800-132.pdf
2247+
[Nonce-Disrespecting Adversaries]: https://github.com/nonce-disrespect/nonce-disrespect
22442248
[OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/man1.0.2/apps/spkac.html
22452249
[RFC 2412]: https://www.rfc-editor.org/rfc/rfc2412.txt
22462250
[RFC 3526]: https://www.rfc-editor.org/rfc/rfc3526.txt

0 commit comments

Comments
 (0)