You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for providing ML-KEM library for rust.
I'm checking documentation but I'm unable to find a resource on how to marshal encapsulation key (generated from keypair),.
What I want to achieve is that the c# application can initiate a key exchage and the server can return an encapsulation key to generate a sharedkey, in turn the server will consume the cipherText to create its own shared key.
I'm stuck on this challenge: in turn the server will consume the cipherText to create its own shared key.
// assume the c# application already receive the publickey and sharedkey, but the server has to consume the cipherText to generate its own sharedkey
let decoded_bytes = base64::engine::general_purpose::STANDARD
.decode(text.as_bytes())
.expect("Failed to decode Base64 private key");
const SIZE: usize = 128;
let array: [u8; SIZE] = payload.as_ref().try_into().expect("Slice with incorrect length");
let encapsulation_key: EncapsulationKey<MlKem1024Params> = EncapsulationKey::<MlKem1024Params>::from_bytes(array);
// Retrieve the encoded ciphertext
let encoded_ciphertext = encapsulation_key.as_bytes();
let shared_key =dk.decapsulate(&encoded_ciphertext).unwrap();
println!("Shared Key: : {:?}", shared_key);
let encrypted_response = Bytes::from(shared_key);
let _ = client.publish(reply_to, encrypted_response).await;
Is there a plan to easily export public keys to external system, so its easy to generate shared key.
The text was updated successfully, but these errors were encountered:
@ghostidentity you don't ever appear to be calling the EncapsulationKey::encapsulate method, which would actually generate an encapsulated key message. Instead you're doing this:
// Retrieve the encoded ciphertextlet encoded_ciphertext = encapsulation_key.as_bytes();
...but that's the serialization of the encapsulation key itself. You still need to actually use that key to encrypt a message.
First of all, thanks for providing ML-KEM library for rust.
I'm checking documentation but I'm unable to find a resource on how to marshal encapsulation key (generated from keypair),.
What I want to achieve is that the c# application can initiate a key exchage and the server can return an encapsulation key to generate a sharedkey, in turn the server will consume the cipherText to create its own shared key.
I'm stuck on this challenge: in turn the server will consume the cipherText to create its own shared key.
Is there a plan to easily export public keys to external system, so its easy to generate shared key.
The text was updated successfully, but these errors were encountered: