ovunto-security

Crates.ioovunto-security
lib.rsovunto-security
version0.1.16
sourcesrc
created_at2024-03-01 13:57:28.393413
updated_at2024-08-03 16:14:20.625757
descriptionA library for secure end-to-end communication between clients through a server.
homepage
repositoryhttps://github.com/Galitan-dev/Ovunto-Security
max_upload_size
id1158931
size199,012
Galitan (Galitan-dev)

documentation

https://docs.rs/ovunto-security

README

Ovunto Security

Ovunto Security is a Rust library for secure end-to-end communication between clients through a server. It provides functionality for encrypting and decrypting messages, managing keys, and constructing cryptographic chains.

Features

  • Encryption: Encrypt and decrypt messages using AES-GCM encryption.
  • Key Management: Derive keys from passwords and salts, manage keyrings, and generate random keys. Chain Construction: Build cryptographic chains for secure communication between clients.

Installation

Add this crate to your Cargo.toml

[dependencies]
ovunto-security = "0.1.0"

Usage

use ovunto_security::{Error, Keyring, Salt};
fn main() -> Result<(), Error> {
    let (username, password) = form().map_err(|_| Error)?;
    let salt = Salt::random();
    let keyring = Keyring::derive_from(password, &salt)?;
    let mut sender_chain = keyring.into_chain();

    let cipher1 = sender_chain.add(format!("{username} initiated a chain"))?;
    let cipher2 = sender_chain.add("Some cookies!".to_owned())?;

    let mut receiver_chain = keyring.into_chain();
    let change1 = receiver_chain.decrypt(cipher1.clone())?;
    let change2 = receiver_chain.decrypt(cipher2.clone())?;

    println!("{:?}", (cipher1, cipher2));
    println!("{:?}", (change1, change2));

    Ok(())
}

Documentation

API documentation for this crate can be found on docs.rs.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 0

cargo fmt