Encryption
VecLabs encrypts all vectors and metadata client-side using AES-256-GCM before any data leaves the SDK. This page covers the technical implementation.Algorithm: AES-256-GCM
AES-256-GCM (Advanced Encryption Standard, 256-bit key, Galois/Counter Mode) is an authenticated encryption algorithm. It provides:- Confidentiality - ciphertext is computationally indistinguishable from random without the key
- Integrity - a 128-bit authentication tag detects any tampering with the ciphertext
- Authenticity - the tag proves the data was encrypted by someone with the key
Key derivation
The encryption key is derived from your Solana wallet keypair using PBKDF2-SHA256:- Deterministic - same wallet always produces the same key for a given collection
- Collection-isolated - different collections use different derived keys
- Versioned - the “veclabs-v1” prefix allows future key derivation upgrades
Encryption per record
Each vector record is encrypted individually:What is encrypted
Everything in a vector record is encrypted together:- The vector values (
f32array) - The metadata (arbitrary JSON)
- The vector ID is NOT encrypted - it’s hashed into the Merkle tree
Source code
The encryption implementation is in the open-source Rust core:crates/solvec-core/src/encryption.rs
It is tested with 5 unit tests including roundtrip, wrong key failure, and empty input edge cases.