Ultra-Secure File Embedding with Kyber1024 + AES-256-GCM

This guide explains how to embed, protect, and extract hidden encrypted payloads using PQEmbeddFileInto, a tool that blends post-quantum cryptography with steganography.
The client will understand exactly what to do β€” sender, receiver, and workflow.


πŸš€ 1. Overview

PQEmbeddFileInto securely hides an encrypted file inside an image or document (PNG, BMP, TIFF, PDF).
Security stack:

  • Kyber1024 KEM β†’ key encapsulation / shared secret

  • AES-256-GCM β†’ payload encryption

  • CRC32-validated PNG chunks OR append-mode metadata stego

No passwords. No human error. Everything cryptographically enforced.


πŸ” 2. Key Files

The system uses a public/private keypair:

  • Public Key (pubkey) β†’ can be shared

  • Private Key (privkey) β†’ keep secret, used only for extraction

The keys are used to derive a 256-bit symmetric AES key via Kyber decapsulation.


🧩 3. Command Summary

Β 
PQEmbeddFileInto genkeys <pub> <priv> PQEmbeddFileInto embed <input> <carrier> <output> <pubkey> PQEmbeddFileInto extract <stego> <output> <privkey>

πŸ“¨ 4. Sender Workflow (Embedding)

The sender hides an encrypted file inside an image/document.


Step 1 β€” Generate a Keypair (Only Once)

Β 
PQEmbeddFileInto genkeys server.pub server.prv

What this does:

  • Creates a Kyber1024 public/private keypair

  • server.pub β†’ share with receiver

  • server.prv β†’ KEEP SECRET (recipient only)


Step 2 β€” Choose What to Hide

Example:
secret.pdf, contract.zip, wallet.json, keys.txt, etc.

This file will be encrypted AND embedded.


Step 3 β€” Choose the Carrier File

Supported carriers:

  • PNG (with custom pqKy chunk)

  • BMP

  • TIFF / TIF

  • PDF
    (others may work via append-mode if binary-safe)

Example carrier:
photo.png, report.pdf, scan.tiff


Step 4 β€” Embed (Encrypt + Stego)

Β 
PQEmbeddFileInto embed secret.pdf photo.png stego.png server.pub

🧠 Internally, this performs:

  1. Kyber1024 encapsulation β†’ a shared secret

  2. SHA-256 β†’ AES-256 key derivation

  3. AES-256-GCM encryption

  4. For PNG β†’ payload inserted as a custom chunk (pqKy)

  5. For other formats β†’ payload appended with a trailer marker (PQEMBEDv1)

If successful:
β†’ stego.png contains invisible encrypted payload.

Send this file normally β€” email, messenger, cloud, whatever.


πŸ“₯ 5. Recipient Workflow (Extraction)

The recipient must have the private key corresponding to the public key used by the sender.


Step 1 β€” Receive the Stego File

Example:
stego.png

This file contains the hidden encrypted payload.


Step 2 β€” Extract and Decrypt

Β 
PQEmbeddFileInto extract stego.png recovered.pdf server.prv

Under the hood:

  1. Locate the stego trailer or PNG custom chunk

  2. Parse envelope

  3. Kyber1024 decapsulation β†’ derive AES-256-GCM key

  4. Decrypt and validate GCM tag

  5. Write decrypted file

When finished:
β†’ recovered.pdf is the original file.


πŸ›‘οΈ 6. Security Properties

βœ” Post-quantum security (Kyber1024)

Resistant to quantum computers.

βœ” AEAD Authentication (AES-256-GCM)

Protects confidentiality + verifies integrity.

βœ” Zero configuration

No passwords, no key derivation errors.

βœ” Steganographic cover

Payload is invisible and survives most binary-safe transfers.


🧭 7. Best Practices for Clients

πŸ” Recipient must protect the private key:

  • Store it offline if possible

  • Do not send by email

  • Do not place in public cloud folders

πŸ”‘ Sender must always use the recipient’s public key.

Private key is NEVER needed for embedding.

β™» Rotate keys if required by policy.

πŸ“ Keep carrier files realistic

Use natural-looking, non-repetitive images/documents to avoid suspicion.


πŸ“ 8. Quick Example Summary

Sender

Β 
PQEmbeddFileInto genkeys server.pub server.prv (only once) PQEmbeddFileInto embed secret.pdf photo.png stego.png server.pub

Send:

  • stego.png


Recipient

Β 
PQEmbeddFileInto extract stego.png recovered.pdf server.prv

🎯 9. Final Notes for Customers

  • The embedded payload is encrypted before being hidden.

  • Even if extracted by an attacker, it cannot be decrypted without the private key.

  • The stego output preserves full carrier integrity and visual fidelity.

  • The tool does not modify EXIF or metadata beyond the minimal required change.