File Encryption and Decryption

Cryptology Monster supports AES-256-GCM encryption for files, including binary files. Unlike Text Encryption, File Encryption operates directly on the uploaded file's bytes.

Supported Input

The file encryption tool accepts files through the browser's file picker.

Examples include:

  • Text documents
  • Images
  • PDFs
  • Archives
  • Source code
  • Other binary files

Processing is subject to browser memory and file-size limitations.

Encrypting a File

  1. Select File Crypto.
  2. Choose a file under Encrypt File (AES-GCM).
  3. Select either password mode or random-key mode.
  4. Provide a password if required.
  5. Click Encrypt & Download.
  6. Save the generated files.

Random-Key Encryption

When password mode is disabled, the application generates a random AES-256 key.

Downloads

For a file named:

document.pdf

the downloaded files are:

document.pdf.enc
key.bin

Encryption Parameters

ParameterValue
AlgorithmAES-256-GCM
Key length256 bits
IV length12 bytes
Authentication tagIncluded in encrypted output
Key outputRaw 32-byte file

File Structure

[12-byte IV][Ciphertext and authentication tag]

Decryption

  1. Select File Crypto.
  2. Choose the encrypted .enc file.
  3. Leave Password mode disabled.
  4. Select the matching key.bin.
  5. Click Decrypt.
  6. Save the recovered file.

The original filename is restored by removing the .enc suffix.

Password-Based File Encryption

When password mode is enabled, the application derives the AES key using PBKDF2.

Parameters

ParameterValue
EncryptionAES-256-GCM
Key derivationPBKDF2-HMAC-SHA-256
Iterations200,000
SaltRandom 16 bytes
IVRandom 12 bytes
Key length256 bits

Output

document.pdf.enc

No separate key file is generated.

File Structure

[16-byte salt][12-byte IV][Ciphertext and authentication tag]

Decryption

  1. Select File Crypto.
  2. Choose the .enc file.
  3. Enable Password mode in the decryption section.
  4. Enter the original password.
  5. Click Decrypt.
  6. Save the recovered file.

Text Encryption vs. File Encryption

The application has two AES-GCM workflows with different characteristics.

PropertyText EncryptionFile Encryption
InputTextFile bytes
Password iterations100,000200,000
Random-key AES256-bit GCM256-bit GCM
Random-key IV12 bytes12 bytes
Password salt16 bytes16 bytes
Encrypted filenameencrypted.binOriginal name + .enc
Decryption outputText areaDownloaded file

Password-encrypted text files and password-encrypted file attachments are not directly interchangeable, because their PBKDF2 iteration counts differ.

Use the matching decryption tool.

Decryption Failures

Decryption may fail due to:

  • Incorrect password
  • Incorrect key file
  • Corrupted ciphertext
  • Missing authentication tag
  • Incorrect encryption mode
  • Incompatible encrypted file format

A failed authentication check means the application cannot establish the integrity of the ciphertext under the supplied key.

File Size and Performance

The tool reads the complete input file into browser memory.

Large files may consume significant memory during encryption and decryption.

The implementation is not a streaming encryption system.

Important Security Considerations

Protect the Key

Possession of both key.bin and the corresponding encrypted file is sufficient to decrypt random-key encrypted content.

Store keys securely.

Use Strong Passwords

Password-based encryption depends on the unpredictability of the chosen password.

PBKDF2 slows password guessing but does not make weak passwords strong.

Preserve the Output

If the encrypted file, key, or password is lost, recovery may be impossible.

Test Before Deleting

Always confirm that decryption succeeds before deleting an original file.

Recommended Workflow

  1. Keep an original backup.
  2. Encrypt a copy.
  3. Preserve the encrypted file and its required key material.
  4. Decrypt the result as a test.
  5. Verify that the recovered file opens correctly.
  6. Only then decide how to handle the original.

Warning: The File Crypto tool does not implement key recovery, password resetting, or cryptographic file repair.


Did this page help you?