Encrypt data using AES-GCM via the Web Crypto API.
Output format: iv (12 bytes) || ciphertext || tag
iv (12 bytes) || ciphertext || tag
Encryption parameters.
The IV-prefixed ciphertext and IV length.
const key = await generateKey({ algorithm: "AES-GCM" });const { ciphertext } = await encrypt({ key, plaintext: new TextEncoder().encode("secret"),}); Copy
const key = await generateKey({ algorithm: "AES-GCM" });const { ciphertext } = await encrypt({ key, plaintext: new TextEncoder().encode("secret"),});
Encrypt data using AES-GCM via the Web Crypto API.
Output format:
iv (12 bytes) || ciphertext || tag