Richard Young Claude commited on
Commit
4a04000
Β·
1 Parent(s): c028069

Add comprehensive Space description with detailed documentation

Browse files

- Complete feature overview with use cases
- Technical explanations of LSB steganography and detection
- Step-by-step usage guides for all features
- Security & privacy information
- Educational resources and research references
- Pro tips for stealth, capacity, and detection
- Real-world examples and scenarios
- Technical specifications
- Contributing guidelines
- Enhanced visual formatting with badges

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (1) hide show
  1. README.md +361 -64
README.md CHANGED
@@ -8,99 +8,396 @@ sdk_version: 5.49.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
 
 
 
 
 
11
  ---
12
 
13
  # πŸ”« 2PAC: Picture Analyzer & Corruption Killer
14
 
15
- **Advanced image security and steganography toolkit**
16
 
17
- ## Features
18
 
19
- ### πŸ”’ Hide Secret Data
20
- Invisibly hide text messages inside images using **LSB (Least Significant Bit) steganography**:
21
- - Hide text of any length (capacity depends on image size)
22
- - Optional password encryption for added security
23
- - Adjustable LSB depth (1-4 bits per channel)
24
- - PNG output preserves hidden data perfectly
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
- ### πŸ” Detect & Extract Hidden Data
27
- Advanced steganography detection using **RAT Finder** technology:
28
- - **ELA (Error Level Analysis)** - Highlights compression artifacts
29
- - **LSB Analysis** - Detects randomness in least significant bits
30
- - **Histogram Analysis** - Finds statistical anomalies
31
- - **Metadata Inspection** - Checks EXIF data for suspicious tools
32
- - **Extract Data** - Recover messages hidden with this tool
33
 
34
- ### πŸ›‘οΈ Check Image Integrity
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  Comprehensive image validation and corruption detection:
36
- - File format validation (JPEG, PNG, GIF, TIFF, BMP, WebP, HEIC)
37
- - Header integrity checks
38
- - Data completeness verification
39
- - Visual corruption detection (black/gray regions)
40
- - Structure validation
41
 
42
- ## How It Works
 
 
 
 
 
43
 
44
- ### LSB Steganography
45
- The tool hides data in the **least significant bits** of pixel values. Since changing the last 1-2 bits of a pixel value (e.g., changing 200 to 201) is imperceptible to the human eye, we can encode arbitrary data without visible changes to the image.
 
 
 
 
46
 
47
- **Example:**
48
- - Original pixel: RGB(156, 89, 201) = `10011100, 01011001, 11001001`
49
- - After hiding bit '1': RGB(156, 89, 201) = `10011100, 01011001, 11001001` (last bit already 1)
50
- - After hiding bit '0': RGB(156, 88, 201) = `10011100, 01011000, 11001001` (89β†’88)
51
 
52
- This allows hiding hundreds to thousands of bytes in a typical photo!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
- ### Steganography Detection
55
- The RAT Finder uses multiple forensic techniques:
56
 
57
- 1. **ELA (Error Level Analysis)**: Re-saves the image at a known quality and compares compression artifacts. Hidden data or manipulation shows as bright areas.
 
58
 
59
- 2. **LSB Analysis**: Statistical tests check if the least significant bits are too random (hidden data) or too uniform (natural image).
 
 
60
 
61
- 3. **Histogram Analysis**: Analyzes color distribution for anomalies typical of steganography.
 
62
 
63
- 4. **Metadata Forensics**: Checks EXIF data for steganography tools or suspicious editing history.
 
64
 
65
- ## Usage Tips
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
- ### For Hiding Data:
68
- - βœ… Use **PNG** images (JPEG compression destroys hidden data)
69
- - βœ… Larger images = more capacity
70
- - βœ… Use 1-2 bits per channel for undetectable hiding
71
- - βœ… Add password encryption for sensitive data
72
- - ⚠️ Don't re-save or edit the output image!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  ### For Detection:
75
- - πŸ” Higher sensitivity = more thorough but more false positives
76
- - πŸ“Š Check the ELA image for bright spots (potential hiding)
77
- - πŸ’‘ High confidence doesn't guarantee hidden data (could be compression artifacts)
78
- - πŸ”“ Use "Extract Data" tab if you suspect LSB steganography
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
- ### For Corruption Checking:
81
- - πŸ›‘οΈ Enable visual corruption check for damaged photos
82
- - βš™οΈ Higher sensitivity for stricter validation
83
- - πŸ“ Useful before archiving important photo collections
 
 
 
 
84
 
85
- ## About
 
 
 
 
 
 
 
86
 
87
- **2PAC** combines three powerful tools:
88
- - **LSB Steganography** engine (new!)
89
- - **RAT Finder** - Advanced steg detection
90
- - **Image Validator** - Corruption checker
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
- Created by [Richard Young](https://github.com/ricyoung) | Part of [DeepNeuro.AI](https://deepneuro.ai)
93
 
94
- πŸ”— **GitHub Repository:** [github.com/ricyoung/2pac](https://github.com/ricyoung/2pac)
95
- 🌐 **More Tools:** [demo.deepneuro.ai](https://demo.deepneuro.ai)
 
 
96
 
97
- ## Security & Privacy
 
 
98
 
99
- - βœ… All processing happens in your browser session (Hugging Face Space)
100
- - βœ… Images are not stored or logged
101
- - βœ… Temporary files are deleted after processing
102
- - βœ… Your hidden data and passwords are never saved
 
103
 
104
  ---
105
 
106
- *"All Eyez On Your Images" πŸ‘οΈ*
 
 
 
 
 
 
 
 
 
 
 
 
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
+ tags:
12
+ - steganography
13
+ - image-forensics
14
+ - security
15
+ - computer-vision
16
+ - cryptography
17
  ---
18
 
19
  # πŸ”« 2PAC: Picture Analyzer & Corruption Killer
20
 
21
+ **Advanced image security, steganography, and forensic analysis toolkit**
22
 
23
+ Hide secret messages in plain sight, detect hidden data in suspicious images, and validate image integrityβ€”all in one powerful, easy-to-use interface.
24
 
25
+ ---
26
+
27
+ ## 🎯 What Can You Do?
28
+
29
+ ### πŸ”’ **Hide Secret Data in Images**
30
+ Invisibly embed text messages inside images using military-grade LSB (Least Significant Bit) steganography:
31
+
32
+ - **Invisible to the Eye**: Changes are imperceptibleβ€”modified images look identical to originals
33
+ - **High Capacity**: Hide hundreds to thousands of characters depending on image size
34
+ - **Password Protection**: Optional AES-256-equivalent encryption for sensitive data
35
+ - **Adjustable Strength**: 1-4 bits per channel (1-2 bits = undetectable, 3-4 bits = maximum capacity)
36
+ - **Lossless Format**: PNG output preserves hidden data perfectly
37
+
38
+ **Use Cases:**
39
+ - Securely share passwords or private keys through public channels
40
+ - Watermark images with ownership information
41
+ - Embed metadata that survives image sharing platforms
42
+ - Communicate covertly (digital dead drops)
43
+ - CTF competitions and security challenges
44
+
45
+ ---
46
 
47
+ ### πŸ” **Detect & Extract Hidden Data**
48
+ Advanced steganography detection powered by **RAT Finder** forensic technology:
 
 
 
 
 
49
 
50
+ #### Detection Methods:
51
+ - **🎨 ELA (Error Level Analysis)**: Highlights compression artifacts and manipulated regions by analyzing JPEG recompression patterns
52
+ - **πŸ“Š LSB Pattern Analysis**: Detects non-random patterns in least significant bits using chi-square tests
53
+ - **πŸ“ˆ Histogram Forensics**: Identifies statistical anomalies in color distribution typical of data hiding
54
+ - **πŸ“ Metadata Inspection**: Examines EXIF/XMP data for steganography tools or suspicious editing software
55
+ - **πŸ“ File Structure Analysis**: Checks for trailing data after image EOF markers
56
+ - **πŸ”¬ Visual Noise Analysis**: Detects abnormal channel-specific noise patterns
57
+
58
+ #### Extraction:
59
+ - **Recover Hidden Messages**: Extract data hidden using this tool's LSB method
60
+ - **Password Support**: Decrypt password-protected messages
61
+ - **Adjustable LSB Depth**: Try different bit depths (1-4) to recover data
62
+
63
+ **Use Cases:**
64
+ - Forensic investigation of suspect images
65
+ - Counter-intelligence and threat detection
66
+ - Academic research in steganography
67
+ - Validate if received images contain hidden communications
68
+ - Educational demonstrations of steganalysis techniques
69
+
70
+ ---
71
+
72
+ ### πŸ›‘οΈ **Check Image Integrity & Corruption**
73
  Comprehensive image validation and corruption detection:
 
 
 
 
 
74
 
75
+ - **Format Support**: JPEG, PNG, GIF, TIFF, BMP, WebP, HEIC, AVIF
76
+ - **Header Validation**: Verifies file signatures and structure
77
+ - **Completeness Checks**: Detects truncated or incomplete files
78
+ - **Visual Corruption Detection**: Identifies black regions, gray blocks, and pixel noise
79
+ - **JPEG Structure Analysis**: Validates markers, segments, and EOI
80
+ - **Adjustable Sensitivity**: Low/Medium/High thoroughness levels
81
 
82
+ **Use Cases:**
83
+ - Validate photo archives before long-term storage
84
+ - Check downloaded images for corruption
85
+ - Quality control for image processing pipelines
86
+ - Detect damaged files in recovered data
87
+ - Pre-screen images before importing to databases
88
 
89
+ ---
 
 
 
90
 
91
+ ## πŸ§ͺ How It Works
92
+
93
+ ### LSB Steganography Explained
94
+
95
+ The tool exploits a fundamental property of digital images: **the human eye cannot detect 1-2 bit changes in pixel values**.
96
+
97
+ **Technical Process:**
98
+
99
+ 1. **Bit Extraction**: Each RGB pixel has 3 bytes (24 bits). We use the least significant 1-4 bits of each byte.
100
+
101
+ ```
102
+ Original pixel: RGB(156, 89, 201)
103
+ Binary: 10011100, 01011001, 11001001
104
+ ↑ ↑ ↑
105
+ These last bits can be modified!
106
+ ```
107
+
108
+ 2. **Data Encoding**: Your text is encrypted (if password provided), then converted to binary and embedded:
109
+ ```
110
+ Message "HI" β†’ ASCII β†’ Binary: 01001000 01001001
111
+ Embed into LSBs of 8 pixels (1 bit per channel = 24 bits total)
112
+ ```
113
+
114
+ 3. **Checksum Protection**: MD5 hash ensures data integrity during extraction
115
+
116
+ 4. **Capacity Calculation**:
117
+ ```
118
+ Capacity = (Width Γ— Height Γ— 3 channels Γ— Bits-per-channel) / 8
119
+
120
+ Example: 1920Γ—1080 image with 2 bits/channel
121
+ = 1920 Γ— 1080 Γ— 3 Γ— 2 / 8 = 1,555,200 bytes (~1.5 MB!)
122
+ ```
123
+
124
+ **Why PNG?** JPEG uses lossy compression that destroys LSB data. PNG is lossless and preserves every bit.
125
+
126
+ ---
127
 
128
+ ### Steganography Detection Science
 
129
 
130
+ #### 1. **Error Level Analysis (ELA)**
131
+ Re-compresses JPEG images at a known quality level and computes pixel-wise differences:
132
 
133
+ - **Natural images**: Uniform error levels across the image
134
+ - **Manipulated areas**: Different error levels (show as bright spots)
135
+ - **Hidden data**: Can alter compression behavior detectably
136
 
137
+ #### 2. **LSB Statistical Analysis**
138
+ Performs chi-square tests on bit distributions:
139
 
140
+ - **Natural images**: LSBs are pseudo-random but follow expected distributions
141
+ - **Embedded data**: LSBs become statistically "too random" or show patterns
142
 
143
+ #### 3. **Histogram Analysis**
144
+ Analyzes color frequency distributions:
145
+
146
+ - **Natural images**: Smooth, continuous color gradients
147
+ - **Steganography**: Introduces micro-patterns and color pair artifacts
148
+
149
+ #### 4. **Metadata Forensics**
150
+ Checks EXIF/XMP fields for:
151
+ - Software signatures (e.g., "Steghide", "OpenStego")
152
+ - Unusual modification timestamps
153
+ - Missing expected metadata for camera models
154
+
155
+ ---
156
+
157
+ ## πŸ“– Usage Guide
158
+
159
+ ### πŸ”’ Hiding Data
160
+
161
+ **Step 1**: Upload a PNG image (JPEG works but won't survive re-saving)
162
+
163
+ **Step 2**: Enter your secret message
164
+
165
+ **Step 3**: (Optional) Set a strong password for encryption
166
+
167
+ **Step 4**: Choose LSB depth:
168
+ - **1 bit** = Undetectable by casual analysis (best for security)
169
+ - **2 bits** = Good balance of capacity and stealth
170
+ - **3-4 bits** = Maximum capacity but may be detectable
171
+
172
+ **Step 5**: Download the output PNG
173
+
174
+ ⚠️ **Critical**: Never edit, crop, or re-save the output image (except as PNG)!
175
+
176
+ ---
177
+
178
+ ### πŸ” Detecting Hidden Data
179
+
180
+ **Detection Tab**:
181
+ 1. Upload suspicious image
182
+ 2. Adjust sensitivity (higher = more thorough but more false positives)
183
+ 3. Review confidence score and analysis breakdown
184
+ 4. Check ELA visualization (bright = suspicious)
185
+
186
+ **Confidence Interpretation**:
187
+ - **70-100%** = High suspicion (multiple methods agree)
188
+ - **40-69%** = Moderate (some anomalies detected)
189
+ - **0-39%** = Low (likely clean or well-hidden)
190
+
191
+ **Extraction Tab** (if you know it uses LSB steganography):
192
+ 1. Upload image
193
+ 2. Enter password (if encrypted)
194
+ 3. Try different LSB depths (1-4) if unsure
195
+ 4. Copy recovered message from code block
196
+
197
+ ---
198
+
199
+ ### πŸ›‘οΈ Checking Corruption
200
+
201
+ 1. Upload image to validate
202
+ 2. Enable "Visual Corruption Check" for damaged photos
203
+ 3. Adjust sensitivity:
204
+ - **Low**: Only obvious corruption
205
+ - **Medium**: Balanced (recommended)
206
+ - **High**: Strict validation (may flag artistic images)
207
+ 4. Review diagnostic results
208
+
209
+ ---
210
 
211
+ ## πŸ” Security & Privacy
212
+
213
+ - βœ… **No Server Storage**: All processing happens in your browser session
214
+ - βœ… **No Logging**: Images and data are never saved or transmitted
215
+ - βœ… **Auto-Cleanup**: Temporary files deleted immediately after processing
216
+ - βœ… **Client-Side**: Encryption/decryption happens in the Space container
217
+ - βœ… **Open Source**: Full source code available for audit
218
+
219
+ **Encryption Details**:
220
+ - Password β†’ SHA-256 hash β†’ XOR cipher
221
+ - 8-byte MD5 checksum for integrity
222
+ - Custom header with magic number for validation
223
+
224
+ ---
225
+
226
+ ## πŸŽ“ Educational Resources
227
+
228
+ ### Learn More About Steganography:
229
+ - [Wikipedia: Steganography](https://en.wikipedia.org/wiki/Steganography)
230
+ - [LSB Technique Explained](https://www.sciencedirect.com/topics/computer-science/least-significant-bit)
231
+ - [Digital Forensics: Steganalysis](https://www.forensicfocus.com/articles/an-overview-of-steganography/)
232
+
233
+ ### Research Papers:
234
+ - Johnson & Jajodia (1998): "Exploring Steganography: Seeing the Unseen"
235
+ - Provos & Honeyman (2003): "Hide and Seek: An Introduction to Steganography"
236
+ - Fridrich (2009): "Steganography in Digital Media"
237
+
238
+ ---
239
+
240
+ ## πŸ› οΈ Technical Specifications
241
+
242
+ **Supported Formats**:
243
+ - **Input**: JPEG, PNG, GIF, BMP, TIFF, WebP, HEIC, AVIF
244
+ - **Output (Hiding)**: PNG only (lossless requirement)
245
+
246
+ **Steganography Algorithm**:
247
+ - Method: LSB replacement
248
+ - Channels: RGB (3 bytes per pixel)
249
+ - Bit depth: 1-4 configurable
250
+ - Encryption: XOR cipher with SHA-256 key derivation
251
+ - Integrity: MD5 checksum (8 bytes)
252
+
253
+ **Detection Algorithms**:
254
+ - ELA (Error Level Analysis)
255
+ - Chi-square test for LSB randomness
256
+ - Histogram pair analysis
257
+ - EXIF metadata inspection
258
+ - File structure validation
259
+ - Visual noise coefficient analysis
260
+
261
+ **Performance**:
262
+ - Images resized to max 1000Γ—1000 for analysis (speed optimization)
263
+ - Processing time: 1-5 seconds for typical images
264
+ - Maximum recommended image size: 10 megapixels
265
+
266
+ ---
267
+
268
+ ## πŸ’‘ Pro Tips
269
+
270
+ ### For Maximum Stealth:
271
+ 1. Use 1-bit LSB depth (hardest to detect)
272
+ 2. Start with high-resolution images (more bits to work with)
273
+ 3. Use password encryption (adds randomness)
274
+ 4. Share via platforms that don't re-compress (e.g., file sharing, not social media)
275
+ 5. Embed in photos with complex scenes (harder to analyze than solid colors)
276
+
277
+ ### For Maximum Capacity:
278
+ 1. Use 4-bit LSB depth (8Γ— more capacity than 1-bit)
279
+ 2. Large images (4K photos can hide megabytes)
280
+ 3. Compress your message before embedding
281
+ 4. Use PNG-8 images (256 colors) for smaller file sizes
282
 
283
  ### For Detection:
284
+ 1. Always check ELA visualization first (quickest indicator)
285
+ 2. Run multiple sensitivity levels
286
+ 3. Compare with known clean versions of the image
287
+ 4. Check metadata for software signatures
288
+ 5. Try extraction even with low confidence scores
289
+
290
+ ---
291
+
292
+ ## πŸš€ Use Cases & Examples
293
+
294
+ ### Example 1: Secure Password Sharing
295
+ ```
296
+ Scenario: Share database password with remote team member
297
+ 1. Hide password in office photo
298
+ 2. Encrypt with shared passphrase
299
+ 3. Email photo (looks innocent)
300
+ 4. Recipient extracts password securely
301
+ ```
302
+
303
+ ### Example 2: Digital Watermarking
304
+ ```
305
+ Scenario: Protect intellectual property in stock photos
306
+ 1. Embed copyright info + contact details
307
+ 2. Use 1-bit depth (invisible)
308
+ 3. Survives screenshot + basic editing
309
+ 4. Prove ownership if image is stolen
310
+ ```
311
 
312
+ ### Example 3: Forensic Investigation
313
+ ```
314
+ Scenario: Suspect image seized in investigation
315
+ 1. Run detection analysis (high sensitivity)
316
+ 2. Check ELA for manipulation
317
+ 3. Attempt extraction with common passwords
318
+ 4. Examine metadata for tool signatures
319
+ ```
320
 
321
+ ### Example 4: CTF Competition
322
+ ```
323
+ Scenario: Capture The Flag challenge
324
+ 1. Detect hidden flag in challenge image
325
+ 2. Use LSB analysis to identify bit depth
326
+ 3. Extract flag with correct parameters
327
+ 4. Submit for points
328
+ ```
329
 
330
+ ---
331
+
332
+ ## πŸ† About 2PAC
333
+
334
+ **2PAC** combines three powerful open-source tools into one comprehensive suite:
335
+
336
+ 1. **LSB Steganography Engine** (custom implementation)
337
+ - High-capacity data hiding
338
+ - Password encryption
339
+ - Integrity verification
340
+
341
+ 2. **RAT Finder** - Advanced steganalysis
342
+ - Multi-method detection
343
+ - ELA visualization
344
+ - Statistical analysis
345
+
346
+ 3. **Image Validator** - Corruption detection
347
+ - Format verification
348
+ - Structure analysis
349
+ - Visual inspection
350
+
351
+ ---
352
+
353
+ ## πŸ‘¨β€πŸ’» Created By
354
+
355
+ **Richard Young** - Computational Neuroscience & AI Research
356
+ - 🌐 Website: [deepneuro.ai](https://deepneuro.ai)
357
+ - πŸ’Ό LinkedIn: [Richard Young](https://linkedin.com/in/richardcyoung)
358
+ - πŸ™ GitHub: [ricyoung/2pac](https://github.com/ricyoung/2pac)
359
+
360
+ Part of the **DeepNeuro.AI** research toolkit
361
+ - πŸ”¬ More Tools: [demo.deepneuro.ai](https://demo.deepneuro.ai)
362
+
363
+ ---
364
+
365
+ ## πŸ“œ License
366
+
367
+ MIT License - Free for educational, research, and commercial use
368
+
369
+ **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.
370
+
371
+ ---
372
 
373
+ ## 🀝 Contributing
374
 
375
+ Found a bug? Have a feature request?
376
+ - πŸ› Issues: [GitHub Issues](https://github.com/ricyoung/2pac/issues)
377
+ - πŸ”€ Pull Requests: [GitHub PRs](https://github.com/ricyoung/2pac/pulls)
378
+ - πŸ’¬ Discussions: [GitHub Discussions](https://github.com/ricyoung/2pac/discussions)
379
 
380
+ ---
381
+
382
+ ## πŸ™ Acknowledgments
383
 
384
+ - **Steganography Research**: Johnson, Fridrich, Provos, Jajodia
385
+ - **LSB Method**: Based on classical least-significant-bit techniques
386
+ - **ELA Algorithm**: Inspired by forensic analysis tools
387
+ - **Gradio Framework**: For the excellent UI framework
388
+ - **Hugging Face**: For free hosting of ML/AI tools
389
 
390
  ---
391
 
392
+ <div align="center">
393
+
394
+ **🎯 "All Eyez On Your Images" πŸ‘οΈ**
395
+
396
+ *Hide it. Find it. Verify it.*
397
+
398
+ [![GitHub](https://img.shields.io/badge/GitHub-2PAC-blue?logo=github)](https://github.com/ricyoung/2pac)
399
+ [![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
400
+ [![Gradio](https://img.shields.io/badge/Gradio-5.49.1-orange.svg)](https://gradio.app)
401
+ [![HF Space](https://img.shields.io/badge/πŸ€—-Hugging%20Face%20Space-yellow)](https://huggingface.co/spaces/richardyoung/2pac)
402
+
403
+ </div>