Skip to main content

Text Encryptor

Encrypt and decrypt text using AES-256-GCM with PBKDF2 key derivation. All processing happens in your browser — your data never leaves your device.

How it works: Enter text and a password. The tool derives an encryption key from your password using PBKDF2 (100,000 iterations, SHA-256), then encrypts with AES-256-GCM. The output includes the salt, IV, and authentication tag encoded in Base64. All encryption and decryption happens in your browser using the Web Crypto API. No data is sent to any server. Save your password — there is no way to recover encrypted text without it.
Ad (leaderboard)
Rate this tool
0.0 / 5 · 0 ratings

Embed This Calculator

Add this calculator to your website for free. Copy the single line of code below and paste it into your HTML. The calculator auto-resizes to fit your page.

<script src="https://calchammer.com/embed.js" data-calculator="text-encryptor" data-category="everyday"></script>
data-theme "light", "dark", or "auto"
data-values Pre-fill inputs, e.g. "amount=1000"
data-max-width Max width, e.g. "600px"
data-border "true" or "false"
Or use an iframe instead
<iframe src="https://calchammer.com/embed/everyday/text-encryptor" width="100%" height="500" style="border:none;border-radius:12px;" title="Text Encryptor Calculator"></iframe>

Preview

yoursite.com/blog
Text Encryptor Calculator auto-resizes here
Ad (in_results)

How AES-256-GCM Encryption Works

AES-256-GCM is an authenticated encryption algorithm that provides both confidentiality and integrity protection in a single operation. AES (Advanced Encryption Standard) with a 256-bit key is the strongest variant of AES, approved by NIST for top-secret government data. GCM (Galois/Counter Mode) combines the counter mode of encryption with Galois field multiplication for authentication, producing both ciphertext and an authentication tag that detects any tampering.

This tool derives the AES-256 key from your password using PBKDF2 (Password-Based Key Derivation Function 2) with 100,000 iterations of SHA-256. Each encryption generates a random 16-byte salt for key derivation and a random 12-byte initialization vector (IV) for AES-GCM. These random values ensure that encrypting the same text with the same password produces completely different output each time, preventing pattern analysis attacks.

Ad (in_content)

The Encryption Pipeline

When you encrypt text, the following steps occur entirely in your browser. First, a random 16-byte salt is generated using crypto.getRandomValues(). Second, your password and the salt are fed into PBKDF2 with 100,000 iterations of SHA-256 to derive a 256-bit encryption key. Third, a random 12-byte IV is generated. Fourth, the text is encrypted using AES-256-GCM with the derived key and IV, producing ciphertext and a 16-byte authentication tag. Finally, the salt, IV, ciphertext, and tag are combined and Base64-encoded for easy copying and sharing.

Why PBKDF2 Is Essential

Human-chosen passwords have far less entropy than the 256 bits needed for AES-256. A typical strong password might have 40-60 bits of entropy. PBKDF2 addresses this by making each password guess computationally expensive. With 100,000 iterations, an attacker trying 1 billion passwords per second on a GPU cluster would need significantly longer to crack the key. The random salt prevents precomputed rainbow table attacks and ensures that two users with the same password produce different encryption keys.

GCM Mode Authentication

The GCM authentication tag is a 16-byte value that acts as a cryptographic checksum of the ciphertext. If an attacker modifies even a single bit of the encrypted data, the authentication tag will not match during decryption, and the operation will fail with an error. This prevents chosen-ciphertext attacks where an attacker manipulates encrypted data to learn information about the plaintext. In this tool, a failed authentication check results in the message "Decryption failed: wrong password or corrupted data."

Security Considerations

The security of this encryption depends entirely on your password strength. Use a long, unique password with mixed character types. The tool itself uses industry-standard algorithms and parameters. All processing uses the browser's built-in Web Crypto API (SubtleCrypto), which is implemented in native code and resistant to timing attacks. Your data, password, and encryption keys exist only in browser memory and are never transmitted over the network.

Frequently Asked Questions

What encryption algorithm does this tool use?

AES-256-GCM with PBKDF2 key derivation (100,000 iterations of SHA-256). AES-256 is the strongest AES variant, and GCM provides both encryption and tamper detection.

Is my data sent to any server?

No. All operations use the browser's Web Crypto API. Your text, password, and results never leave your device. You can verify by using the tool offline.

What is PBKDF2?

PBKDF2 converts a password into a cryptographic key using 100,000 rounds of SHA-256 with a random salt. This makes brute-force attacks against weak passwords much more expensive.

What does the encrypted output contain?

The output is Base64-encoded and contains the salt (for key derivation), IV (for AES-GCM), ciphertext (encrypted data), and authentication tag (tamper detection). All four are needed for decryption.

Can I decrypt with other tools?

Yes, if they implement PBKDF2-SHA256 (100K iterations, 16-byte salt) followed by AES-256-GCM (12-byte IV, 16-byte tag). The format is Base64(Base64(salt):Base64(iv):Base64(ciphertext):Base64(tag)).

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and should not be considered professional expert advice. Consult a qualified professional before making decisions based on these calculations. See our full Disclaimer.