Demostration of using ChalametPIR - Keyword Private Information Retrieval, the Rust Library Crate @ https://github.com/itzmeanjan/ChalametPIR.
This binary crate demonstrates usage of Keyword Private Information Retrieval using the ChalametPIR library crate. It showcases a client-server architecture where the client can query a database of key-value pairs without revealing the queried keyword to the server.
Rust stable toolchain; see https://rustup.rs for installation guide. MSRV for this crate is 1.85.0.
# While developing this demonstration, I was using
$ rustc --version
rustc 1.85.0 (4d91de4e4 2025-02-17)
- Run the PIR server.
cargo run --profile optimized --bin server db/crypto.json
- In a separate terminal window, run the PIR client.
cargo run --profile optimized --bin client
- Query the Database: The client will prompt you to enter keywords. Type in a keyword present in your database and hit Enter. The client will then display the corresponding value. Type 'quit' to exit the client.
Note
For fetching the value associated with the queried keyword, client first prepares a PIR query using its local hint database, which it downloaded from the PIR server, when setting up the PIR client. Then it attempts to decode the received PIR response from the PIR server. If you prompt it to fetch value associated with some key which is absent in the database, the client will not be able to decode the response. During this execution of the protocol, server will never learn which keyword was queried by the client.