Registry / crypto / rust-sodium

rust-sodium

JSON →
library0.10.2rscratesunverified

Fast cryptographic library for Rust (bindings to libsodium).

# Cargo.toml [dependencies] rust_sodium = "0.10.2"
INSTALL
IMPORT
SIG · RUST-SODIUM
R
rust-sodium
cryptorustv0.10.2
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.

secretbox
use rust_sodium::crypto::secretbox;

Encrypts a message using secretbox (XSalsa20-Poly1305) from libsodium.

use rust_sodium::crypto::secretbox; fn main() { let key = secretbox::gen_key(); let nonce = secretbox::gen_nonce(); let plaintext = b"Hello, world!"; let ciphertext = secretbox::seal(plaintext, &nonce, &key); println!("Ciphertext: {:?}", ciphertext); }
Debug
Known issues
gotchaRequires libsodium to be installed on the system.
fix
Install libsodium via your package manager or use the 'libsodium-sys' feature.
affects: >=0.1.0
Upgrade
Version history
0.10.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Amazon
1
Resources
rust-sodium — cargo add rust-sodium · libregistry