Skip to content

jedisct1/rust-sealed_box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Sealed boxes implementation for Rust/WebAssembly.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published