Skip to content

writerslogic/c2pa-text-binding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c2pa-text-binding

C2PA soft binding and content fingerprinting for text assets

crates.io docs.rs License

Overview

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.

Quick Start

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

Implement a fingerprinting algorithm

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!()
    }
}

Register with the Soft Binding Resolution API

Fingerprinting algorithms can be registered with the C2PA Soft Binding Resolution API to enable decentralized manifest recovery for text assets.

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

About

C2PA soft binding and content fingerprinting for text assets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages