This is a prototype implementation of the Piano private information retrieval(PIR) algorithm that allows a client to access a database without the server knowing the querying index. The algorithm details can be found in the paper (https://eprint.iacr.org/2023/452.pdf).
Note: This repo includes both versions of Piano (the initial version and the updated version). The new version is now described in the main body of the online version of our paper. We thank Jesko Dujmovic for helping us improve the scheme.
The initial version is now described as a variant in the online version of our paper (Appendix A).
The legacy code is in client/client.go
.
Running the code will get the numbers we report in our conference version (https://www.computer.org/csdl/proceedings-article/sp/2024/313000a055/1RjEaufvKzm).
Warning: The code is not audited and is not for any serious commercial or real-world use case. Please use it only for educational purposes.
- Install Go(https://go.dev/doc/install).
- For developing, please install gRPC(https://grpc.io/docs/languages/go/quickstart/)
The tutorial implementation is in tutorial_new/tutorial_new.go
.
Try go run tutorial_new/tutorial_new.go
.
- In one terminal,
go run server/server.go -port 50051
. This sets up the server. The server will store the whole DB in the RAM, so please ensure there's enough memory. - In another terminal,
go run client_new/client_new.go -ip localhost:50051 -thread 1
. This runs the PIR experiment with one setup phase for a window of$\sqrt{n}\ln(n)$ -queries and follows with the online phase of up to 1000 queries. The ip flag denotes the server's address. The thread denotes how many threads are used in the setup phase.
- The two integers in
config.txt
denoteN
andDBSeed
.N
denotes the number of entries in the database.DBSeed
denotes the random seed to generate the DB. The client will use the seed only for verifying the correctness. The code only reads the integers in the first line. - In
util/util.go
, you can change theDBEntrySize
constant to change the entry size, e.g. 8bytes, 32bytes, 256bytes.
For example, setting N=134217728
and DBEntrySize=8
will generate a 1GB database.
- The server implementation is in
server/server.go
. - The client implementation is in
client_new/client_new.go
. - Common utilities are in
util/util.go
, including the PRF and theDBEntry
definition. - The messages exchanged by the server and client are defined in
query/query.proto
. If you change it, runbash proto.sh
to generate the corresponding server and client API. You should implement those APIs later.
Mingxun Zhou([email protected])
Andrew Park([email protected])