File Encrypt and Decrypt
Lock any file with a password using AES-256-GCM in your browser, and unlock it again later with the same password.
File Encrypt and Decrypt
There is no way back without the password
At least 8 characters, our own minimum. Longer is safer.
Quick facts
- Price
- Free
- Sign-up
- Not required
- Where it runs
- On your device
- Files uploaded
- No
- Limits
- Up to 100 MB per input; Up to 1 file at once
- Produces
- NIENC
- Updated
File Encrypt and Decrypt locks any file with a password using AES-256-GCM in your browser, and unlocks the resulting .nienc file again with the same password. It is for anyone who wants to send or store a private file somewhere they do not fully trust, such as a shared drive or an email attachment, without installing software. The encryption runs on your device through the browser’s built-in WebCrypto, and the password never leaves the page.
How to use
- Leave Action on Encrypt a file, then drop any file on the box, up to 100 MB.
- Type a Password of at least 8 characters, our own minimum, and type it again in Password again.
- Press Encrypt, then Download. The new file has the old name plus
.nienc, such asreport.pdf.nienc. - To open it later, choose Decrypt a .nienc file, drop the
.niencfile, type the same password and press Decrypt. - Download the result. It gets back the original file name, which was stored inside the encrypted part.
Examples
Encrypt notes.txt, which holds hello world, with the password correct horse. The download is notes.txt.nienc, 71 bytes long: 33 bytes of header, then the encrypted name length, name and text, then a 16-byte tag. Encrypt the same file again and the bytes after the first five come out different, because each file gets a new random salt and nonce. Decrypt it with correct horses and you get only an error message, never a partial file.
Limits
If the password is lost, the file cannot be recovered: there is no reset and no back door. A wrong password, a damaged file and a changed file all give the same clear error and no output, because the format cannot tell them apart. Files up to 100 MB can be encrypted, our own limit, since the whole file must fit in memory; the matching .nienc file may be up to 306 bytes larger. The format is this tool’s own. It is not tested for files encrypted by other tools, and other programs are not expected to read it.
The .nienc format, version 1: four bytes NIEC, one version byte, a 16-byte random salt and a 12-byte random nonce, then the AES-256-GCM ciphertext with its 16-byte tag. The key comes from PBKDF2 with SHA-256 and 600,000 iterations, the figure the OWASP Password Storage Cheat Sheet recommends, and the 33 header bytes are authenticated too.
FAQ
Can you recover my file if I forget the password?
No. Nothing about the password is kept anywhere, so nobody can open the file without it. Store the password in a password manager before you delete the original.
Why does encrypting take a moment even for a tiny file?
The password is stretched with 600,000 rounds of PBKDF2 before it becomes a key. That cost is paid once per file and makes each guess at the password slow for an attacker too.
Does the encrypted file hide the original name and size?
The name is inside the encrypted part, so it is hidden, though the download is named after it unless you rename it. The size is not hidden: the output is always 51 bytes plus the length of the name longer than the input.
Related tools
- Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of any text or file, all four at once, in lowercase hex, right in your browser.
- Password GeneratorGenerate strong random passwords from uppercase, lowercase, numbers and symbols, with a strength rating and one-click copy.
- Base64 Encoder / DecoderEncode text or files to Base64 and decode Base64 back to text or a file, in standard or URL-safe Base64URL, right in your browser.