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.
The system is built upon a modular 10-component architecture:
- User Management: Secure user registration, authentication, and session management using
Flask-Loginandbcrypt. - Image Upload & Management: Secure file handling, hash generation (SHA-256), and UUID-based storage.
- Automated Watermark Generation: Dynamic JSON payloads containing owner names, copyright data, UUIDs, and timestamps.
- Military-Grade Encryption: AES-256-CBC encryption of the watermark payload prior to embedding for ultimate confidentiality.
- 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.
- Robust Extraction Engine: Agnostic extraction pipeline with brute-force DWT strength discovery and AES decryption.
- Tamper Detection: Pixel-level integrity checking using OpenCV Structural Similarity Index (SSIM) and cryptographic hashing.
- Quality Analysis: Automated calculation of image fidelity metrics including PSNR, MSE, and SSIM.
- Attack Simulation Suite: Built-in stress testing to simulate real-world attacks (JPEG compression, Gaussian noise, rotation, scaling) on your watermarked images.
- PDF Certificate Generation: Automated creation of verifiable PDF ownership certificates using
ReportLab.
- 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)
├── 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
- Clone the repository (or navigate to the project folder).
- Create a virtual environment (Recommended):
python -m venv venv # Windows venv\Scripts\activate # Linux/Mac source venv/bin/activate
- Install Dependencies:
pip install -r requirements.txt
- Initialize the Database:
python database/init_db.py
- Run the Application:
python app.py
- Access the Web Interface: Open your browser and navigate to http://127.0.0.1:5000.
- 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.
- 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.
- 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.
This application is configured for a local development environment. If deploying to production:
- Set a strong, randomly generated
SECRET_KEYinconfig.py. - Ensure the
UPLOAD_FOLDERpaths are secure and properly permissioned. - Use a production-ready WSGI server like
gunicorninstead of the Flask development server.