Skip to main content

phasm_core/stego/armor/
mod.rs

1// Copyright (c) 2026 Christoph Gaffga
2// SPDX-License-Identifier: GPL-3.0-only
3// https://github.com/cgaffga/phasmcore
4
5//! Armor mode: robust steganography resistant to JPEG recompression.
6//!
7//! Armor mode trades undetectability for robustness by using:
8//! - **STDM** (Spread Transform Dither Modulation) for embedding, which
9//!   distributes each bit across multiple coefficients via spreading vectors
10//! - **Reed-Solomon** error correction to recover from bit errors introduced
11//!   by recompression
12//! - **Stability analysis** to select coefficient positions that survive
13//!   quality factor changes
14//!
15//! **Phase 2 adaptive robustness:** When the message is small relative to the
16//! image capacity, the encoder automatically maximizes robustness by:
17//! - Increasing RS parity (up to 240/255 symbols, from fixed 64/255)
18//! - Repeating the RS-encoded bitstream r times across spare capacity
19//! - Using soft majority voting with STDM log-likelihood ratios on decode
20//! - Increasing the STDM delta for larger decision regions
21//!
22//! Phase 2 activates transparently when r >= 3. Phase 1 images (r <= 1) are
23//! decoded using the original path for full backward compatibility.
24//!
25//! The pipeline: encrypt -> frame -> RS encode -> [repeat r×] -> STDM embed.
26
27pub mod ecc;
28pub mod selection;
29pub mod spreading;
30pub mod embedding;
31pub mod repetition;
32pub mod capacity;
33pub mod fft2d;
34pub mod template;
35pub mod resample;
36pub mod dft_payload;
37pub mod fortress;
38pub mod pipeline;