Image methods Image file
Data after the end of the file
An image decoder reads the file up to the end marker, then stops. Whatever comes after is none of its business. So anything can be written there.
How does this method work?
A PNG ends with an IEND chunk, always the same. A JPEG ends with the FF D9 marker (end of image). Any byte placed after it is ignored on display.
- Locate the end of the image: the end of the
IENDchunk. - Append the message, as is.
89 50 4E 47 … 49 45 4E 44 AE 42 60 82 | m e e t a t …
└──────────── image ───────────────────┘ └── appended ──┘ To read the message, find the end of the image and take everything after it.
What does a file processed this way look like?
Like the original image: the pixels and the file structure do not change. The file is just longer. Most programs open it without complaint.
What are the weaknesses of this method?
Strengths
- The simplest of all: a concatenation. In a terminal:
cat image.png secret.txt > result.png. - Image untouched.
- No size limit: a whole file can be appended.
Weaknesses
- Visible in a text editor. The message sits in the clear at the end of the file.
- Given away by size: a file much heavier than the image warrants raises suspicion.
- Flagged by analysis tools:
pngcheckwarns about extra data afterIEND, andbinwalkdetects appended files. - Removed by any re-save and by platforms that recompress.
How do you recover data after the end?
Look at the end of the file: tail -c 200 image.png, strings image.png | tail, or a hex editor. If the file does not end with the bytes 49 45 4E 44 AE 42 60 82, something was appended. binwalk also identifies what follows (archive, another image, text).
What are the variants?
- Appended file — stick an archive, another image or a document instead of text.
- Image + ZIP polyglot — append a ZIP archive: the same file then opens both ways.
- Encrypted content — append encrypted bytes that no longer give their meaning away.
- Before the start — some formats also tolerate data before their header; PNG does not.
In CipherChronicle
The workbench appends the text, in UTF-8, right after the IEND chunk. To decrypt, drop the received file as is: the page reads what follows the end of the image. In a chain, this method comes last when encrypting.