Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StegoVault: Secure Digital Watermarking System

StegoVault is a comprehensive, production-ready web application designed for secure digital image watermarking and copyright protection. It utilizes modern cryptographic techniques (AES-256) combined with advanced image steganography algorithms to invisibly embed ownership information into images, allowing creators to prove ownership even after malicious tampering or compression.

screencapture-127-0-0-1-5000-2026-06-27-20_47_33

🚀 Key Features

The system is built upon a modular 10-component architecture:

  1. User Management: Secure user registration, authentication, and session management using Flask-Login and bcrypt.
  2. Image Upload & Management: Secure file handling, hash generation (SHA-256), and UUID-based storage.
  3. Automated Watermark Generation: Dynamic JSON payloads containing owner names, copyright data, UUIDs, and timestamps.
  4. Military-Grade Encryption: AES-256-CBC encryption of the watermark payload prior to embedding for ultimate confidentiality.
  5. Multi-Algorithm Embedding Engine: Choose between three distinct algorithms depending on your needs:
    • LSB (Least Significant Bit): High capacity and fast, but fragile.
    • DCT (Discrete Cosine Transform): Frequency domain embedding; robust against standard JPEG compression.
    • DWT (Discrete Wavelet Transform): Advanced Haar wavelet transform; highly resilient to scaling, cropping, and noise.
  6. Robust Extraction Engine: Agnostic extraction pipeline with brute-force DWT strength discovery and AES decryption.
  7. Tamper Detection: Pixel-level integrity checking using OpenCV Structural Similarity Index (SSIM) and cryptographic hashing.
  8. Quality Analysis: Automated calculation of image fidelity metrics including PSNR, MSE, and SSIM.
  9. Attack Simulation Suite: Built-in stress testing to simulate real-world attacks (JPEG compression, Gaussian noise, rotation, scaling) on your watermarked images.
  10. PDF Certificate Generation: Automated creation of verifiable PDF ownership certificates using ReportLab.

🛠️ Technology Stack

  • Backend: Python 3, Flask, SQLAlchemy (SQLite)
  • Image Processing: OpenCV (opencv-python-headless), NumPy, Scikit-Image, PyWavelets
  • Cryptography: PyCryptodome (AES-256), bcrypt
  • Frontend: HTML5, Vanilla CSS (Glassmorphism UI), Vanilla JavaScript
  • Reporting: ReportLab (PDF generation)

📁 Project Structure

├── app.py                          # Main Flask application and routing
├── config.py                       # Application configuration variables
├── requirements.txt                # Python dependencies
├── database/
│   ├── init_db.py                  # Database initialization script
│   └── models.py                   # SQLAlchemy ORM models
├── modules/
│   ├── attack_simulation.py        # Image stress-testing logic
│   ├── encryption.py               # AES and RSA cryptographic wrappers
│   ├── extraction.py               # Unified extraction pipeline
│   ├── quality_analysis.py         # PSNR/MSE/SSIM calculations
│   ├── tamper_detection.py         # Integrity verification logic
│   ├── watermark_generator.py      # JSON payload generation
│   └── embedding/
│       ├── lsb.py                  # Spatial domain embedding
│       ├── dct.py                  # Frequency domain block embedding
│       └── dwt.py                  # Wavelet domain embedding
├── static/                         # CSS, JS, and image uploads
├── templates/                      # Jinja2 HTML templates
└── utils/                          # Authentication, file handling, certificates

⚙️ Installation & Setup

  1. Clone the repository (or navigate to the project folder).
  2. Create a virtual environment (Recommended):
    python -m venv venv
    # Windows
    venv\Scripts\activate
    # Linux/Mac
    source venv/bin/activate
  3. Install Dependencies:
    pip install -r requirements.txt
  4. Initialize the Database:
    python database/init_db.py
  5. Run the Application:
    python app.py
  6. Access the Web Interface: Open your browser and navigate to http://127.0.0.1:5000.

📖 Usage Guide

1. Protect an Image

  • Register an account and navigate to the Dashboard.
  • Click Upload New Image and provide your original PNG or JPEG file.
  • Once uploaded, click Protect Image.
  • Input your Copyright details, select your desired algorithm (DCT or DWT recommended for robustness), set the strength, and click Encrypt and Embed.
  • Download the resulting watermarked image.

2. Verify and Detect Tampering

  • Navigate to the Verify tab.
  • Upload any suspect image. The system will automatically attempt to extract and decrypt hidden payloads across all known algorithms.
  • If a watermark is found, the system will compare the suspect image against the original in the database to detect any unauthorized modifications.
  • Click Download Certificate to generate a PDF report of the findings.

3. Simulate Attacks

  • Immediately after embedding a watermark, you will be directed to the Analysis page.
  • Click Run Attack Simulations to subject your watermarked image to compression, noise, rotation, and scaling.
  • The system will report back on whether the watermark survived the attacks, helping you tune your embedding strength for future images.

🔒 Security Notes

This application is configured for a local development environment. If deploying to production:

  • Set a strong, randomly generated SECRET_KEY in config.py.
  • Ensure the UPLOAD_FOLDER paths are secure and properly permissioned.
  • Use a production-ready WSGI server like gunicorn instead of the Flask development server.

About

StegoVault is a secure web application that combines AES-256 encryption and image steganography to invisibly embed, protect, and verify digital image ownership.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages