Expand description
Searchable Encryption for privacy-preserving keyword search.
This module provides searchable symmetric encryption (SSE) that allows searching encrypted data without decrypting it.
§Use Cases in CHIE Protocol
- Encrypted Content Catalogs: Search encrypted file metadata without revealing content
- Privacy-Preserving Discovery: Find content by keywords without exposing search queries
- Delegated Search: Allow authorized parties to search encrypted data
§Protocol
- Index Generation: Create encrypted index of keywords in documents
- Trapdoor Generation: Generate search token for a keyword (requires secret key)
- Search: Match trapdoor against encrypted index without decryption
- Result Retrieval: Return matching document IDs
§Security
- Server cannot learn: keywords, queries, or plaintext document content
- Server can learn: search pattern (which queries match), access pattern (which documents match)
- This is a deterministic SSE scheme (same keyword always produces same trapdoor)
§Example
use chie_crypto::searchable::{SearchableEncryption, EncryptedIndex};
// Create searchable encryption instance
let sse = SearchableEncryption::new();
// Build encrypted index
let mut index = EncryptedIndex::new(&sse);
index.add_document(1, &[b"rust".to_vec(), b"crypto".to_vec()]);
index.add_document(2, &[b"crypto".to_vec(), b"p2p".to_vec()]);
index.add_document(3, &[b"rust".to_vec(), b"p2p".to_vec()]);
// Generate search trapdoor
let trapdoor = sse.generate_trapdoor(b"crypto");
// Search the encrypted index
let results = index.search(&trapdoor);
assert_eq!(results.len(), 2); // Documents 1 and 2
assert!(results.contains(&1));
assert!(results.contains(&2));Structs§
- Encrypted
Index - Encrypted searchable index
- Encrypted
Index Builder - Builder for encrypted index with bulk operations
- Multi
Keyword Search - Multi-keyword search (AND operation)
- Searchable
Encryption - Searchable symmetric encryption instance with master key
- Trapdoor
- Search trapdoor that allows searching without revealing the keyword
Enums§
Type Aliases§
- Document
Id - Document ID type
- Searchable
Result