Skip to content

prashantrahul141/image-secret-text-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hide Secret text in PNG Images.

Hide text in an ordinary looking png image, written in pure c without any external libraries. Supports PNG format images. Do read the PNG Specification (here) before trying to understand how it works.

Usage

Storing Text in PNG Images using C.
File format supported : PNG.
Arguments:
    - f : filename. takes <file path> as paramter.
    - e : Encode text from the given file.
    - d : Decode text in the given file.
    - t : Text which will be encoded in the image. takes <text> as paramters.
  1. Encoding text in a png image.
main -f demo.png -e -t 'this text will get encoded'
>> FILENAME : demo.png
>> ENCODING MODE.
>> DATA TO BE ENCODED IN THE IMAGE : this text will get encoded (26 bytes).
>> ENCODING SECRET CHUNK.
>> ENCODING COMPLETE.
>> Total duration it took: 0.001000ms

This will result a image named output.png with the text you provided encoded in it.

  1. Decoding text from an image.
main -f output.png -d
>> FILENAME : output.png
>> DECODING MODE.
>> DECODED TEXT : this text will get encoded

This will decode the text from the given image.

Building from source

gcc main.c -o main -O3

You can use any compiler of your choice. also you can #define DEBUG to enable debug statements.