Encrypt a File with a Password
About this tool
About Encrypt File
Lock any file behind a password before you email it, put it on a USB stick or leave it in cloud storage. Encrypt File works with every format: photos, spreadsheets, ZIP archives, videos, backups. It uses AES-256-GCM, the authenticated cipher behind HTTPS and disk encryption, with a key stretched from your password by PBKDF2-SHA-256 over 600,000 rounds, so each password guess is expensive for an attacker. Every file gets a fresh random salt and nonce. The original file name and type are sealed inside, so you can also hide the name from the outside. Large files are processed in 4 MB pieces with a progress bar and a cancel button, and every piece is authenticated: if a single byte is changed, or the file is cut short, decryption refuses instead of returning damaged data. The format is documented, versioned and opened with our Decrypt File tool. Encryption happens entirely in your browser with the Web Crypto API. Neither the file nor the password ever leaves your device.
Built and maintained by Abhi JainUpdated
How to Encrypt a File
- 1
Choose a file
Drop any file on the page or click Choose file.
- 2
Set a password
Type a strong password in Password and again in Confirm password. Tick Hide the file name if the name itself is sensitive.
- 3
Encrypt
Click Encrypt file and wait for the progress bar to finish.
- 4
Download and keep the password
Click Download encrypted file to save the .ktpv file, and store the password somewhere safe, such as a password manager.
Encrypt File: questions and answers
How secure is this file encryption?
Files are encrypted with AES-256-GCM. The key comes from your password through PBKDF2-SHA-256 with 600,000 iterations (the OWASP recommendation) and a random 16-byte salt. With a long, unique password, the file can't be opened without it. The weak point is a short or reused password, which can be guessed offline.
What if I forget the password?
The file can't be recovered. There is no back door, reset link or master key, and we never see your password. Save it in a password manager before you delete the original.
What does the encrypted file reveal?
Only its approximate size and that it was made with this tool (it starts with the bytes KTPV). The contents, the original file name and the file type are encrypted. Tick Hide the file name so the outer name gives nothing away either.
What is the .ktpv file format?
A 42-byte header (the letters KTPV, version, PBKDF2 iteration count, chunk size, salt and nonce), then an encrypted block holding the file name, type and size, then the file in 4 MB AES-256-GCM chunks. Each chunk is bound to the header and its position, and the last chunk is marked as final, so tampering, reordering and truncation are all detected.
Can I encrypt large files?
Yes. Files are read and encrypted 4 MB at a time, so a multi-gigabyte file works on most computers. The finished file is held in memory until you save it, so very large files need enough free RAM.
Is the file uploaded to a server?
No. Encryption runs in your browser with the built-in Web Crypto API. The file and the password never leave your device, and you can disconnect from the internet after the page loads. To protect a PDF so it still opens in any PDF reader, use Protect PDF instead.
Related Tools
- Decrypt FileOpen a file you encrypted with Encrypt File, with its original name.
- Encrypt TextTurn a message into password-protected AES-256 ciphertext you can paste anywhere.
- Protect PDFPassword protect your PDF with strong user and owner passwords.
- Password GeneratorStrong random passwords with a live strength and entropy estimate.