Repository navigation
Releases
Releases · cernica/hadamask
hadamask 0.1.1
Client-side protection for vector databases: embeddings go through a secret orthogonal transform (similarity search stays exact), metadata and document text are encrypted per field with AES-256-GCM.
pip install "hadamask[pgvector]" # or qdrant, weaviate, milvus, chroma, elasticsearch, opensearch, redis, mongodb, langchain, llamaindex, allWhat it is not: the embedding transform is obfuscation with measured leakage, not encryption. The relative geometry of your corpus stays visible (see the security model and the paper). Alpha software, not externally audited.
What's new in 0.1.1
- Importing an adapter, integration or key manager without its extra now tells you what to install:
pip install "hadamask[pgvector]", instead of a bareModuleNotFoundError. - The README's install section explains the core package and the extras, and its links now work on PyPI.
What's in hadamask
- Two transforms:
hadamard, the paper'sH·D2·P·H·D1and the default; anddense, a Haar-random orthogonal matrix that keeps the native dimension. Usedensefor 1536-d embeddings on pgvector, whose HNSW index is limited to 2000 dimensions. - Metadata: AES-256-GCM per field, a fresh nonce per value, and length padding. Fields can be
blind(equality filters) orplaintext(all filters). - One store API on 9 databases: Qdrant, Weaviate, Milvus, Chroma, pgvector, Elasticsearch, OpenSearch, Redis Stack and MongoDB Atlas. It supports MongoDB-style filters, paging, score thresholds, projections, scroll, count, payload updates, delete by filter, and
copy_tofor migration and key rotation. - Frameworks: SDK wrappers for Qdrant and Weaviate, and integrations for LangChain and LlamaIndex.
- Key management: master keys wrapped by HashiCorp Vault, AWS KMS, Google Cloud KMS or Azure Key Vault.
- Benchmark: on 100k OpenAI ada-002 embeddings, the
densetransform costs about 1.1× query latency and 1.02–1.05× storage versus unprotected storage, on both Qdrant and pgvector. Recall is unchanged. Full results
Full history: CHANGELOG.md