Security Tools
Encrypt & decrypt.
Password-protect text or a file with AES-256-GCM, derived from your passphrase with PBKDF2 at 600,000 iterations — the current OWASP-recommended minimum. Everything runs locally via the browser's Web Crypto API; nothing is uploaded.
How to encrypt and decrypt with a passphrase
- Pick Encrypt or Decrypt at the top of the tool.
- Type or paste your text, or choose a file. If you choose a file it takes priority over the text box.
- Enter a passphrase. Longer is stronger, and a few unrelated words beat a short word with symbols.
- Press the button. Encrypted text can be copied or saved, and an encrypted file downloads with the data protected.
- To read it later, switch to Decrypt, supply the encrypted text or file and the same passphrase.
What is happening under the hood
Your passphrase is stretched into a key with PBKDF2 and 600,000 iterations, and the data is sealed with AES-256-GCM. A fresh random salt and nonce are made every time, so encrypting the same message twice gives two different results. GCM is an authenticated mode: a wrong passphrase or a modified file is detected and refused rather than returning garbage.
Why your text and passphrase stay private
An encryption tool is only worth using if the secret never leaves your machine. The work runs through the Web Crypto API inside an isolated frame on this page. That frame is cut off from the network, so your message, file and passphrase cannot be transmitted by the page or by anything else on it. The advertising on this page loads outside the frame and has no view into it.
Before you rely on it
- There is no reset. If you forget the passphrase, the data cannot be recovered by anyone, including us.
- Keep the passphrase separate from the encrypted output. Sending both together defeats the point.
- Keep a backup of important originals until you have confirmed that decryption works.
- This protects stored or shared data. It does not hide that a message exists, and it cannot protect a device that already has malware on it.
Related jobs
Use the passphrase generator and strength checker beside this page to choose a strong passphrase before you encrypt.
How it works
- AES-256-GCM: an authenticated cipher — it detects tampering or a wrong passphrase and refuses to produce output, rather than silently returning garbage.
- PBKDF2-HMAC-SHA256, 600,000 iterations: the passphrase is stretched into a key using OWASP's current recommended minimum iteration count for PBKDF2-HMAC-SHA256 (Password Storage Cheat Sheet), with a fresh random salt and IV every time you encrypt — so encrypting the same text twice produces two different outputs.
- Self-contained output: the encrypted text (or file) carries its own salt and IV, so decrypting only needs the output plus your passphrase.
- Fully local: built on the browser's native Web Crypto API (
crypto.subtle). No text, file, or passphrase is sent anywhere; verified before shipping with round-trip tests, plus checks that a wrong passphrase and a tampered ciphertext are both correctly rejected rather than silently accepted.
What this tool does
You give it text or a file and a passphrase. It returns an encrypted version that nobody can read without the same passphrase. Everything happens in your browser through the Web Crypto API, so the text, the file and the passphrase are never uploaded. Encrypted text comes out as a single Base64 string you can paste into a message or a note. An encrypted file downloads with a .enc extension. To get the original back, switch to Decrypt, supply the same passphrase and paste the string or choose the file.
How the encryption is built
- A key is derived from your passphrase. The tool uses PBKDF2 with HMAC-SHA-256 and 600,000 iterations, with a fresh random 16-byte salt every time. OWASP's Password Storage Cheat Sheet gives 600,000 as the work factor for PBKDF2-HMAC-SHA256. The iterations make each passphrase guess slow for an attacker, and the salt makes sure the same passphrase never produces the same key twice.
- The data is encrypted with AES-256-GCM. GCM is an authenticated mode: it produces a 16-byte authentication tag (the Web Crypto default of 128 bits) along with the ciphertext. On decryption, a wrong passphrase or any change to the data fails the check and no output is produced.
- A fresh 12-byte IV is generated for every encryption. The AES-GCM specification recommends a 96-bit IV, and MDN notes that an IV must never be reused with the same key. Random IV and salt are why encrypting the same text twice gives two different results.
- Everything needed to decrypt is packed into the output. The container is the salt (16 bytes), the IV (12 bytes) and then the ciphertext with its tag. The salt and IV are not secret, so only the passphrase has to be kept.
Worked example
Encrypt the five-character text hello with a passphrase. The plaintext is 5 bytes, GCM adds a 16-byte tag, the salt adds 16 bytes and the IV adds 12 bytes, so the container is 5 + 16 + 16 + 12 = 49 bytes. Base64 turns every 3 bytes into 4 characters, so 49 bytes become 68 characters. Run it again and you get a different 68-character string, because the salt and IV are new. Both decrypt back to hello with the same passphrase. Change a single character of either string and decryption fails with no partial output. Note what the example shows: the output is always 44 bytes longer than the input, so the length of what you encrypted is not hidden.
Choosing a passphrase
The encryption is not the weak point; the passphrase is. Anyone who has the output can guess passphrases offline, limited only by the 600,000-iteration key derivation. A short or common passphrase will fall to a dictionary, so use a long random one. A six-word Diceware passphrase is about 77 bits when drawn from the full 7,776-word list. You can generate one with the Diceware Passphrase Generator and measure it with the Password Entropy Calculator. There is no reset: if you forget the passphrase, the data cannot be recovered.
What it is good for, and what it is not
- Good for: sending yourself a sensitive note, protecting a small file before putting it in cloud storage, or sharing a secret over a channel you do not fully trust, with the passphrase passed another way.
- Not a password manager or backup system. It does not remember passphrases or keep copies.
- Not OpenPGP, ZIP or any other format. The output uses this tool's own layout, so only this tool (or code that implements the same layout) can open it.
- Not protection for the page itself. If your device has malware, or you load the page from a copy you do not trust, local encryption does not help. For files that matter, use a vetted tool such as an audited desktop encryption program.
- Not a way to hide who or when. It conceals content only. Size and the fact that you sent something are visible.
Common mistakes
- Sending the passphrase in the same message as the encrypted data.
- Re-using one passphrase across many files.
- Editing, trimming or re-wrapping the Base64 string. Remove only whitespace.
- Expecting to decrypt on a device without the same passphrase. There is no master key.
Common mix-ups
-
Often assumedAES-256 encryption means my file is safe whatever passphrase I pick.
What the source saysNIST SP 800-132 says user-chosen passwords have low entropy and shall not be used directly as keys, and that the entropy of the password is critical against offline guessing. A short passphrase caps the real strength. [1]
-
Often assumed600,000 PBKDF2 iterations make even a weak passphrase uncrackable.
What the source saysNIST SP 800-132 says an iteration count C raises the cost of a dictionary attack on a password with t bits of entropy from 2^t to C times 2^t operations. 600,000 is about 2^19, so it adds roughly 19 bits of work, not unlimited strength. [1]
Checked against these sources on .
Frequently asked questions
Is it safe to encrypt text in the browser?
The encryption uses the browser's built-in Web Crypto implementation of AES-256-GCM, and the text, file and passphrase are not sent anywhere. The remaining risks are a weak passphrase and an untrustworthy device. For high-stakes files, use a vetted encryption program as well.
What encryption does this tool use?
AES-256 in Galois/Counter Mode, with the key derived from your passphrase by PBKDF2-HMAC-SHA256 at 600,000 iterations. A random 16-byte salt and a random 12-byte IV are created for each encryption.
Why does the same text give a different result each time?
Each encryption uses a new random salt and IV. That is required for AES-GCM: the IV must never repeat with the same key. Every output still decrypts to the same text with the same passphrase.
What happens if I forget the passphrase?
The data cannot be recovered. There is no reset and no backup key, because the passphrase is the only secret. Store it in a password manager or somewhere safe before relying on the output.
Why does decryption fail with the right passphrase?
The output was probably altered. GCM authenticates the data, so a missing character, an added line break or a truncated file will fail the check. Copy the whole string again, or use the original file.
Can I encrypt large files?
The tool reads the file into browser memory and encrypts it in one operation, so very large files may be slow or fail on devices with little memory. Encrypt large archives with a desktop program instead.
How strong does my passphrase need to be?
As strong as the secret deserves, since anyone holding the output can try guesses offline. A random passphrase of six or more words from a 7,776-word list is a common minimum. The 600,000 PBKDF2 iterations slow guessing but do not rescue a weak passphrase.
Sources
- MDN: AesGcmParams: 96-bit IV recommendation, IV uniqueness, tagLength defaults to 128 (retrieved 2026-10).
- MDN: SubtleCrypto.deriveKey: PBKDF2 key derivation in Web Crypto (retrieved 2026-10).
- OWASP Password Storage Cheat Sheet: PBKDF2-HMAC-SHA256 work factor of 600,000 (retrieved 2026-10).
- NIST SP 800-38D: Galois/Counter Mode (GCM) and GMAC: specification of the authenticated mode (retrieved 2026-10).