AES-GCM Encryption/Decryption
Runs locally in your browser/device — no server needed.
How it works
- Your key is hashed with SHA-256 to create a 256-bit AES key.
- Encrypt: a new random 12-byte IV is generated each time, then AES-GCM encrypts your plaintext.
- The output is Base64URL of IV + ciphertext (the ciphertext includes the GCM authentication tag).
- AES-GCM provides confidentiality and integrity: if the key or ciphertext is wrong/tampered, the integrity check fails.
- That’s why a wrong password shows Failed to decrypt instead of returning “garbage” plaintext.
- The random IV ensures the same plaintext (with the same key) produces a different ciphertext each time you encrypt.