#public-key #libsodium #blake2 #communication-channel #private-key #nacl

no-std crypto_kx

Pure Rust implementation of libsodium's crypto_kx using BLAKE2

6 releases

0.2.1 Jul 22, 2023
0.2.0 Jul 22, 2023
0.2.0-pre.0 May 30, 2023
0.1.0 Aug 14, 2022
0.0.1 Sep 13, 2021

#2397 in Cryptography

Download history 519/week @ 2023-12-13 290/week @ 2023-12-20 111/week @ 2023-12-27 320/week @ 2024-01-03 472/week @ 2024-01-10 580/week @ 2024-01-17 480/week @ 2024-01-24 511/week @ 2024-01-31 544/week @ 2024-02-07 589/week @ 2024-02-14 657/week @ 2024-02-21 702/week @ 2024-02-28 793/week @ 2024-03-06 1006/week @ 2024-03-13 846/week @ 2024-03-20 909/week @ 2024-03-27

3,638 downloads per month
Used in 2 crates

Apache-2.0 OR MIT

16KB
234 lines

RustCrypto: crypto_kx

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Pure Rust implementation of libsodium's crypto_kx primitive.

Documentation

About

Imagine Alice wants to open a safe communication channel with Betty, using something like crypto_secretstream. They first need to agree on a shared secret.

To obtain this shared secret, Diffie-Hellman can be used, which works as follows: Suppose both Alice and Betty know the public key of each other. Then they use their private key and the other's public key to generate a secret. This secret is the same for both Alice and Betty, as described by the Diffie-Hellman algorithm. No eavesdropper can know what the secret is, as they only know the public keys, but not the private keys.

Using the same key for sending and receiving might pose cryptographic issues and/or reduce the overall throughput. So when computing the shared secret, you actually get two keys, one for each direction.

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.6–2.5MB
~54K SLoC