StegaPic is a command-line tool for image steganography, using Least Significant Bit (LSB) encoding to hide and extract messages or files in images. It provides a simple and secure way to embed and retrieve hidden data.
- Hide Messages/Text: Embed text messages into an image.
- Hide Files: (Not recommended) Embed files into an image.
- Extract Messages/Text: Retrieve hidden messages from an image.
- Password Protection: Optionally secure your hidden data with a password.
- Python 3.x
- Required Python modules:
colorama
random
os
time
PIL
(Pillow)
-
Clone the repository:
git clone https://github.com/sh1vam-03/LSB-Steganography-StegaPic.git
-
Navigate to the project directory:
cd LSB-Steganography-StegaPic
-
Install the required Python modules:
pip install -r requirements.txt
-
Run the Tool
python StegaPic.py
-
Options Menu
- HIDE DATA: Embed a message or file in an image.
- HIDE MESSAGE/TEXT: Embed a text message.
- HIDE FILE: Embed a file (not recommended).
- EXTRACT DATA: Retrieve a hidden message from an image.
- QUIT & EXIT: Exit the tool.
- HIDE DATA: Embed a message or file in an image.
-
Hiding Data
- Provide the path to the image.
- Optionally enter a password.
- Enter the message you want to hide.
- Specify the name for the output image.
-
Extracting Data
- Provide the path to the image containing the hidden message.
- Optionally enter a password if the file was secured.
- The hidden message will be displayed.
-
Start the Tool
Launch the StegaPic tool from your terminal by navigating to the project directory and running:
python stegapic.py
-
Select the Option to Hide Data
When prompted, choose the option to hide data:
Choose an option from the following: [1] HIDE DATA [2] EXTRACT DATA [0] QUIT & EXIT [+] Choose an Option -> 1
-
Choose to Hide a Message/Text
You’ll be given further options to hide a message or a file. For this example, select to hide a text message:
[*] HIDE DATA <Selected> Choose an option from the following: [1] HIDE MESSAGE/TEXT [2] HIDE FILE (Not Recommended) [0] QUIT & EXIT [+] Choose an Option -> 1
-
Provide Image Path
Enter the path to the image where you want to hide the message. For example:
[+] Image Path -> image.png
The tool will then confirm that the image has been selected and will provide information about the image:
[ALERT] Image Information Image Size: 512x512 Total Pixels: 262144 Based on the image size, you can hide up to 96.0KB data. Approximately 98304.0 characters.
-
Enter a Password (Optional)
If you want to secure your hidden message with a password, you can enter it here. If not, simply press Enter:
[+] Password (Optional) ->
-
Type the Message to Hide
Enter the message you want to hide in the image. For example:
[+] Message Box -> Hi, This is a hidden message.
The tool will confirm that the message has been successfully hidden:
Message Inserted...
-
Specify Output Image Name
Enter a name for the output image. This is the image that will contain the hidden message. For example:
[+] Output Image Name (Optional) -> StegaPic_image.png
The tool will save the image with the hidden message and confirm the success:
Message hidden successfully in the image! Output Image Location: StegaPic_image.png
Extracting a Hidden Message from an Image
-
Start the Tool
Again, start the StegaPic tool from your terminal.
-
Select the Option to Extract Data
Choose the option to extract hidden data:
Choose an option from the following: [1] HIDE DATA [2] EXTRACT DATA [0] QUIT & EXIT [+] Choose an Option -> 2
-
Provide Image Path
Enter the path to the image from which you want to extract the hidden message:
[+] Image Path -> StegaPic_image.png
-
Enter Password (If Applicable)
If the image was secured with a password, enter it here. Otherwise, just press Enter:
[+] Password (Optional) ->
-
Retrieve the Hidden Message
The tool will process the image and display the hidden message:
[\] Please wait! Depending on Image size it takes some time. Your hidden message: Hi, This is a hidden message.
By following these steps, you can easily hide and extract messages in images using StegaPic.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or issues, please contact sh1vam.03.