Skip to content

marcusfrdk/simple-image-encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Encoder

Embed strings or entire files in a image. All without noticing a difference in the image.

Note: This is NOT meant for encryption, all data is CLEARTEXT and fully visible for anyone who checks the source code of the image.

Requirements

I have only used Python 3.9 with standard libraries. It should work for any Python 3.X version running Windows, MacOS or Linux.

Installation

Git

git clone https://github.com/marcusfrdk/image-encoder.git

Manual Download

How to download the repository

How to use

Encode

python encode.py path data
  • data - if the string is equal to a path where a jpg, jpeg or png file exists. It will read the file and encode this as the data. Otherwise it will take whatever string you supply.

Decode

python decode.py path

Example

Encoding strings

python encode.py example.jpg "Hello World"
# Encoding string...

Encoding files

python encode.py example.jpg example.txt
# Encoding file...

Decoding files

python decode.py example-encoded.jpg

Flags

Encode

Flag  Description  Required Type
path The path to the source image.  Yes path
data The data to be encoded, can be a path or a string.  Yes path or string 
-n, --name Set the output file's name.  No string

Decode

Flag  Description  Required  Type
path The path to the image Yes path
-a, --all Output the entire message No boolean
-t, --time Outputs the time it was encoded No boolean
-b, --build Rebuilds an encoded file No boolean
-re, --remove-encoding Removed the encoded data from a file No boolean

FAQ

What can this be used for?

Encoding files with data (steganography) can be used for many things, but it is primarily used for hiding messages. Allowing only people who know how to decode it to read the message.

How does it work?

Steganography can be done in many ways, but this implementation simply appends the message after the "FF D9" hex code, which is the official end to any image file. Meaning the image won't be affected.

Can I contribute code?

Of course! I would be more than happy if you would do that.

Todo

  • Encrypt the encoded messages
  • Add a simple local webserver people can use instead of the terminal.
  • Containerize functions and simplify functionality.
  • Unit testing among other tests
  • Support more file types, such as audio, video and text files.

Notes

  • I've only tested this on Linux (Ubuntu 20.04) and MacOS (Big sur). It might not work fully as expected on Windows. I will test this as soon as possible.
  • This project is only for fun and should never be used in production or mission critical projects.

Credits

Example image

Photo by Marius Tandberg on Unsplash

Inspiration

I got inspiration to do this project thanks to NeuralNine.

About

Encode strings or files in images.

Resources

Stars

Watchers

Forks

Languages