Metadata-Version: 2.4
Name: stegmarc
Version: 1.0.0
Summary: Universal steganographic analysis — statistical, forensic, and neural watermark detection
License: MIT
Project-URL: Homepage, https://github.com/raghavaggarwal/stegmarc
Project-URL: Docs, https://raghavaggarwal.github.io/stegmarc-docs
Project-URL: API, https://raghav7006--stegmark-api-web.modal.run
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Security
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy<2.0,>=1.24
Requires-Dist: scipy>=1.10
Requires-Dist: scikit-image>=0.21
Requires-Dist: Pillow>=10.0
Requires-Dist: reportlab>=4.0
Requires-Dist: jpegio>=0.2.8
Requires-Dist: fastapi>=0.100
Requires-Dist: uvicorn>=0.23
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: trustmark>=0.1
Requires-Dist: torch>=2.0
Requires-Dist: torchvision>=0.15

# Stegmark

Universal steganographic analysis — statistical, forensic, and neural watermark detection.

## Install

```bash
pip install stegmark                  # statistical + forensic detectors
pip install "stegmark[neural]"        # + TrustMark / Stable Signature neural detection
```

## Usage

```python
from stegmark import analyze, robustness_test

# Analyze any image
result = analyze("image.jpg")
print(result.verdict)
print(result.confidence)
result.save_report("audit.pdf")

# Test watermark robustness
report = robustness_test("cover.jpg", secret="my_id")
print(f"Survived {report.survival_rate:.0%} of attacks")
print(f"Failed: {report.failed_attacks}")
report.save_report("robustness_audit.pdf")

# With cover image for quality metrics
result = analyze("stego.jpg", cover_path="original.jpg")
print(f"PSNR: {result.psnr:.1f} dB  SSIM: {result.ssim:.4f}")
```

## What it detects

| Detector | Domain | Catches |
|---|---|---|
| Chi-square | JPEG DCT | LSB replacement in DCT coefficients |
| RS Analysis | Spatial | Pixel-level LSB substitution |
| SPA | Spatial | Sample pair analysis |
| EOF Detection | Forensic | Data appended after image end marker |
| EXIF Analysis | Forensic | Metadata anomalies, steg tool fingerprints |
| LSB Histogram | Forensic | LSB plane uniformity |
| Multi-channel | Forensic | Per-R/G/B channel embedding |
| TrustMark | Neural | Adobe C2PA robust watermarks |
| Stable Signature | Neural | Meta AI Stable Diffusion watermarks |
| SRNet | Neural/GPU | Adaptive spatial steg (WOW/S-UNIWARD/HILL) |

## API

Also available as a hosted API: `https://raghav7006--stegmark-api-web.modal.run`

```bash
curl -X POST https://raghav7006--stegmark-api-web.modal.run/analyze \
  -F "stego=@image.jpg"
```

## Installation Notes

### Apple Silicon (M1/M2/M3 Mac)
jpegio requires a native arm64 build:
```bash
ARCHFLAGS="-arch arm64" pip install jpegio
pip install stegmark
```

### Linux
```bash
pip install stegmark
```

### Windows
jpegio is not supported on Windows. Use WSL2 or Docker.
