#libsodium #sealed #encryption #boxes #key-pair #recipient

no-std sealed_box

Libsodium sealed_box construction for Rust/WebAssembly

10 releases

0.2.8 May 9, 2024
0.2.7 May 23, 2023
0.2.5 Nov 29, 2022
0.2.4 Jun 29, 2022
0.1.0 May 21, 2021

#1247 in Cryptography

Download history 10/week @ 2024-02-24 21/week @ 2024-03-09 2/week @ 2024-03-16 8/week @ 2024-03-30 146/week @ 2024-05-04 17/week @ 2024-05-11 2/week @ 2024-05-18 3/week @ 2024-05-25 1/week @ 2024-06-01

104 downloads per month

MIT license

71KB
213 lines

Contains (static library, 61KB) wasm-libs/libsealedbox.a

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.

No runtime deps