Skip to content

About

Rust library allowing for a very quick and simple implementation of AES-GCM-256-SIV encryption

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

rusty_crypt

Crates.io Version Documentation Crates.io License

A simple and secure Rust library providing an easy-to-use interface for AES-256-GCM-SIV authenticated encryption.

rusty_crypt provides high-level utilities and macros to easily integrate modern symmetric encryption into Rust applications.

Features

  • AES-256-GCM-SIV encryption and decryption
  • Secure key and nonce generation
  • Convenient utility macros (aes_key!, quick_encrypt!, quick_decrypt!)
  • Binary data support
  • Explicit error handling

Quick Start (Using Macros)

use rusty_crypt::{aes_key, quick_encrypt, quick_decrypt, AesGeneratedKey};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // 1. Generate a secure random key (or load one using the aes_key! macro)
    let key = AesGeneratedKey.generate_key()?;
    
    // Example loading from Base64:
    // let key = aes_key!("JeAe64TzfRKY0f4Mfx4slwqE3dZwQAXKd7UPZ2JF2q0=")?;

    // 2. Quickly encrypt in a single line
    let (ciphertext, nonce) = quick_encrypt!(key.clone(), b"Hello, rusty_crypt!")?;

    // 3. Decrypt just as easily
    let plaintext = quick_decrypt!(key, &ciphertext, &nonce)?;

    println!("Decrypted: {}", String::from_utf8(plaintext)?);

    Ok(())
}

Security

rusty_crypt uses AES-256-GCM-SIV.

  • Key size: 32 bytes (256 bits)
  • Nonce size: 12 bytes (96 bits)
  • Never reuse a nonce with the same key.
  • Keep encryption keys secret.

Documentation

Full API documentation:

https://docs.rs/rusty_crypt


License

MIT License

About

Rust library allowing for a very quick and simple implementation of AES-GCM-256-SIV encryption

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages