An open API service indexing awesome lists of open source software.

https://github.com/kazuakiishiguro/diffie-hellman

This is a toy sample of how DH key exchange works
https://github.com/kazuakiishiguro/diffie-hellman

diffie-hellman rust

Last synced: 17 days ago
JSON representation

This is a toy sample of how DH key exchange works

Awesome Lists containing this project

README

          

# Diffie Hellman

A portable DH key exchange toy-example.

:warning: **WARNING**: This library has not been audited, so please do not use for production code.

## Example

```rust
use diffie_hellman::{private_key, public_key, secret};

let p: u64 = 11;

// Assume Alice wants to share secret with Bob
let priv_a: u64 = 7; // Alice's private key
let pub_b: u64 = 8; // Bob's public key

// Share secret
let secret = secret(p, pub_a, prib_b);
let expected: u64 = 2;
assert_eq!(secret, expected);
```

## License

License under

* [MIT license](http://opensource.org/licenses/MIT)