Registry / crypto / libsodium-sys-stable

libsodium-sys-stable

JSON →
library1.24.0rscratesunverified

Maintained FFI bindings for the libsodium cryptographic library (stable branch).

# Cargo.toml [dependencies] libsodium-sys-stable = "1.24.0"
INSTALL
IMPORT
SIG · LIBSODIUM-SYS-STAB
L
libsodium-sys-stable
cryptorustv1.24.0
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.

crypto_secretbox_easy
use libsodium_sys_stable::crypto_secretbox_easy;

Encrypts a message using libsodium secretbox.

use libsodium_sys_stable::crypto_secretbox_easy; fn main() { unsafe { let key = [0u8; 32]; let nonce = [0u8; 24]; let msg = b"hello"; let mut ciphertext = vec![0u8; msg.len() + 16]; crypto_secretbox_easy(ciphertext.as_mut_ptr(), msg.as_ptr(), msg.len() as u64, nonce.as_ptr(), key.as_ptr()); println!("Encrypted"); } }
Debug
Known issues
gotchaRequires libsodium system library to be installed.
fix
Install libsodium via package manager (e.g., apt install libsodium-dev).
affects: >=1.0.0
Upgrade
Version history
1.24.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
libsodium-sys-stable — cargo add libsodium-sys-stable · libregistry