A Python-based tool for hiding and extracting secret messages within image files using steganography. Built for Kali Linux, this tool allows you to embed text data into images and retrieve it without altering the visible appearance of the image.
Steganography is the practice of hiding information within another file, such as an image, without visibly altering it. This tool uses the Least Significant Bit (LSB) technique to embed and extract secret messages in PNG images.
-
Hide Text in an Image:
- The tool takes an input image and a secret message.
- It encodes the message into the least significant bits of the image's pixel data.
- The output is a new image that looks identical to the original but contains the hidden message.
-
Extract Text from an Image:
- The tool reads the least significant bits of the image's pixel data.
- It decodes the hidden message and displays it.
- Kali Linux (or any Linux distribution with Python 3).
- Python 3.x.
- The
Pillow
library (install usingpip
).
- Install Required Libraries:
sudo apt update sudo apt install python3-pip pip3 install pillow
- Clone the Repository:
git clone https://github.com/yourusername/steganography-tool.git cd steganography-tool
- Run the Script:
python3 steganography.py
Usage
- Hide a Secret Message in an Image
python3 steganography.py
Choose the Hide option.
Enter the path to the input image (e.g., input.png).
Enter the secret message you want to hide.
Enter the output image name (e.g., output.png).
The tool will create a new image with the hidden message.
- Extract a Secret Message from an Image:
python3 steganography.py
Choose the Extract option.
Enter the path to the steganographic image (e.g., output.png).
The tool will extract and display the hidden message.
Example Workflow
- Hide a Message:
$ python3 steganography.py Choose an option: 1. Hide a message in an image 2. Extract a message from an image Enter your choice (1 or 2): 1 Enter the input image path: input.png Enter the secret message: This is a secret! Enter the output image name: output.png [*] Message hidden successfully in output.png
- Extract a Message:
$ python3 steganography.py Choose an option: 1. Hide a message in an image 2. Extract a message from an image Enter your choice (1 or 2): 2 Enter the steganographic image path: output.png [*] Extracted message: This is a secret!