Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b841abc

Browse filesBrowse files
tniessenMylesBorins
authored andcommitted
doc: warn about GCM authenticity
PR-URL: #18376 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent ef45bb4 commit b841abc
Copy full SHA for b841abc

File tree

Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/crypto.md‎

Copy file name to clipboardExpand all lines: doc/api/crypto.md
+9Lines changed: 9 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,14 @@ received _authentication tag_. If no tag is provided, or if the cipher text
425425
has been tampered with, [`decipher.final()`][] will throw, indicating that the
426426
cipher text should be discarded due to failed authentication.
427427

428+
Note that this Node.js version does not verify the length of GCM authentication
429+
tags. Such a check *must* be implemented by applications and is crucial to the
430+
authenticity of the encrypted data, otherwise, an attacker can use an
431+
arbitrarily short authentication tag to increase the chances of successfully
432+
passing authentication (up to 0.39%). It is highly recommended to associate one
433+
of the values 16, 15, 14, 13, 12, 8 or 4 bytes with each key, and to only permit
434+
authentication tags of that length, see [NIST SP 800-38D][].
435+
428436
The `decipher.setAuthTag()` method must be called before
429437
[`decipher.final()`][].
430438

@@ -2414,6 +2422,7 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
24142422
[HTML5's `keygen` element]: https://www.w3.org/TR/html5/forms.html#the-keygen-element
24152423
[NIST SP 800-131A]: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf
24162424
[NIST SP 800-132]: http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf
2425+
[NIST SP 800-38D]: http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
24172426
[Nonce-Disrespecting Adversaries]: https://github.com/nonce-disrespect/nonce-disrespect
24182427
[OpenSSL's SPKAC implementation]: https://www.openssl.org/docs/man1.0.2/apps/spkac.html
24192428
[RFC 2412]: https://www.rfc-editor.org/rfc/rfc2412.txt

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.