Spaces:
Sleeping
title: 2PAC Picture Analyzer & Corruption Killer
emoji: π«
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
license: mit
tags:
- steganography
- image-forensics
- security
- computer-vision
- cryptography
π« 2PAC: Picture Analyzer & Corruption Killer
Advanced image security, steganography, and forensic analysis toolkit
"All Eyez On Your Images" ποΈ
Hide secret messages in plain sight, detect hidden data in suspicious images, and validate image integrityβall in one powerful, easy-to-use interface.
π― What Can You Do?
π Hide Secret Data in Images
Invisibly embed text messages inside images using military-grade LSB (Least Significant Bit) steganography:
- Invisible to the Eye: Changes are imperceptibleβmodified images look identical to originals
- High Capacity: Hide hundreds to thousands of characters depending on image size
- Password Protection: Optional AES-256-equivalent encryption for sensitive data
- Adjustable Strength: 1-4 bits per channel (1-2 bits = undetectable, 3-4 bits = maximum capacity)
- Lossless Format: PNG output preserves hidden data perfectly
Use Cases:
- Securely share passwords or private keys through public channels
- Watermark images with ownership information
- Embed metadata that survives image sharing platforms
- Communicate covertly (digital dead drops)
- CTF competitions and security challenges
π Detect & Extract Hidden Data
Advanced steganography detection powered by RAT Finder forensic technology:
Detection Methods:
- π¨ ELA (Error Level Analysis): Highlights compression artifacts and manipulated regions
- π LSB Pattern Analysis: Detects non-random patterns in least significant bits using chi-square tests
- π Histogram Forensics: Identifies statistical anomalies in color distribution
- π Metadata Inspection: Examines EXIF/XMP data for steganography tools
- π File Structure Analysis: Checks for trailing data after image EOF markers
- π¬ Visual Noise Analysis: Detects abnormal channel-specific noise patterns
Extraction:
- Recover Hidden Messages: Extract data hidden using this tool's LSB method
- Password Support: Decrypt password-protected messages
- Adjustable LSB Depth: Try different bit depths (1-4) to recover data
Use Cases:
- Forensic investigation of suspect images
- Counter-intelligence and threat detection
- Academic research in steganography
- Validate if received images contain hidden communications
- Educational demonstrations of steganalysis techniques
π‘οΈ Check Image Integrity & Corruption
Comprehensive image validation and corruption detection:
- Format Support: JPEG, PNG, GIF, TIFF, BMP, WebP, HEIC, AVIF
- Header Validation: Verifies file signatures and structure
- Completeness Checks: Detects truncated or incomplete files
- Visual Corruption Detection: Identifies black regions, gray blocks, and pixel noise
- JPEG Structure Analysis: Validates markers, segments, and EOI
- Adjustable Sensitivity: Low/Medium/High thoroughness levels
Use Cases:
- Validate photo archives before long-term storage
- Check downloaded images for corruption
- Quality control for image processing pipelines
- Detect damaged files in recovered data
- Pre-screen images before importing to databases
π§ͺ How It Works
LSB Steganography Explained
The tool exploits a fundamental property of digital images: the human eye cannot detect 1-2 bit changes in pixel values.
Technical Process:
Bit Extraction: Each RGB pixel has 3 bytes (24 bits). We use the least significant 1-4 bits of each byte.
Original pixel: RGB(156, 89, 201) Binary: 10011100, 01011001, 11001001 β β β These last bits can be modified!Data Encoding: Your text is encrypted (if password provided), then converted to binary and embedded
Checksum Protection: MD5 hash ensures data integrity during extraction
Capacity Calculation:
Capacity = (Width Γ Height Γ 3 channels Γ Bits-per-channel) / 8 Example: 1920Γ1080 image with 2 bits/channel = 1920 Γ 1080 Γ 3 Γ 2 / 8 = 1,555,200 bytes (~1.5 MB!)
Why PNG? JPEG uses lossy compression that destroys LSB data. PNG is lossless and preserves every bit.
Steganography Detection Science
1. Error Level Analysis (ELA)
Re-compresses JPEG images at a known quality level and computes pixel-wise differences:
- Natural images: Uniform error levels
- Manipulated areas: Different error levels (bright spots)
- Hidden data: Can alter compression behavior detectably
2. LSB Statistical Analysis
Performs chi-square tests on bit distributions:
- Natural images: LSBs follow expected distributions
- Embedded data: LSBs become statistically "too random"
3. Histogram Analysis
Analyzes color frequency distributions:
- Natural images: Smooth, continuous gradients
- Steganography: Introduces micro-patterns and color pair artifacts
π Quick Start Guide
π Hiding Data
- Upload a PNG image (JPEG works but won't survive re-saving)
- Enter your secret message
- (Optional) Set a strong password for encryption
- Choose LSB depth:
- 1 bit = Undetectable (best for security)
- 2 bits = Good balance
- 3-4 bits = Maximum capacity
- Download the output PNG
β οΈ Critical: Never edit, crop, or re-save the output image (except as PNG)!
π Detecting Hidden Data
- Upload suspicious image
- Adjust sensitivity (higher = more thorough but more false positives)
- Review confidence score and analysis breakdown
- Check ELA visualization (bright = suspicious)
Confidence Interpretation:
- 70-100% = High suspicion
- 40-69% = Moderate
- 0-39% = Low (likely clean)
π‘οΈ Checking Corruption
- Upload image to validate
- Enable "Visual Corruption Check" for damaged photos
- Adjust sensitivity (Low/Medium/High)
- Review diagnostic results
π Security & Privacy
- β No Server Storage: All processing happens in your browser session
- β No Logging: Images and data are never saved or transmitted
- β Auto-Cleanup: Temporary files deleted immediately after processing
- β Client-Side: Encryption/decryption happens in the Space container
- β Open Source: Full source code available for audit
Encryption Details:
- Password β SHA-256 hash β XOR cipher
- 8-byte MD5 checksum for integrity
- Custom header with magic number for validation
π‘ Pro Tips
For Maximum Stealth:
- Use 1-bit LSB depth (hardest to detect)
- Start with high-resolution images (more bits to work with)
- Use password encryption (adds randomness)
- Share via platforms that don't re-compress
- Embed in photos with complex scenes (harder to analyze)
For Maximum Capacity:
- Use 4-bit LSB depth (8Γ more capacity than 1-bit)
- Large images (4K photos can hide megabytes)
- Compress your message before embedding
For Detection:
- Always check ELA visualization first
- Run multiple sensitivity levels
- Compare with known clean versions
- Check metadata for software signatures
- Try extraction even with low confidence scores
π Use Cases & Examples
Example 1: Secure Password Sharing
Scenario: Share database password with remote team member
1. Hide password in office photo
2. Encrypt with shared passphrase
3. Email photo (looks innocent)
4. Recipient extracts password securely
Example 2: Digital Watermarking
Scenario: Protect intellectual property in stock photos
1. Embed copyright info + contact details
2. Use 1-bit depth (invisible)
3. Survives screenshot + basic editing
4. Prove ownership if image is stolen
Example 3: Forensic Investigation
Scenario: Suspect image seized in investigation
1. Run detection analysis (high sensitivity)
2. Check ELA for manipulation
3. Attempt extraction with common passwords
4. Examine metadata for tool signatures
π οΈ Technical Specifications
Supported Formats:
- Input: JPEG, PNG, GIF, BMP, TIFF, WebP, HEIC, AVIF
- Output (Hiding): PNG only (lossless requirement)
Steganography Algorithm:
- Method: LSB replacement
- Channels: RGB (3 bytes per pixel)
- Bit depth: 1-4 configurable
- Encryption: XOR cipher with SHA-256 key derivation
- Integrity: MD5 checksum (8 bytes)
Detection Algorithms:
- ELA (Error Level Analysis)
- Chi-square test for LSB randomness
- Histogram pair analysis
- EXIF metadata inspection
- File structure validation
- Visual noise coefficient analysis
Performance:
- Images resized to max 1000Γ1000 for analysis
- Processing time: 1-5 seconds for typical images
- Maximum recommended image size: 10 megapixels
π Educational Resources
Learn More About Steganography:
Research Papers:
- Johnson & Jajodia (1998): "Exploring Steganography: Seeing the Unseen"
- Provos & Honeyman (2003): "Hide and Seek: An Introduction to Steganography"
- Fridrich (2009): "Steganography in Digital Media"
π About 2PAC
2PAC combines three powerful open-source tools into one comprehensive suite:
LSB Steganography Engine (custom implementation)
- High-capacity data hiding
- Password encryption
- Integrity verification
RAT Finder - Advanced steganalysis
- Multi-method detection
- ELA visualization
- Statistical analysis
Image Validator - Corruption detection
- Format verification
- Structure analysis
- Visual inspection
π¨βπ» Created By
Richard Young - Computational Neuroscience & AI Research
- π Website: deepneuro.ai
- πΌ LinkedIn: Richard Young
- π GitHub: ricyoung/2pac
Part of the DeepNeuro.AI research toolkit
- π¬ More Tools: demo.deepneuro.ai
ποΈ In Memory of Jeff Young
This project is dedicated to the memory of Jeff Young, who loved Tupac's music and embodied his spirit of bringing people together. Like my brother, Jeff would always reach out to help others, making connections and building community wherever he went. His compassion for people and willingness to always lend a hand to those in need are qualities that inspired this tool's purposeβhelping others preserve their precious memories.
May your photos always be as bright and clear as the memories they capture, and may we all strive to connect and help others as Jeff did.
π License
MIT License - Free for educational, research, and commercial use
Disclaimer: This tool is for educational and legitimate security research purposes. Users are responsible for compliance with applicable laws. Do not use for illegal surveillance, unauthorized data exfiltration, or malicious purposes.
π€ Contributing
Found a bug? Have a feature request?
- π Issues: GitHub Issues
- π Pull Requests: GitHub PRs
- π¬ Discussions: GitHub Discussions
π Acknowledgments
- Steganography Research: Johnson, Fridrich, Provos, Jajodia
- LSB Method: Based on classical least-significant-bit techniques
- ELA Algorithm: Inspired by forensic analysis tools
- Gradio Framework: For the excellent UI framework
- Hugging Face: For free hosting of ML/AI tools
π― "All Eyez On Your Images" ποΈ
Hide it. Find it. Verify it.
"I ain't a killer but don't push me. Corrupt images got their days numbered."
Made with β€οΈ by Richard Young