Image methods Sharing
Visual cryptography
Visual cryptography was introduced by Moni Naor and Adi Shamir at EUROCRYPT in 1994. What sets it apart: decryption needs no computer and no computation. Stack two transparent sheets and the secret image appears.
How does visual cryptography work?
Start from a black-and-white image. Each pixel is replaced, in each of the two shares, by a 2 × 2 block of subpixels of which two are black and two transparent. There are six such blocks.
For each pixel, a block is drawn at random for the first share, then:
- white pixel: the second share gets the same block. Stacked, the two blocks leave two clear subpixels: the area looks grey.
- black pixel: the second share gets the complementary block. Stacked, all four subpixels are black.
White pixel Black pixel
share 1 share 2 share 1 share 2
■ □ ■ □ ■ □ □ ■
□ ■ □ ■ □ ■ ■ □
stacked: ■ □ stacked: ■ ■
□ ■ ■ ■ Taken alone, each share only contains randomly drawn “two black, two clear” blocks: it is statistically identical whatever the image. It reveals strictly nothing.
What does an image processed with visual cryptography look like?
Each share is regular black-and-white noise, twice as wide and twice as tall as the image. Stacking shows the image in black on a 50% grey background: contrast is halved, which is the price of the process.
A photo must first be reduced to two tones. A plain threshold suits text and logos; for a photo, dithering (error diffusion) keeps the impression of shading.
What are the weaknesses of visual cryptography?
Strengths
- Perfect secrecy of a single share: this is not about computing power, the information simply is not there.
- Decryption without a machine: two transparencies are enough.
- Survives printing and, to some extent, recompression, as long as the subpixels stay crisp.
Weaknesses
- Contrast halved and size doubled.
- Black and white only in the original scheme.
- Demanding alignment: a shift of half a subpixel blurs everything. On paper, print large.
- Both shares are required: lose one and the image is lost.
- A share can be forged: someone holding one share and knowing the image can craft a fake second share that shows something else.
Can the image be recovered from a single share?
No. This is a proven result, not a practical difficulty: for every possible image, there is a second share compatible with the one you hold. All images are therefore equally plausible. The only attack is to obtain the other share.
What are the variants of visual cryptography?
- k-out-of-n schemes — n shares, any k of which reveal the image while k − 1 reveal nothing.
- Meaningful shares — each share shows an innocuous picture (a landscape, a portrait) and stacking them reveals a third.
- Colour visual cryptography — by cyan, magenta and yellow decomposition.
- XOR sharing — gives up physical stacking for a computation, and gains colour, contrast and original size.
In CipherChronicle
The workbench outputs two PNGs, with a rendering choice: dithering for photos, threshold for text and logos. When decrypting, drop both shares and the page simulates the stacking. For the real experience, print both shares on transparencies at the same scale.
Demonstration
The CipherChronicle artwork is encrypted then decrypted right here, in your browser, with the same engine as the workbench. Drag the bar to compare.