Documentation Index
Fetch the complete documentation index at: https://docs.privora.xyz/llms.txt
Use this file to discover all available pages before exploring further.
The Privora client SDKs provide type-safe encryption using the network’s FHE public key.
Supported Types
| Type | Range | Ciphertext Size |
|---|
| u8 | 0-255 | ~10KB |
| u32 | 0-4.2B | ~40KB |
| u64 | 0-18Q | ~80KB |
Basic Encryption
let encryptor = privora.encryptor();
let encrypted_u8: ClientEncrypted<u8> = encryptor.encrypt(100u8)?;
let encrypted_u32: ClientEncrypted<u32> = encryptor.encrypt(10000u32)?;
let encrypted_u64: ClientEncrypted<u64> = encryptor.encrypt(1000000u64)?;
const encrypted_u8 = privora.encrypt(100, 'u8');
const encrypted_u32 = privora.encrypt(10000, 'u32');
const encrypted_u64 = privora.encrypt(1000000, 'u64');
Batch Encryption
let values = vec![100u8, 200, 50, 75];
let encrypted: Vec<ClientEncrypted<u8>> = encryptor.encrypt_batch(&values)?;
const encrypted = privora.encryptBatch([
{ value: 100, type: 'u8' },
{ value: 200, type: 'u8' },
]);
With User Recovery
let encrypted = encryptor.encrypt(100u8)?;
let with_recovery = user_crypto.add_recovery(encrypted, &100u8.to_le_bytes())?;
const encrypted = privora
.encrypt(100, 'u8')
.withUserRecovery(userCrypto);
Submitting Data
let hash: [u8; 32] = privora.submit(&encrypted).await?;
const hash: string = await privora.submit(encrypted);
Best Practices
- Use the smallest type that fits your data
- Add user recovery for data users need to view locally
- Batch encryption for multiple values