Skip to content

Latest commit

Β 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Έ Image-Steganography-CLI-Tool πŸ”

A Python-based Image Steganography Command Line Tool that allows you to encrypt a secret message and embed it inside an image (PNG) using LSB steganography, and later extract & decrypt it securely using a password. This CLI tool is built for terminal users, automation, and security-focused experimentation, combining strong cryptography with invisible data hiding.


🧱 Project Structure

Image-Steganography-CLI-Tool/
β”‚
β”œβ”€β”€ assets/             # Screenshots
β”œβ”€β”€ main.py             # Basic CLI application
β”œβ”€β”€ interactive.py      # Rich CLI Version
β”œβ”€β”€ requirements.txt    # Project Dependancies
└── README.md           # Project documentation

✨ Features

πŸ” Encryption & Embedding

  • Encrypts message using Fernet (AES-128 encryption)
  • Derives key from password using PBKDF2-HMAC (SHA256)
  • Embeds encrypted payload into WAV audio using LSB (Least Significant Bit)
  • Supports:
    • Direct text input
    • Message from file

πŸ”“ Extraction & Decryption

  • Extracts embedded payload from WAV
  • Uses stored salt to regenerate the Fernet key
  • Decrypts message securely
  • Outputs decrypted message to:
    • Terminal or
    • File

🎨 Rich CLI Interface

  • Colored terminal output
  • Structured key display tables
  • Styled panels for encoding/decoding results
  • Better user experience and readability

⚑ Dual Mode Support

  • 🧼 Basic CLI β†’ Lightweight, no dependencies
  • 🎨 Rich CLI β†’ Enhanced UI with colors and panels

πŸ›  Technologies Used

Technology Purpose
Python 3 Core language
argparse CLI argument parsing
Pillow (PIL) Image processing
cryptography (Fernet + PBKDF2HMAC) Secure encryption
LSB Steganography Data hiding technique
struct / secrets / base64 Payload & cryptographic helpers
Rich Interactive CLI interface

▢️ How to Run

1️⃣ Clone the repository

git clone https://github.com/ShakalBhau0001/Image-Steganography-CLI-Tool.git

2️⃣ Enter the project directory

cd Image-Steganography-CLI-Tool

3️⃣ Install Dependencies

pip install rich cryptography pillow

OR

pip install -r requirements.txt

4️⃣ Running the Project

Basic CLI Version

python main.py

Rich Interactive Version

python interactive.py

▢️ Usage

πŸ” Encrypt & Embed

1. Text Encrypt & Embed

python main.py encrypt --in-image cover.png --out-image stego.png --password mypass --message "secret"
python main.py encrypt --in-image inputfile.png --out-image outputfile.png --password yourpassword --message "Enter Your Secret Message"

2. Text File Encrypt & Embed

python main.py encrypt --in-image cover.png --out-image stego.png --password mypass --message-file secret.txt
python main.py encrypt --in-image inputfile.png --out-image outputfile.png --password yourpassword --message-file Add Your Secret txt file

πŸ”“ Decrypt & Extract

1. Text Decrypt & Extract

python main.py decrypt --in-image stego.png --password mypass
python main.py decrypt --in-image outputfile.png --password yourpassword

2. Text File Decrypt & Extract

python main.py decrypt --in-image stego.png --password mypass123 --out-file output.txt
python main.py decrypt --in-image outputfile.png --password yourpassword --out-file filename.txt

πŸ“ Supported Formats

  • Input Image: PNG / RGB or RGBA images
  • Output Image: PNG (RGBA)
  • Message Type:
    • UTF-8 text
    • Binary files (via --message-file)

⚠️ Payload size depends on image resolution. Small images may not support large messages.


βš™οΈ How It Works

1️⃣ Key Derivation

  • Password β†’ PBKDF2-HMAC(SHA256, 390k iterations) β†’ 32-byte key β†’ Fernet key

2️⃣ Encryption

  • Message encrypted using Fernet
  • Payload format:
    [STEG][16-byte salt][4-byte length][encrypted data]

3️⃣ Embedding

  • Each bit of payload embedded into:

    • LSB of R, G, B channels
  • Alpha channel remains untouched

  • Image visually unchanged

4️⃣ Extraction

  • Reads LSB bits
  • Reconstructs payload
  • Validates MAGIC header
  • Regenerates key from password + salt
  • Decrypts message

⚠️ Common Errors

  • Wrong password β†’ Fernet Decryption fails
  • Wrong image β†’ MAGIC header not found
  • Small image β†’ Payload too large
  • Corrupted stego image β†’ Payload integrity error

🌟 Future Enhancements

  • Auto capacity detection before embedding
  • Progress indicator for large images
  • Support for JPEG (with DCT-based steganography)
  • Multi-file embedding
  • Optional compression before encryption

πŸ“¦ Extended Version

This repository focuses on a specific steganography technique implemented as a command-line (CLI) learning project.

The goal of this project is to:

  • Understand how steganography works at a practical level
  • Experiment with data hiding techniques
  • Learn how CLI-based security tools are structured

For a more advanced and combined implementation that includes:

  • Image steganography
  • Audio steganography
  • File encryption support

please refer to:

πŸ”— StegaVault-CLI


⚠️ Disclaimer

This project is intended for educational and research purposes only.

It is not designed for real-world secure communication. Steganography alone does not guarantee secrecy and should not be considered a replacement for proper cryptographic security.


πŸ“Έ Preview

1. Encryption

Rich CLI Preview

2. Decryption

Rich CLI Preview

3. Info

Rich CLI Preview

4. Exit

Rich CLI Preview


πŸͺͺ Author

Creator: Shakal Bhau

GitHub: ShakalBhau0001


⭐ Support

If you like this project, consider giving it a ⭐ on GitHub!


About

A Python command-line image steganography tool that encrypts messages with Fernet and hides them inside PNG images using LSB techniques. Built as a CLI-focused learning project for experimenting with password-based key derivation, encryption, and practical data hiding via terminal automation.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages