| Crates.io | lockboxer |
| lib.rs | lockboxer |
| version | 0.2.0 |
| created_at | 2025-08-30 08:27:42.589103+00 |
| updated_at | 2025-09-04 04:46:56.426851+00 |
| description | Configurable fork of Lockbox encryption library. |
| homepage | https://github.com/kimlindholm/lockboxer |
| repository | https://github.com/kimlindholm/lockboxer |
| max_upload_size | |
| id | 1817382 |
| size | 43,028 |
Lockboxer is a configurable fork of Lockbox Rust library that provides easy-to-use, secure, and efficient
encryption and decryption using the AES-GCM (Galois/Counter Mode) algorithm.
It ensures data integrity and confidentiality while offering flexibility for various use cases.
To use Lockboxer in your Rust project, add the following to your Cargo.toml:
[dependencies]
lockboxer = "0.2"
Here’s a quick example to get you started with Lockboxer:
use lockboxer::Vault;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Generate a random key
// This is for demo purposes. In a real situation you'll want to
// use a stable key.
let key = lockboxer::generate_key();
// Initialize a vault with the key
let vault = Vault::new(&key);
// Or with config options:
let vault = Vault::new(&key)
.with_tag("Custom.Tag.V1")
.with_aad("Custom.AAD");
// Encrypt some plaintext
let plaintext = b"Hello, secure world!";
let encrypted = vault.encrypt(plaintext)?;
println!("Encrypted: {:?}", encrypted);
// Decrypt the ciphertext
let decrypted = vault.decrypt(&encrypted)?;
println!("Decrypted: {}", String::from_utf8(decrypted)?);
Ok(())
}