AES-256 Encryptor
Encrypt and decrypt text with AES-256-GCM using a passphrase. Generate portable encrypted data with authenticated encryption, a random salt and a unique initialization vector.
AES Encryption & Decryption
Enter your text and passphrase, then choose an operation.
Your text and passphrase are not submitted to Permitir's PHP server. Encryption and decryption use your browser's built-in Web Crypto API. This page does not save your input or encrypted output to a database.
How This AES Encryptor Works
This tool uses the Advanced Encryption Standard (AES) with a 256-bit key and Galois/Counter Mode (GCM). AES-GCM is an authenticated encryption mode: it protects the confidentiality of your data and detects changes to the encrypted message.
AES-256
A 256-bit symmetric encryption key is derived from your passphrase.
Random Salt
A fresh random salt is generated for each encryption operation.
Authenticated Encryption
GCM authentication helps detect tampering or incorrect decryption data.
1. Passphrase-based key derivation
A passphrase is not directly used as an AES key. Instead, the browser derives a 256-bit key using PBKDF2 with HMAC-SHA-256 and 600,000 iterations. A random salt ensures that encrypting the same text with the same passphrase produces different encrypted results.
2. AES-256-GCM encryption
The derived key encrypts your text using AES-GCM. The tool generates a new 12-byte initialization vector (IV) for each encryption operation. The IV is not a secret and is included in the encrypted output because it is needed for decryption.
3. Portable encrypted output
The result is a JSON object containing the format version, algorithm, key-derivation settings, salt, IV and encrypted data. You can copy this complete object and store it separately from your passphrase.
4. Decryption and integrity checking
To decrypt, paste the complete encrypted JSON into the text field and enter the original passphrase. The tool derives the key again and attempts authenticated decryption. If the passphrase is incorrect or the encrypted data has been modified, decryption will fail.
Security Notes
- AES-GCM: An authenticated encryption mode that provides confidentiality and integrity protection.
- 256-bit key: The tool derives a 256-bit AES key from your passphrase.
- PBKDF2: Uses HMAC-SHA-256 with 600,000 iterations to derive the encryption key.
- Random salt: A new 16-byte salt is generated for every encryption operation.
- Random IV: A new 12-byte initialization vector is generated for every encryption operation.
- Authentication tag: AES-GCM uses a 128-bit authentication tag to detect tampering.
- No password recovery: If you lose your passphrase, this tool cannot recover it for you.
Frequently Asked Questions
What is AES-256 encryption?
AES is a symmetric encryption algorithm. AES-256 uses a 256-bit key. The same secret key is used to encrypt and decrypt information. This tool uses AES-256 in GCM mode.
What is the difference between AES-GCM and AES-CBC?
Both are AES modes, but GCM provides authenticated encryption. CBC does not provide message authentication by itself and requires additional integrity protection to be used safely. This tool uses GCM to provide encryption and tamper detection together.
Can I decrypt the encrypted output later?
Yes. Save the complete encrypted JSON output. Later, paste it into the text field, enter the exact original passphrase, and select Decrypt Data. The encrypted output contains the salt and IV needed for key derivation and decryption.
Does Permitir receive my original text or passphrase?
No. This implementation performs encryption and decryption in the browser using the Web Crypto API. The tool does not send your entered text or passphrase to the PHP application.
What happens if I enter the wrong passphrase?
Authenticated decryption fails. The tool displays an error rather than returning unverified plaintext.
Can I use the encrypted output on another device?
Yes, provided the other application supports the same encryption format and parameters. You need the complete encrypted JSON object and the original passphrase. This page uses its own documented JSON envelope format, so another application must implement the same format to read it directly.
What if I forget my passphrase?
There is no password reset or recovery function. The passphrase is required to derive the encryption key. Keep a secure backup of your passphrase.
Is AES encryption the same as password hashing?
No. Encryption is reversible when the correct key is available. Password hashing is designed to be one-way and is normally used to verify login passwords. For user authentication, use a password-hashing algorithm such as Argon2id rather than reversible AES encryption.
Explore More Security Tools
Permitir provides tools and educational resources for encryption, authentication, identity management and cybersecurity.