You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strhide Wire Format Specification (Overview and Index)
Scope: strhide 0.9.x (Wire format: Structural domain UBE v2, Content domain V4 Content Envelope).
This directory contains normative specifications, intended to enable third parties to implement fully interoperable readers and writers without inspecting the Rust source code.
Reference implementation: rust/src; see ../ARCHITECTURE.md for module responsibilities, and ../STEGO-API.md for public APIs.
Historical documents (non-normative, links and old section numbering preserved for reference): ../WIRE_SPEC_CONTENT.md, ../WIRE_SPEC_STRUCTURE.md. When this specification conflicts with older documents, this directory takes precedence; see CORRECTIONS.md for a summary of known differences.
1. The Two Steganographic Domains
strhide defines two mutually incompatible envelope schemes with isolated key derivation domains that cannot be cross-read.
Dimension
Structural Domain (write / restore)
Content Domain (embed / extract)
Envelope
UBE v2: 112B header + hint + meta + chunked payload + 24B trailer
Key-derived base header (Spatial 64B / JPEG 44B / HEVC 32B) + optional TLV + single AEAD body
Irreversible; cover pixels/coefficients are altered and cannot be recovered
Passwordless Default Key
BUILTIN_DEFAULT_KEY
PUBLIC_DEFAULT_SECRET
Compression
raw deflate; Auto requires saving ≥ 2%
raw deflate; retained only if strictly smaller than plaintext
Derivation labels, AADs, or default keys must never be mixed across the two domains. Any cross-read must return "no hidden data".
2. Normative Conventions
2.1 Language and Conformance
MUST / MUST NOT: Strict requirements necessary for interoperability; SHOULD / SHOULD NOT: Recommended defaults from which implementations may deviate if documented.
All constants, field offsets, and formulas provide references to the reference implementation (rust/src/...:line). These locations serve as evidence, not normative specifications; line numbers may drift as the codebase evolves.
De facto behaviors of the current reference implementation are explicitly labeled Tier I (see §2.3): they describe how the reference implementation writes bytes, but reader implementations MUST NOT depend on them.
2.2 Endianness and Bit Ordering
Structural Domain: Little-endian across all fields unless explicitly noted otherwise (header / trailer / meta / chunk lengths).
Content Domain: Base header and HKDF info multi-byte fields are Big-endian; the sigma field is f32 little-endian.
Bit Packing: Byte-internal bit ordering is MSB-first (bit 7 is the first slot/message bit), unless a structure explicitly specifies LSB-first.
CRC: Both domains use CRC32-IEEE (reflected polynomial 0xEDB88320, initial value 0xFFFFFFFF, inverted output).
2.3 Stability Tiers
Tier
Meaning
Impact of Changes
F (Frozen)
Written carriers depend on it
Any change renders existing carriers unreadable; changes before 1.0 require explicit tracking as breaking changes
D (Dialect)
Substitutable via compile-time profiles/labels
Does not corrupt official carriers, but produces an isolated dialect unreadable by official builds
I (Implementation Freedom)
Affects writing behavior only, not readability
Readers do not depend on it; free to optimize as long as byte-level baselines protect repository output
Prior to 1.0, any Tier F specification remains subject to change. Versioning policy:
CipherSuiteId, strategy_id, format_id, algorithm_id, and TLV type_id are append-only: new values may be added, but existing semantics cannot be altered.
Version fields (version, CURRENT_VERSION, compact meta version, CHANNEL_VERSION) are strictly monotonically increasing; unrecognized versions fail-closed.
No legacy read paths are provided (pre-release project). Reading an unsupported version MUST return an explicit "unsupported version" or absence of data rather than guessing layouts.
2.4 Reference Implementation Scope
Carrier quality evaluation and estimation in the analysis module still use host libm, and do not participate in byte-level output; all floating-point math affecting output bytes MUST follow DETMATH.md.
SIMD utilization, parallelization strategies, compression levels, and retry loops in the reference implementation belong to Tier I; readers MUST NOT rely on specific choices.
This specification does not claim that bit-for-bit equivalence with the reference implementation is required for interoperability; the test for interoperability is the ability to correctly read and extract legitimate carriers written by the counterpart. Byte-level baselines exist strictly to guard this repository's own consistency.
Whenever adding format_id, strategy_id, TLV, derivation labels, slot rules, or cost models, update the corresponding topic specification and errata status in CORRECTIONS.md.
Any change to Tier F algorithms constitutes a wire format change, requiring synchronized updates to byte-level baselines and changelogs.
file:line citations reflect the reference implementation; if code and documentation conflict, update the documentation to match code and record the deviation in CORRECTIONS.md.