diff options
author | Ujjwal Sharma <usharma1998@gmail.com> | 2018-04-05 02:17:56 +0530 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2018-04-08 13:32:09 +0200 |
commit | 0a679327be992d2a60fc3522ab2335064e9750dc (patch) | |
tree | 4a22e4fcee02aab46dc4e8c959a159ba19d0534e /doc | |
parent | 77b52fd58f7398a81999c81afd21fe2e156c0766 (diff) | |
download | android-node-v8-0a679327be992d2a60fc3522ab2335064e9750dc.tar.gz android-node-v8-0a679327be992d2a60fc3522ab2335064e9750dc.tar.bz2 android-node-v8-0a679327be992d2a60fc3522ab2335064e9750dc.zip |
doc: update language regarding key stretching
Update the docs to provide clearer instructions regarding the exact
scope of the use (and re-use) of an IV, stating the instructions
explicitly with greater clarity.
PR-URL: https://github.com/nodejs/node/pull/19810
Fixes: https://github.com/nodejs/node/issues/19748
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/crypto.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 5064d1a7b2..f00adf02ec 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1377,6 +1377,13 @@ The `key` is the raw key used by the `algorithm` and `iv` is an [Buffers][`Buffer`], `TypedArray`, or `DataView`s. If the cipher does not need an initialization vector, `iv` may be `null`. +Initialization vectors should be unpredictable and unique; ideally, they will be +cryptographically random. They do not have to be secret: IVs are typically just +added to ciphertext messages unencrypted. It may sound contradictory that +something has to be unpredictable and unique, but does not have to be secret; +it is important to remember that an attacker must not be able to predict ahead +of time what a given IV will be. + ### crypto.createCredentials(details) <!-- YAML added: v0.1.92 @@ -1458,6 +1465,13 @@ The `key` is the raw key used by the `algorithm` and `iv` is an [Buffers][`Buffer`], `TypedArray`, or `DataView`s. If the cipher does not need an initialization vector, `iv` may be `null`. +Initialization vectors should be unpredictable and unique; ideally, they will be +cryptographically random. They do not have to be secret: IVs are typically just +added to ciphertext messages unencrypted. It may sound contradictory that +something has to be unpredictable and unique, but does not have to be secret; +it is important to remember that an attacker must not be able to predict ahead +of time what a given IV will be. + ### crypto.createDiffieHellman(prime[, primeEncoding][, generator][, generatorEncoding]) <!-- YAML added: v0.11.12 |