This Python script allows you to access and modify pixel values of an image while keeping the image header intact. It uses the Pillow
library to manipulate images, for both hiding and extracting the data.
Make sure you have Python installed on your system. You also need the Pillow
and PyQt6
library to run this script.
-
Clone this repository or download the files.
-
Install the required Python packages by running:
pip install -r requirements.txt
-
Run the Python gui program
python stegosaurus.py
-
Interact with the program to hide or extract data
-
Run the Python program to encode the message
python lsb_hide.py [input image] [output image] [message]
input image: the cover image to be modified
output image: the modified stego image (if unspecified, default to output.png)
message: the text to be hidden (either simple string text or the path to a file ending in .txt)
flags can be used as an alternative format, they can appear in any order, and any unflagged input will be matched in the standard order to the needed input
--input-image [input image]
-i [input image]
--output-image [output image]
-o [output image]
--string [message]
-s [message]
--text-file [message]
-t [message]
-f: overwrite the image specified by the [output image]
-
Run the Python program to decode the message
python lsb_extract.py [input image] [output file]
input image: the stego image to decode
output file: the extracted message data
flags can be used as an alternative format, they can appear in any order, and any unflagged input will be matched in the standard order to the needed input
--input [input image]
-i [input image]
--output [output file]
-o [output file]
--print: print the data as text to standard out instead of [output file] (temp.txt will be created then destroyed)
-p: print the data...
-f: overwrite the image specified by the [output file]
-
Run the Python program to check the level of modification to the image
python psnr.py [cover image] [stego image]
stegosaurus.py
: Program to hide/extract data graphicallylsb_hide.py
: Program to hide data in a cover imagelsb_extract.py
: Program to extract data from a stego imagerequirements.txt
: Lists the required Python packages (Pillow
,PyQt
).README.md
: This file.