DEV Community

Cover image for Hide Any File in Two Images β€” Browser-Only, No Server
GoodRelax
GoodRelax

Posted on

Hide Any File in Two Images β€” Browser-Only, No Server

GRTM2CD πŸ—ΊοΈπŸˆπŸ•

GoodRelax Treasure Map to Cat and Dog

The Story

What if you found a treasure map?
You could ask a cat and a dog to each keep a piece.
When you need the map, just call them both.

I built a tool that does exactly that.

πŸ‘‰ Try it now

What It Does

This is a browser-only steganography tool.

It takes any file β€” PDF, ZIP,

whatever β€” and hides it across two ordinary PNG images.

You need both images to recover the file. Either one alone is useless.

work flow


How It Works

The process in one line:

Compress β†’ Encrypt (AES-256-GCM) β†’ Split across two images β†’ Embed in LSBs β†’ Fill remaining capacity with noise

The result:

  • Each image looks like a normal PNG
  • LSBs are indistinguishable from white noise
  • Neither image alone reveals anything
  • Both together reconstruct the original file perfectly

Why Two Images?

  • Capacity β€” each image only needs to hold half the payload
  • Deniability β€” no ciphertext continuity in either image
  • Security β€” the AES key, IV, and ciphertext are all fragmented across both

One image found? Just a photo. Two images found? Still just two photos β€” unless you know what to look for.


Why Browser-Only?

No server means nothing can leak.

  • No uploads, no installation, no build tools
  • Works offline β€” just open the HTML file
  • Cross-platform

Everything runs locally via Web Crypto API, Canvas API, and typed arrays.


Usage

Encode: Drop any file + two images β†’ get two PNGs.

Decode: Drop the two PNGs β†’ get the original file back. Order doesn't matter.


Tech Stack

  • Vanilla JS (ES modules, no frameworks)
  • Web Crypto API (AES-256-GCM)
  • Canvas / OffscreenCanvas
  • pako (zlib compression)
  • PNG output only

No frameworks. No build tools. Single HTML + JS.


Try It Now

πŸ‘‰ https://goodrelax.github.io/gr-tools/grtm2cd/

Drop a file and two images β€” see what happens.

πŸ“‚ https://github.com/GoodRelax/gr-tools

Please use responsibly.

Feedback and stars welcomeβ™ͺ (c) 2026 GoodRelax

Top comments (0)