Metadata-Version: 2.1
Name: iscc-crypto
Version: 0.1.0
Summary: ISCC - Crypto
Home-page: https://iscc.codes
License: Apache-2.0
Keywords: iscc,cryptography,EdDSA,jsc,verifiable credentials,content identification
Author: Titusz
Author-email: tp@py7.de
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Security :: Cryptography
Requires-Dist: base58
Requires-Dist: cryptography
Requires-Dist: jcs
Requires-Dist: python-dotenv
Description-Content-Type: text/markdown

# ISCC - Crypto

[![Tests](https://github.com/iscc/iscc-crypto/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/iscc/iscc-crypto/actions/workflows/test.yml)

`iscc-crypto` is the cryptographic signing and verification module for the
[ISCC](https://iscc.codes) (*International Standard Content Code*) Framework.

## 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](https://pip.pypa.io/en/stable/) to install `iscc-crypto`:

```bash
pip install iscc-crypto
```

## Quick Start

```python
import iscc_crypto as ic

# Generate new Ed25519 keypair
keypair = ic.key_generate()
print(f"Public Key: {keypair.public_key}")
print(f"Secret Key: {keypair.secret_key}")

# Sign a JSON document
doc = {"hello": "world"}
signed = ic.sign_json(doc, keypair)
print(f"Signed Doc: {signed}")

# Verify signature
verified = ic.verify_json(signed)
print(f"Verified Doc: {verified}")

# Create W3C Data Integrity Proof
vc = {"type": "VerifiableCredential", "issuer": "did:web:example.com"}
signed_vc = ic.sign_vc(vc, keypair)
print(f"Signed VC: {signed_vc}")

# Verify W3C Data Integrity Proof
verified, doc = ic.verify_vc(signed_vc, keypair.pk_obj)
print(f"VC Verified: {verified}")
```

## Documentation

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

## Development

**Requirements**

- [Python 3.10](https://www.python.org/) or higher
- [Poetry](https://python-poetry.org/) for dependency management

**Development Setup**

```shell
git clone https://github.com/iscc/iscc-crypto.git
cd iscc-crypto
poetry install
```

**Testing**

Run the test suite:

```shell
poetry run pytest
```

## Maintainers

[@titusz](https://github.com/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 join our developer chat on Telegram at <https://t.me/iscc_dev>.

## License

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

