Skip to main content

C2PA soft binding and content fingerprinting for text assets (watermark + fingerprint family)

Project description

c2pa-text-binding

C2PA soft binding and content fingerprinting for text assets

CI crates.io docs.rs 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 Algorithm (list id) Kind
simhash com.writerslogic.text-fingerprint.1 (41) surface fingerprint
stego com.writerslogic.zwc-watermark.2 (42) zero-width watermark
structure com.writerslogic.text-structure.1 (43) structural fingerprint
minhash com.writerslogic.text-minhash.1 (44) excerpt/quotation fingerprint

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.1"

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.

Related Crates

Crate Description
c2pa-structured-text Structured text embedding via ASCII armour delimiters
c2pa-text Unstructured text embedding via Unicode Variation Selectors
c2pa-rs Official C2PA SDK

License

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

Built by WritersLogic

Project details


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.2.0.tar.gz (75.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.2.0-cp39-abi3-win_amd64.whl (501.2 kB view details)

Uploaded CPython 3.9+Windows x86-64

c2pa_text_binding-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (657.6 kB view details)

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

c2pa_text_binding-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (629.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

c2pa_text_binding-0.2.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.2.0.tar.gz.

File metadata

  • Download URL: c2pa_text_binding-0.2.0.tar.gz
  • Upload date:
  • Size: 75.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for c2pa_text_binding-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cbdf399c3941c153dd3b81f55cfbe501debf67f01229cbc6f8debe7ab061d22f
MD5 1621529c4e861fe5e41c3ca04d158570
BLAKE2b-256 c142d8866d26c0300420619f2b9e8ccdf7963087674258b5b2129c4dcf212be3

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.2.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.2.0-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for c2pa_text_binding-0.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ff0e3a15d7682454e7d295584cbc2804892281b5a09604280303a9b3af24db3c
MD5 ef10e993fb2937ed2aa78b363df760fa
BLAKE2b-256 23f5a63683837763bd3a740a25acf24129f9f22e029e24ab62b65e0f2666b4d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.2.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.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for c2pa_text_binding-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d0f4aae193f6b1e8435a1179e0221f19bdb303af6fafe6151a28a6ee7ccf668
MD5 cc8e99d261ff3901000f640f5134af4c
BLAKE2b-256 38a0f53f69567c153cf4c9000d7d3923c546862d27ada56f3204a9ece8a2dacb

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.2.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.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for c2pa_text_binding-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 41e6edc6e3cfe8bc0abdddc889623b88b5ca5c5c0ecd849521f89ae8bb46f73f
MD5 3fd79ec7b7d544cdf0b0023d57b9ff29
BLAKE2b-256 88f17db2a8047d101e74b9f7e00c5d8c1fb5e5fb3faacef1df38dfe474a5be5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.2.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.2.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.2.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 965a9befb2476c401f1e6ad98d5610d39d144ed78d0f943611f386028d57bdc2
MD5 3558b74e903256293c233295175a35bf
BLAKE2b-256 21de97226fbdfa644fd7854436bdc97a4d544dc6e943a57a5fb2d2f21139b7ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_text_binding-0.2.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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page