Crates.io | ez_pqcrypto |
lib.rs | ez_pqcrypto |
version | 0.1.0 |
source | src |
created_at | 2020-02-11 22:02:17.174111 |
updated_at | 2020-02-11 22:02:17.174111 |
description | Abstracts over pqcrypto. Allows selecting a post-quantum encryption algorithm by setting a single byte-sized value. Useful for multi-algorithmic or nondeterministic schemes |
homepage | https://thomaspbraun.com/ |
repository | https://github.com/tbraun96/ez_pqcrypto/ |
max_upload_size | |
id | 207481 |
size | 28,194 |
Abstracts over pqcrypto. Allows selecting a post-quantum encryption algorithm by setting a single byte-sized value. Useful for multi-algorithmic or nondeterministic schemes
// Alice wants to share data with Bob. She first creates a PostQuantumContainer
let mut alice_container = PostQuantumContainer::new_alice(algorithm_dictionary::BABYBEAR);
// Then, alice sender her public key to Bob. She must also send the byte value of algorithm_dictionary::BABYBEAR to him
let alice_public_key = alice_container.get_public_key();
let algorithm_byte_value = algorithm_dictionary::BABYBEAR;
//
// Then, Bob gets the public key. To process it, he must create a PostQuantumContainer for himself
let bob_container = PostQuantumContainer::new_bob(algorithm_byte_value, alice_public_key);
// Internally, this computes the CipherText. The next step is to send this CipherText back over to alice
let bob_ciphertext = bob_container.get_ciphertext();
//
// Next, alice received Bob's ciphertext. She must now run an update on her internal data in order to get the shared secret
alice_container.alice_on_receive_ciphertext(bob_ciphertext);
assert_eq!(alice_container.get_shared_secret(), bob_container.get_shared_secret());