Self Encryption
Self Encryption
Quick Start Guide
Installation
cargo add self_encryptionpip install self-encryptionnpm install @withautonomi/self-encryptionSimple Example
use self_encryption::{bytes::Bytes, decrypt, encrypt};
fn main() -> self_encryption::Result<()> {
// Encrypt bytes in memory
let data = Bytes::from("Small data to encrypt");
let (data_map, encrypted_chunks) = encrypt(data.clone())?;
// Decrypt using the data map and chunks
let decrypted = decrypt(&data_map, &encrypted_chunks)?;
// Original data and decrypted data will be the same
assert_eq!(data, decrypted);
Ok(())
}
from self_encryption import encrypt, decrypt
# Encrypt bytes in memory
data = b"Small data to encrypt"
data_map, encrypted_chunks = encrypt(data)
# Decrypt using the data map and chunks
decrypted = decrypt(data_map, encrypted_chunks)Core Concepts
DataMap
Chunk Sizes
Streaming Operations
Streaming File Encryption
Last updated