Mathematical Pipeline Formulations
This technical reference defines the exact mathematical formulations, cryptographic stretching, pseudorandom spatial mapping, and bitwise transformations driving the STEGNOLINES engine.
1. Dynamic Key & Counter Derivation (PBKDF2-HMAC-SHA256)
To eliminate pre-shared salts while preventing replay attacks, a deterministic 16-byte cryptographic salt $S$ is extracted directly from the cover text:
The cryptographic key material is generated by executing 100,000 iterations of PBKDF2:
Key_AES = DerivedBytes[0..31] (256-bit AES Key)
Counter_CTR = DerivedBytes[32..47] (128-bit Initial Counter IV0)
2. Symmetric Cipher Stream (AES-256-CTR)
AES in Counter Mode (CTR) functions as a stream cipher, providing high execution performance with exactly zero padding overhead:
CipherBits = [m_1, m_2, ..., m_K] where m_j ∈ {0, 1}
3. Cryptographic CSPRNG Seeding & Spatial Placement
The Stego-Key string is derived into a 256-bit cryptographic seed using PBKDF2-HMAC-SHA256 across 100,000 iterations with a domain-specific salt:
An AES-256-CTR CSPRNG combined with Unbiased Rejection Sampling eliminates modulo bias completely and generates deterministic, uniform random indices $P = [p_1, p_2, ..., p_K]$ in the cover text via an $O(K)$ Lazy Fisher-Yates shuffle. (A legacy fallback engine using DJB2 + Mulberry32 is maintained for backward compatibility with previous version messages).
4. Bitwise XOR Masking & Recovery
For each message bit $m_j$ and selected cover bit $c_{p_j}$, the XOR key bit $k_j$ is computed as:
During extraction, the exact message bit is recovered using the same cover bits:
Since $(c_{p_j} \oplus m_j) \oplus c_{p_j} = m_j$, perfect bit-for-bit lossless data reconstruction is mathematically guaranteed.
5. Variation Selector Mapping
0xFE00 + B (if 0 ≤ B ≤ 15, VS1..VS16)
0xE0100 + B - 16 (if 16 ≤ B ≤ 255, VS17..VS256)