Crate fluxencrypt

Crate fluxencrypt 

Source
Expand description

§FluxEncrypt

A high-performance, secure encryption SDK for Rust applications, providing both hybrid encryption capabilities and streaming data protection with enterprise-grade security features.

§Features

  • Hybrid Encryption: Combines RSA-OAEP (4096-bit default) and AES-GCM for optimal security and performance
  • Stream Processing: Handle large files and data streams efficiently
  • Memory Safety: Automatic secret zeroization and secure memory handling
  • Performance: Hardware-accelerated cryptographic operations
  • Flexibility: Configurable security parameters, multiple key formats, and base64 encoding support

§Quick Start

use fluxencrypt::{Config, HybridCipher};
use fluxencrypt::keys::KeyPair;

// Generate a new key pair (4096-bit recommended for production)
let keypair = KeyPair::generate(4096)?;

// Create cipher with default configuration
let cipher = HybridCipher::new(Config::default());

// Encrypt data
let plaintext = b"Hello, FluxEncrypt!";
let ciphertext = cipher.encrypt(keypair.public_key(), plaintext)?;

// Decrypt data
let decrypted = cipher.decrypt(keypair.private_key(), &ciphertext)?;
assert_eq!(plaintext, &decrypted[..]);

§Module Organization

  • encryption - Core encryption and decryption functionality
  • keys - Key generation, parsing, and management
  • env - Environment-based secret management
  • stream - Streaming encryption for large datasets
  • config - Configuration options and builders
  • error - Error types and handling

Re-exports§

pub use config::Config;
pub use encryption::HybridCipher;
pub use error::FluxError;
pub use error::Result;

Modules§

config
Configuration options and builders for FluxEncrypt operations.
encryption
Core encryption and decryption functionality.
env
Environment-based secret management functionality.
error
Error types and handling for FluxEncrypt operations.
keys
Key generation, parsing, and management functionality.
stream
Streaming encryption and decryption functionality.

Structs§

Cryptum
Main FluxEncrypt cryptographic engine providing unified access to all encryption functionality
CryptumBuilder
Builder for configuring and creating Cryptum instances

Constants§

VERSION
Current version of the FluxEncrypt library

Functions§

cryptum
Convenience function to create a Cryptum instance with default settings