Skip to content
/ imgarc Public

Encode, hide, and protect binary files in PNG images

License

Notifications You must be signed in to change notification settings

isdampe/imgarc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgarc - Encode, hide and protect binary files in PNG images.

imgarc is a simplistic steganographic encoder/decoder. You can use it to encode, hide and protect and kind of binary file in a PNG image. You can then decode the PNG image to retrieve the original binary file.

While imgarc does use a "password" for encoding and decoding, it does not encrypt data. It is instead used to scramble the order in which your data is stored within the PNG image. If your data is considered sensitive, you should encrypt it before encoding it, and then decrypt it after decoding it.

Requirements

  • libpng, inc. headers
  • gcc
  • MinGW (Windows only)
  • libpng3.dll (Windows only)

Compiling

imgarc has been compiled successfully on macOS, Ubuntu Linux, and Microsoft Windows (all x64).

For macOS / Linux:

cd imgarc/
./build.sh

For Windows:

cd imgarc/
build.bat

Decode the included example

imgarc comes with a PNG image example.png. This PNG image has another binary file encoded inside it that you can decode as an example.

To decode and view the example file:

cd imgarc/
imgarc -d -i example.png -p really_secure_password -v

imgarc usage

cd imgarc/
# Encode src/file_io.c into example.png and store it in output.png
./bin/imgarc -e -i example.png -f src/file_io.c -o output.png -v
# Decode output.png and store the file it contains in /tmp
./bin/imgarc -d -i output.png -o /tmp -v
# Show the file output after decoding.
cat /tmp/file_io.c

The imgarc header and data layout

|-------------------------------------------------------------|
|     size (4 bytes, unsigned)     |     sha1 (20 bytes)      |
|-------------------------------------------------------------|
|     filename (n bytes, terminated by \0)                    |
|-------------------------------------------------------------|
|     binary_data (size - 24 - (strlen(filename) +1)) bytes   |
|     ...                                                     |
|     ...                                                     |
|     ...                                                     |
|-------------------------------------------------------------|

size: uint32_t, size of entire imgarc entry, header + data
sha1: char *, SHA1 hash of binary data, used as checksum
filename: char *, string representing the encoded file, variable length
binary_data: uint8_t[], raw binary data of the file

About

Encode, hide, and protect binary files in PNG images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages