Crates.io | crypto_kx |
lib.rs | crypto_kx |
version | 0.2.1 |
source | src |
created_at | 2021-09-13 15:37:45.012695 |
updated_at | 2023-07-22 20:59:38.85922 |
description | Pure Rust implementation of libsodium's crypto_kx using BLAKE2 |
homepage | https://github.com/RustCrypto/nacl-compat |
repository | https://github.com/RustCrypto/nacl-compat/tree/master/crypto_kx |
max_upload_size | |
id | 450615 |
size | 16,782 |
crypto_kx
Pure Rust implementation of libsodium's crypto_kx
primitive.
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.
Licensed under either of:
at your option.
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.