Why authenticated encryption matters
AES-GCM encrypts data and helps detect tampering. That combination is preferable to naive encryption modes that only hide plaintext and leave messages malleable.
In GCM, the authentication tag is as important as the ciphertext. If verification fails, treat the message as untrusted—do not partially decrypt and “see what happens.”
Nonces, keys, and reuse
Never reuse a nonce with the same key in GCM. Nonce reuse can destroy confidentiality guarantees. Prefer random 96-bit nonces from a strong generator, or use a well-reviewed API that manages this for you.
Key management usually matters more than algorithm choice. A strong cipher with a leaked key is still a failure.
Password-based caveats
Deriving keys from passwords requires slow hashing (such as PBKDF2) and strong user passwords. Weak passwords remain the weak link no matter which AES mode you pick.
Use vetted libraries and key management in production. Browser demos are for learning and lightweight personal use cases. Forgebox AES tools help you explore the flow locally without uploading plaintext to a remote service.