#user-name #identity #third-party #credentials #key-pair #public #asymmetric

zemi-identity

Identity tools that can be used to create credentials without a trusted third party. This library can deterministically produce an asymmetric keypair from user credentials. It also generates a consistent public identity tied to the provided username that cannot easily be used to discover the username.

2 releases

0.1.1 Nov 16, 2022
0.1.0 Nov 15, 2022

#787 in Authentication

MIT license

18KB
277 lines

zemi-identity

Zemi Identity

Identity tools that can be used to create credentials without a trusted third party. This library can deterministically produce an asymmetric keypair from user credentials. It also generates a consistent public identity tied to the provided username that cannot easily be used to discover the username.

Important Exports

Version 1 (current)

  • Uses Argon2di to derive key material.
  • Uses ed25519 elliptical curve cryptography for keys.

Example: From Credentials

let identity = Identity::from_credentials("username", "password", "salt", Version::V1)?;
let signature = identity.sign(b"message")?;
let verify_op = identity.verify(b"message", &signature);
assert!(verify_op.is_ok());

Example: To Public Identity

let identity = Identity::from_credentials("username", "password", "salt", Version::V1)?;
let public = identity.to_public_identity();
let verify_op = public.verify(b"message", &signature);
assert!(verify_op.is_ok());

Dependencies

~4.5MB
~90K SLoC