AES Text Encryptor
Encrypt and decrypt text using AES-256-GCM directly in your browser with SubtleCrypto.
Uses AES-256-GCM with PBKDF2 key derivation. Encrypted output is base64-encoded.
About this tool
AES (Advanced Encryption Standard) is a military-grade symmetric encryption algorithm that secures sensitive information by scrambling text into unreadable ciphertext, which can only be decrypted with the correct password. This AES Text Encryptor uses AES-256-GCM, the most robust variant offering 256-bit key strength and authenticated encryption—meaning both your data's privacy and integrity are protected. Unlike cloud-based tools that send your data to remote servers, this encryptor runs entirely in your browser, ensuring your plaintext and password never leave your device.
To encrypt text, simply paste or type your message, enter a strong password, and click 'Encrypt'; the tool generates a secure ciphertext that you can safely share or store. To decrypt, paste the ciphertext, enter the same password, and click 'Decrypt' to recover the original message. The tool handles special characters, Unicode, and any text length. This makes it ideal for securing sensitive notes, protecting credentials before pasting them elsewhere, encrypting backup files, or sharing confidential information with others who have the same password.
Remember that your encryption strength depends critically on password quality—use at least 12 characters with mixed case, numbers, and symbols. The GCM mode automatically detects tampering, so if someone modifies the encrypted text, decryption will fail with an error, protecting you against silent corruption. Browser-based encryption is convenient for quick security tasks, but for long-term archival of highly sensitive data, consider hardware security keys or offline encryption tools.
Frequently Asked Questions
Code Implementation
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
import base64
# AES-256-CBC Encryption
key = get_random_bytes(32) # 256-bit key
iv = get_random_bytes(16) # 128-bit IV
def encrypt(plaintext: str, key: bytes, iv: bytes) -> str:
cipher = AES.new(key, AES.MODE_CBC, iv)
ct_bytes = cipher.encrypt(pad(plaintext.encode(), AES.block_size))
return base64.b64encode(iv + ct_bytes).decode()
def decrypt(ciphertext: str, key: bytes) -> str:
raw = base64.b64decode(ciphertext)
iv = raw[:16]
cipher = AES.new(key, AES.MODE_CBC, iv)
return unpad(cipher.decrypt(raw[16:]), AES.block_size).decode()
encrypted = encrypt("Hello, World!", key, iv)
print("Encrypted:", encrypted)
print("Decrypted:", decrypt(encrypted, key))
# AES-256-GCM (authenticated encryption)
def encrypt_gcm(plaintext: str, key: bytes) -> dict:
cipher = AES.new(key, AES.MODE_GCM)
ct, tag = cipher.encrypt_and_digest(plaintext.encode())
return {
"nonce": base64.b64encode(cipher.nonce).decode(),
"tag": base64.b64encode(tag).decode(),
"ct": base64.b64encode(ct).decode(),
}Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.