Skip to main content

ISCC-CRYPTO - cryptographic operations for the International Standard Content Code

Project description

ISCC - Crypto

Tests

iscc-crypto is the cryptographic signing and verification module for the ISCC (International Standard Content Code) Framework.

[!CAUTION] This is a proof of concept. All releases with version numbers below v1.0.0 may break backward compatibility. The algorithms and code of this repository are experimental and not part of the official ISO 24138:2024 standard. This library has not undergone a formal security audit by independent third parties. While we strive to follow best practices and have implemented various security measures, the absence of an audit means there may be undiscovered vulnerabilities. Therefore, this library should not be used in production environments where strong security guarantees are critical.

Features

  • Ed25519 key generation and management
  • JSON canonicalization and signing
  • W3C Verifiable Credentials Data Integrity proofs
  • Multibase and multikey support
  • Minimal external dependencies for core cryptographic operations

Installation

Use the package manager pip to install iscc-crypto:

pip install iscc-crypto

Quick Start

>>> import json
>>> import iscc_crypto as icr

>>> # Use fixed test keys for deterministic output
>>> keypair = icr.key_from_secret("z3u2So9EAtuYVuxGog4F2ksFGws8YT7pBPs4xyRbv3NJgrNA")

>>> # Sign a JSON document
>>> doc = {"title": "My Document", "content": "Important data"}
>>> signed_doc = icr.sign_json(doc, keypair)

>>> # Show the signed document structure
>>> print(json.dumps(signed_doc, indent=2))
{
  "title": "My Document",
  "content": "Important data",
  "signature": {
    "version": "ISCC-SIG v1.0",
    "pubkey": "z6MkpFpVngrAUTSY6PagXa1x27qZqgdmmy3ZNWSBgyFSvBSx",
    "proof": "z5xCgXk6tGJTVcvrcvVok5XgLn5Mefo49ztwwW8QCmjoySH4ZEkri4XoY2JjiyaD7yD4Na7eoGPqmhPoeM2uvBmF8"
  }
}

>>> # Verify the signed document
>>> icr.verify_json(signed_doc)
VerificationResult(signature_valid=True, identity_verified=None, message=None)

Documentation

Documentation is published at https://crypto.iscc.codes

Development

Requirements

Development Setup

git clone https://github.com/iscc/iscc-crypto.git
cd iscc-crypto
uv sync

Testing

Run the test suite:

uv run pytest

Maintainers

@titusz

Contributing

Pull requests are welcome. For significant changes, please open an issue first to discuss your plans. Please make sure to update tests as appropriate.

You may also want to join our developer chat on Telegram at https://t.me/iscc_dev.

License

iscc-crypto is licensed under the Apache License, Version 2.0

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

iscc_crypto-0.3.0.tar.gz (310.8 kB view details)

Uploaded Source

Built Distribution

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

iscc_crypto-0.3.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iscc_crypto-0.3.0.tar.gz
  • Upload date:
  • Size: 310.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for iscc_crypto-0.3.0.tar.gz
Algorithm Hash digest
SHA256 22bcec6ab7328a35ec44078f8b49a309e930f5f13847df4c32ee4305525550a3
MD5 852e671429fff727e92bd045c7efa188
BLAKE2b-256 f1b82e4ca26568aff53284835f1508e4748cf70306d7d502707e29c0c49e4f97

See more details on using hashes here.

File details

Details for the file iscc_crypto-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iscc_crypto-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e674bad99d5c3fecc6aa9cb9873bd934378fdb79a92348cb60e0494430c4493
MD5 9a221afee7a42d898fa7463d656e91b5
BLAKE2b-256 dec9b4efaa633fc714e5ef0e0a00c38dc0e63a153eaee06ea72f8f338cbacd3a

See more details on using hashes here.

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