From 6f743db600ba90ed872ec3f95d146b6fbb3caa09 Mon Sep 17 00:00:00 2001 From: Alberto Solavagione Date: Mon, 28 Oct 2024 18:01:08 +0100 Subject: [PATCH] jpt docs --- docs_jpt/getting-started.md | 28 ++++++++++ docs_jpt/intro.md | 20 ++++++- docs_jpt/supported-features.md | 96 ++++++++++++++++++++++++++++++++++ docs_zkryptium/intro.md | 4 +- 4 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 docs_jpt/getting-started.md create mode 100644 docs_jpt/supported-features.md diff --git a/docs_jpt/getting-started.md b/docs_jpt/getting-started.md new file mode 100644 index 0000000..d03eb50 --- /dev/null +++ b/docs_jpt/getting-started.md @@ -0,0 +1,28 @@ +--- +sidebar_position: 3 +--- + +# Getting Started + + +### Requirements + +- [Rust](https://www.rust-lang.org/) (>= 1.65) +- [Cargo](https://doc.rust-lang.org/cargo/) (>= 1.65) + + +### Usage + +Add this to your Cargo.toml: + +``` +[dependencies] +json-proof-token = "0.3.5" +``` + +### Example +Take a look at the [examples](https://github.com/Cybersecurity-LINKS/json-proof-token/tree/main/examples). + +## Tests + +TBD \ No newline at end of file diff --git a/docs_jpt/intro.md b/docs_jpt/intro.md index 0d1a759..42118c8 100644 --- a/docs_jpt/intro.md +++ b/docs_jpt/intro.md @@ -5,4 +5,22 @@ sidebar_position: 1 # json-proof-token -TODO \ No newline at end of file +> [GitHub](https://github.com/Cybersecurity-LINKS/json-proof-token) + +**json-proof-token** is Rust library implementing the new [JOSE Working Group](https://datatracker.ietf.org/wg/jose/documents/) drafts: +- [JSON Web Proof](https://datatracker.ietf.org/doc/html/draft-ietf-jose-json-web-proof-03) +- [JSON Proof Algorithms](https://datatracker.ietf.org/doc/html/draft-ietf-jose-json-proof-algorithms-03) +- [JSON Proof Token](https://datatracker.ietf.org/doc/html/draft-ietf-jose-json-proof-token-03) + +The specification work for this can be found [here](https://github.com/json-web-proofs/json-web-proofs) and aims to establish a new JSON based container as a new entry in the JOSE family of container formats +Support for newer cryptographic techniques and new features such as: +* Selective Disclosure +* Unlinkability +* Predicates + +This library, together with [ZKryptium](../zkryptium/intro), has been integrated into the [IOTA Identity Framework](https://github.com/iotaledger/identity.rs/pull/1285) to enable support for Zero-Knowledge Selective Disclosure Verifiable Credentials. + +### Decoder + +[Here](https://cybersecurity-links.github.io/json-proof-token/) you can find a simple decoder for JSON Proof Tokens. + diff --git a/docs_jpt/supported-features.md b/docs_jpt/supported-features.md new file mode 100644 index 0000000..e19ae69 --- /dev/null +++ b/docs_jpt/supported-features.md @@ -0,0 +1,96 @@ +--- +sidebar_position: 2 +--- + +# Supported Features + +### JSON Web Keys (JWK) + +JWK is defined in [RFC 7517](https://tools.ietf.org/html/rfc7517). + +> **NOTE**: To represent **BLS** keys this implementation refers to [draft-ietf-cose-bls-key-representations-05](https://datatracker.ietf.org/doc/html/draft-ietf-cose-bls-key-representations-05). + +JWKs are currently used in the proof generation and verification of JWPs. + +The tables below represent which `kty` and `crv` are supported at momement. + +#### JWK Key Type + +| Key Type | Support | +|:--------:|:-------:| +| `OKP` | ✔ | +| `EC` | ✔ | +| `RSA` | ✘ | +| `oct` | ✘ | + + +#### JWK Elliptic Curve +The standard list of Elliptic Curves can be found [here](https://www.iana.org/assignments/jose/jose.xhtml#web-key-elliptic-curve): + +| Curve Name | Support | +|:---------:|:-------:| +| `P-256` | ✘ | +| `P-384` | ✘ | +| `P-521` | ✘ | +| `secp256k1` | ✘ | +| `Ed25519` | ✘ | +| `Ed448` | ✘ | +| `X25519` | ✘ | +| `X448` | ✘ | + + +This list is made from the currenlty active draft [Barreto-Lynn-Scott Elliptic Curve Key Representations for JOSE and COSE - v05](https://datatracker.ietf.org/doc/html/draft-ietf-cose-bls-key-representations-05#section-2.2.3). + +| Curve Name | Support | +|:---------:|:-------:| +| `BLS12381G2` | ✔ | +| `BLS12381G1` | ✘ | +| `BLS48581G2` | ✘ | +| `BLS48581G2` | ✘ | + +### JSON Web Proof Algorithms + +The supported algorithm are defined in in the [JPA](https://datatracker.ietf.org/doc/html/draft-ietf-jose-json-proof-algorithms) specification. + +> NOTE: Keep in mind that these specifications are in the early stages, and there is a high likelihood that they will undergo significant changes in the future. + +#### Single Use +| Algorithm | Support | Remarks | +|:---------:|:-------:|:-------:| +| `SU-ES256` | ✘ | Named [here](https://datatracker.ietf.org/doc/html/draft-ietf-jose-json-proof-algorithms#section-6.1.10) | + + + +#### BBS + +> **Note**: This library leverages the [ZKryptium](../zkryptium/intro) cryptographic library to perform BBS algorithm operations. + +The `BBS-SHAKE256` and `BBS-SHAKE256-PROOF` values are temporary and await an update to the official draft that will define names to support the ciphersuite `BBS_BLS12381G1_XOF:SHAKE-256_SSWU_RO_H2G_HM2S_` specified in [BBS+](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bbs-signatures-07#name-bls12-381-ciphersuites).: + +| Algorithm | Support | Remarks | +|:---------:|:-------:|:-------:| +| `BBS` | ✔ | | +| `BBS-SHAKE256` | ✔ | | +| `BBS-PROOF` | ✔ | | +| `BBS-SHAKE256-PROOF` | ✔ | | + +#### MAC + +These are defined [here](https://datatracker.ietf.org/doc/html/draft-ietf-jose-json-proof-algorithms#section-6.3.9): + +| Algorithm | Support | Remarks | +|:---------:|:-------:|:-------:| +| `MAC-H256` | ✘ | | +| `MAC-H384` | ✘ | | +| `MAC-H512` | ✘ | | +| `MAC-K25519` | ✘ | | +| `MAC-K448` | ✘ | | +| `MAC-H256K` | ✘ | | + + +### JSON Web Proof Serialization + +| Format | Support | +|:----------------:|:---------:| +| Compact | ✔ | +| JSON | ✘ | \ No newline at end of file diff --git a/docs_zkryptium/intro.md b/docs_zkryptium/intro.md index f41e829..32a0e1a 100644 --- a/docs_zkryptium/intro.md +++ b/docs_zkryptium/intro.md @@ -4,7 +4,9 @@ sidebar_position: 1 # ZKryptium -[**ZKryptium**](https://github.com/Cybersecurity-LINKS/zkryptium) is a cryptographic library written in Rust which provides an implementation in accordance with: +> [GitHub](https://github.com/Cybersecurity-LINKS/zkryptium) + +**ZKryptium** is a cryptographic library written in Rust which provides an implementation in accordance with: * [BBS+ Signature Scheme](./algorithms/bbs.md#bbs) * [Blind BBS Signatures](./algorithms/bbs.md#blind-bbs-signature-extension) * [CL2003 Signature Scheme](./algorithms/cl03.md#cl03)