Skip to content

About

Encrypt and securely hide files inside images, right in your browser.

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

Harpocrates 🤫

Encrypt and securely hide files inside images, right in your browser.

Harpocrates is a client-side web application that uses modern cryptography and steganography to conceal a file within the pixels of a standard image. Your data is encrypted with a password and never leaves your machine, providing a powerful tool for privacy and data concealment.


✨ Key Features

  • Real steganography, not a renamed archive: the encrypted payload is scattered inside the image's pixels. The result is a valid, lossless PNG that opens in any viewer — there is no appended blob, no magic marker and no trailing data.
  • Entirely In-Browser: No files are ever uploaded to a server. All encoding and decoding operations happen locally on your computer.
  • Robust Encryption: Your secret file is secured with AES-256-GCM, an authenticated encryption algorithm that ensures both confidentiality and integrity.
  • Strong Password Protection: The encryption key is derived from your password using PBKDF2-SHA-256 with 600,000 iterations, the iteration count currently recommended for password-based key derivation.
  • No detectable signature: The header that locates the hidden payload is keyed with your password (HMAC-derived), so the file contains nothing an inspector can recognise — strings, a hex editor or binwalk will not find a marker.
  • Imperceptible quality loss: in Adaptive ±1 mode a touched colour channel moves by at most one level, and the alpha channel is preserved byte-for-byte.
  • Modern & Responsive UI: A clean, Material You-inspired interface with automatic light and dark theme support for a great user experience.
  • No Special Software Needed: All you need is a modern web browser.

🚀 How to Use

Using Harpocrates is simple. The interface is divided into two main modes: Encode and Decode.

To Hide a File (Encode)

  1. Make sure you are on the Encode tab.
  2. In the "Carrier Image" section, click to upload a PNG or JPG image that will be used to hide your file.
  3. In the "Secret File" section, click to upload the file you wish to hide.
  4. Under "Set Password", enter and confirm a strong password for encryption.
  5. Pick an Embedding Technique (see below).
  6. Click the Encrypt & Hide File button.
  7. Press Download File to save your new image, which now secretly contains your file.

The carrier card shows the image's dimensions and how much data it can carry, so you never have to guess whether your file will fit.

To Reveal a File (Decode)

  1. Switch to the Decode tab.
  2. Click to upload the steganographic image (the image containing the hidden file).
  3. Enter the password that was used to hide the file.
  4. Click the Decrypt & Reveal File button.
  5. If the password is correct, press Download File to save the original, revealed file.

Note: images produced by the previous version (v2), where the payload was appended to the end of the file, can still be decoded. New images are always written with the v3 pixel-based format.


🔬 The Two Embedding Techniques

Adaptive ±1 (recommended) Classic LSB
How a bit is stored the channel's lowest bit is set by nudging the value by +1 or −1 the channel's lowest bit is overwritten
Visual impact at most one level per touched channel at most one level per touched channel
Statistical footprint lower — the surrounding pixel statistics stay close to the original slightly higher — classic LSB replacement is a known target of statistical detectors
Capacity 3 bits per pixel 3 bits per pixel

Both modes scatter the payload with a password-derived pseudo-random permutation, so the modified pixels look like ordinary hidden noise spread evenly over the picture instead of a contiguous block.


⚙️ The Technical Details

Harpocrates combines steganography with strong, modern cryptography.

  1. Payload Preparation: The secret file is packed as [name length][name][data length][data][random padding]. The random padding keeps the ciphertext length from revealing the exact size of your file.
  2. Key Derivation: The password is stretched with PBKDF2-HMAC-SHA-256 (600,000 iterations) into a locator key. A random per-file seed, which is itself masked with a keystream derived from that key, is used to derive the working keys with HKDF-SHA-256: one for AES-GCM, one for the pixel permutation, and one for the integrity tag.
  3. Encryption: The payload is sealed with AES-256-GCM using a fresh random 96-bit nonce.
  4. Scattering: The ciphertext bits are written into the least significant bit of colour channels at positions given by a 4-round keyed Feistel network (with cycle-walking, so it stays a bijection for any image size). Without the password, the set of touched pixels is indistinguishable from noise — and it differs from file to file, so the same secret hidden in the same image twice never produces the same picture.
  5. Keyed Header: A 64-byte header holds the payload length, the nonce and an HMAC-SHA-256 integrity tag. Its marker is HMAC(key, "harpocrates/v3/magic"), so there is no fixed signature in the file — the header is only meaningful to someone who knows the password.
  6. Output: The result is re-encoded as a PNG (8-bit RGB or RGBA) with a bit-exact codec implemented in the page. Transparency, and the visual content of the image, are preserved exactly.
  7. Decryption: The decoder re-derives the same permutation, reads the header, verifies the keyed integrity tag and decrypts with AES-GCM. A wrong password fails the tag check, so no partial or garbage output is ever produced.

Honest limitations

  • Steganography hides data; it does not encrypt it. That is why the payload is encrypted as well — even if someone discovers that an image carries something, they still cannot read it.
  • No steganographic method is undetectable. A forensic laboratory with dedicated LSB analysis can determine that an image's least significant bits carry an unusual amount of information. The scattering, the keyed header and the ±1 dithering raise the bar considerably, but they do not make the image mathematically undetectable.
  • Capacity is finite: roughly one byte of payload per 8 pixels. Re-encoding or re-saving the image will destroy the hidden data, so always keep the file exactly as Harpocrates produced it.

💖 Support This Project

If you find Harpocrates useful and appreciate the work, please consider supporting its development. Donations are greatly appreciated!

TON Wallet Address:

UQAbjx-d8UQ_FxEgONFB3Y412f4fW7e-zOdBXmMSs59pkYog

Thank you!

About

Encrypt and securely hide files inside images, right in your browser.

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Contributors

Languages