ovunto_security/
lib.rs

1//! `ovunto_security` is a library for secure e2ee communication between clients through a server.
2//!
3//! It provides functionality for encrypting and decrypting messages, managing keys, construct chain.
4//!
5//! # Example
6//!
7//! ```
8//! use ovunto_security::{Result, Keyring, Salt};
9//!
10//! fn main() -> Result<()> {
11//!     // Generate a random salt
12//!     let salt = Salt::random();
13//!
14//!     // Derive a keyring from a password and salt
15//!     let password = "my_password".to_string();
16//!     let keyring = Keyring::derive_from(password, &salt)?;
17//!
18//!     // Use the keyring to encrypt and decrypt messages
19//!     let message = "Hello, world!".to_string();
20//!     let encrypted_message = keyring.encrypt_str(message.clone())?;
21//!     let decrypted_message = keyring.decrypt_str(encrypted_message)?;
22//!
23//!     assert_eq!(message, decrypted_message);
24//!
25//!     Ok(())
26//! }
27//! ```
28
29extern crate aes_gcm;
30extern crate argon2;
31extern crate base32;
32extern crate base64;
33extern crate blake3;
34extern crate chrono;
35extern crate hex;
36extern crate hmac;
37#[macro_use]
38extern crate ovunto_security_macros;
39extern crate rand;
40extern crate rand_core;
41extern crate rsa;
42extern crate secp256k1;
43extern crate serde;
44extern crate serde_json;
45extern crate sha1;
46extern crate sha2;
47
48pub use client::{
49    Chain, ChainLayer, ClientVault, Credentials, CredentialsChange, Keyring, VaultChange,
50};
51pub use crypto::{CipherMessage, Hmac, Key, Nonce, Salt};
52pub use primitives::{Algorithm, Error, Result};
53pub use totp::{TOTPGenerator, TOTP};
54pub use traits::{Decrypt, Encrypt, FromBytes, IntoBytes};
55
56pub mod client;
57pub mod constants;
58pub mod crypto;
59pub mod primitives;
60pub mod totp;
61pub mod traits;