fluxencrypt-async 0.3.7

Async/await support for FluxEncrypt encryption SDK
Documentation

FluxEncrypt Async

Async/await support for the FluxEncrypt encryption SDK, providing non-blocking encryption and decryption operations suitable for high-concurrency applications.

Features

  • Async Encryption/Decryption: Non-blocking hybrid encryption operations
  • Streaming Support: Process large files asynchronously without blocking
  • Concurrent Processing: Handle multiple operations simultaneously
  • Tokio Integration: Full compatibility with the Tokio async runtime

Quick Start

use fluxencrypt_async::{AsyncHybridCipher, Config};
use fluxencrypt::keys::KeyPair;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Generate a new key pair
    let keypair = KeyPair::generate(2048)?;

    // Create async cipher
    let cipher = AsyncHybridCipher::new(Config::default());

    // Encrypt data asynchronously
    let plaintext = b"Hello, async FluxEncrypt!";
    let ciphertext = cipher.encrypt_async(&keypair.public_key(), plaintext).await?;

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

    Ok(())
}