C2PA soft binding and content fingerprinting for text assets
Provides a trait-based interface for text content fingerprinting algorithms compatible with the C2PA Soft Binding framework. Implementations generate content-derived fingerprints that survive reformatting, re-encoding, and partial modification of text content, enabling manifest recovery when hard bindings are broken.
Where hard bindings (cryptographic hashes) break on any byte-level change, soft bindings use perceptual fingerprints to re-associate content with its provenance even after transformation.
[dependencies]
c2pa-text-binding = "0.1"use c2pa_text_binding::{TextFingerprint, FingerprintResult, Error};
struct MyAlgorithm;
impl TextFingerprint for MyAlgorithm {
fn algorithm_id(&self) -> &str {
"com.writerslogic.text-fingerprint-v1"
}
fn generate(&self, text: &str) -> Result<FingerprintResult, Error> {
// Your fingerprinting implementation
todo!()
}
fn match_fingerprint(
&self,
text: &str,
fingerprint: &[u8],
) -> Result<f64, Error> {
// Returns confidence score 0.0..=1.0
todo!()
}
}Fingerprinting algorithms can be registered with the C2PA Soft Binding Resolution API to enable decentralized manifest recovery for text assets.
| 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 |
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Built by WritersLogic