Skip to main content

Crate c2pa_text_binding

Crate c2pa_text_binding 

Source
Expand description

Reference implementation of the WritersLogic C2PA text soft-binding family.

Each algorithm links text content to its C2PA manifest without a byte-exact hash, so provenance is recoverable after copying, reformatting, excerpting, or light editing. All algorithms are registered in the C2PA Soft Binding Algorithm List and referenced from a c2pa.soft-binding assertion.

ModuleAlgorithmKind
stegocom.writerslogic.zwc-watermark.2watermark (embedded)
simhashcom.writerslogic.text-fingerprint.1fingerprint (surface)
minhashcom.writerslogic.text-minhash.1fingerprint (excerpt)
structurecom.writerslogic.text-structure.1fingerprint (structural)

normalize is the shared canonical stream; soft_binding emits the c2pa.soft-binding assertion (CBOR that round-trips through the c2pa-rs reader); crosscheck recomputes a candidate’s fingerprint from the current text and classifies it into a BOUND / LIKELY / REVIEW confidence tier, whose boundaries are grounded in the measured false-match rates in examples/threshold_sweep.rs.

Everything here compiles to wasm32-unknown-unknown. All cryptography is pure Rust with no C bindings (sha2, hmac, blake2, ed25519-dalek, coset); the soft-binding assertion is CBOR via ciborium, and reed-solomon-erasure backs watermark recovery. Registration in the C2PA algorithm list is not the same as C2PA conformance certification, which is a separate program this crate makes no claim to.

Re-exports§

pub use crosscheck::classify;
pub use crosscheck::crosscheck_tag;
pub use crosscheck::fingerprint_evidence;
pub use crosscheck::verify;
pub use crosscheck::Confidence;
pub use crosscheck::Evidence;
pub use error::Error;
pub use manifest::public_key;
pub use manifest::sign_cose;
pub use manifest::verify_cose;
pub use minhash::MinHash;
pub use simhash::Fingerprint;
pub use simhash::Hash256;
pub use soft_binding::SoftBinding;
pub use soft_binding::SOFT_BINDING_LABEL;
pub use stego::embed;
pub use stego::extract;
pub use stego::Recovered;

Modules§

crosscheck
Content-keyed cross-check and confidence classification.
error
manifest
Minimal COSE_Sign1 (EdDSA / Ed25519) signing and verification for a c2pa.soft-binding assertion payload.
minhash
com.writerslogic.text-minhash.1 — MinHash-128 over word 5-gram shingles for excerpt and quotation matching. Estimates Jaccard set overlap; two texts are treated as the same or overlapping content at Jaccard >= 0.70. 32 bands x 4 rows of LSH provide sublinear lookup keys. Deterministic and interoperable with ISO 24138 (ISCC) Text-Code semantics.
normalize
Canonical normalization shared by the text soft-binding family.
simhash
com.writerslogic.text-fingerprint.1 — a durable 256-bit SimHash over the normalized surface stream, plus overlapping window fingerprints so an excerpt or truncated copy still matches. Embeds nothing in the text.
soft_binding
The c2pa.soft-binding assertion emitted for each algorithm in this family.
stego
com.writerslogic.zwc-watermark.2 — embeds a routing pointer plus a content-binding HMAC tag as invisible zero-width characters at deterministic word-boundary positions.
structure
com.writerslogic.text-structure.1 — a deterministic, model-free 256-bit SimHash over a document’s structural skeleton: sentence-length sequence, paragraph shape, punctuation-class profile, and function-word skeleton. Survives synonym-level paraphrase that defeats a surface fingerprint. Match when Hamming distance <= 24 / 256.