Expand description
ovunto_security is a library for secure e2ee communication between clients through a server.
It provides functionality for encrypting and decrypting messages, managing keys, construct chain.
§Example
use ovunto_security::{Result, Keyring, Salt};
fn main() -> Result<()> {
// Generate a random salt
let salt = Salt::random();
// Derive a keyring from a password and salt
let password = "my_password".to_string();
let keyring = Keyring::derive_from(password, &salt)?;
// Use the keyring to encrypt and decrypt messages
let message = "Hello, world!".to_string();
let encrypted_message = keyring.encrypt_str(message.clone())?;
let decrypted_message = keyring.decrypt_str(encrypted_message)?;
assert_eq!(message, decrypted_message);
Ok(())
}Re-exports§
pub use client::Chain;pub use client::ChainLayer;pub use client::ClientVault;pub use client::Credentials;pub use client::CredentialsChange;pub use client::Keyring;pub use client::VaultChange;pub use crypto::CipherMessage;pub use crypto::Hmac;pub use crypto::Key;pub use crypto::Nonce;pub use crypto::Salt;pub use primitives::Algorithm;pub use primitives::Error;pub use primitives::Result;pub use totp::TOTPGenerator;pub use totp::TOTP;pub use traits::Decrypt;pub use traits::Encrypt;pub use traits::FromBytes;pub use traits::IntoBytes;