Skip to content

Commit 6706be1

Browse files
authored
doc: change AES-GCM IV recommendation in WebCrypto
PR-URL: #42611 Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 2f51e12 commit 6706be1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

doc/api/webcrypto.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -1019,9 +1019,14 @@ added: v15.0.0
10191019

10201020
* Type: {ArrayBuffer|TypedArray|DataView|Buffer}
10211021

1022-
The initialization vector must be unique for every encryption operation
1023-
using a given key. The AES-GCM specification recommends that
1024-
this contain at least 12 random bytes.
1022+
The initialization vector must be unique for every encryption operation using a
1023+
given key.
1024+
1025+
Ideally, this is a deterministic 12-byte value that is computed in such a way
1026+
that it is guaranteed to be unique across all invocations that use the same key.
1027+
Alternatively, the initialization vector may consist of at least 12
1028+
cryptographically random bytes. For more information on constructing
1029+
initialization vectors for AES-GCM, refer to Section 8 of [NIST SP 800-38D][].
10251030

10261031
#### `aesGcmParams.name`
10271032

@@ -1923,5 +1928,6 @@ added: v15.0.0
19231928

19241929
[JSON Web Key]: https://tools.ietf.org/html/rfc7517
19251930
[Key usages]: #cryptokeyusages
1931+
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
19261932
[RFC 4122]: https://www.rfc-editor.org/rfc/rfc4122.txt
19271933
[Web Crypto API]: https://www.w3.org/TR/WebCryptoAPI/

0 commit comments

Comments
 (0)