#secure-communication #encryption-key #random-key #aes-gcm #clients #chains #client-server

ovunto-security

A library for secure end-to-end communication between clients through a server

16 releases

0.1.16 Aug 3, 2024
0.1.15 Jun 10, 2024
0.1.13 Apr 28, 2024
0.1.3 Mar 19, 2024

#1217 in Cryptography

MIT license

75KB
1.5K SLoC

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.

Dependencies

~15MB
~238K SLoC