What Is File Encryption and Why Does It Matter?
File encryption is the process of converting readable data into an unreadable format that can only be restored with the correct decryption key. It is the foundational technology behind secure messaging, online banking, cloud storage, and virtually every digital service you use today. When you encrypt a file, you are essentially locking it inside a digital vault — anyone can see the vault exists, but only someone with the key can open it.
In an age where data breaches are reported almost daily, and where billions of personal records have been exposed through careless storage, file encryption is no longer optional. It is a basic hygiene practice that every individual and every organization should adopt. Whether you are a freelancer sending a client contract, a student protecting research notes, a business owner backing up financial records, or a journalist protecting a source, encrypting your files gives you control over who can read your data.
This tool makes encryption accessible to everyone. You do not need to install software, remember terminal commands, or understand cryptography. Upload a file, set a password, and download the encrypted version. But beneath the simplicity lies a serious, industry-standard cryptographic engine: AES-256-GCM with PBKDF2-SHA256 key derivation. This is not a toy.
Understanding AES-256-GCM
AES stands for Advanced Encryption Standard. It was established by the U.S. National Institute of Standards and Technology (NIST) in 2001 after an open international competition. Today it is the global standard for symmetric encryption and is used by the U.S. government to protect classified information up to the "Top Secret" level. AES has three key sizes — 128, 192, and 256 bits — and AES-256 is the strongest variant available.
The "256" refers to the key size. A 256-bit key has 2^256 possible values — a number so vast it exceeds the estimated number of atoms in the observable universe. Brute-forcing an AES-256 key by trying every possibility is not just impractical; it is considered physically impossible with current or any foreseeable technology. This is why AES-256 is often called "military-grade" encryption.
The "GCM" part stands for Galois/Counter Mode. It is a mode of operation — a method of using the AES cipher. GCM is what cryptographers call an Authenticated Encryption with Associated Data (AEAD) algorithm. It does two things simultaneously: it encrypts the data (making it unreadable), and it authenticates it (detecting any modification). This is a crucial distinction.
Why GCM Is Better Than CBC
The older AES-CBC mode (Cipher Block Chaining) encrypts data but does not verify integrity. This means an attacker can modify encrypted data without detection, potentially leading to padding oracle attacks or bit-flipping attacks that can recover plaintext. GCM solves this by appending a 128-bit authentication tag to the ciphertext. When you decrypt, the cipher verifies this tag first. If even one bit of the file has been changed, decryption fails loudly. This is why modern tools — including this one — prefer GCM over CBC.
How Key Derivation Works (PBKDF2)
AES-256 requires a 32-byte key. But you do not want to memorize a 32-byte binary blob, so we use a password instead. That is where key derivation comes in. A Key Derivation Function (KDF) takes a password and turns it into a cryptographic key. The naive approach — hashing the password once with SHA-256 — is vulnerable because attackers can precompute hash tables (rainbow tables) or use GPUs to test billions of passwords per second.
PBKDF2 (Password-Based Key Derivation Function 2) is designed to be slow. It applies a cryptographic hash (in our case, HMAC-SHA256) to the password thousands of times, with a random salt mixed in. This tool uses 200,000 iterations. That means each password guess takes about 200,000 hash operations, dramatically slowing down brute-force attacks without adding noticeable delay for legitimate users.
The salt is a 16-byte random value generated fresh for every file you encrypt. Its purpose is to prevent attackers from precomputing results. If you encrypt the same file twice with the same password, you will get completely different encrypted outputs — because the salt and nonce are different each time.
Encryption Algorithm Step by Step
Here is exactly what happens when you click "Encrypt File":
- Generate salt. A cryptographically secure random 16-byte value is generated using
crypto.getRandomValues(). - Generate nonce. Another 12-byte random value is generated. The nonce (number used once) ensures that even identical plaintexts produce different ciphertexts.
- Derive the key. Your password is combined with the salt via PBKDF2-HMAC-SHA256 with 200,000 iterations to produce a 256-bit AES key.
- Encrypt. The file bytes are encrypted with AES-256-GCM using the key and nonce. GCM also produces a 128-bit authentication tag.
- Assemble the container. The magic header "FENC", version byte, salt, nonce, and ciphertext+tag are combined into the output file.
- Download. The browser creates a Blob and downloads it with a
.encextension.
The entire process runs locally in your browser using the Web Crypto API, a native browser implementation of cryptographic primitives. No JavaScript library is loaded from a third party — the encryption is done by your browser's built-in crypto engine, which is audited and FIPS-certified on major platforms.
Encrypted File Format
The output file uses a simple, documented binary format:
[ "FENC" 4B ][ version 1B ][ salt 16B ][ nonce 12B ][ ciphertext + GCM tag ]
This makes the file self-describing. As long as the bytes are intact, anyone with the correct password and a compatible decryptor can restore your file — even years from now. Renaming, moving, or transferring the file does not affect decryption.
Why Browser-Side Encryption Is Safer
Most online encryption tools upload your file to their servers, encrypt it there, and send it back. This means the file exists on their server — even briefly. That is a security risk, especially if the service is compromised or the operator is malicious. This tool takes a fundamentally different approach: the file never leaves your device. It is read into memory by your browser, encrypted locally, and the encrypted blob is downloaded directly. The server only serves the HTML page — it never sees your file or your password.
This also means the tool works offline. Save the HTML page to your desktop, open it without a network connection, and you can encrypt files without any internet. The encryption is done by your browser, not by a remote server. That makes it usable in air-gapped environments, on planes, in areas with poor connectivity, or in situations where you simply do not trust the network.
Choosing a Strong Password
Your encryption is only as strong as your password. AES-256-GCM is unbreakable, but if your password is password123, an attacker can guess it in seconds and decrypt your file. This is why the tool includes a password generator that produces cryptographically random passwords of 24 characters drawn from the full printable ASCII set (uppercase, lowercase, digits, symbols).
A good password should be:
- Long. At least 12 characters, ideally 16+. Each additional character multiplies the search space.
- Random. Human-chosen passwords are predictable. Use the generator.
- Unique. Never reuse the password from another account.
- Stored safely. Use a password manager (Bitwarden, 1Password, KeePass) or a written copy in a secure place.
The tool shows a live strength meter as you type. It estimates entropy based on length, character variety, and common patterns. If you generate a password with the built-in generator, the meter will jump to "Strong" immediately — and you can copy or download it with one click.
What File Types Can You Encrypt?
Any file. This tool does not inspect, parse, or care about file contents. You can encrypt:
- Documents — PDF, DOCX, XLSX, PPTX, TXT, ODT
- Images — JPG, PNG, GIF, WEBP, TIFF, RAW
- Videos — MP4, MOV, AVI, MKV
- Audio — MP3, WAV, FLAC, AAC
- Archives — ZIP, RAR, 7Z, TAR, GZ
- Databases — SQL, SQLITE, DB
- Source code — any language, any project
- Backups — full disk images, VM snapshots
- Encryption keys — PEM, PFX, key files
The only limit is your browser's available memory. Chrome, Firefox, Edge, and Safari can handle files of several hundred megabytes. For files above ~500 MB, use a local tool like age or GPG which stream the data to disk instead of loading it into memory.
Real-World Use Cases
Personal Backup Protection
Before uploading a backup to Google Drive, Dropbox, or any cloud service, encrypt it. That way, even if the cloud provider is breached or your account is compromised, your data remains unreadable. You keep the only key.
Sending Sensitive Files
Encrypt a file and share the password through a separate channel (Signal, phone call, password manager share). This is called out-of-band key exchange and is the standard practice for secure file sharing. Never send the password and the file through the same email or chat.
Protecting Client Work
Freelancers and agencies can encrypt source code, design files, or financial records before sharing them with clients or contractors. Only the recipient with the correct password can open them.
Traveling with Sensitive Data
Store encrypted copies of passports, contracts, and other sensitive documents on a USB drive. If the drive is lost or stolen, the contents remain safe.
Protecting Source Materials
Journalists, researchers, and activists can encrypt interview recordings, source documents, or notes before transmitting them. This is a critical protection in high-risk environments.
Compliance and Data Governance
GDPR, HIPAA, PCI-DSS, and many other regulations require encryption of data at rest and in transit. This tool provides a simple, auditable way to encrypt files before storage or transmission.
Common Mistakes to Avoid
- Losing the password. There is no recovery. No backdoor. No reset. Keep a backup in a password manager.
- Sharing the password over the same channel as the file. If both are intercepted together, encryption provides zero benefit.
- Using a weak password. A 4-digit PIN is brute-forced in seconds. Use the generator.
- Deleting the original before verifying the encrypted file decrypts. Always test decryption before deleting anything.
- Trusting unknown online tools. Most upload your file to their server. This one does not — verify by opening DevTools and watching the Network tab.
How to Decrypt Your Encrypted File
This tool is designed for encryption only. To decrypt a .enc file, use a compatible decryptor. Options include:
- Browser-based decryptor — a companion tool on this site (coming soon).
- OpenSSL CLI — extract the salt/nonce from the file header, derive the key with PBKDF2, and decrypt with
openssl enc -d -aes-256-gcm. - Custom script — the format is documented above; write your own with any crypto library.
Always test the decryption process immediately after encryption to ensure your password works and the file is intact. There is no feeling worse than discovering, months later, that your password is wrong.
Understanding the Security Guarantees
| Property | Guarantee |
|---|---|
| Confidentiality | AES-256-GCM with 256-bit key — unbreakable by brute force |
| Integrity | 128-bit GCM auth tag — any tampering detected on decrypt |
| Key derivation | PBKDF2-HMAC-SHA256 with 200,000 iterations |
| Randomness | CSPRNG (crypto.getRandomValues) for salt and nonce |
| Server exposure | None — file and password never leave your browser |
| Password storage | None — the password exists only in your browser's memory |
| File storage | None — the encrypted file is generated locally and downloaded directly |
| Standards | NIST FIPS 197 (AES), NIST SP 800-38D (GCM), RFC 8018 (PBKDF2) |
Frequently Asked Questions
Is my file uploaded to your server?
Do you store my password?
Can I recover my file if I forget the password?
What is the maximum file size?
How do I decrypt the .enc file later?
Is AES-256-GCM safer than AES-256-CBC?
Does this work offline?
Is Web Crypto API secure?
Can I encrypt multiple files at once?
What happens if the encrypted file is corrupted?
Does this work on mobile?
Is this tool free?
Related Tools You Might Find Useful
This site offers several other privacy and security tools. Here are some you may want to explore:
External Resources and Further Reading
If you want to go deeper into the cryptography and standards behind this tool, here are some authoritative resources:
- NIST FIPS 197 — the official specification for the Advanced Encryption Standard
- NIST SP 800-38D — the specification for GCM mode
- RFC 8018 — the specification for PBKDF2
- MDN Web Crypto API — Mozilla's documentation for the browser crypto API
- OWASP Cryptographic Storage Cheat Sheet — best practices for cryptography in applications
- age encryption — a modern, simple file encryption tool for the command line
- GnuPG — the standard for PGP-compatible encryption