Skip to main content

New : Cipher Breaker, the codebreaking assistant, is now on Android Discover

▮ CipherChronicle

Image methods Image file

PNG private chunk

The PNG format was designed to be extensible: any application may add its own chunks, and every reader must politely ignore those it does not know. That politeness makes a hiding place.

How does a private chunk work?

Each PNG chunk carries a four-letter type whose letter case has a meaning:

Letter Lowercase means
1st ancillary chunk: a reader may ignore it
2nd private chunk: outside the standard, application-specific
3rd reserved, always uppercase
4th safe to copy by an editor that does not understand it

A type such as ciPh therefore says: “ancillary, private, safe to copy”. A reader that meets it checks its integrity code, then moves on to the next chunk.

Hiding a message means creating such a chunk, storing the text in it and inserting it before IEND. Each chunk ends with a CRC-32 computed over its type and data: it must be computed correctly, or the file is reported as corrupt.

What does a file processed this way look like?

Like the original image, pixel for pixel. Unlike metadata, the message shows up in no properties window: programs only display chunks they know.

What are the weaknesses of the private chunk?

Strengths

  • Image untouched and file perfectly valid.
  • Invisible in common interfaces, properties included.
  • Standard-compliant: this is not a hack, it is an intended use.

Weaknesses

  • Given away by a plain chunk listing. pngcheck -v reports a chunk of unknown type, which draws attention at once.
  • Plain text in the file: strings shows it.
  • Removed by re-saving and by PNG optimisers, which drop non-essential chunks.
  • Removed by platforms that recompress images.

How do you recover a message from a private chunk?

List the chunks with pngcheck -v image.png: the standard types are known (IHDR, PLTE, IDAT, IEND, tEXt, gAMA, pHYs…), any other name is worth opening. A hex editor or a few lines of script then extract its content.

What are the variants?

  • Encrypted or compressed content — the chunk no longer gives its text to strings.
  • Mimicking a standard chunk — store the data in a legitimate but rarely used chunk type, such as a colour profile.
  • Extra IDAT chunks — add compressed data after the end of the pixels, which the decoder ignores.
  • Data after the end — step outside the file structure altogether.

In CipherChronicle

The workbench writes the message into a ciPh chunk placed just before IEND. To decrypt, drop the received file without re-saving it. In a chain, this method comes last when encrypting.