{"id":18683015,"url":"https://github.com/numbersprotocol/numbers-c2pa","last_synced_at":"2026-02-10T02:32:43.353Z","repository":{"id":103178016,"uuid":"410755470","full_name":"numbersprotocol/numbers-c2pa","owner":"numbersprotocol","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-25T06:51:57.000Z","size":298,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-11-27T12:40:16.676Z","etag":null,"topics":["c2pa","capture-cam","capture-dashboard"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numbersprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-27T05:41:48.000Z","updated_at":"2025-11-25T06:46:35.000Z","dependencies_parsed_at":"2025-04-12T04:31:24.128Z","dependency_job_id":"b14d264f-6f75-47cb-8664-ee0e0ab90839","html_url":"https://github.com/numbersprotocol/numbers-c2pa","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/numbersprotocol/numbers-c2pa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnumbers-c2pa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnumbers-c2pa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnumbers-c2pa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnumbers-c2pa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numbersprotocol","download_url":"https://codeload.github.com/numbersprotocol/numbers-c2pa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnumbers-c2pa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29289486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T02:32:08.756Z","status":"ssl_error","status_checked_at":"2026-02-10T02:30:31.937Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c2pa","capture-cam","capture-dashboard"],"created_at":"2024-11-07T10:13:30.506Z","updated_at":"2026-02-10T02:32:43.347Z","avatar_url":"https://github.com/numbersprotocol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# numbers-c2pa\n\n\n## Setup\n\nInstall Rust\n\n```bash\n$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nInstall c2patool\n\nDownload the prebuilt binary for your platform:\n\n```bash\n# For macOS (Universal Binary - Apple Silicon \u0026 Intel)\ncurl -L -o c2patool.zip https://github.com/contentauth/c2pa-rs/releases/download/c2patool-v0.26.1/c2patool-v0.26.1-universal-apple-darwin.zip\nunzip c2patool.zip\nchmod +x c2patool/c2patool\ncp c2patool/c2patool ~/.local/bin/  # or any directory in your PATH\n\n# For Linux\ncurl -L -o c2patool.tar.gz https://github.com/contentauth/c2pa-rs/releases/download/c2patool-v0.26.1/c2patool-v0.26.1-x86_64-unknown-linux-gnu.tar.gz\ntar -xzf c2patool.tar.gz\nchmod +x c2patool/c2patool\ncp c2patool/c2patool ~/.local/bin/\n\n# For Windows\n# Download: https://github.com/contentauth/c2pa-rs/releases/download/c2patool-v0.26.1/c2patool-v0.26.1-x86_64-pc-windows-msvc.zip\n# Extract and add c2patool.exe to your PATH\n\n# Verify installation\nc2patool --version  # Should show: c2patool 0.26.1\n```\n\nAlternatively, build from source (requires Rust):\n\n```bash\n$ cargo install c2patool --version 0.26.1\n```\n\nInstall numbers-c2pa\n\n```\n$ python3 -m pip install git+https://github.com/numbersprotocol/numbers-c2pa.git\n```\n\n## Usage\n\nC2PA Injection\n\n```python\nfrom datetime import datetime\n\nfrom numbers_c2pa import create_c2pa_manifest, inject_file\n\nif __name__ == '__main__':\n    with open('examples/es256_private.key') as f:\n        private_key = f.read()\n    with open('examples/es256_certs.pem') as f:\n        sign_cert = f.read()\n    manifest = create_c2pa_manifest(\n        nid='this is nid',\n        creator_public_key='this is creator public key',\n        asset_hash='this is sha256hash',\n        date_created=datetime.now(),\n        location_created='123.123, 45.45',\n        date_captured=None,\n    )\n    inject_file(\n        'examples/numbers.png',\n        'examples/numbers-c2pa.png',\n        manifest=manifest,\n        parent_path='examples/numbers.png',\n        private_key=private_key,\n        sign_cert=sign_cert,\n    )\n    # examples/numbers-c2pa.png will be created\n    # Upload file to https://verify.contentauthenticity.org/inspect to view C2PA data\n```\n\nRead C2PA data\n\n```python\nfrom numbers_c2pa import read_c2pa_file\n\nif __name__ == '__main__':\n    c2pa_json = read_c2pa_file('examples/numbers-c2pa.png')\n    print(c2pa_json)\n\n```\n\n## Create self-signed certificate with intermediate CA\n\nAccording to [c2patool](https://github.com/contentauth/c2patool#appendix-creating-and-using-an-x509-certificate) readme:\n\n\u003e Both the private_key and sign_cert must be in PEM format. The sign_cert must contain a PEM certificate chain starting with the end-entity certificate used to sign the claim ending with the intermediate certificate before the root CA certificate. See the sample folder for example certificates.\n\nUsing a intermediate CA certificate is required.\n\n## Updated steps\n\nCreate end-entity and intermediate private keys\n\n```bash\nopenssl ecparam -genkey -name prime256v1 -noout -out intermediate_ca.key\nopenssl ecparam -genkey -name prime256v1 -noout -out end_entity.key\n```\n\nCreate intermediate cert\n\n```bash\nopenssl req -x509 -new -key intermediate_ca.key -out intermediate_ca.crt -subj \"/CN=Numbers Intermediate CA\" -days 365 -sha256\n```\n\nCreate `end_entity_csr.conf` file\n\n```conf\n[ req ]\ndefault_bits = 2048\nprompt = no\ndefault_md = sha256\nreq_extensions = v3_req\ndistinguished_name = dn\n\n[ dn ]\nC = US\nST = California\nL = San Fransisco\nO = Numbers Protocol\nOU = Numbers Protocol\nCN = Numbers Protocol\n\n[ v3_req ]\nbasicConstraints = CA:FALSE\nkeyUsage = digitalSignature, keyEncipherment\nextendedKeyUsage = timeStamping\nsubjectAltName = @alt_names\n\n[ alt_names ]\nDNS.1 = numbersprotocol.io\nDNS.2 = www.numbersprotocol.io\n```\n\nCreate end-entity CSR\n\n```bash\nopenssl req -new -key end_entity.key -out end_entity.csr -config end_entity_csr.conf\n```\n\nCreate end-entity certificate\n\n```bash\nopenssl x509 -req -in end_entity.csr -CA intermediate_ca.crt -CAkey intermediate_ca.key -out end_entity.crt -days 365 -CAcreateserial -extfile end_entity_csr.conf -extensions v3_req -sha256\n```\n\nCombine certificate chain\n\n```bash\ncat end_entity.crt intermediate_ca.crt \u003e certificate_chain.pem\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbersprotocol%2Fnumbers-c2pa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumbersprotocol%2Fnumbers-c2pa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbersprotocol%2Fnumbers-c2pa/lists"}