sealed_box

Crates.iosealed_box
lib.rssealed_box
version0.2.8
sourcesrc
created_at2021-05-21 14:46:11.130716
updated_at2024-05-09 21:23:52.281053
descriptionLibsodium sealed_box construction for Rust/WebAssembly
homepagehttps://github.com/jedisct1/rust-sealed_box
repositoryhttps://github.com/jedisct1/rust-sealed_box
max_upload_size
id400361
size71,981
Frank Denis (jedisct1)

documentation

README

Sealed boxes for Rust/WebAssembly

This Rust crate provides libsodium sealed boxes for WebAssembly.

Usage:

// Recipient: create a new key pair
let recipient_kp = sealed_box::KeyPair::create();

//  Sender: encrypt the message for the recipient whose public key is recipient_kp.pk
let msg = b"test";
let ciphertext = sealed_box::seal(msg, recipient_kp.pk);

// Recipient: decrypt the ciphertext using the key pair
let decrypted_msg = sealed_box::open(&ciphertext, &recipient_kp).unwrap();

assert_eq!(msg[..], decrypted_msg);

Compile with cargo wasix.

Commit count: 35

cargo fmt