diff options
author | Tobias Nießen <tniessen@tnie.de> | 2022-04-12 03:42:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 03:42:41 +0300 |
commit | 6706be1cdb676605a25d1a4b8dd0890fab62d73f (patch) | |
tree | e55a5705c43145fe2d8cf3e2dc5935038fc58df8 /doc/api/webcrypto.md | |
parent | 2f51e121dae43c5eaf77e3dff372f5e9abee381b (diff) |
doc: change AES-GCM IV recommendation in WebCrypto
PR-URL: https://github.com/nodejs/node/pull/42611
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Diffstat (limited to 'doc/api/webcrypto.md')
-rw-r--r-- | doc/api/webcrypto.md | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 618a9cfdcfc..e752eaff591 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -1019,9 +1019,14 @@ added: v15.0.0 * Type: {ArrayBuffer|TypedArray|DataView|Buffer} -The initialization vector must be unique for every encryption operation -using a given key. The AES-GCM specification recommends that -this contain at least 12 random bytes. +The initialization vector must be unique for every encryption operation using a +given key. + +Ideally, this is a deterministic 12-byte value that is computed in such a way +that it is guaranteed to be unique across all invocations that use the same key. +Alternatively, the initialization vector may consist of at least 12 +cryptographically random bytes. For more information on constructing +initialization vectors for AES-GCM, refer to Section 8 of [NIST SP 800-38D][]. #### `aesGcmParams.name` @@ -1923,5 +1928,6 @@ added: v15.0.0 [JSON Web Key]: https://tools.ietf.org/html/rfc7517 [Key usages]: #cryptokeyusages +[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 4122]: https://www.rfc-editor.org/rfc/rfc4122.txt [Web Crypto API]: https://www.w3.org/TR/WebCryptoAPI/ |