Photo cipher

Hide an encrypted message inside a photo, built to survive moderate re-compression by chat apps.

Source photo

Built to survive moderate JPEG recompression.

How it works

What it does

Photo cipher hides an encrypted message inside an ordinary photo in a way designed to survive moderate JPEG recompression, which is what chat apps and social networks do to images. The person who receives the photo opens it here with the same password and gets the message back.

How the message is hidden

The photo is split into 8×8 pixel blocks, the same grid JPEG works on. Each block carries one bit by nudging its average brightness to the nearest even or odd step on a scale of 24 levels, a technique called quantization index modulation that Brian Chen and Gregory Wornell described around 1998. JPEG compression keeps the average brightness of a block quite well, so the bits tend to survive. Every bit is written 7 times in blocks spread across the picture, and a majority vote corrects damaged copies.

Encryption and capacity

Before hiding, the message is encrypted with AES-256-GCM using a key derived from your password with Argon2id (64 MiB of memory, 3 passes). The photo is scaled so that its sides are between 800 and 2,048 pixels. Capacity is small: an 800×800 photo holds roughly 78 characters, and larger photos hold more.

Limits

Resizing, cropping, filters, brightness changes or very strong compression destroy the hidden data, and some apps downscale large photos automatically. Send the photo as a file when you can and test it first. The brightness changes may show up as faint blockiness on smooth areas such as sky. The hiding pattern is public, so anyone with this tool can tell that a photo carries data; only the content is protected, by your password. Everything runs in your browser and the photo is not uploaded.