Expand description
Steganographic encoding and decoding pipelines.
This module provides two embedding modes:
-
Ghost (
ghost_encode/ghost_decode): Stealth mode using J-UNIWARD cost function and Syndrome-Trellis Coding (STC) to minimize statistical detectability. Best for images that will not be recompressed. -
Armor (
armor_encode/armor_decode): Robustness mode using STDM (Spread Transform Dither Modulation) with Reed-Solomon error correction to survive JPEG recompression. Trades capacity for survivability.
Both modes share the same payload frame format, encryption (AES-256-GCM-SIV),
and key derivation (Argon2id two-tier). The smart_decode function
auto-detects which mode was used.
Re-exports§
pub use error::StegoError;pub use armor::pipeline::armor_encode;pub use armor::pipeline::armor_encode_with_quality;pub use armor::pipeline::armor_decode;pub use armor::pipeline::DecodeQuality;pub use armor::pipeline::ArmorCapacityInfo;pub use armor::pipeline::armor_capacity_info;pub use armor::capacity::estimate_armor_capacity as armor_capacity;pub use payload::PayloadData;pub use payload::FileEntry;pub use payload::compressed_payload_size;
Modules§
- armor
- Armor mode: robust steganography resistant to JPEG recompression.
- capacity
- Ghost mode capacity estimation.
- cost
- Embedding cost functions for steganographic coding.
- crypto
- Cryptographic primitives for payload encryption.
- error
- Error types for the steganography pipeline.
- frame
- Payload frame construction and parsing.
- optimizer
- Cover image preprocessing optimizer for steganographic embedding.
- payload
- Payload serialization, compression, and file embedding.
- permute
- Media-agnostic coefficient position permutation.
- progress
- Global decode progress tracking.
- quality
- Encode quality scoring: Stealth (Ghost) and Robustness (Armor).
- shadow
- Shadow messages: Y-channel direct LSB embedding + RS ECC (headerless brute-force).
- shadow_
layer - Media-agnostic shadow-layer primitives.
- side_
info - Side information for SI-UNIWARD (Side-Informed UNIWARD).
- stc
- Syndrome-Trellis Coding (STC) for minimal-distortion embedding.
Structs§
- Encode
Quality - Encode quality result returned alongside stego bytes.
- Optimizer
Config - Configuration for the cover image optimizer.
- Shadow
Layer - Shadow layer descriptor for encoding.
Enums§
- Optimizer
Mode - Which optimization pipeline to run.
Constants§
- ARMOR_
TARGET_ DIMENSION - Target pixel dimension (longest side) for Armor/Fortress pre-resize. Images larger than this are downsampled by the frontend before encoding in Armor mode, so that the 8×8 block grid survives platform recompression (e.g. WhatsApp resizes to ~1600px on the longest side).
- GHOST_
DECODE_ STEPS - Total number of progress steps reported by
ghost_decode. - GHOST_
ENCODE_ STEPS - Total number of progress steps reported by Ghost encode.
- GHOST_
ENCODE_ WITH_ SHADOWS_ STEPS - Progress steps for Ghost encode with shadows.
- MAX_
DIMENSION - Maximum pixel dimension (width or height) for encode. Images exceeding this are downsampled by the frontend before reaching Rust.
- MAX_
PIXELS - Maximum total pixel count for encode (width × height). 200 MP covers all current cameras including flagship 200 MP sensors. Memory-optimized: strip-based UNIWARD (~170 MB/strip), compact positions (8 bytes each), segmented STC Viterbi. Total ~1 GB for 200 MP.
- MIN_
ENCODE_ DIMENSION - Minimum pixel dimension (width or height) for encode. Images below this are rejected with an error message.
Functions§
- estimate_
shadow_ capacity - Estimate shadow layer capacity for a JPEG image.
- ghost_
capacity - Estimate Ghost mode capacity (standard J-UNIWARD).
- ghost_
capacity_ si - Estimate Ghost mode capacity with SI-UNIWARD (“Deep Cover”).
- ghost_
capacity_ with_ shadows - Estimate Ghost primary capacity accounting for shadow position overhead.
- ghost_
decode - Decode a payload from a stego JPEG using Ghost mode.
- ghost_
encode - Encode a text message into a cover JPEG using Ghost mode.
- ghost_
encode_ si - Encode using Ghost mode with side information (SI-UNIWARD / “Deep Cover”).
- ghost_
encode_ si_ with_ files - Encode with side information and file attachments.
- ghost_
encode_ si_ with_ files_ quality - Encode with SI-UNIWARD + files and return the encode quality score.
- ghost_
encode_ si_ with_ quality - Encode with SI-UNIWARD and return the encode quality score.
- ghost_
encode_ si_ with_ shadows - Encode with Ghost SI-UNIWARD plus shadow messages.
- ghost_
encode_ si_ with_ shadows_ quality - Encode with SI-UNIWARD + shadows and return the encode quality score.
- ghost_
encode_ with_ files - Encode a text message with file attachments into a cover JPEG using Ghost mode.
- ghost_
encode_ with_ files_ quality - Encode with Ghost mode + files and return the encode quality score.
- ghost_
encode_ with_ quality - Encode with Ghost mode and return the encode quality score.
- ghost_
encode_ with_ shadows - Encode with Ghost mode plus shadow messages for plausible deniability.
- ghost_
encode_ with_ shadows_ quality - Encode with Ghost mode + shadows and return the encode quality score.
- ghost_
shadow_ decode - Decode a shadow message from a stego JPEG.
- optimize_
cover - Optimize raw RGB pixels for steganographic embedding.
- shadow_
capacity - Compute shadow capacity in plaintext bytes from Y nzAC count.
- smart_
decode - Unified decode: auto-detects Ghost or Armor mode from the embedded frame.
- validate_
encode_ dimensions - Validate image dimensions for encoding.