Skip to content

Commit

Permalink
crypto,doc: update language regarding key stretching
Browse files Browse the repository at this point in the history
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.

Fixes: #19748
  • Loading branch information
ryzokuken committed Apr 5, 2018
1 parent 3567ea0 commit 7a881d9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,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
Expand Down Expand Up @@ -1437,6 +1444,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
Expand Down

0 comments on commit 7a881d9

Please sign in to comment.