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
- Host: GitHub
- URL: https://github.com/kazuakiishiguro/diffie-hellman
- Owner: kazuakiishiguro
- License: mit
- Created: 2020-07-29T01:49:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-15T05:12:14.000Z (almost 6 years ago)
- Last Synced: 2025-12-25T11:45:46.127Z (6 months ago)
- Topics: diffie-hellman, rust
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
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)