← The Lab
// The Lab

Visual cryptography

Splits an image into two shares of pure noise. Stack them and the secret appears, no computer needed.

Pythoncryptography

The program takes a PNG or JPG image and makes two new images out of it, each made of what looks like random black and white pixels. On their own they reveal nothing. Laid on top of each other, they show a black and white version of the original.

It works by turning every pixel of the original into a small block of sub-pixels in each share. For a white pixel, both shares get the same random pattern, so stacking them leaves half the block white. For a black pixel, they get opposite patterns, and stacking them makes the whole block black. Each share alone is always half black and half white, so there’s nothing in it to read.

The animation above slides two shares together. They meet in the middle and the heart appears. Below, you can do the same with your own picture: encrypt it into two shares, or decrypt two shares someone gave you.

Make your own shares

Everything happens in your browser, nothing is uploaded.