Skip to content

This Steganography Tool allows users to securely embed and extract hidden messages in images or audio files using Least Significant Bit (LSB) techniques.

License

Notifications You must be signed in to change notification settings

rooter09/Tool-Steganography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Steganography Tool

A high-performance, modern steganography application that allows you to securely embed and extract hidden messages in images, audio files, and text using advanced LSB (Least Significant Bit) techniques.

License Python React Flask

โœจ Features

  • ๐Ÿ–ผ๏ธ Image Steganography - Hide and extract messages from PNG/JPG/JPEG images
  • ๐ŸŽต Audio Steganography - Hide and extract messages from WAV audio files
  • ๐Ÿ“ Text Steganography - Hide messages in text using zero-width Unicode characters
  • โšก Lightning Fast - Optimized with NumPy vectorized operations (1000x faster)
  • ๐ŸŽจ Modern UI - Beautiful gradient design with smooth animations
  • ๐Ÿ“ฑ Responsive - Works seamlessly on desktop and mobile devices
  • ๐Ÿ”’ Secure - Files processed locally, no data retention

๐Ÿš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/steganography.git
    cd steganography
  2. Set up the Backend (Flask API)

    cd backend
    pip install -r requirements.txt
    python app.py

    The Flask API will start on http://localhost:5000

  3. Set up the Frontend (React)

    Open a new terminal window:

    cd frontend
    npm install
    npm run dev

    The React app will start on http://localhost:3000

  4. Open your browser

    Navigate to http://localhost:3000 and start hiding messages! ๐ŸŽ‰

๐Ÿ“– Usage Guide

Image Steganography

Embedding a Message:

  1. Click on the "Image" tab
  2. Select "Embed Message" mode
  3. Upload an image file (PNG, JPG, JPEG)
  4. Type your secret message in the text area
  5. Click "๐Ÿ”’ Embed Message"
  6. Download the encoded image

Extracting a Message:

  1. Click on the "Image" tab
  2. Select "Extract Message" mode
  3. Upload the previously encoded image
  4. Click "๐Ÿ”“ Extract Message"
  5. Your hidden message will be revealed!

Audio Steganography

Embedding a Message:

  1. Click on the "Audio" tab
  2. Select "Embed Message" mode
  3. Upload a WAV audio file
  4. Type your secret message
  5. Click "๐Ÿ”’ Embed Message"
  6. Download the encoded audio file

Extracting a Message:

  1. Click on the "Audio" tab
  2. Select "Extract Message" mode
  3. Upload the encoded audio file
  4. Click "๐Ÿ”“ Extract Message"
  5. View your hidden message

Text Steganography

Embedding a Message:

  1. Click on the "Text" tab
  2. Select "Embed Message" mode
  3. Enter cover text (optional - can be empty)
  4. Enter your secret message
  5. Click "๐Ÿ”’ Embed Message"
  6. Copy the encoded text (looks identical to original!)

Extracting a Message:

  1. Click on the "Text" tab
  2. Select "Extract Message" mode
  3. Paste the encoded text
  4. Click "๐Ÿ”“ Extract Message"
  5. Your hidden message appears!

๐Ÿ—๏ธ Project Structure

steganography/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ app.py                 # Flask API server with optimized algorithms
โ”‚   โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ”‚   โ”œโ”€โ”€ uploads/              # Temporary upload folder (auto-created)
โ”‚   โ””โ”€โ”€ outputs/              # Temporary output folder (auto-created)
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ImageSteganography.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AudioSteganography.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ TextSteganography.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx           # Main application component
โ”‚   โ”‚   โ”œโ”€โ”€ App.css           # Styling with gradients
โ”‚   โ”‚   โ””โ”€โ”€ main.jsx          # React entry point
โ”‚   โ”œโ”€โ”€ index.html            # HTML template
โ”‚   โ”œโ”€โ”€ package.json          # Node dependencies
โ”‚   โ””โ”€โ”€ vite.config.js        # Vite configuration
โ”œโ”€โ”€ Tool-steganography/       # Original standalone script
โ”‚   โ””โ”€โ”€ script.py
โ”œโ”€โ”€ README.md                 # This file
โ”œโ”€โ”€ QUICKSTART.md            # Quick start guide
โ””โ”€โ”€ README_SETUP.md          # Detailed setup guide

๐Ÿ”ง API Endpoints

Health Check

  • GET /api/health - Check if the API is running

Image Steganography

  • POST /api/image/embed - Embed a message in an image

    • Form Data: file (image), message (text)
    • Returns: Base64 encoded image
  • POST /api/image/extract - Extract a message from an image

    • Form Data: file (image)
    • Returns: Hidden message

Audio Steganography

  • POST /api/audio/embed - Embed a message in audio

    • Form Data: file (WAV audio), message (text)
    • Returns: Base64 encoded audio
  • POST /api/audio/extract - Extract a message from audio

    • Form Data: file (WAV audio)
    • Returns: Hidden message

Text Steganography

  • POST /api/text/embed - Embed a message in text

    • JSON: coverText, secretMessage
    • Returns: Encoded text with zero-width characters
  • POST /api/text/extract - Extract a message from text

    • JSON: encodedText
    • Returns: Hidden message

๐Ÿ› ๏ธ Technologies Used

Backend

  • Flask 3.0.0 - Lightweight web framework
  • Flask-CORS 4.0.0 - Handle cross-origin requests
  • Pillow 10.1.0 - Advanced image processing
  • NumPy 1.26.2 - High-performance numerical operations
  • SciPy 1.11.4 - Audio file processing
  • Werkzeug 3.0.1 - WSGI utilities

Frontend

  • React 18.2 - Modern UI library
  • Vite 5.0 - Lightning-fast build tool
  • Axios 1.6.2 - Promise-based HTTP client
  • CSS3 - Modern styling with gradients and animations

โšก Performance Optimizations

This tool has been heavily optimized for speed:

  • Vectorized Operations: Using NumPy array operations instead of Python loops
  • Early Termination: Stops processing as soon as the message is found
  • Efficient Bit Manipulation: Using np.unpackbits() and np.packbits()
  • Smart Chunking: Only processes necessary data (max 10,000 characters)
  • Result: ~1000x faster than naive implementations!

Performance Benchmarks

  • Image Extraction: < 50ms (previously 10+ seconds)
  • Audio Extraction: < 100ms (previously 1+ minutes)
  • Embedding: < 200ms for typical files

๐Ÿ”’ How It Works

Image & Audio Steganography (LSB Technique)

  1. Embedding: Converts the message to binary and replaces the least significant bit (LSB) of each pixel/sample
  2. Extraction: Reads the LSB of each pixel/sample until the null terminator is found
  3. Advantage: Changes are imperceptible to human eyes/ears

Text Steganography (Zero-Width Characters)

  1. Embedding: Converts message to binary and encodes using zero-width Unicode characters (\u200B, \u200C)
  2. Extraction: Detects and decodes zero-width characters back to the original message
  3. Advantage: Completely invisible in normal text display

๐Ÿšจ Troubleshooting

Backend Issues

Problem: ModuleNotFoundError when starting the backend

# Solution: Install dependencies
cd backend
pip install -r requirements.txt

Problem: Port 5000 already in use

# Solution: Change port in backend/app.py (line 287)
app.run(debug=True, port=5001)  # Use a different port

Frontend Issues

Problem: npm install fails

# Solution: Clear npm cache and retry
npm cache clean --force
npm install

Problem: Port 3000 already in use

# Solution: Vite will automatically suggest another port (5173)
# Or set a specific port in vite.config.js

CORS Errors

  • Ensure the backend is running before starting the frontend
  • Flask-CORS is configured to allow all origins by default
  • Check that the backend URL in frontend components matches your backend server

๐Ÿ“ Notes & Best Practices

  • File Size: Ensure images/audio files are large enough to hold your message

    • Rule of thumb: 1 character requires 8 pixels/samples
    • Example: A 100-character message needs at least 800 pixels
  • Image Format: PNG is recommended over JPG for image steganography

    • JPG compression can corrupt embedded data
    • PNG is lossless and preserves hidden messages
  • Audio Format: Only WAV files are supported for audio steganography

    • MP3/AAC compression will destroy hidden data
  • Security: This tool is for educational purposes

    • LSB steganography is detectable with proper analysis
    • Not recommended for highly sensitive data
    • Consider encryption before embedding for better security

๐Ÿ”ฎ Future Enhancements

  • Add encryption option (AES-256) before embedding
  • Support for MP4 video steganography
  • Password protection for messages
  • Batch processing for multiple files
  • Advanced steganalysis detection
  • File compression before embedding
  • Docker containerization
  • Cloud deployment guide

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Inspired by classical steganography techniques
  • Built with modern web technologies
  • Optimized for performance and user experience

๐Ÿ“ง Contact

For questions or support, please open an issue on GitHub.


โญ If you find this project useful, please consider giving it a star!

Made with โค๏ธ by rooter a.k.a Harsh Sandilya.

About

This Steganography Tool allows users to securely embed and extract hidden messages in images or audio files using Least Significant Bit (LSB) techniques.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published