Balancing image privacy and usability
Keep the thumbnail.
Encrypt the detail.
Thumbnail-Preserving Encryption turns a photo into a reversible ciphertext image while preserving the exact low-resolution preview people use to browse it.
Your image and key stay in this browser.
The idea
An image can remain browsable without revealing its fine detail.
Conventional encryption hides everything, including the visual cue you need to find a photo. TPE deliberately reveals one measurable property: the average color of each image block.
Everything else is mixed by a keyed, reversible substitution–permutation network. Larger blocks reveal a smaller thumbnail; smaller blocks reveal more.
Live demo
See the construction work.
Start with the highlighted slider Drag the block size to choose how recognizable the preserved preview remains. Everything runs locally.
The thumbnail did not.
From plaintext
From ciphertext
PreservedExact block averagesEncrypt the sample to verify the invariant.
Method
The paper’s construction,
made visible.
Each color channel and thumbnail block is processed independently. One round substitutes pixel pairs without changing their sum, then permutes their positions.
- 01
Divide
Split each channel into b × b blocks. A block’s integer sum defines one exact thumbnail pixel.
- 02
Substitute
Re-rank each pixel pair among every valid pair with the same sum, using key-derived pseudorandomness.
- 03
Permute
Shuffle pixels within the block. Repeating both operations mixes detail while the block sum stays fixed.
- 04
Reverse
Regenerate the same keyed choices, undo each permutation, and reverse each substitution.
Σ blockplaintext = Σ blockciphertext
So the block averages—and the resulting thumbnail—are exactly identical.
Paper