Image methods Steganography
Pixel value differencing (PVD)
PVD (Pixel Value Differencing) was proposed by Da-Chun Wu and Wen-Hsiang Tsai in 2003. It starts from an observation about vision: the eye notices a small change in a uniform sky, but not in foliage or on an edge. So hide more where it will not show.
How does PVD work?
The image, greyscale in the original version, is cut into pairs of neighbouring pixels. For each pair:
- Compute the difference
dbetween the two pixels (absolute value). - Find the range
dfalls into, in a table fixed in advance. The classic table is:
| Difference range | Width | Bits hidden |
|---|---|---|
| 0 to 7 | 8 | 3 |
| 8 to 15 | 8 | 3 |
| 16 to 31 | 16 | 4 |
| 32 to 63 | 32 | 5 |
| 64 to 127 | 64 | 6 |
| 128 to 255 | 128 | 7 |
- Read as many message bits as the range allows and turn them into a number
b. - Replace the difference with
d' = lower bound of the range + b. - Adjust both pixels so that their difference is
d', splitting the correction between them.
Example: two pixels 100 and 120, difference 20, range 16–31, so 4 bits. To hide 1010 (10), the new difference is 16 + 10 = 26. The pixels are pushed apart by 6 in total: 97 and 123.
When reading, recompute the difference of each pair: it falls in the same range, and d' − lower bound gives the bits back.
What does an image processed with PVD look like?
Like the original, with changes concentrated on edges and textures. In a smooth area, pixels move by a few units at most; near a strong edge, they may move by several dozen without it being noticed.
What are the weaknesses of PVD?
Strengths
- Adaptive capacity, often higher than 1-bit LSB on a detailed photo.
- Changes placed where the eye is least sensitive.
- Immune to attacks designed for LSB (chi-square, RS).
Weaknesses
- Signature in the difference histogram. In a natural image, the number of pairs falls smoothly as the difference grows. After PVD, steps appear at the range boundaries (8, 16, 32…): the classic point of attack.
- Edge cases to handle: the adjustment can push a pixel below 0 or above 255; those pairs must be skipped, when writing and when reading.
- Destroyed by JPEG, which alters exactly the differences between neighbours.
- Variable capacity: you cannot know what an image can hold without scanning it.
How do you detect a message hidden by PVD?
Plot the histogram of differences between neighbouring pixels, pair by pair. A smooth curve is normal; a staircase with jumps at powers of two signals PVD and reveals the range table used. All that is left is to read.
What are the variants of PVD?
- PVD + LSB — LSB in smooth areas, PVD in textured ones, for more capacity.
- Tri-way PVD — work on 2 × 2 pixel blocks and three difference directions.
- Secret-table PVD — keep the range table as a key, or vary it from pair to pair, to erase the histogram steps.
- Modulus PVD — encode the bits in the remainder of the sum of the two pixels, which reduces distortion.
In CipherChronicle
The workbench applies PVD to the three colour channels, on pixel pairs along each row, with the range table above. It uses a variant that is simpler to verify: only the second pixel of each pair is modified, the first acting as an anchor. The capacity shown depends on the content of the image, not just its size.
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.