https://github.com/khevamann/text-embed
A fun project I did that encodes a string or text file in an image
https://github.com/khevamann/text-embed
encoder-decoder image-encoder python3
Last synced: 11 months ago
JSON representation
A fun project I did that encodes a string or text file in an image
- Host: GitHub
- URL: https://github.com/khevamann/text-embed
- Owner: khevamann
- Created: 2020-02-21T21:50:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-03T22:37:03.000Z (about 6 years ago)
- Last Synced: 2025-06-18T05:46:18.727Z (12 months ago)
- Topics: encoder-decoder, image-encoder, python3
- Language: Python
- Homepage:
- Size: 5.35 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Text Encoder
I created this project, because I was learning about PPM files and how they store each pixel value in an array. I thought it would be cool to alter a file to hide information in a picture. This is a clever way to communicate secretly online. Since this program has a unique way of running, the only way to decode the image is to run it through the same program that encoded it.
## Planned Features
- Allow for multiple file formats (PNG, JPEG...)
- Allow custom offsets to make the encoding more secure
## Getting started
```shell script
git clone https://github.com/khevamann/text-embed.git
cd text-embed
# To encode a file
python3 embed_string.py
# To decode a file
python3 embed_string.py
```
### Here is a sample run
Running the below script will encode the text file sample.txt into the image sample.ppm. The images below show the before and after. As you can see it is hard to notice the encoded string.
```shell script
python3 embed_string.py sample.ppm sample.txt
```
Without String | With String Encoded
:-------------------------:|:-------------------------:
 | 
> If you zoom in really close on the right image you can see the pixels that are altered with text. You will see some pixels that are clearly not the right color. However this is very hard to notice if not looking for it. To make it even more discrete you can use a larger image.