Giter Club home page Giter Club logo

verifiable's Introduction

Verifiable project logo: A shield in blue hues with a rounded top that narrows downwards in a 'V' like shape. In the center there is the tip of white 'V' that elongates across the left corner of the shield to white background. Undernath the lower side of 'V' there is a stylistic key handle also elongating over the edge of the shield.

Decentralized identifiers, verifiable credentials, associated protocols and key management with hardware security elements.

Main build workflow

Mutation testing badge


Features

  • Decentralized identifiers (DID).
  • Verifiable credentials (VC).
  • Various related protocols to DIDs and VCs.
  • Key and secrets management.
  • A simple .NET tool, Verifiable, to use the libraries.
Library NuGet
Verifiable NuGet
Verifiable.NSec NuGet
Verifiable.Core NuGet
Verifiable.BouncyCastle NuGet
Verifiable.Tpm NuGet
Verifiable.Sidetree NuGet
Verifiable.Microsoft NuGet
Verifiable.Jwt NuGet
Verifiable.Security.DataStorage NuGet

Quickly about practicalities

Please, open an issue if you have a suggestion, improvement (e.g. even fixing a typo) or something in mind that could be useful and worth considering.

Pressing . on keyboard on this repository page or when viewing any file to open this codebase in VS Code web editor is also a good way to get a feel of the code. See more great tips at 10 Fun Things You Can Do With GitHub.dev by @lostintangent.

Otherwise the usual things about forking and sending pull requests work too. :)

This is an early version under development. All will be breaking.


This repository contains projects that implement .NET libraries for W3C decentralized identifier specification (DID), Verifiable Credentials and related technologies from Decentralized Identity Foundation (DIF).

In simple terms these libraries implement a specification for documents that have distinquishing identifier, can be signed, linked, timestamped, managed and combined into representations without the necessity of a central, governing party but can also function well with such parties (eIDAS may be one).

Since this technology and its likely applications rely on cryptography, these libraries include basic implementation for management of secrets such as the created documents and their material. Technologies include trusted platform modules (TPM), hardware security modules (HSM) and other potential technology such secure enclaves.

Quick links


The design principles

  • Agnostic to serialization and deserialization library. The design principles for DIDs and VCs and other data elements do not rely on specific deserialization and serialization (e.g. no library specific attributes on types) libraries. Current implementation uses System.Text.Json converters. CBOR could be interesting.
  • Data oriented programming. Or leaning towards it. The code is structured around the idea of parameters going in functions and results from return values. Or in more length: code is separate from (immutable) data, leaning generic data structures and general-purpose functions (extenstions methods and static methods).
  • Sensitive memory is ring-fenced using types. The goal is to recognize sensitive key material and handle it appropriately (noting security practices and regulations). Currently public, private and other key material is ring-fenced to types. The types are wrappes that know how to point to and and unwrap material to operations. The material can be allocated using MemoryPool<T> and so a custom allocator can be provided (e.g. for mlocked memory regions).
  • Agnostic to underlying cryptographic implementation. The design should allow using external, special libraries. Currently BouncyCastle, NSec.Cryptography and .NET standard cryptography are included (TPM is in progress).
  • Hardware security elements. It should be possible to use hardware security elements, such as trusted platform modules.
  • Developer experience. Writing against an evolving specification or some specific specifications can be difficult. It takes time to learn. So code shoud link in comments to W3C and RFCs where appropriate (see code for examples).
  • Tests and tests that use real data. There should be as much tests as possible. Also thests that use as test vectors data from other implementations to cross-check.

Vulnerability disclosure

If you find a vulnerability in this project please let us know as soon as possibly. For secure disclosure, please see the security policy.

Contributing

Please, read contribution guidelines for technicalities.

For development, the code and project should run on Windows, Linux and MacOS. Some hardware specific elements may work on only some operating systems.

Community at TPM.DEV for TPM related study materials and discussions could be great, they have also.

Taking something from contribution guide and adding specific ideas.

The usual things :)

๐Ÿ‘€ Please, do write issues.

๐Ÿ™Œ By all means, do create pull requests (see contribution guidelines).

โญ Stars are always nice. :)

The code things

โœ… Adding tests is really good, of course.

๐Ÿ’ป adding TPM functionality (signing, encryption, permissions) โ€“ and tests.

๐Ÿ’ญ Issue templates and other improvements to project.

๐Ÿš€ improve continuous integration automation is always good!

๐Ÿ” Add more cryptographic and security capabilities.

๐Ÿ”‘ As a corollary, add X509 related functionality.

๐Ÿ“˜ Support for more protocols (see at https://identity.foundation/).

The things writing code

๐Ÿ“ Threat and privacy modelling diagrams and explanations would be cool! LINDDUN is a great one! But not the only one! A nice compilation to choose from is SEI: Threat Modeling: 12 Available Methods. These really need to be written down at some point.

๐Ÿ“– Draft plans, add documents and eIDAS data objects and some algorithms.

Repository visualization

Visualization of this repo

verifiable's People

Contributors

dependabot[bot] avatar reubenbond avatar veikkoeeva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

verifiable's Issues

See what is required to ensure libraries work in Tizen environment

Since Tizen is used, it should be explicitly checked what the operating environments it is exposed to mean for Verifiable libraries. The plan is already to delegate cryptographic functionality to either libraries or the platform in discretion of the programmer, but it may be worth seeing what combination works well and test (and pre-provide) that.

A notable case here is (potential) wallet functionality.

Switch some signatures to use ValueTask and implement IAsyncDisposable

At the moment (in did:key branch) while shaping APIs some API signatures (mostly delegates) that could end up calling asynchronous operations are synchronous. It would make sense to refactor these signatures to expose only ValueTask<T>. Accompanying this, code should add IAsyncDisposable in addition IDisposable. Something to consider either after or during did:key branch.

Be mindful regarding EU cybersecurity regulation

It is not clear what liabilities the newly proposed EU cyber security regulation brings to open source developers in general or small startups developing open source in particular. This is a placeholder issue regarding this topic.

Keep payments e.g. PSD2 (FAPI), others in context

This is an explicit note to keep in mind FAPI and and related (e.g. CIBA) in general and for IoT in particular.

There are issues in offering PSD2 payments as a service eID 2, zero-knowledge proofs, SSI etc. maybe can mitigate too.

Also interesting are the EU and other sandboxes on Central Bank Digital Currencies (CBDCs). E.g. Norway:
https://github.com/nahmii
https://blog.nahmii.io/norges-bank-cbdc-sandbox-code-now-public-3afb10463731

These use cases are not the core focus of this library, or driving focus at the moment, but important nevertheless.

Key material typing, rotation, context and hardware support

Currently there are rough sketch of separate key material and key handling code. In the code this shows as SentitiveMemory, PublicKeyMemory, PrivateKeyMemory and related types.

For the plain key material, the idea:

  1. Use type checking as rudimentary safeguard against misusing public/private key material.
  2. Have a type that can include context information and information on data layout (e.g. how the key material is stored) with the raw material.
  3. Have a well defined type to access the material if it is located actually in a security chip, a separate process space, remote server and so on.
  4. Have a baseline to work towards key management functionality.

Some of these will be tested (e.g. TPM/security chip usage), for others such as Pkcs11Interop it may make sense to write an integration example.

Further notes and thoughts

Trying to remove the need to trust cloud providers
Quick update on Pluton and Linux
https://transparency.dev/application/strengthen-discovery-of-encryption-keys/ and at https://ioc.exchange/@matthew_d_green/109513247860625543.

Git Credential Manager Web Account Manager integration: https://github.com/GitCredentialManager/git-credential-manager/blob/main/docs/windows-broker.md, https://github.com/GitCredentialManager/git-credential-manager

https://github.com/ionescu007/tpmtool

NIST SP 800-63 Digital Identity Guidelines (Call for Comments on Initial Public Draft of Revision 4)
[Security and Privacy Controls for Information Systems and Organizations](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final]

And material related to EU Cyber Resiliency Act.

Consider WASM as a compilation target (not only Blazor)

Here Blazor and WASM without Blazor are more important than WASI.

Some other notes

WebCrypto could mean using RSA (or ECDSA). In this case keyAgreement could mean https://datatracker.ietf.org/doc/html/rfc6101#section-6.1.1.

It may be https://w3c.github.io/webappsec/admin/webappsec-charter-2021.html will define Ed25519 (and X25519) support and browsers implement it quickly. It also appears LibSodium can be compiled to WASM.

Explicit notes:

  • There should be possibility, maybe even dynamically selective, to choose either platform or library provided libraries to be used. One scenario: easy testing on some actual platform.
  • Adequate testing of WASM and when using platform specific cryptograhic implementations.

See also publishing wasm files, e.g. at https://dev.to/azure/exploring-net-webassembly-with-wasi-and-wasmtime-41l5.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.