From ed5b6fb1f52c57213d7410c5c0a2dc05f77ef87a Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Fri, 17 Jul 2015 21:32:41 +0200 Subject: [PATCH] description of additionalData for AES-GCM added description for additionalData for AES-GCM --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 654c29a..ec3cff1 100644 --- a/README.md +++ b/README.md @@ -978,8 +978,15 @@ window.crypto.subtle.encrypt( //Always generate a new iv every time your encrypt! iv: window.crypto.getRandomValues(new Uint8Array(16)), - //Additional authentication data (unsure what proper use for this is) + //Additional authenticated data: + //AES-GCM protects the confidentiality and the integrity. The additionalData is not + //encrypted but the integrity is stil protected. + //Decryption will only succeed if the additionalData is the same during + //decryption and encryption. + //This is an optional property. additionalData: window.crypto.getRandomValues(new Uint8Array(256)), + + //Length of the authentication tag tagLength: 128, }; },