πŸ”Β Post-Quantum File Compression + Encryption (ML-KEM-1024 + AES-GCM + LZMA)

PQFileCompressAndLock is a post-quantum secure tool that performs:

  • πŸ“¦ Compression (LZMA SDK)

  • πŸ” Encryption (ML-KEM-1024 + AES-256-GCM)

  • πŸ”„ Decompression + Decryption

  • βœ”οΈ Integrity Verification (SHA-256)

Designed to protect files against classical and quantum attacks.


1️⃣ High-Level Workflow

PQFileCompressAndLock works in a single step for the user, but internally it performs:

  1. Compress file β†’ .lzma

  2. Generate Kyber-1024 keypair

  3. Generate shared secret

  4. Encrypt using AES-256-GCM

  5. Package everything into a final encrypted file

Decryption performs the reverse process.


2️⃣ Main Features

πŸ“¦ LZMA Super-Compression

Reduces file size before encryption.

πŸ” Post-Quantum ML-KEM-1024

Key encapsulation resistant to quantum attacks.

πŸ”‘ AES-256-GCM

Authenticated encryption with integrity built-in.

πŸ” Integrity Test Mode (--verify)

SHA-256 comparison of original vs restored file.


3️⃣ Folder Structure

The program automatically creates:

Β 
keys/ β”œβ”€ kyber.pub β”œβ”€ kyber.prv β”œβ”€ cipher.key

These are per-encryption ephemeral keys.

⚠️ They must remain next to the executable for decryption to work.


4️⃣ ⭐ Usage Summary (Very Simple)

πŸ” Encrypt

Β 
PQFileCompressAndLock encrypt <input_file> <output_file>

πŸ”“ Decrypt

Β 
PQFileCompressAndLock decrypt <input_file> <output_file>

βœ”οΈ Verify Integrity

Β 
PQFileCompressAndLock --verify <original_file> <restored_file>

5️⃣ Sender Instructions (Encrypting a File)

🎯 Goal: deliver a post-quantum encrypted file to the recipient.

Step 1 β€” Run encryption

Β 
PQFileCompressAndLock encrypt myfile.pdf secure_output.enc

What happens internally

  • LZMA compression

  • Key generation

  • Shared secret encapsulation

  • AES-256-GCM encryption

  • Output file saved as secure_output.enc

Step 2 β€” Send file

You send only:

Β 
secure_output.enc

Nothing else.

🚫 Never send:

  • keys/kyber.prv

  • keys/kyber.pub

  • keys/cipher.key

These must stay local.


6️⃣ Recipient Instructions (Decrypting a File)

🎯 Goal: restore the original file.

Step 1 β€” Place encrypted file next to the program

Example:

Β 
secure_output.enc PQFileCompressAndLock.exe keys/

Step 2 β€” Run decryption

Β 
PQFileCompressAndLock decrypt secure_output.enc restored.pdf

The system automatically:

  • Loads Kyber keys

  • Decapsulates shared secret

  • Decrypts using AES-GCM

  • Decompresses LZMA

  • Outputs restored.pdf

Step 3 β€” Optional integrity check

Β 
PQFileCompressAndLock --verify myfile.pdf restored.pdf

If identical:

Β 
[OK] TEST PASSED :: Files are identical.

7️⃣ Security Model β€” Very Clear for Clients

βœ”οΈ Post-quantum safe (ML-KEM-1024)

Protection even against future quantum computers.

βœ”οΈ AES-256-GCM authenticated encryption

Data confidentiality + integrity.

βœ”οΈ Keys are ephemeral per operation

Every encrypted file uses new keys and new symmetric secrets.

βœ”οΈ No password-based encryption

Your clients never need to choose passwords or manage keyfiles manually.


8️⃣ What the Sender Must Know

βœ” Run encryption
βœ” Send encrypted file
βœ” Keep local keys untouched
βœ” They never need to decrypt anything


9️⃣ What the Recipient Must Know

βœ” Keep the keys/ folder safe
βœ” Run decryption
βœ” Use --verify if needed
βœ” Keys are automatically managed


πŸ”Ÿ Quick Cheat Sheet (for printing)

Β 
ENCRYPT: PQFileCompressAndLock encrypt input.txt secure.enc DECRYPT: PQFileCompressAndLock decrypt secure.enc output.txt VERIFY: PQFileCompressAndLock --verify original.txt output.txt

πŸŽ‰ Final Notes for the Customer

PQFileCompressAndLock provides military-grade, quantum-resistant, and fully automatic file security.