Skip to content

dev4hobby/image-steganography

Repository files navigation

Image Steganography

image_out
What you see isn't everything.
This image contains hidden data.

example

Dependency

Python>=3.8.x with pip

numpy==1.21.2
Pillow==8.3.2
fastapi==0.68.1
pydantic==1.8.2
uvicorn==0.15.0
python-multipart==0.0.5

Install

pip install -r requirements.txt

Use as a module

Hide message

converts the input string to binary and replaces the LSB of each pixel

python hide.py

or

python hide.py -in image.png -out output.png -m message.txt

Seek message

Concatenate each LSB in the image to see the hidden string.

python seek.py

or

python seek.py -in output.png

Serve as WebServer (with FastAPI)

can serve steganography module on web server if you want.

uvicorn main:app --host=0.0.0.0 --port=8000

Connect to browser (with Next.js)

can serve steganography webpage if you want

cd steganography-web && yarn && yarn dev

API Document

Automatic docs

Check this out

Appendix

Check setting file

You can check the image path or other required values.

{
  "encoding": "utf8",
  "bits": 8,
  "token_string": "#secret#",
  "message": "./message.txt",
  "in_image": "./image.png",
  "out_image": "./output.png",
  "modified_image": "./output.png"
}