From 86ef4bcb5de1377f08ec57c6fd993e09317c2539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 6 Apr 2018 14:32:35 +0200 Subject: [PATCH] doc: improve CCM example The nonce must be transmitted along with ciphertext and tag. --- doc/api/crypto.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 5064d1a7b267b4..238e39d500cc95 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -2233,7 +2233,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