mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
doc: improve CCM example
The nonce must be transmitted along with ciphertext and tag. PR-URL: https://github.com/nodejs/node/pull/19851 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -2267,7 +2267,7 @@ const ciphertext = cipher.update(plaintext, 'utf8');
|
||||
cipher.final();
|
||||
const tag = cipher.getAuthTag();
|
||||
|
||||
// Now transmit { ciphertext, tag }.
|
||||
// Now transmit { ciphertext, nonce, tag }.
|
||||
|
||||
const decipher = crypto.createDecipheriv('aes-192-ccm', key, nonce, {
|
||||
authTagLength: 16
|
||||
|
||||
Reference in new issue
Block a user