files/en-us/web/api/aesgcmparams/index.md
{{ APIRef("Web Crypto API") }}
The AesGcmParams dictionary of the Web Crypto API represents the object that should be passed as the algorithm parameter into {{domxref("SubtleCrypto.encrypt()")}}, {{domxref("SubtleCrypto.decrypt()")}}, {{domxref("SubtleCrypto.wrapKey()")}}, or {{domxref("SubtleCrypto.unwrapKey()")}}, when using the AES-GCM algorithm.
For details of how to supply appropriate values for this parameter, see the specification for AES-GCM: NIST SP800-38D, in particular section 5.2.1.1 on Input Data.
name
AES-GCM.iv
additionalData {{optional_inline}}
: An {{jsxref("ArrayBuffer")}}, a {{jsxref("TypedArray")}}, or a {{jsxref("DataView")}}. This contains additional data that will not be encrypted but will be authenticated along with the encrypted data. If additionalData is given here then the same data must be given in the corresponding call to decrypt(): if the data given to the decrypt() call does not match the original data, the decryption will throw an exception. This gives you a way to authenticate associated data without having to encrypt it.
The bit length of additionalData must be smaller than 2^64 - 1.
The additionalData property is optional and may be omitted without compromising the security of the encryption operation.
tagLength {{optional_inline}}
: A Number. This determines the size in bits of the authentication tag generated in the encryption operation and used for authentication in the corresponding decryption.
The Web Crypto API specification requires this to have one of the following values: 32, 64, 96, 104, 112, 120, or 128. On the other hand, the AES-GCM specification recommends that it should be 96, 104, 112, 120, or 128, although 32 or 64 bits may be acceptable in some applications. For additional guidance, see Appendix C of the NIST Publication on "Recommendation for Block Cipher Modes of Operation".
tagLength is optional and defaults to 128 if it is not specified.
See the examples for {{domxref("SubtleCrypto.encrypt()")}} and {{domxref("SubtleCrypto.decrypt()")}}.
{{Specifications}}
Browsers that support the "AES-GCM" algorithm for the {{domxref("SubtleCrypto.encrypt()")}}, {{domxref("SubtleCrypto.decrypt()")}}, {{domxref("SubtleCrypto.wrapKey()")}}, or {{domxref("SubtleCrypto.unwrapKey()")}} methods will support this type.