mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00: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:
@@ -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