| Crates.io | bt_secure_storage |
| lib.rs | bt_secure_storage |
| version | 0.2.4 |
| created_at | 2025-10-28 14:15:03.872032+00 |
| updated_at | 2025-11-24 21:52:22.687399+00 |
| description | A simple and lightweight Secret Vault and Encryption Library for Rust to store secrets |
| homepage | https://github.com/bachuetech/bt_secure_storage |
| repository | https://github.com/bachuetech/bt_secure_storage.git |
| max_upload_size | |
| id | 1904811 |
| size | 85,864 |
BT Secure Storage
This library provides a simple secret vault and encryption system using the whoami crate to get the username and the keyring backend to store secrets securely. It also includes an encryption/decryption system based on AES.
let vault = SecretVault::new("my_app");
let cipher = SecretCipher::new();
// Store a secret securely
let service_name = "my_service";
let secret = "super_sensitive_data";
vault.store_secret(service_name, secret)?;
// Retrieve the stored secret
let retrieved_secret = vault.retrieve_secret(service_name)?;
assert_eq!(retrieved_secret, secret);
// Encrypt and decrypt data using AES
let encrypted_data = cipher.encrypt_secret(secret, "my_key")?;
let decrypted_data = cipher.decrypt_secret(&encrypted_data.0, &encrypted_data.1, "my_key")?;
Improve file name for long secrets
GPL-3.0-only