Important Note on Keys and IVs:
- Keys must encode 16 bytes for AES-128 or 32 bytes for AES-256.
- Keys and CBC IVs may be literal UTF-8 text or prefixed with base64:.
- CBC uses a 16-byte IV. GCM generates and stores a fresh 12-byte nonce automatically.
- The Key and IV used for decryption MUST be identical to those used for encryption.
- For real-world applications, use strong, randomly generated keys and IVs, and securely manage them.