Skip to content

Commit

Permalink
description of additionalData for AES-GCM
Browse files Browse the repository at this point in the history
added description for additionalData for AES-GCM
  • Loading branch information
afitzek committed Jul 17, 2015
1 parent 093fe42 commit ed5b6fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
},
Expand Down

0 comments on commit ed5b6fb

Please sign in to comment.