Skip to main content

crates.io docs.rs CI OpenSSF Scorecard License

Overview

A concrete family of text soft-binding algorithms compatible with the C2PA Soft Binding framework, each registered in the C2PA soft binding algorithm list. A soft binding derives a content-keyed value that survives reformatting, re-encoding, excerpting, and light editing, so a manifest is recoverable when the hard binding — a byte-exact hash — has been broken.

Module Registered alg identifier Kind
simhash com.writerslogic.text-fingerprint.1 surface fingerprint
stego com.writerslogic.zwc-watermark.2 zero-width watermark
structure com.writerslogic.text-structure.1 structural fingerprint
minhash com.writerslogic.text-minhash.1 excerpt/quotation fingerprint

The alg string is what a c2pa.soft-binding assertion carries and what a recovery service matches on; it is the identifier that matters.

This crate is the perceptual/watermark recovery layer. It is distinct from the Variation-Selector transport used elsewhere in WritersProof, which is a hard binding (a c2pa.hash.data over normalized text) and is not soft binding. Registration in the algorithm list is not C2PA conformance certification.

Quick Start

[dependencies]
c2pa-text-binding = "0.2"

Emit and sign a c2pa.soft-binding assertion

soft_binding builds the normative CBOR assertion (it round-trips through the c2pa-rs reader — see tests/c2pa_roundtrip.rs); manifest signs it as a COSE_Sign1 / EdDSA envelope.

use c2pa_text_binding::{simhash::Fingerprint, soft_binding, sign_cose, SOFT_BINDING_LABEL};

let text = "…the document being bound…";
let secret_key = [7u8; 32];                   // caller-supplied Ed25519 secret
let assertion = soft_binding::from_fingerprint(&Fingerprint::compute(text));
let cbor = assertion.to_cbor()?;              // store under SOFT_BINDING_LABEL
let signed = sign_cose(&cbor, &secret_key)?;  // detached-key COSE_Sign1
# Ok::<(), c2pa_text_binding::Error>(())

Recover and classify a candidate

The verify path recomputes the fingerprint from the current text, compares it to the stored value at the algorithm's registered threshold, and returns a confidence tier. BOUND requires a durable fingerprint match (41/44, measured zero false matches) plus the anti-transfer cross-check; a structural (43) match or a watermark hit alone caps at LIKELY. Tier thresholds are grounded in ROBUSTNESS.md.

use c2pa_text_binding::{simhash::Fingerprint, soft_binding::{self, SoftBinding}, verify, Confidence};

let text = "…the document being bound…";
let cbor = soft_binding::from_fingerprint(&Fingerprint::compute(text)).to_cbor()?;

let candidate = SoftBinding::from_cbor(&cbor)?;
let tier = verify(text, &candidate, /*watermark_verified=*/ false, /*crosscheck_ok=*/ true);
assert_eq!(tier, Confidence::Bound);
# Ok::<(), c2pa_text_binding::Error>(())

Register with the Soft Binding Resolution API

These algorithms are registered in the C2PA soft binding algorithm list, so a c2pa.soft-binding assertion referencing them can drive decentralized manifest recovery.

Transport Survivability Research

The soft-binding layer above exists because hard bindings are fragile in text pipelines. TRANSPORT.md is a reproducible benchmark quantifying that fragility, comparing every invisible-text carrier — A.8 variation selectors (v1 and a proposed v2), the zero-width Reed-Solomon watermark, Unicode Tag smuggling, naive zero-width binary — against the fingerprint recovery layer, across deterministic probes and real transports (HTML sanitizers, Office, email, Markdown, pandoc, macOS RTF).

Key results, all reproducible with cargo run --release --example transport_survivability and harness/tier1.py:

  • Carrier survival is not provenance survival. Email, Markdown, and pandoc round trips leave the invisible carrier intact but reflow the visible text, breaking the A.8 hard binding. Only the reflow-tolerant fingerprint survives.
  • A.8 needs a checksum, not just a length. Property testing shows the v1 length field is self-corruptible — a single dropped length byte yields a wrong payload. Only an integrity field (this crate's HMAC watermark, or a v2 checksum) fails safe.
  • Error correction is decisive. The Reed-Solomon watermark tolerates ~30–40% code-point loss where every un-coded carrier fails by 20%.
  • Sanitizers preserve invisible payloads. Ten of thirteen real pipelines — including bleach and nh3 — pass the payload through untouched; a security-relevant result.

Interoperability. This crate's A.8 codec is byte-identical to Encypher's c2pa-text reference library in both directions (tests/interop.rs, harness/interop.py), so the comparison is against the real deployed format, not a stand-in.

Runs are reproducible via a pinned venv (harness/requirements.txt) or the Dockerfile, which stamps tool and library versions with every result.

Related Crates

Part of a family of single-purpose crates, one per C2PA embedding method. Each is standalone and independently versioned.

Crate Description
c2pa-structured-text Structured text: ASCII-armoured manifest in a comment or front matter
c2pa-unstructured-text Unstructured text: invisible Unicode variation-selector run
c2pa-html HTML: script and link elements in the document head
c2pa-http HTTP: the c2pa-manifest Link header, with a Tower middleware
c2pa-vtt WebVTT caption and subtitle embedding
c2pa-zip ZIP-based documents: EPUB, DOCX, ODT, OXPS
c2pa-warc WARC web archive embedding (ISO 28500)
c2pa-fonts OpenType/TrueType (SFNT) font embedding
c2pa-ml ML model containers: GGUF, SafeTensors, ONNX
c2pa Official C2PA SDK

Security

Found a vulnerability? Please report it privately — see SECURITY.md.

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.

Built by WritersLogic

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

c2pa_text_binding-0.3.0.tar.gz (101.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

c2pa_text_binding-0.3.0-cp39-abi3-win_amd64.whl (503.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

c2pa_text_binding-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (659.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

c2pa_text_binding-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (631.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

c2pa_text_binding-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.2 MB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file c2pa_text_binding-0.3.0.tar.gz.

File metadata

  • Download URL: c2pa_text_binding-0.3.0.tar.gz
  • Upload date:
  • Size: 101.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for c2pa_text_binding-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c1c2c3a35a4b95682f7cfbba359f9403cc3cb62f5a0f686c8cd79016c6a190db
MD5 aae7ce44291624948f02bb2e8d9d85bd
BLAKE2b-256 1baed27daea1ec8c8e123c0b04b794b731bbeb48bbcea896a2d111bf16020a84

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.3.0.tar.gz:

Publisher: release.yml on writerslogic/c2pa-text-binding

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_text_binding-0.3.0-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for c2pa_text_binding-0.3.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 25ed30c1ffef55e932e5abc82d14fb9ade5f35628b1529d2b621e5e1a0baf9c9
MD5 a3986032ee78fbd18108e811e2178027
BLAKE2b-256 fd2cfaff360a02b739a295faaf57cb84a1d9ec80d080d7812324490e6175e6ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.3.0-cp39-abi3-win_amd64.whl:

Publisher: release.yml on writerslogic/c2pa-text-binding

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_text_binding-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for c2pa_text_binding-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36bc2a9190130d85bfe70fe5899cc3855b302f0f453d0504d3be2338a641a244
MD5 6d4ec17ab6f634469745a447a1f0d9d6
BLAKE2b-256 329136030d51e98abcfdacd875037e97be4a6bf29977eb014923ffbffe0f8c18

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on writerslogic/c2pa-text-binding

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_text_binding-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for c2pa_text_binding-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 66d59f8b1a87dca49a37d1c19a8940393605c555857823238b20d0bd2f036f03
MD5 181f448480125d2bd5af6f6f650c2008
BLAKE2b-256 8192640d10f9e91e7a388c0f3170c2cfe01330c1c77d7441784ff70299fa75b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on writerslogic/c2pa-text-binding

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_text_binding-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for c2pa_text_binding-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 d0fa45c02803beda9b022d5fe7f12894c040fe6f8aeabfc5c7409d96a80f76ac
MD5 524243b55526f6097ae2d6db1b05c651
BLAKE2b-256 8fd56ad6dec2eb48e26e2ea20f86d708013914e0ae08318e00d6fa40858c3f32

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on writerslogic/c2pa-text-binding

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

5 files

0.2.0

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page