Stego PNG
Hiding a Data File
  1. Select file format and operation
  2. Specify the data file to be hidden
  3. Specify input image file in which to hide the data
  4. Specify output image file containing the hidden data
  5. Enter stego/encryption key
  6. Hide the data


a.  Select file format and operation

We use here the example of hiding a text file in a PNG image file, although the file to be hidden need not be a text file, it can be of any type. The text file is mckenna.txt, of size 30 KB, and the image file is dome.png, of size 429 KB. These two files are contained in the file original_image_files.zip (2332 KB) which can be downloaded from this website and used with the trial version of this program. (Seven more PNG images, suitable for hiding data, are in the file more_suitable_png_images.zip, 1235 KB.)

The procedure for hiding a data file in a BMP file is (after selecting 'BMP') exactly the same.


b.  Specify the data file to be hidden

After selecting the file format and the operation (encrypt and hide) you have to do the following before hiding the data:

  1. Locate the data file which is to be hidden.
  2. Select an image file within which to hide the data.
  3. Specify an image file (whether or not already existing) which will be the stego file (the file containing the hidden data).
  4. Specify the stego key.

To specify the data file click on the "File with data to be hidden" button and select it in the usual way.


c.  Specify input image file in which to hide the data

To specify the input image click on the "Original (input) PNG [or BMP] file" button and select the file in the usual way.

The data is not hidden in the input image file itself, but rather in a copy of it, so the original image file is unchanged.

Not all PNG and BMP files are suitable for use by this program. Stego PNG detects whether an input image file is suitable and if not then you are informed.

It is not possible to say exactly how many bytes of an image file are required to hide a given data file because (i) sections of the data file are compressed (if possible) before being hidden in the image files and (ii) not all bytes in the image files are used to store bits from the data file (the bytes in the image files used for this purpose are selected randomly). Stego PNG tries to judge whether the input image file is large enough to hide the data. It may happen that it will decide that it is large enough (or possibly large enough), but find otherwise when it attempts to hide the file (in which case an error message results).


d.  Specify output image file containing the hidden data

To specify the output image click on the "Stego (ouput) PNG [or BMP] file" button and select the file in the usual way.

The output file may be in the same folder as the input file, but the input and output files must be different. They can have the same file names if they are in different folders (as in this example).


e.  Enter stego/encryption key

Clicking on "Specify key" brings up a window which allows you to enter a stego key:

stego key

The stego key is any string of typeable characters from 16 to 64 characters in length. Spaces are ignored and no distinction is made between upper and lower case.

The checksum is an error-avoidance device. If you enter a particular stego key often then you will become familiar with the checksum for that key, and if you make a typing error it will be revealed as a difference in the checksum value, allowing you to correct your error.


f.  Hide the data

hide-the-data button Click on the "Hide the data" button to perform the operation (which takes just a few seconds).

If the input image file is unsuitable, or not large enough to hold the data, or some other error occurs, then a message box will appear with an error message. Otherwise success is reported:

Operation: Hide data
Data file: D:\temp\stpng_test\data_files\mckenna.txt
Data file size: 29,869 bytes
Original image file: D:\temp\stpng_test\png_files\dome.png
Original image file size: 438,499 bytes
Stego image file: D:\temp\stpng_test\stego_png_files\dome.png
Stego image file size: 383,623 bytes
The data file was successfully hidden in the PNG image file.

If the stego image is examined in a graphics file viewer it will appear exactly the same as the original image file, as shown below:

Original PNG file   Stego file
(A copy of the original file
with the data file hidden in it.)
 

However the size of the stego file (in this case, 375 KB) is usually significantly different from the size of the original file (in this case, 429 KB).

If BMP files are used then the size of the stego file is the same as the size of the original file. When PNG files are used the original file and the stego file are usually of different sizes (the stego file may be smaller or larger), so it is not possible for someone who has both the original file and the stego file to do a byte-by-byte comparison to determine which bytes of the original file had a bit from the data file added. Thus using PNG files rather than BMP files increases security.

After hiding the data file it is advisable (if maximum security is required) to delete (or preferably delete securely, using Data Destroyer) the original file (unless you wish to re-use it).

Stego PNG Main Page Hermetic Systems Home Page