Skip to content

AuthMark is a prototype for cryptographically verifiable image watermarking. It combines SHA-256 metadata hashing with DCT embedding, offering a Flask web UI and REST API. The system includes robustness testing and PSNR/SSIM evaluation to assess imperceptibility and resilience.

License

Notifications You must be signed in to change notification settings

pottsie283/AuthMark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

40 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” AuthMark: Cryptographically Verifiable Image Watermarking

Securing digital authenticity one pixel at a time ๐Ÿ–ผ๏ธโœจ

Ever wondered if that stunning image online is authentic or AI-generated? AuthMark solves this by embedding cryptographically verifiable watermarks directly into images using advanced DCT (Discrete Cosine Transform) techniques. It's like a digital fingerprint that's nearly impossible to forge! ๐Ÿ•ต๏ธโ€โ™‚๏ธ

๐Ÿš€ What Makes AuthMark Special?

๐Ÿ”’ Cryptographic Security

  • Ed25519 Digital Signatures: Each watermark is cryptographically signed and verifiable
  • Tamper Detection: Know instantly if an image has been modified
  • Non-repudiation: Prove the authenticity of your images beyond doubt

โšก Lightning Fast Performance

  • Multi-core Processing: Leverages all your CPU cores for blazing speed
  • Optimized AI Detection: ~0.2s average processing time with smart fallbacks
  • Smart Memory Management: Handles large images without breaking a sweat

๐Ÿ›ก๏ธ Robust Against Attacks

  • JPEG Compression: Survives quality reduction and re-encoding
  • Geometric Transforms: Resistant to cropping, rotation, and scaling
  • Noise Attacks: Maintains integrity through various image manipulations

๐Ÿค– Advanced AI Detection System

  • Hierarchical Detection: DMimage โ†’ Lightweight โ†’ Statistical fallback
  • Smart Model Management: Auto-detects model reliability and falls back gracefully
  • Specialised Models: DMimageDetection for diffusion models, lightweight for general detection
  • Real-time Processing: ~0.2s per image with intelligent caching

๐ŸŽฏ Quick Start

Installation

# Clone the magic โœจ
git clone https://github.com/pottsie283/authmark.git
cd authmark/watermarking

# Set up your environment ๐Ÿ 
python -m venv AuthVenv
source AuthVenv/bin/activate  # On Windows: AuthVenv\Scripts\activate

# Install dependencies ๐Ÿ“ฆ
pip install -r requirements.txt

Launch the Application

# Start the Flask server ๐Ÿš€
flask --app app.py run

# Visit the web interface ๐ŸŒ
# http://localhost:5000/

๐Ÿ’ก Usage Examples

๐Ÿ–ฅ๏ธ Web Interface (Easiest Way)

  1. Upload & Watermark: Drop your image, enter your private key, and get a cryptographically signed watermarked image
  2. Verify Authenticity: Upload any image to check if it contains a valid watermark
  3. Robustness Testing: See how your watermarks survive various attacks
  4. A/B Study: Test your ability to distinguish watermarked vs. original images

๐Ÿ”Œ API Usage (For Developers)

Performance Monitoring:

# Check system performance ๐Ÿ“Š
curl http://localhost:5000/api/performance/stats

# Thread pool utilisation ๐Ÿงต
curl http://localhost:5000/api/threadpool/stats

๐Ÿ”‘ Key Generation

from core.crypto_utils import generate_key_pair

# Generate your cryptographic keys ๐Ÿ—๏ธ
private_key_pem, public_key_pem = generate_key_pair()
print("Your keys are ready! ๐ŸŽ‰")

๐Ÿ—๏ธ Architecture Overview

AuthMark/
โ”œโ”€โ”€ ๐ŸŒ Web Interface (Flask + HTML/CSS/JS)
โ”œโ”€โ”€ ๐Ÿ”Œ REST API (Flask-RESTX with Swagger docs)
โ”œโ”€โ”€ ๐Ÿ” Core Engine
โ”‚   โ”œโ”€โ”€ DCT Watermarking (Frequency domain embedding)
โ”‚   โ”œโ”€โ”€ Cryptographic Binding (RSA signatures)
โ”‚   โ”œโ”€โ”€ AI Anomaly Detection (Multi-method analysis)
โ”‚   โ””โ”€โ”€ Robustness Testing (Attack simulation)
โ”œโ”€โ”€ โšก Performance Layer
โ”‚   โ”œโ”€โ”€ Multi-core Processing
โ”‚   โ”œโ”€โ”€ Thread Pool Management
โ”‚   โ””โ”€โ”€ Real-time Monitoring
โ””โ”€โ”€ ๐Ÿงช Testing & Evaluation Suite

๐ŸŽฎ Interactive Features

๐Ÿ”ฌ Robustness Laboratory

Test your watermarks against real-world scenarios:

  • JPEG Compression (different quality levels)
  • Geometric Attacks (rotation, scaling, cropping)
  • Noise Injection (Gaussian, salt & pepper)

๐Ÿง  A/B Perceptual Study

Challenge yourself:

  • Can you spot the watermarked image?
  • 10 randomised questions
  • Detailed performance metrics
  • Perfect for research and validation

๐Ÿ“Š Performance Dashboard

Monitor everything in real-time:

  • Processing speeds and bottlenecks
  • Memory usage optimisation
  • Thread pool utilisation
  • Success/failure rates

๐ŸŽฏ Key Features

โœ… Invisible Watermarks: Imperceptible to human eyes (high PSNR/SSIM)
โœ… Cryptographic Verification: RSA-2048 digital signatures
โœ… Multi-format Support: JPEG, PNG, and more
โœ… Batch Processing: Handle multiple images efficiently
โœ… Attack Simulation: Built-in robustness testing
โœ… Advanced AI Detection: Hierarchical detection with smart fallbacks
โœ… Performance Monitoring: Real-time metrics and optimization
โœ… RESTful API: Easy integration with other systems
โœ… Interactive Web UI: No command-line expertise required

โš ๏ธ Important Limitations

๐Ÿšซ Video Support: Currently image-only (video watermarking is future work)
๐Ÿšซ Key Management: In-memory only for demo purposes
๐Ÿšซ GPS Data: Sensitive EXIF fields are excluded for privacy
๐Ÿšซ Extreme Attacks: Some aggressive modifications may break watermarks
๐Ÿšซ Real-time Video: Not optimised for live video streams

๐Ÿ“‹ What's Not Included

  • Production Key Storage: Use proper HSMs or key management services
  • User Authentication: Basic demo authentication only
  • Cloud Deployment: Configured for local development
  • Commercial Licensing: Research/educational use focused

๐Ÿ”ฌ Research Applications

Perfect for:

  • Digital Forensics: Prove image authenticity in investigations
  • Copyright Protection: Protect your creative works
  • Academic Research: Study watermarking robustness and perceptual quality
  • AI Detection Studies: Research synthetic media identification
  • Performance Analysis: Benchmark cryptographic watermarking systems

๐Ÿ† Performance Benchmarks

Operation Time Details
AI Detection (DMimage) ~0.1s Specialized diffusion model detection
AI Detection (Lightweight) ~0.2s General AI content detection
AI Detection (Statistical) ~0.05s Fallback analysis when models unavailable
Watermark Embedding ~2-5s Multi-core DCT processing
Watermark Verification ~1-3s Optimized extraction

๐ŸŽฏ Detection Accuracy

  • Synthetic Images: 100% detection rate (DMimage model)
  • Authentic Images: 60% correct classification (lightweight model)
  • Smart Fallback: Automatic model reliability detection

๐Ÿค Contributing

I'd love your help! Whether you're:

  • ๐Ÿ› Finding bugs
  • ๐Ÿ’ก Suggesting features
  • ๐Ÿ“– Improving documentation
  • ๐Ÿงช Adding test cases
  • โšก Optimising performance

Check out the issues page and join the conversation!

๐Ÿ“œ License

MIT License - see LICENSE for details. Feel free to use this in your research, but please cite our work! ๐Ÿ™

๐ŸŽ“ Academic Context

This system was developed as part of advanced cryptographic research into verifiable digital media authenticity. It demonstrates practical applications of:

  • Frequency-domain watermarking techniques
  • Cryptographic binding and non-repudiation
  • Multi-core optimisation strategies
  • Hierarchical AI detection systems
  • Perceptual quality assessment

๐ŸŒŸ Star This Repo

If AuthMark helped you secure digital authenticity or advance your research, please give it a star! โญ It helps others discover this tool and motivates continued development.


Built with โค๏ธ for digital authenticity and security

"In a world of deepfakes and digital deception, AuthMark stands as a beacon of verifiable truth." ๐Ÿ”โœจ

About

AuthMark is a prototype for cryptographically verifiable image watermarking. It combines SHA-256 metadata hashing with DCT embedding, offering a Flask web UI and REST API. The system includes robustness testing and PSNR/SSIM evaluation to assess imperceptibility and resilience.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published