Home › Developer Tools › File Encryption Tool

File Encryption Tool

Lock any file (a PDF, a photo, a ZIP archive, a spreadsheet) with a password before you email it or store it in the cloud. The file is encrypted with AES-256-GCM on your own device, and the same page decrypts the .enc file back to the original.

Last updated:

Drop files here to encrypt them

Any file type: documents, photos, archives, videos. Files are encrypted on your device and never uploaded.

AES-256-GCM in 1 MiB authenticated chunks · PBKDF2-SHA256 key · random salt and nonce per file · runs locally with the WebCrypto API. The password is never stored; if you lose it, the file cannot be recovered.

Advertisement
Advertisement

How to use the File Encryption Tool

  1. Choose Encrypt files and drop one or more files onto the box, or press Choose files.
  2. Enter a strong password twice, or press Generate and store the generated password in your password manager.
  3. Press Encrypt files and download each .enc file (or all of them as one ZIP).
  4. To open a file later, drop the .enc file here: the tool switches to Decrypt. Enter the same password and press Decrypt files.
  5. Download the decrypted file: it gets its original name and type back, and the tool confirms that it was not modified.

How the file encryption works

  1. Key derivation: a random 16-byte salt is generated for every file, and a 256-bit AES key is derived from your password with PBKDF2-HMAC-SHA256. The iteration count (600,000 by default) is stored in the file so it can be decrypted later even if you picked a different setting.
  2. Metadata: the original file name, MIME type, size and modification time are encrypted as a small first record, so the .enc file reveals nothing about what is inside except its approximate size.
  3. Chunked AES-GCM: the content is split into 1 MiB chunks. Each chunk is encrypted with AES-256-GCM using a unique 12-byte nonce (an 8-byte random prefix plus a 4-byte chunk counter) and gets its own 16-byte authentication tag.
  4. Tamper detection: the header, the chunk number and a "last chunk" flag are authenticated as additional data. Changing any byte, swapping two chunks or cutting the file short makes decryption fail instead of returning damaged data.

.enc file format

OffsetBytesContent
04Signature FTCE (hex 46 54 43 45)
41Format version, 0x01
54PBKDF2 iterations, unsigned big-endian (600,000 = 00 09 27 C0)
916Salt
258Nonce prefix
334Chunk size in bytes (1,048,576)
374Length L of the encrypted metadata
41LEncrypted metadata (JSON with name, type, size, mtime) + 16-byte tag, chunk number 0
41 + LrestData chunks 1…n, each up to 1 MiB of ciphertext + 16-byte tag

For chunk number i, the IV is nonce prefix || uint32_be(i) and the additional authenticated data is header (37 bytes) || uint32_be(i) || final, where final is 1 only for the last data chunk. An empty file still produces one (empty) final chunk.

Decrypt an .enc file in Python

import json, struct, sys
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives.ciphers.aead import AESGCM

def decrypt_file(path, password):
    data = open(path, 'rb').read()
    header = data[:37]
    assert header[:4] == b'FTCE' and header[4] == 1, 'not an FTCE v1 file'
    iterations, = struct.unpack('>I', header[5:9])
    salt, prefix = header[9:25], header[25:33]
    chunk, = struct.unpack('>I', header[33:37])
    key = PBKDF2HMAC(hashes.SHA256(), 32, salt, iterations).derive(password.encode())
    gcm = AESGCM(key)
    iv = lambda i: prefix + struct.pack('>I', i)
    aad = lambda i, final: header + struct.pack('>I', i) + bytes([final])
    mlen, = struct.unpack('>I', data[37:41])
    meta = json.loads(gcm.decrypt(iv(0), data[41:41 + mlen], aad(0, 0)))
    body, size = data[41 + mlen:], chunk + 16
    pieces = [body[o:o + size] for o in range(0, len(body), size)]
    out = b''.join(gcm.decrypt(iv(i + 1), c, aad(i + 1, int(i == len(pieces) - 1)))
                   for i, c in enumerate(pieces))
    return meta['n'], out

name, content = decrypt_file(sys.argv[1], sys.argv[2])
open(name, 'wb').write(content)
print('wrote', name, len(content), 'bytes')

Tips for encrypting files safely

  • Use a password manager. Generate a 20-character password here, save it in your password manager together with a note about which file it opens, and only then delete the unencrypted original.
  • Test before deleting. After encrypting, press Test: decrypt them (or decrypt the downloaded file once) to confirm that the password works.
  • Encrypt folders as one file. Put many files in a ZIP first (for example with the ZIP File Creator), then encrypt the archive: one password, one file to share, and folder names are hidden too.
  • Share the password separately. If the .enc file goes by email, send the password by phone or text message, never in the same thread.
  • Encryption does not hide size. The .enc file is about the same size as the original, so someone could guess that a 4 GB file is probably a video.

Frequently asked questions

Are my files uploaded anywhere?

No. The files are read and encrypted by JavaScript in your browser using the WebCrypto API, and the result is created as a download on your device. Nothing is sent to FreeToolCabin or any other server, and the tool keeps working if you go offline after the page has loaded.

How strong is the encryption?

Each file is encrypted with AES-256 in GCM mode, the authenticated cipher used by TLS 1.3. The 256-bit key is derived from your password with PBKDF2-HMAC-SHA256 and a random 16-byte salt (600,000 iterations by default, the OWASP 2023 recommendation). In practice the password is the weak point, so use a long random password or passphrase.

What happens if I forget the password?

The file cannot be recovered. The password is never stored or transmitted and there is no back door or reset. Keep the password in a password manager, separately from the encrypted file.

Can I send the .enc file by email or upload it to cloud storage?

Yes. The .enc file can be shared openly; without the password it reveals nothing about the content, and even the original file name is hidden inside the encrypted data. Send the password through a different channel, such as a phone call or a messaging app, never in the same email.

How large can the file be?

The tool reads and encrypts the file in 1 MiB chunks, but the browser keeps the finished result in memory until you download it. Files of several hundred megabytes work on most computers; multi-gigabyte files depend on available RAM and may fail on phones.

Why is the encrypted file slightly bigger?

Each 1 MiB chunk gets a 16-byte authentication tag, and the file starts with a 37-byte header (signature, iteration count, salt, nonce and chunk size) plus the encrypted file name. For a 10 MB file the overhead is well under 1 KB.

Can I decrypt the file without this website?

Yes. The format is documented on this page and uses only standard primitives (PBKDF2-SHA256 and AES-256-GCM). The Python script shown below decrypts it with the widely used cryptography package, so you are never locked in to this tool.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Text Encryption ToolEncrypt and decrypt text with a password using AES-256-GCM, entirely in your browser.File Hash CheckerGet MD5, SHA-1, SHA-256 and SHA-512 checksums of files and verify them against a hash.Password GeneratorCreate strong passwords and passphrases.PGP Encrypt / DecryptEncrypt, decrypt, sign and verify PGP messages with your armored keys, entirely offline.Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.MD5 Hash GeneratorGenerate MD5 hashes of text, lines or files and verify checksums.SHA-256 Hash GeneratorSHA-256 and HMAC-SHA256 hashes of text, lines or files, in hex or Base64.Base64 Encoder DecoderEncode or decode Base64 text and files, and make data URIs.URL Encoder DecoderPercent-encode or decode URLs, query strings and form data.HTML Entity Encoder / DecoderEscape and unescape HTML entities, named or numeric.Bcrypt Hash Generator & CheckerCreate bcrypt password hashes and check a password against a hash.Binary TranslatorConvert text to binary, hex, octal and back.HMAC GeneratorGenerate and verify HMAC signatures with SHA-256, SHA-512, SHA-1 or MD5.CRC32 Checksum CalculatorCalculate CRC-32, CRC-32C, CRC-16 and Adler-32 checksums of text or large files.JWT DecoderDecode JSON Web Tokens, read the claims and expiry, and verify HS256 signatures.JWT GeneratorCreate and sign HS256, HS384 or HS512 JSON Web Tokens in your browser and verify them.Password Strength CheckerSee how strong a password really is, how long it takes to crack and how to improve it.Caesar CipherEncode and decode Caesar shift ciphers and crack unknown shifts with a ranked brute force.Vigenère CipherEncrypt and decrypt Vigenère and Autokey ciphers, and crack unknown keys with frequency analysis.Atbash CipherEncode and decode Atbash ciphers (A↔Z, B↔Y) in Latin or Hebrew, with a live letter mapping table.ASCII TableFull ASCII code chart 0–255 in decimal, hex, octal, binary and HTML, with search and copy.Unicode Character LookupFind Unicode characters by name or code point and copy them with UTF-8, HTML and code escapes.Punycode ConverterConvert international domain names, emails and URLs between Unicode and xn-- Punycode, in bulk.JSON Escape / UnescapeEscape text for a JSON string, unescape \n and \" back to text, or stringify a whole object.Binary to HexConvert binary to hex instantly with steps and signed mode.Hex to BinaryConvert hex to binary instantly with steps and signed mode.Binary CalculatorAdd, subtract, multiply, divide, AND, OR, XOR and shift binary numbers with decimal values.Hex CalculatorHexadecimal + − × ÷ and AND, OR, XOR, NOT, shifts with decimal and binary equivalents.Base32 Encoder / DecoderEncode and decode Base32 (RFC 4648), Base32hex, Crockford and z-base-32 from text, hex or files.Base58 Encoder / DecoderEncode and decode Base58 and Base58Check (Bitcoin alphabet) from text or hex, with checksum verification.Unicode Escape / UnescapeConvert text to \uXXXX, \u{...}, \x, &#...; or CSS escapes and decode them back.TOTP GeneratorGenerate 2FA one-time codes from a secret key, create otpauth QR codes and verify codes.RSA Key GeneratorGenerate 2048, 3072 or 4096-bit RSA key pairs as PEM, PKCS#1, JWK or OpenSSH, locally.SSL Certificate DecoderDecode PEM SSL/X.509 certificates: subject, issuer, expiry, SANs, key and fingerprints.Argon2 Hash GeneratorHash passwords with Argon2id, Argon2i or Argon2d and verify them against an encoded hash.Base64 to PDFDecode a Base64 string to a PDF with preview and download, or encode a PDF to Base64.Bitwise CalculatorCalculate AND, OR, XOR, NOT and bit shifts at 8–64 bits with a bit grid and all bases.CSR GeneratorCreate a certificate signing request (CSR) and private key with SANs, RSA or ECDSA, in your browser.CSR DecoderDecode a PEM certificate signing request: subject, SANs, key size, signature and CA readiness checks.Enigma Machine SimulatorEncrypt and decrypt with a virtual Enigma I, M3 or M4: rotors, rings, plugboard and lampboard.Hex Opacity CalculatorConvert opacity percent to a 2-digit HEX alpha code and full #RRGGBBAA color, with a 0-100% table.Playfair CipherEncrypt and decrypt Playfair ciphers from a keyword, with the 5x5 key square and every digraph step.Pwned Password CheckerCheck if a password appeared in data breaches; only 5 characters of its SHA-1 hash are sent.RSA Encryption ToolEncrypt text with an RSA public key and decrypt it with the private key using RSA-OAEP in your browser.SAML DecoderDecode SAMLRequest and SAMLResponse messages to readable XML, attributes and validity times.SSL Certificate ConverterConvert SSL certificates and keys between PEM, DER, PFX/P12 and P7B in your browser.Checksum CalculatorCompute 8-bit sum, two's complement LRC, XOR/BCC, NMEA, Fletcher and Internet checksums of bytes.PBKDF2 Hash GeneratorDerive PBKDF2 keys from a password, salt and iteration count with SHA-1, SHA-256 or SHA-512.Protobuf DecoderDecode raw Protocol Buffers hex or Base64 without a schema, or add a .proto for field names.XML Escape / UnescapeEscape & < > " ' for XML text and attributes, unescape entities back, or wrap text in CDATA.Binary Search Tree VisualizerInsert, delete and find in BST, AVL and red-black trees with animated rotations and traversals.MongoDB ObjectId to TimestampDecode a MongoDB ObjectId to its creation date, or build ObjectIds from dates for range queries.PGP Key GeneratorGenerate an OpenPGP key pair (Curve25519, NIST ECC or RSA) with passphrase and expiry, offline.Quoted-Printable Encoder / DecoderEncode or decode quoted-printable email text (MIME) with UTF-8 and 76-character soft line breaks.Self-Signed Certificate GeneratorCreate a self-signed SSL certificate and key for localhost or dev servers, as PEM or PFX.SHA-1 Hash GeneratorSHA-1 and HMAC-SHA1 of text or files in hex or Base64, plus Git blob hashes and verify.SHA-512 Hash GeneratorSHA-512 and SHA-384 hashes of text or files in hex or Base64, HMAC and hash verification.SRI Hash GeneratorCreate Subresource Integrity hashes (sha256/384/512) and ready <script> or <link> tags.SSH Key GeneratorGenerate Ed25519 or RSA SSH key pairs in your browser: OpenSSH public key plus private key.String Escape / UnescapeEscape or unescape strings for JavaScript, Java, C#, Python, C, SQL, regex, CSV and shell.UTF-8 Encoder / DecoderConvert text to UTF-8 bytes in hex, decimal, binary, \x or % and decode bytes back to text.UUID Decoder & ValidatorDecode any UUID: version, variant, v1/v6/v7 timestamp and MAC node, plus bulk validation.Base64 to FileDecode Base64 or a data URI to a downloadable file; detects the real file type and previews it.Passphrase GeneratorMake strong, memorable diceware passphrases from a 7,776-word list, with entropy in bits.
See all 65 Encoders, Hashes & Crypto →