# Hiding in images: LSB, JPEG and adaptive steganography

> Digital images became the favourite carrier for hidden messages because every pixel and every compressed coefficient is a number with a little noise in it. This part follows the techniques from the first least-significant-bit tools of the 1990s through palette tricks, JPEG coefficient embedding (JSteg, OutGuess, F5 and matrix embedding) to the content-adaptive schemes of the 2010s (HUGO, WOW, UNIWARD) and the syndrome-trellis codes that drive them. After reading, you can embed one byte into eight pixels by hand, explain why JPEG hiding works on quantized DCT coefficients, compute how matrix embedding saves changes, read a payload in bits per pixel critically, and name the open tools from their own documentation.

Source: https://ronutz.com/en/learn/hiding-in-images-lsb-jpeg-and-adaptive-steganography  
Updated: 2026-11-23  
Related tools: https://ronutz.com/en/tools/bit-numbering-and-order

---

A digital photograph is a grid of numbers, and most of those numbers carry a little noise that nobody would miss if it changed by one. That observation, made independently by many people in the early 1990s, turned images into the most studied carrier in modern steganography. This part of the series opened by [Steganography: hiding that a message exists](https://ronutz.com/en/learn/steganography-hiding-that-a-message-exists) follows the [history before computers](https://ronutz.com/en/learn/steganography-before-computers-wax-tablets-invisible-ink-and-microdots) into pixels and compressed files: the least significant bit, palette images, the coefficients inside a JPEG (Joint Photographic Experts Group) file, and the content-adaptive schemes that researchers built once the simple methods had been broken. Every technique is shown in principle and with a toy example worked by hand; how each one is detected is the subject of the next part, [Steganalysis: finding the hidden message](https://ronutz.com/en/learn/steganalysis-finding-the-hidden-message), which this article points to wherever a method's weakness matters. After reading, you can hide one byte in eight pixels on paper, explain why the coefficients of a JPEG file and not its pixels carry the message, compute how much matrix embedding saves, read a payload figure in bits per pixel with the right suspicion, and name the open tools from their own documentation.

## Why images, and what the vocabulary means

Andreas Westfeld and Andreas Pfitzmann of the Dresden University of Technology described the attraction in 1999: multimedia data such as audio and video "contain so-called quantisation noise which provides space to embed data", and they concentrated on images as "the most widespread carrier medium" ([Westfeld and Pfitzmann, Attacks on Steganographic Systems, Information Hiding Workshop 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)). Their paper fixes the vocabulary used in the rest of this series. The sender's embedding function takes a carrier medium and the message to embed and produces a steganogram (today usually called the stego image); the recipient's extracting function recovers the message; and the stego image "should have the same statistical characteristics as the carrier media so that the use of a steganographic algorithm can not be detected" ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)).

The same paper separates two keys. A steganographic key "controls the embedding and extracting process", for example by scattering the message over a secret subset of the places available, while a cryptographic key encrypts the message before it is embedded; with the secret held in the key, the algorithm itself can be public, which is [Kerckhoffs's principle](https://ronutz.com/en/glossary/kerckhoffs-principle) applied to hiding ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)). The authors also embedded pseudo-random bit strings in all their experiments because such strings "have all statistical properties of encrypted messages" ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)). That assumption, a message that looks like random bits, runs through every technique below: an encrypted or compressed payload is a stream of zeros and ones in roughly equal numbers.

A greyscale pixel in an 8-bit image is an integer from 0 to 255. Its least significant bit (LSB) has a weight of 1, so changing it moves the brightness by one level out of 256; its most significant bit has a weight of 128. The site's [bit numbering tool](https://ronutz.com/en/tools/bit-numbering-and-order) shows every bit of a value with its weight, and the article on [character encoding](https://ronutz.com/en/learn/character-encoding) explains how a letter becomes the byte that is hidden below. A colour image in the common 24-bit form has three such numbers per pixel, one each for red, green and blue (RGB).

## Where the idea came from

The 1999 survey of information hiding by Fabien Petitcolas, Ross Anderson and Markus Kuhn of the University of Cambridge records that "many writers have proposed embedding the data in the least significant bits", citing an image watermark by R. G. van Schyndel, A. Z. Tirkel and C. F. Osborne (1994) and one by R. B. Wolfgang and E. J. Delp (1996), and that "an obviously better technique, which has occurred independently to many writers, is to embed the data into the least significant bits of pseudo-randomly chosen pixels or sound samples", so that "the key for the pseudo-random sequence generator becomes the stego-key for the system and Kerckhoffs' principle is observed" ([Petitcolas, Anderson and Kuhn, Information Hiding: A Survey, Proceedings of the IEEE, July 1999](https://www.cl.cam.ac.uk/~rja14/Papers/ieee99-infohiding.pdf)). The survey adds a detail from practice: a prototype digital camera designed to let spies hide encrypted reports in snapshots chose candidate pixels with a pseudo-random generator and rejected those where the local variance of brightness was too high or too low ([Petitcolas, Anderson and Kuhn, 1999](https://www.cl.cam.ac.uk/~rja14/Papers/ieee99-infohiding.pdf)).

An earlier warning came from the world of classified systems. Petitcolas's information hiding pages credit C. Kurak and J. McHugh with pointing out in 1992, in "A cautionary note on image downgrading" (Computer Security Applications Conference), that an image declassified from "top secret" to "public" could carry another image hidden in its low bit planes; his demonstration replaces the least significant bit planes of a photograph of an arctic hare with the most significant bit planes of a photograph of an F-15 aircraft, one plane at a time, hiding 64 KB with one plane and 452 KB with seven ([Petitcolas, The image downgrading problem](https://petitcolas.net/steganography/image_downgrading)).

## Worked example: one byte into eight pixels, bit by bit

Take the letter S. In ASCII (American Standard Code for Information Interchange) it is the byte 0x53, which is 01010011 in binary, written here with the most significant bit first. Take eight neighbouring pixels of a greyscale image, with values 152, 153, 155, 154, 157, 158, 160 and 161. LSB replacement overwrites the last bit of each pixel with one bit of the message, in order. (The arithmetic below was computed for this article; the method is the one described in the sources above.)

| Pixel | Cover value | Cover in binary | Message bit | Stego value | Stego in binary | Change |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | 152 | 1001100**0** | 0 | 152 | 1001100**0** | none |
| 2 | 153 | 1001100**1** | 1 | 153 | 1001100**1** | none |
| 3 | 155 | 1001101**1** | 0 | 154 | 1001101**0** | −1 |
| 4 | 154 | 1001101**0** | 1 | 155 | 1001101**1** | +1 |
| 5 | 157 | 1001110**1** | 0 | 156 | 1001110**0** | −1 |
| 6 | 158 | 1001111**0** | 0 | 158 | 1001111**0** | none |
| 7 | 160 | 1010000**0** | 1 | 161 | 1010000**1** | +1 |
| 8 | 161 | 1010000**1** | 1 | 161 | 1010000**1** | none |

The recipient reads the last bit of the eight stego pixels, 0 1 0 1 0 0 1 1, which is 0x53, the letter S. Four things in this table explain most of what follows in this part and the next:

1. **About half the pixels change.** A random-looking message bit already matches the pixel's last bit half the time, so eight bits cost four changes here. Ron Crandall put it in 1998: "This conventional technique may also be viewed as coding two bits of message per changed pixel" ([Crandall, Some Notes on Steganography, 18 December 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)).
2. **No pixel moves by more than one level.** That is 1 in 256, invisible to the eye in a natural photograph.
3. **The changes are asymmetric.** An even value can only go up by one and an odd value can only go down by one: 154 and 155 swap with each other, as do 156 and 157, but 155 never becomes 156. Values travel only inside fixed pairs (2k, 2k+1). The chi-square attack in [the next part](https://ronutz.com/en/learn/steganalysis-finding-the-hidden-message) is built on exactly this.
4. **The positions are public unless a key chooses them.** Here the message sits in the first eight pixels; a real tool would either do this sequentially or let a key select scattered pixels.

The Brazilian security blogger Anchises Moraes published a Portuguese explanation of the same idea that he dates to about 1999, reproduced on his blog on 27 May 2012; it quotes the help text of a tool called Hide In Picture (HIP), which hid the character 109 (binary 01101101) in the bytes 200 53 2 195 54 69 191 56 to obtain 200 53 3 194 55 69 190 57, observing that "the difference between the new values and the old ones are at most 1" ([Anchises Moraes, "[Segurança] Esteganografia", 27 May 2012](https://anchisesbr.blogspot.com/2012/05/seguranca-esteganografia.html)).

### LSB matching: the same capacity, a different trace

Westfeld and Pfitzmann closed their 1999 paper by suggesting that embedders "replace the operation overwrite by other operations (e. g., by increment)", so that the frequencies "are not balanced, but circulate in the range of values" ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)); Crandall had noted the same option for non-paletted images, "changing the LSB by incrementing or decrementing the original value (with caution for overflow and underflow)" ([Crandall, 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)). This became known as LSB matching or ±1 embedding: when a pixel's last bit is wrong, add or subtract one at random. In the table above, pixel 3 (155) could become 154 or 156; both end in 0. The capacity is unchanged, but values now leave their pairs, which removes the pair-equalizing trace of replacement. Jessica Fridrich and Jan Kodovský of Binghamton University used "optimally-coded ternary ±1 embedding" as one of the three test algorithms for their 2012 rich models ([Fridrich and Kodovský, Rich Models for Steganalysis of Digital Images, IEEE Transactions on Information Forensics and Security, 2012](http://dde.binghamton.edu/kodovsky/pdf/TIFS2012-SRM.pdf)), and Andrew Ker of the University of Oxford published "Steganalysis of LSB Matching in Grayscale Images" in the IEEE (Institute of Electrical and Electronics Engineers) Signal Processing Letters in 2005 ([Ker, publications](https://www.cs.ox.ac.uk/andrew.ker/publications.html)): matching is harder to detect than replacement, not undetectable.

### Sequential, scattered or filled

Westfeld and Pfitzmann's 1999 experiments show the three placement strategies the early tools used. EzStego embedded "line by line on the unbroken sequence of pixels from top left to bottom right" and left the rest of the image unchanged when the message was shorter than the capacity; S-Tools spread the message over the whole image, embedding up to three bits per pixel in true-colour images (one per colour channel); Steganos used the carrier completely in every case, padding shorter messages ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)). Each choice leaves a different trace, and the next part shows how each was found.

## Palette images: when the least significant bit is not the least important

Images in the Graphics Interchange Format (GIF) do not store colours in each pixel. Westfeld and Pfitzmann describe a GIF file as holding "a colour palette with up to 256 different colours" chosen from 2^24 possible ones, plus the matrix of palette indices compressed with the Lempel-Ziv-Welch (LZW) algorithm ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)). Each pixel holds an index into the palette, and neighbouring index numbers can point at completely unrelated colours, so flipping the last bit of an index may swap a sky blue for a brick red. Crandall's 1998 note says so plainly: "In a paletted image the LSB does not necessarily have the least visual impact", and he recommended relying "on parity, or some other function of the entire cell, rather than the LSB" ([Crandall, 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)).

**EzStego**, written by Romana Machado, solved the problem by sorting. It made a sorted copy of the palette so that adjacent entries are hard to tell apart (following a shortest path through the RGB colour cube rather than sorting by luminance), then used the least significant bit of a colour's position in the sorted list as the hidden bit. In the paper's own example, a pixel with original index 7 sits at sorted position 4 (binary 100); to embed a 1 the tool replaces it with index 3, which sits at sorted position 5 (binary 101), an imperceptible neighbour; the palette itself is left unmodified ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)).

**Palette reduction** was another approach. Fridrich, Miroslav Goljan and Rui Du summarized the earlier finding of Neil Johnson and Sushil Jajodia of George Mason University that several programs "decrease the color depth and then expand it to 256 by making small perturbations to the colors", which "will create suspicious pairs (clusters) of colors that can be easily detected" ([Fridrich, Goljan and Du, Reliable Detection of LSB Steganography in Color and Grayscale Images, 2001](https://www.cs.uaf.edu/2015/spring/cs463/lecture/04_06_stego/stego_detection_2001.pdf)).

**Gifshuffle**, by Matthew Kwan, changes no pixel at all. It reorders the colour map. Any list of n items can be ordered in n! ways, so an ordering can represent a number from 0 to n! − 1, and the program's home page states that "a GIF image with 256 colours can store up to 1683 bits (210 bytes) of information by shuffling the colours in its colourmap"; version 2.0 was posted on 21 January 2003, and the program is public domain ([Kwan, The Gifshuffle Home Page](http://www.darkside.com.au/gifshuffle/)). The figure checks out: the base-2 logarithm of 256! is about 1,684. The hiding place is the palette's order, which is otherwise meaningless, and that is also its weakness, since a palette sorted in an odd order is itself an anomaly.

## JPEG: hiding in the coefficients, not the pixels

### What a JPEG file actually stores

The baseline JPEG standard, ITU-T Recommendation T.81, "Digital compression and coding of continuous-tone still images", was approved on 18 September 1992 and is still in force ([ITU-T, T.81 (09/92)](https://www.itu.int/rec/T-REC-T.81-199209-I/en)); ITU-T is the standardization sector of the International Telecommunication Union. The standard is built on the discrete cosine transform (DCT): the forward DCT (FDCT) turns each 8 × 8 block of pixels into 64 values called DCT coefficients, one of them the DC coefficient and the other 63 the AC coefficients; each coefficient is then quantized with its own value from a 64-entry quantization table and rounded to the nearest integer; the quantized coefficients are reordered in a zig-zag sequence and passed to entropy coding, usually Huffman coding ([ITU-T Recommendation T.81, 1992, text published by the W3C](https://www.w3.org/Graphics/JPEG/itu-t81.pdf)). DC (direct current) and AC (alternating current) are the electrical names for the block's average and its frequency components. The Joint Photographic Experts Group is the committee that wrote the standard.

Westfeld's 2001 description of the pipeline puts the steganographic point in one diagram: the image is cut into 8 × 8 blocks, transformed, quantized (the lossy step) and then Huffman coded (lossless). Anything hidden in pixel values before compression is destroyed by quantization; anything hidden in the quantized integers after it survives exactly, because Huffman coding is lossless ([Westfeld, F5: a steganographic algorithm (in German), Verlässliche IT-Systeme 2001](https://www2.htw-dresden.de/~westfeld/publikationen/westfeld.vis01.pdf)). Johnson and Jajodia made the converse point for defenders in 1998: "For LSB methods of inserting data, simply using a lossy compression technique, such as JPEG, is enough to render the embedded message useless" ([Johnson and Jajodia, Steganalysis: The Investigation of Hidden Information, IEEE Information Technology Conference 1998](https://www.cse.buffalo.edu/courses/cse725/peter/Johnson_1997.pdf)). Stripping hidden content by re-encoding is the subject of [a later part of this series](https://ronutz.com/en/learn/detecting-and-stripping-hidden-content-in-practice).

Westfeld's histogram of quantized coefficients from a test image shows two characteristic properties that every JPEG embedding scheme since has had to respect: the frequency of coefficients falls as their absolute value grows, and the fall itself slows down, so the difference between neighbouring bars is larger in the middle than at the edges ([Westfeld, 2001](https://www2.htw-dresden.de/~westfeld/publikationen/westfeld.vis01.pdf)). Most coefficients are zero, which is why the zeros are not used for hiding.

### JSteg: LSB replacement moved into the coefficients

JSteg, by Derek Upham, was the first widely known JPEG tool. Westfeld reproduced its embedding function in C: after quantization it overwrites the least significant bit of each coefficient, skipping coefficients whose value is 0 or 1 (`if ((inval & 1) != inval)`), and he measured a capacity of 12.8% of the stego file's size on his test image ([Westfeld, 2001](https://www2.htw-dresden.de/~westfeld/publikationen/westfeld.vis01.pdf)). Niels Provos of the University of Michigan described the same rule: the least significant bits of the quantized DCT coefficients that are neither 0 nor 1 are the redundant bits into which the message goes ([Provos, Defending Against Statistical Steganalysis, USENIX Security Symposium, August 2001](https://www.usenix.org/legacy/events/sec01/full_papers/provos/provos.pdf)). Because one coefficient affects a whole block, Westfeld and Pfitzmann noted that "there is no visual attack in the sense presented here, because one steganographic bit influences up to 256 pixels" ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)); their statistical attack still found it.

A toy run of the JSteg rule on nine AC coefficients of one block, in zig-zag order, embedding the six bits 1 0 1 0 0 1 (computed for this article; negative values are stored in two's complement, so −1 ends in bit 1 and −2 in bit 0):

| Coefficient | 5 | −2 | 0 | 1 | 3 | −1 | 2 | 0 | −4 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Used by JSteg? | yes | yes | no (0) | no (1) | yes | yes | yes | no (0) | yes |
| Bit embedded | 1 | 0 | | | 1 | 0 | 0 | | 1 |
| After embedding | 5 | −2 | 0 | 1 | 3 | −2 | 2 | 0 | −3 |

Two changes for six bits. As in the pixel case, values only move inside fixed pairs: 2 and 3, 4 and 5, −2 and −1, −4 and −3.

### OutGuess: hiding while repairing the histogram

Provos released OutGuess as a tool that "preserves statistics based on frequency counts", so that "statistical tests based on frequency counts are unable to detect the presence of steganographic content"; his download page dates version 0.2 to 12 February 2001, and the tool is distributed under a Berkeley Software Distribution (BSD) licence ([Provos, Outguess 0.2](https://www.provos.org/p/outguess/); [Provos, Outguess and Stegdetect Downloads](https://www.provos.org/p/outguess-and-stegdetect-downloads/)). The design, published at the USENIX Security Symposium in August 2001, has three parts ([Provos, 2001](https://www.usenix.org/legacy/events/sec01/full_papers/provos/provos.pdf)):

- **Keyed selection.** An RC4 (Rivest Cipher 4) stream cipher, initialized with the user's secret key, encrypts the message and drives a pseudo-random number generator (PRNG) that picks which redundant bits to use; a 16-bit seed and the message length are embedded first, and the sender tries different seeds and keeps the one that needs the fewest changes.
- **A cap on use.** The selection interval limits the message to at most 50% of the available redundant bits, leaving the rest free for corrections.
- **Correction.** For every change of a coefficient from 2i to 2i + 1, an unused coefficient with the value 2i + 1 is changed to 2i, so that the histogram of coefficients ends up identical to the original; "after applying a correcting transform to an image, statistical steganalysis is no longer able to detect the presence of steganography".

The claim held against frequency-count tests. It did not hold against tests outside that model: Provos's own page records that in 2002 "Fridrich, Goljan and Hogea's 'Attacking the OutGuess' is capable of reliably detecting images with content embedded by OutGuess" ([Provos, Outguess 0.2](https://www.provos.org/p/outguess/)). Preserving one statistic exactly tends to disturb others, a pattern that recurs throughout the field.

### F3, F4 and F5: decrementing instead of overwriting

Westfeld presented F5 at the 4th Information Hiding Workshop in Pittsburgh, 25 to 27 April 2001, in the paper "High capacity despite better steganalysis", published in volume 2137 of Lecture Notes in Computer Science, pages 289 to 302; Binghamton's Digital Data Embedding (DDE) Laboratory distributes his original Java implementation ([DDE Lab, Steganographic Algorithms](https://dde.binghamton.edu/download/stego_algorithms)). His German version of the same year walks through the design in steps, each fixing the previous one's weakness ([Westfeld, 2001](https://www2.htw-dresden.de/~westfeld/publikationen/westfeld.vis01.pdf)):

- **F3** stops overwriting. When a coefficient's last bit does not match the message bit, it decrements the coefficient's absolute value by one. Zeros are skipped, but coefficients equal to 1 and −1 are now used, which keeps the histogram symmetric. Decrementing a 1 or −1 produces a 0, which the recipient will skip; this loss is called shrinkage, and the sender must embed the same bit again in the next coefficient. Shrinkage only ever destroys zeros (a 1 carrying a 1 is never decremented), so F3 ends up embedding more zeros than ones and leaves an excess of even coefficients, another detectable trace.
- **F4** fixes that by giving negative coefficients the inverted meaning: positive odd and negative even coefficients carry a 1, positive even and negative odd coefficients carry a 0. Westfeld proves that, with a uniformly distributed message, the two characteristic properties of the histogram survive F4's embedding.
- **F5** adds two more ideas: permutative straddling, which shuffles all coefficients with a permutation derived from a password so that the changes spread evenly over the image instead of piling up at the start of the file; and matrix embedding, which reduces the number of changes for a given message.

A toy run of the F4 rule on the same nine coefficients and the same six bits (computed for this article):

| Coefficient | 5 | −2 | 0 | 1 | 3 | −1 | 2 | 0 | −4 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Bit it carries (F4 rule) | 1 | 1 | skipped | 1 | 1 | 0 | 0 | skipped | not reached |
| Bit to embed | 1 | 0 | | 1 | 0 | 0 | 1 | | |
| After embedding | 5 | −1 | 0 | 1 | 2 | −1 | 1 | 0 | −4 |

Three changes, each one reducing an absolute value by one (−2 to −1, 3 to 2, 2 to 1). Had the fourth bit been a 0 instead of a 1, the coefficient 1 would have become 0, the bit would have been lost to shrinkage, and the sender would have had to embed it again in the coefficient 3.

On Westfeld's test image, a short message of 217 bytes (1,736 bits) needed 1,157 changes with F4 and only 459 with F5, an embedding efficiency of 3.8 bits per change ([Westfeld, 2001](https://www2.htw-dresden.de/~westfeld/publikationen/westfeld.vis01.pdf)). Westfeld limited his security argument to the attacks known at the time; a year later Fridrich, Goljan and Dorin Hogea published a calibration attack that "can reliably detect messages (and estimate their size) hidden in JPEG images using the steganographic algorithm F5" ([Fridrich, Goljan and Hogea, Steganalysis of JPEG Images: Breaking the F5 Algorithm, Information Hiding Workshop 2002](http://ws2.binghamton.edu/fridrich/Research/f5.pdf)). The next part explains how.

## Matrix embedding: fewer changes for the same message

Matrix embedding is the most reusable idea in this part, and it predates F5. Crandall described it in a note dated 18 December 1998 ([Crandall, 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)), which Tomáš Filler, Jan Judas and Fridrich later identified as an essay "posted on the steganography mailing list in 1998"; they add that Jürgen Bierbrauer connected the problem to coding theory and that Westfeld "made famous among steganographers" the technique by incorporating it in F5 ([Filler, Judas and Fridrich, Minimizing Additive Distortion in Steganography Using Syndrome-Trellis Codes, IEEE Transactions on Information Forensics and Security, 2011](http://dde.binghamton.edu/filler/pdf/Fill10tifs-stc.pdf)).

Crandall's example takes a block of three cells (three pixels, or three usable coefficients) whose extracted bits are a, b and c, and carries two message bits in them: message bit 1 is a XOR c (exclusive or: 1 when the two bits differ) and message bit 2 is b XOR c. If both bits are already right (probability one quarter), nothing changes; if only bit 1 is wrong, change a; if only bit 2 is wrong, change b; if both are wrong, change c ([Crandall, 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)). Two bits always cost at most one change. Crandall named such designs by a triple (changes allowed, cells per block, bits conveyed), so this one is (1, 3, 2), and he observed that they use "the same decoding matrix H as the Hamming error correcting codes" of Richard Hamming (1950) ([Crandall, 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)).

**Worked example.** Three usable F4 coefficients 5, −2 and 3 carry the bits a = 1, b = 1, c = 1. The message is 0 1.

- Extracted bit 1 is a XOR c = 1 XOR 1 = 0. The message wants 0: correct.
- Extracted bit 2 is b XOR c = 1 XOR 1 = 0. The message wants 1: wrong.
- Only bit 2 is wrong, so change b: the coefficient −2 becomes −1 (absolute value decremented), which under the F4 rule carries a 0.
- Check: a XOR c = 1 XOR 1 = 0, and b XOR c = 0 XOR 1 = 1. The message 0 1 is in place, with one change.

The general code with one change allowed has n = 2^k − 1 cells and carries k bits. Westfeld's formulas give a change density of 1/(n + 1), an embedding rate of k/n and an embedding efficiency, the average number of message bits per change, of k divided by the change density times n, which is always larger than k ([Westfeld, 2001](https://www2.htw-dresden.de/~westfeld/publikationen/westfeld.vis01.pdf)):

| k (bits per block) | n (cells per block) | Changes per cell | Message bits per cell | Bits per change |
| --- | --- | --- | --- | --- |
| 1 | 1 | 50.00% | 100.00% | 2.00 |
| 2 | 3 | 25.00% | 66.67% | 2.67 |
| 3 | 7 | 12.50% | 42.86% | 3.43 |
| 4 | 15 | 6.25% | 26.67% | 4.27 |
| 5 | 31 | 3.13% | 16.13% | 5.16 |
| 6 | 63 | 1.56% | 9.52% | 6.10 |
| 7 | 127 | 0.78% | 5.51% | 7.06 |
| 8 | 255 | 0.39% | 3.14% | 8.03 |

(Values recomputed for this article from Westfeld's formulas; they agree with his table.) The trade is plain: high efficiency only for short messages. Crandall's own comment on the (1, 31, 5) design was "The (1, 31, 5) design is conveying 5 message bits for every cell changed! The penalty, of course, is the low rate" ([Crandall, 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)). F5 picks k automatically: in Westfeld's example, 1,000 message bits in a carrier with 50,000 usable bits need a rate of 2%, so F5 chooses k = 8 and can place 196 code words of length 255 ([Westfeld, 2001](https://www2.htw-dresden.de/~westfeld/publikationen/westfeld.vis01.pdf)).

### nsF5 and wet paper codes

Fridrich, Tomáš Pevný and Kodovský revisited F5 in 2007. Shrinkage, they wrote, can be eliminated with wet paper codes, which let the sender choose which coefficients may change without the recipient knowing the choice; they called F5 with wet paper codes "nsF5 (no-shrinkage F5)", found that "matrix embedding markedly improves security as it dilutes the number of embedding changes", and estimated that against the detectors of 2007 the average steganographic capacity of greyscale JPEG images at quality factor 70 was "approximately 0.05 bits per non-zero AC DCT coefficient" ([Fridrich, Pevný and Kodovský, Statistically Undetectable JPEG Steganography: Dead Ends, Challenges, and Opportunities, ACM Multimedia and Security Workshop, 2007](http://dde.binghamton.edu/kodovsky/pdf/Fri07-ACM.pdf)). nsF5 became the standard reference point for JPEG steganography in later benchmarks.

## Steghide: exchanging instead of overwriting

Steghide, by Stefan Hetzl, describes itself as "a steganography program that is able to hide data in various kinds of image- and audio-files", with support for JPEG, BMP (bitmap), WAV (Waveform Audio File Format) and AU audio files, compression and encryption of the embedded data and a checksum; its home page dates version 0.5.1 to 15 October 2003 and gives the GNU General Public License (GPL) ([Steghide home page](https://steghide.sourceforge.net/)). Hetzl and Petra Mutzel published the method in 2005: a "graph-theoretic approach to steganography based on the idea of exchanging rather than overwriting pixels". Pixels that need to change become vertices of a graph, possible exchange partners are joined by edges, a maximum cardinality matching picks the exchanges, and because values are swapped rather than altered, "this embedding preserves first-order statistics" ([Hetzl and Mutzel, A Graph-Theoretic Approach to Steganography, 2005](https://dmg.tuwien.ac.at/hetzl/research/graphstego.pdf)). As with OutGuess, a preserved histogram is not the end of the story: the National Vulnerability Database (NVD) records CVE-2021-27211, published on 15 February 2021, which states that "steghide 0.5.1 relies on a certain 32-bit seed value, which makes it easier for attackers to detect hidden data" ([NVD, CVE-2021-27211](https://nvd.nist.gov/vuln/detail/CVE-2021-27211)). The consequences for detection are in the next part.

## Content-adaptive steganography: change the pixels that are hard to model

By 2010 the simple methods were all detectable, and the research community changed approach. Instead of trying to preserve a statistical model of the cover, which an attacker can always step outside, the sender assigns every possible change a cost and embeds the message while minimizing the total cost. Crandall had sketched this too in 1998: "Conceptually, the encoder examines an area of the image and weighs each of the options that allow it to embed the desired bits in that area. It scores each option for how conspicuous it is and chooses the option with the best score" ([Crandall, 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)). Holub and Fridrich state the modern version: practical algorithms now embed near the theoretical payload-distortion bound, so "the only task left to the sender is essentially the design of the distortion function", and today's most secure schemes "constrain the embedding changes to those parts of the image that are difficult to model (e.g., complex textures or 'noisy' areas)" ([Holub and Fridrich, Designing Steganographic Distortion Using Directional Filters, IEEE WIFS 2012](http://dde.binghamton.edu/vholub/pdf/WIFS12_Designing_Steganographic_Distortion_Using_Directional_Filters.pdf)).

### HUGO (2010)

Pevný, Filler and Patrick Bas presented "Using high-dimensional image models to perform highly undetectable steganography" at the 12th Information Hiding Workshop in Calgary, 28 to 30 June 2010 (Lecture Notes in Computer Science volume 6387, pages 161 to 177) ([Filler, Judas and Fridrich, 2011, reference list](http://dde.binghamton.edu/filler/pdf/Fill10tifs-stc.pdf)). The algorithm, HUGO (Highly Undetectable steGO), measures distortion in the space of a detector's own features, the subtractive pixel adjacency matrix (SPAM) model built from differences of neighbouring pixels ([Fridrich, Kodovský, Holub and Goljan, Breaking HUGO: the Process Discovery, Information Hiding 2011](http://ws2.binghamton.edu/fridrich/Research/hugobreakers05.pdf); [Holub and Fridrich, 2012](http://dde.binghamton.edu/vholub/pdf/WIFS12_Designing_Steganographic_Distortion_Using_Directional_Filters.pdf)). Its authors put it up as the target of the first open steganalysis competition, BOSS (Break Our Steganographic System!), with a payload of 0.4 bits per pixel in every image; the change rate at that payload was about 0.1, depending on content ([Fridrich, Kodovský, Holub and Goljan, 2011](http://ws2.binghamton.edu/fridrich/Research/hugobreakers05.pdf)). Two lessons from the attacks on it belong here. With its default threshold of 90, HUGO had a weakness "that makes the algorithm vulnerable to first-order attacks due to an artifact present in the histogram of pixel differences", which is why later benchmarks ran it with a threshold of 255 ([Fridrich and Kodovský, 2012](http://dde.binghamton.edu/kodovsky/pdf/TIFS2012-SRM.pdf)). And in seven BOSS test images with regions saturated at 0 or 255, forced embedding left visible salt-and-pepper noise in the least significant bit plane, mostly near the image border ([Fridrich, Kodovský, Holub and Goljan, 2011](http://ws2.binghamton.edu/fridrich/Research/hugobreakers05.pdf)). Adaptive does not mean free of corner cases.

### WOW (2012)

Vojtěch Holub and Fridrich presented WOW (Wavelet Obtained Weights) at the IEEE Workshop on Information Forensics and Security (WIFS) in Tenerife, 2 to 5 December 2012. The cost of changing a pixel comes from the change it causes in the outputs of a bank of directional high-pass filters, aggregated so that "the aggregation rule is designed to force the embedding changes to highly textured or noisy regions and to avoid clean edges"; embedding uses syndrome-trellis codes; and "at 0.5 bpp, the EOOB of WOW is almost twice as high as that of HUGO", meaning the detector's out-of-bag error estimate (EOOB) was nearly doubled ([Holub and Fridrich, 2012](http://dde.binghamton.edu/vholub/pdf/WIFS12_Designing_Steganographic_Distortion_Using_Directional_Filters.pdf)). The reason edges matter: along a clean edge the content is predictable in one direction, so a detector can model it; in texture it cannot.

### UNIWARD (2014) and its relatives

Holub, Fridrich and Tomáš Denemark generalized the idea in "Universal distortion function for steganography in an arbitrary domain" (EURASIP Journal on Information Security, 2014), naming it "universal wavelet relative distortion (UNIWARD)": the cost is "a sum of relative changes of coefficients in a directional filter bank decomposition of the cover image", and the same function serves the spatial domain (S-UNIWARD), the JPEG domain (J-UNIWARD) and side-informed JPEG (SI-UNIWARD) ([Holub, Fridrich and Denemark, 2014](http://dde.binghamton.edu/vholub/pdf/EURASIP14_Universal_Distortion_Function_for_Steganography_in_an_Arbitrary_Domain.pdf)). Their comparison of where the schemes put their changes is the clearest picture of the idea: on a test image with pillars and horizontal lines, HUGO embeds with high probability into the pillar edges and lines, while S-UNIWARD's directional costs "force the changes solely into the textured areas" ([Holub, Fridrich and Denemark, 2014](http://dde.binghamton.edu/vholub/pdf/EURASIP14_Universal_Distortion_Function_for_Steganography_in_an_Arbitrary_Domain.pdf)).

Other cost functions followed. Bin Li, Ming Wang, Jiwu Huang and Xiaolong Li proposed HILL at the International Conference on Image Processing (ICIP) in October 2014 ([Chaumont, Deep Learning in Steganography and Steganalysis from 2015 to 2018, reference list](https://arxiv.org/abs/1904.01444)); Vahid Sedighi, Rémi Cogranne and Fridrich proposed MiPOD, "Content-Adaptive Steganography by Minimizing Statistical Detectability", in IEEE Transactions on Information Forensics and Security in 2016 ([Fridrich, publications](http://ws2.binghamton.edu/fridrich/publications.html)). In the JPEG domain, the 2020 ALASKA#2 competition used J-UNIWARD, UERD (L. Guo, J. Ni and Y. Q. Shi, 2014) and J-MiPOD (Cogranne, Quentin Giboulot and Bas, 2020) as its three embedding algorithms ([ALASKA](https://alaska.utt.fr); [Yousfi, Butora, Khvedchenya and Fridrich, ImageNet Pre-trained CNNs for JPEG Steganalysis, IEEE WIFS 2020](http://ws2.binghamton.edu/fridrich/Research/Alaska-2-Revised.pdf)).

## Syndrome-trellis codes: the engine under the adaptive schemes

A cost for every pixel is only useful if the sender can actually embed the message while paying close to the minimum total cost, and the recipient, who does not know the costs, can still read it. Filler, Judas and Fridrich's syndrome-trellis codes (STCs), published in IEEE Transactions on Information Forensics and Security in 2011, solve that problem ([Filler, Judas and Fridrich, 2011](http://dde.binghamton.edu/filler/pdf/Fill10tifs-stc.pdf)). The construction generalizes the Hamming example above.

- **Extraction is a matrix product.** The recipient takes the least significant bits of the stego image as a vector and multiplies it by a public binary parity-check matrix H; the result, the syndrome, is the message. In the authors' notation, Ext(y) = HP(y) ([Filler, Judas and Fridrich, 2011](http://dde.binghamton.edu/filler/pdf/Fill10tifs-stc.pdf)). In Crandall's 1998 example, H has two rows, one computing a XOR c and the other b XOR c.
- **Embedding is a search.** Many bit vectors share the same syndrome. The sender must find, among all of them, the one closest to the cover in total cost. For random codes this search is exponential; the authors chose codes whose matrix has a narrow band structure, so that the search becomes a shortest path through a trellis, solved with the Viterbi algorithm with "linear time and space complexity w.r.t. the number of cover elements" ([Filler, Judas and Fridrich, 2011](http://dde.binghamton.edu/filler/pdf/Fill10tifs-stc.pdf)).
- **It covers the earlier codes.** The authors write that most coding schemes then in use, "matrix embedding, wet paper codes, etc.", can be implemented in this framework, and that it performs close to the theoretical bound; the UNIWARD paper reports that with STCs of constraint height h = 12 "the coding loss appears rather small" ([Filler, Judas and Fridrich, 2011](http://dde.binghamton.edu/filler/pdf/Fill10tifs-stc.pdf); [Holub, Fridrich and Denemark, 2014](http://dde.binghamton.edu/vholub/pdf/EURASIP14_Universal_Distortion_Function_for_Steganography_in_an_Arbitrary_Domain.pdf)).
- **Pixels with infinite cost are "wet".** A cost of infinity forbids a change; the wet paper channel of nsF5 is the special case where some elements may never change ([Filler, Judas and Fridrich, 2011](http://dde.binghamton.edu/filler/pdf/Fill10tifs-stc.pdf)).

Because the codes perform so close to the bound, research papers usually simulate embedding at the theoretical payload-distortion bound instead of running the codes; the UNIWARD comparisons, for example, were "simulated at their corresponding payload-distortion bounds" ([Holub, Fridrich and Denemark, 2014](http://dde.binghamton.edu/vholub/pdf/EURASIP14_Universal_Distortion_Function_for_Steganography_in_an_Arbitrary_Domain.pdf)). The split of work is now standard: design the cost, let STCs (or a simulator) do the rest.

## What capacity means: bits per pixel, and why it misleads

Payload is quoted as a relative figure. In the spatial domain it is bits per pixel (bpp): the message length divided by the number of pixels, so 1 bpp is one bit in every pixel of a greyscale image. In JPEG it is bits per non-zero AC coefficient (bpnzAC), since zeros cannot be used ([Holub, Fridrich and Denemark, 2014](http://dde.binghamton.edu/vholub/pdf/EURASIP14_Universal_Distortion_Function_for_Steganography_in_an_Arbitrary_Domain.pdf)). Crandall warned in 1998 that a rate quoted against one bit per pixel is a convention: "Purists might object that this is actually 12.5 %" of an 8-bit pixel ([Crandall, 1998](https://www2.htw-dresden.de/~westfeld/crandall.pdf)). And with matrix embedding or STCs, payload and number of changes are different things: HUGO's 0.4 bpp meant a change rate of about 0.1 ([Fridrich, Kodovský, Holub and Goljan, 2011](http://ws2.binghamton.edu/fridrich/Research/hugobreakers05.pdf)).

**Worked numbers** for a 512 × 512 greyscale image, the size used by the BOSS image base (arithmetic for this article):

| Payload | Bits | Bytes (about) | Where the figure comes from |
| --- | --- | --- | --- |
| 1 bpp | 262,144 | 32,768 | every LSB used |
| 0.4 bpp | 104,858 | 13,107 | the BOSS payload for HUGO |
| 0.1 bpp | 26,214 | 3,277 | a low payload in later benchmarks |
| 0.005 bpp | 1,311 | 164 | the 2001 "safe" bound for plain LSB embedding |

The last row is from Fridrich, Goljan and Du in 2001: "An upper bound of 0.005 bits/pixel was experimentally determined for safe LSB embedding" ([Fridrich, Goljan and Du, 2001](https://www.cs.uaf.edu/2015/spring/cs463/lecture/04_06_stego/stego_detection_2001.pdf)). For JPEG, the 2007 estimate quoted above was about 0.05 bpnzAC against the detectors of that year ([Fridrich, Pevný and Kodovský, 2007](http://dde.binghamton.edu/kodovsky/pdf/Fri07-ACM.pdf)).

**What the detectors make of 0.4 bpp.** With the 34,671-feature spatial rich model and an ensemble classifier trained on BOSSbase version 0.92 (9,074 images from seven cameras, cropped to 512 × 512), the median detection error at 0.4 bpp was 7.85% for ±1 embedding and 13.55% for HUGO run with threshold 255 ([Fridrich and Kodovský, 2012](http://dde.binghamton.edu/kodovsky/pdf/TIFS2012-SRM.pdf)); for S-UNIWARD with the 8-tap Daubechies filters, the out-of-bag error at 0.4 bpp against the same kind of model on BOSSbase 1.01 was 0.1981, about 20% ([Holub, Fridrich and Denemark, 2014](http://dde.binghamton.edu/vholub/pdf/EURASIP14_Universal_Distortion_Function_for_Steganography_in_an_Arbitrary_Domain.pdf)). An error of 50% would be a coin toss; the adaptive schemes raised the detector's error, they did not reach invisibility. The figures come from different set-ups and should be compared with that caution; the next part explains how these errors are measured.

**The square root law.** Ker, Pevný, Kodovský and Fridrich presented "The Square Root Law of Steganographic Capacity" at the Association for Computing Machinery (ACM) Multimedia and Security Workshop in Oxford on 22 September 2008. Their slides open with Ross Anderson's remark at the first Information Hiding Workshop in 1996: "the more covertext we give the warden, the better he will be able to estimate its statistics, and so the smaller the rate at which Alice will be able to tweak bits safely. The rate might even tend to zero". Across cover types, embedding methods and detectors, they "observed close accordance with a square root law": the number of changes that can be made at a fixed risk grows with the square root of the cover's size, not in proportion to it. Their conclusion for practice is blunt: "'Bits per pixel', 'bits per nonzero coefficient' are the wrong measures" ([Ker, Pevný, Kodovský and Fridrich, The Square Root Law of Steganographic Capacity, slides, 22 September 2008](http://www.cs.ox.ac.uk/andrew.ker/docs/keretal-acm08-slides.pdf)). The same slides list two limits: the law does not apply when perfect steganography is available, and it applies properly to the number of embedding changes rather than to the payload. A quadruple-size image does not safely carry four times the message; at the same risk it carries roughly twice the changes. The organizers of the 2020 ALASKA#2 challenge followed the same logic in their own way, giving each image a different payload "such that most complex images have higher payload" ([ALASKA](https://alaska.utt.fr)).

## The open tools, from their own documentation

The tools below are named for reference, from their own pages, with no instructions for use. The research implementations matter as much as the end-user programs, because most published results are produced with them.

| Tool | Author or maintainer | What its documentation says it does | Dates and licence from its pages |
| --- | --- | --- | --- |
| OutGuess | Niels Provos | "a universal steganographic tool that allows the insertion of hidden information into the redundant bits of data sources"; handlers for the PNM (portable anymap) and JPEG formats; preserves frequency-count statistics | 0.2 released 12 February 2001; BSD licence ([Provos](https://www.provos.org/p/outguess/); [downloads](https://www.provos.org/p/outguess-and-stegdetect-downloads/)) |
| Steghide | Stefan Hetzl | hides data in JPEG, BMP, WAV and AU files; compression, encryption, checksum; colour and sample frequencies not changed | 0.5.1 dated 15 October 2003; GPL ([home page](https://steghide.sourceforge.net/)); method by exchange ([Hetzl and Mutzel, 2005](https://dmg.tuwien.ac.at/hetzl/research/graphstego.pdf)) |
| F5 (original) | Andreas Westfeld | JPEG embedding with F4 rule, permutative straddling and matrix embedding | original Java implementation distributed by the DDE Lab ([DDE Lab](https://dde.binghamton.edu/download/stego_algorithms)) |
| Gifshuffle | Matthew Kwan | GIF colour map steganography by shuffling, with compression and encryption | 2.0 on 21 January 2003; public domain ([home page](http://www.darkside.com.au/gifshuffle/)) |
| OpenStego | Samir Vaidya | "Data Hiding: It can hide any data within a cover file (e.g. images)" and "Watermarking (beta)" | site copyright 2017 to 2021 ([OpenStego](https://www.openstego.com/)) |
| DDE Lab implementations | Binghamton University | Matlab, MEX (Matlab executable) and C++ code of S-UNIWARD, WOW, HUGO with bounding distortion, MiPOD, J-UNIWARD, nsF5, side-informed schemes; free "for research and non-profit purposes" | page created December 2012 ([DDE Lab](https://dde.binghamton.edu/download/stego_algorithms)) |

Many tools of the 1990s survive only as names. The software list in Westfeld and Pfitzmann's 1999 paper points to addresses at GeoCities, AOL member pages and university File Transfer Protocol (FTP) servers ([Westfeld and Pfitzmann, 1999](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)), and Anchises Moraes marked the 1999 download links in his reproduced article as "link inexistente" (link no longer exists) ([Anchises Moraes, 27 May 2012](https://anchisesbr.blogspot.com/2012/05/seguranca-esteganografia.html)). Steganography inside capture-the-flag (CTF) games, where these tools reappear as puzzles, is covered in the [article on CTF competitions](https://ronutz.com/en/learn/capture-the-flag-competitions) and in the next part.

## The Brazilian angle

The Brazilian record in this part is one of teaching and research rather than of tools. Anchises Moraes's circa-1999 article, mentioned above, explained LSB hiding in Portuguese with the HIP example; he republished it in May 2012 after attending tosconf, the first edition of the unconference of the Laboratório Hacker de Campinas (LHC), on 26 May 2012, where Vinícius Berardi gave a talk on steganography that "explained one of the best-known techniques of steganography, which consists of hiding messages inside image files by manipulating the bits that represent the colours of each of the pixels" (our translation here and below); Moraes linked an earlier version of the talk given at FLISOL Campinas, titled "Steganography with PHP" (in Portuguese) ([Anchises Moraes, 27 May 2012](https://anchisesbr.blogspot.com/2012/05/seguranca-esteganografia.html)). The scene behind those events is described in [the Brazilian hacker scene](https://ronutz.com/en/learn/the-brazilian-hacker-scene).

On the academic side, Anderson Rocha and Siome Goldenstein of the Institute of Computing of the University of Campinas (Unicamp) published "Steganography and Steganalysis in Digital Multimedia: Hype or Hallelujah?", a tutorial in the Revista de Informática Teórica e Aplicada of the Federal University of Rio Grande do Sul (volume 15, number 1, 2008, pages 83 to 110), which introduces "the basic theory behind Steganography and Steganalysis" and relates it to image processing and computer vision ([RITA, 2008](https://seer.ufrgs.br/index.php/rita/article/view/rita_v15_n1_p83-110)). Rocha's detection work, funded by the São Paulo Research Foundation (FAPESP), belongs to the next part.

## What defenders can take from this part

Detection proper is the next part; three practical points follow directly from the mechanisms above.

- **The format decides the method.** Lossless formats (Portable Network Graphics (PNG), BMP and similar) invite pixel LSB methods; JPEG files invite coefficient methods; palette images invite index and palette-order tricks. A defender who knows the format knows which family to test first.
- **Simple tools leave simple traces.** Sequential LSB replacement, unchanged since the 1990s, is still what many easy-to-use tools do, and it is the most detectable method in this article. Content-adaptive schemes are a research-grade problem; they are rarely what an ordinary tool implements.
- **Recompression removes pixel-domain payloads.** Johnson and Jajodia's 1998 observation that lossy compression makes LSB-embedded messages useless still holds for spatial-domain hiding ([Johnson and Jajodia, 1998](https://www.cse.buffalo.edu/courses/cse725/peter/Johnson_1997.pdf)); payloads embedded in the quantized coefficients of a JPEG survive a lossless copy of the file but not a fresh decode and recompression with different settings. [A later part of this series](https://ronutz.com/en/learn/detecting-and-stripping-hidden-content-in-practice) covers stripping and content disarm in practice. Control catalogues already ask for this kind of attention: the United States National Institute of Standards and Technology (NIST) lists "monitoring for steganography" among the techniques for preventing exfiltration under control SC-7(10), notes that "covert means that can be used to exfiltrate information include steganography" under SI-4(18), and names "steganography encoded data" among what data sanitization between security domains should minimize under AC-4(25) ([NIST SP 800-53 Revision 5, September 2020](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf)). The glossary entry on [exfiltration](https://ronutz.com/en/glossary/exfiltration) and the article on [data loss prevention](https://ronutz.com/en/learn/dlp-fundamentals) place this in the wider picture.

## What to remember

- An 8-bit pixel changed in its least significant bit moves by one level in 256; LSB replacement changes about half the pixels it uses, and values move only within fixed pairs (2k, 2k + 1), which is the trace that betrays it.
- LSB matching (±1) keeps the capacity and breaks the pair structure; it is harder to detect, not undetectable.
- In palette images the index's LSB can mean a wild colour jump; EzStego sorted the palette, Gifshuffle hid in the palette's order (up to about 1,683 bits in 256 colours).
- JPEG hiding works on the quantized DCT coefficients, after the lossy step: JSteg overwrote their LSBs, OutGuess repaired the histogram, F5 decremented absolute values and added matrix embedding.
- Matrix embedding (Crandall, 1998) carries k bits in 2^k − 1 cells with at most one change, at the price of a lower rate; syndrome-trellis codes (2011) generalize it to arbitrary costs.
- Content-adaptive schemes (HUGO 2010, WOW 2012, UNIWARD 2014, HILL, MiPOD) put changes in texture and noise and avoid clean edges; they raise the detector's error, not to 50%.
- Payloads in bits per pixel are a convention, not a safety measure: the square root law says safe changes grow with the square root of the cover's size.

<ReaderQuestions>
- Every scheme in this article that preserved one statistic exactly (OutGuess's histogram, Steghide's first-order statistics) was later detected through another. Is preserving a statistic a sound design goal, or does it advertise what an attacker should look beyond?
- Content-adaptive schemes concentrate changes in textured regions. If the attacker knows the cost function too, as Kerckhoffs's principle requires, how much does knowing where changes are likely help the detector?
- The square root law says safe payload grows more slowly than image size. What does that imply for someone choosing between one large image and many small ones?
- Matrix embedding and syndrome-trellis codes trade embedding rate for fewer changes. Is "number of changes" the right thing to minimize, or should the cost of each change matter more, as the adaptive schemes assume?
- Most published results are simulations at a theoretical bound rather than runs of real tools. How far can conclusions drawn from simulated embedding be carried over to the tools that people actually use?
</ReaderQuestions>

## Sources

- [Andreas Westfeld and Andreas Pfitzmann, Attacks on Steganographic Systems: Breaking the Steganographic Utilities EzStego, Jsteg, Steganos, and S-Tools, and Some Lessons Learned, Information Hiding Workshop, Dresden, 1999, copy hosted by Carnegie Mellon University: vocabulary, keys, EzStego palette sorting, placement strategies of EzStego, S-Tools and Steganos, JSteg and the 256-pixel remark, the proposal to increment instead of overwrite, the 1999 tool addresses (accessed 17 November 2026)](https://users.ece.cmu.edu/~adrian/487-s06/westfeld-pfitzmann-ihw99.pdf)
- [Fabien A. P. Petitcolas, Ross J. Anderson and Markus G. Kuhn, Information Hiding: A Survey, Proceedings of the IEEE, 87(7), July 1999: LSB proposals of van Schyndel, Tirkel and Osborne (1994) and Wolfgang and Delp (1996), pseudo-randomly chosen pixels, the spy camera prototype (accessed 17 November 2026)](https://www.cl.cam.ac.uk/~rja14/Papers/ieee99-infohiding.pdf)
- [Fabien Petitcolas, The information hiding homepage, The image downgrading problem: Kurak and McHugh (1992), bit-plane replacement demonstration, 64 KB to 452 KB (accessed 17 November 2026)](https://petitcolas.net/steganography/image_downgrading)
- [Ron Crandall, Some Notes on Steganography, 18 December 1998, copy hosted by Andreas Westfeld: two bits per changed pixel, parity of cells, LSB in paletted images, incrementing or decrementing, matrix encoding (1, 3, 2) and Hamming codes, scoring each option, the 12.5% remark (accessed 17 November 2026)](https://www2.htw-dresden.de/~westfeld/crandall.pdf)
- [Anchises Moraes, "[Segurança] Esteganografia", AnchisesLandia blog, 27 May 2012: tosconf of 26 May 2012, Vinícius Berardi's talk, the circa-1999 article with the HIP example (accessed 17 November 2026)](https://anchisesbr.blogspot.com/2012/05/seguranca-esteganografia.html)
- [Jessica Fridrich and Jan Kodovský, Rich Models for Steganalysis of Digital Images, IEEE Transactions on Information Forensics and Security, 2012, authors' copy: ±1 embedding as a test algorithm, HUGO's threshold weakness, BOSSbase 0.92, detection errors at 0.4 bpp (accessed 17 November 2026)](http://dde.binghamton.edu/kodovsky/pdf/TIFS2012-SRM.pdf)
- [Andrew D. Ker, publications list, University of Oxford: Steganalysis of LSB Matching in Grayscale Images, IEEE Signal Processing Letters 12(6), 2005; square root law papers (accessed 17 November 2026)](https://www.cs.ox.ac.uk/andrew.ker/publications.html)
- [Jessica Fridrich, Miroslav Goljan and Rui Du, Reliable Detection of LSB Steganography in Color and Grayscale Images, 2001, copy hosted by the University of Alaska Fairbanks: palette reduction clusters, the 0.005 bits per pixel bound (accessed 17 November 2026)](https://www.cs.uaf.edu/2015/spring/cs463/lecture/04_06_stego/stego_detection_2001.pdf)
- [Matthew Kwan, The Gifshuffle Home Page: colour map shuffling, 1683 bits in 256 colours, version 2.0 of 21 January 2003, public domain (accessed 17 November 2026)](http://www.darkside.com.au/gifshuffle/)
- [ITU-T, Recommendation T.81 (09/92), Digital compression and coding of continuous-tone still images: approval 18 September 1992, in force (accessed 17 November 2026)](https://www.itu.int/rec/T-REC-T.81-199209-I/en)
- [ITU-T Recommendation T.81, CCITT text published by the W3C: FDCT into 64 coefficients, DC and AC, quantization table and rounding, zig-zag, entropy coding (accessed 17 November 2026)](https://www.w3.org/Graphics/JPEG/itu-t81.pdf)
- [Andreas Westfeld, F5: ein steganographischer Algorithmus, Hohe Kapazität trotz verbesserter Angriffe, Verlässliche IT-Systeme 2001, author's copy: JPEG pipeline, histogram properties, JSteg code and 12.8% capacity, F3, F4, F5, shrinkage, straddling, matrix encoding formulas and table, 217-byte example (accessed 17 November 2026)](https://www2.htw-dresden.de/~westfeld/publikationen/westfeld.vis01.pdf)
- [Neil F. Johnson and Sushil Jajodia, Steganalysis: The Investigation of Hidden Information, IEEE Information Technology Conference, Syracuse, 1998, course copy at the University at Buffalo: lossy compression renders LSB messages useless (accessed 17 November 2026)](https://www.cse.buffalo.edu/courses/cse725/peter/Johnson_1997.pdf)
- [Niels Provos, Defending Against Statistical Steganalysis, 10th USENIX Security Symposium, August 2001: JPEG redundant bits, RC4 keyed selection, seed search, 50% cap, correcting transform (accessed 17 November 2026)](https://www.usenix.org/legacy/events/sec01/full_papers/provos/provos.pdf)
- [Niels Provos, Outguess 0.2, 12 July 2008 page: description, BSD licence, news including the 2002 attack by Fridrich, Goljan and Hogea (accessed 17 November 2026)](https://www.provos.org/p/outguess/)
- [Niels Provos, Outguess and Stegdetect Downloads, 20 June 2009 page: OutGuess 0.2 of 12 February 2001 (accessed 17 November 2026)](https://www.provos.org/p/outguess-and-stegdetect-downloads/)
- [DDE Lab, Binghamton University, Steganographic Algorithms: implementations, licence terms, the F5 IH 2001 reference and original Java code, page created December 2012 (accessed 17 November 2026)](https://dde.binghamton.edu/download/stego_algorithms)
- [Jessica Fridrich, Miroslav Goljan and Dorin Hogea, Steganalysis of JPEG Images: Breaking the F5 Algorithm, 5th Information Hiding Workshop, 2002, author's copy (accessed 17 November 2026)](http://ws2.binghamton.edu/fridrich/Research/f5.pdf)
- [Tomáš Filler, Jan Judas and Jessica Fridrich, Minimizing Additive Distortion in Steganography Using Syndrome-Trellis Codes, IEEE Transactions on Information Forensics and Security, 2011, authors' copy: Crandall's 1998 essay, Bierbrauer, F5, syndrome coding, Viterbi, linear complexity, wet paper channel, HUGO reference (accessed 17 November 2026)](http://dde.binghamton.edu/filler/pdf/Fill10tifs-stc.pdf)
- [Jessica Fridrich, Tomáš Pevný and Jan Kodovský, Statistically Undetectable JPEG Steganography: Dead Ends, Challenges, and Opportunities, ACM Multimedia and Security Workshop, 2007: nsF5, wet paper codes, 0.05 bpnzAC (accessed 17 November 2026)](http://dde.binghamton.edu/kodovsky/pdf/Fri07-ACM.pdf)
- [Steghide home page: description, formats, features, version 0.5.1 of 15 October 2003, GPL (accessed 17 November 2026)](https://steghide.sourceforge.net/)
- [Stefan Hetzl and Petra Mutzel, A Graph-Theoretic Approach to Steganography, 2005, author's copy: exchanging rather than overwriting, matching, first-order statistics preserved (accessed 17 November 2026)](https://dmg.tuwien.ac.at/hetzl/research/graphstego.pdf)
- [NIST National Vulnerability Database, CVE-2021-27211, published 15 February 2021: steghide 0.5.1's 32-bit seed (accessed 17 November 2026)](https://nvd.nist.gov/vuln/detail/CVE-2021-27211)
- [Vojtěch Holub and Jessica Fridrich, Designing Steganographic Distortion Using Directional Filters, IEEE WIFS, Tenerife, December 2012, authors' copy: WOW, textured regions and clean edges, comparison with HUGO (accessed 17 November 2026)](http://dde.binghamton.edu/vholub/pdf/WIFS12_Designing_Steganographic_Distortion_Using_Directional_Filters.pdf)
- [Jessica Fridrich, Jan Kodovský, Vojtěch Holub and Miroslav Goljan, Breaking HUGO: the Process Discovery, 13th Information Hiding Conference, 2011, authors' copy: HUGO's name, 0.4 bpp payload, change rate about 0.1, seven visually detectable images (accessed 17 November 2026)](http://ws2.binghamton.edu/fridrich/Research/hugobreakers05.pdf)
- [Vojtěch Holub, Jessica Fridrich and Tomáš Denemark, Universal Distortion Function for Steganography in an Arbitrary Domain, EURASIP Journal on Information Security, 2014, authors' copy: UNIWARD, S-, J- and SI-UNIWARD, placement of changes, bpnzAC, simulation at the bound, STC constraint height, Table 1 (accessed 17 November 2026)](http://dde.binghamton.edu/vholub/pdf/EURASIP14_Universal_Distortion_Function_for_Steganography_in_an_Arbitrary_Domain.pdf)
- [Marc Chaumont, Deep Learning in Steganography and Steganalysis from 2015 to 2018, arXiv 1904.01444, version of October 2019: reference to HILL, ICIP 2014 (accessed 17 November 2026)](https://arxiv.org/abs/1904.01444)
- [Jessica Fridrich, publications list, Binghamton University: MiPOD, IEEE TIFS 11(2), 2016 (accessed 17 November 2026)](http://ws2.binghamton.edu/fridrich/publications.html)
- [ALASKA steganalysis challenge site, Troyes University of Technology: ALASKA#2 embedding algorithms, payload by complexity (accessed 17 November 2026)](https://alaska.utt.fr)
- [Yassine Yousfi, Jan Butora, Eugene Khvedchenya and Jessica Fridrich, ImageNet Pre-trained CNNs for JPEG Steganalysis, IEEE WIFS 2020, authors' copy: J-UNIWARD, J-MiPOD and UERD references (accessed 17 November 2026)](http://ws2.binghamton.edu/fridrich/Research/Alaska-2-Revised.pdf)
- [Andrew D. Ker, Tomáš Pevný, Jan Kodovský and Jessica Fridrich, The Square Root Law of Steganographic Capacity, slides, ACM Multimedia and Security Workshop, Oxford, 22 September 2008: Anderson's 1996 remark, results, limits, the wrong measures (accessed 17 November 2026)](http://www.cs.ox.ac.uk/andrew.ker/docs/keretal-acm08-slides.pdf)
- [OpenStego home page, Samir Vaidya: data hiding and watermarking (beta) (accessed 17 November 2026)](https://www.openstego.com/)
- [Anderson Rocha and Siome Goldenstein, Steganography and Steganalysis in Digital Multimedia: Hype or Hallelujah?, Revista de Informática Teórica e Aplicada 15(1), 2008, pages 83 to 110 (accessed 17 November 2026)](https://seer.ufrgs.br/index.php/rita/article/view/rita_v15_n1_p83-110)
- [NIST, Special Publication 800-53 Revision 5, Security and Privacy Controls for Information Systems and Organizations, September 2020: SC-7(10), SI-4(18), AC-4(25) (accessed 17 November 2026)](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf)
