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:
parent
dff214153f
commit
99c77dc018
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user