Registry / crypto / crypto-box

crypto-box

JSON →
library0.9.1rscratesunverified

Pure Rust implementation of NaCl's crypto_box public-key authenticated encryption primitive.

# Cargo.toml [dependencies] crypto_box = "0.9.1"
INSTALL
IMPORT
SIG · CRYPTO-BOX
C
crypto-box
cryptorustv0.9.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Box
use crypto_box::Box;

Create a public-key authenticated encryption box.

use crypto_box::{Box, SecretKey, PublicKey}; fn main() { let alice_secret = SecretKey::generate(&mut rand::thread_rng()); let bob_secret = SecretKey::generate(&mut rand::thread_rng()); let bob_public = bob_secret.public_key(); let alice_box = Box::new(&alice_secret, &bob_public); println!("Encryption box created"); }
Debug
Known issues
gotchaRequires the `rand` crate for key generation.
fix
Add `rand` as a dependency and use `rand::thread_rng()`.
affects: >=0.9.0
Upgrade
Version history
0.9.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
crypto-box — cargo add crypto-box · libregistry