PPLP: Privacy-Preserving Location Proximity (面向位置保护的隐私距离计算与近邻检测)
git clone https://github.com/microsoft/SEAL.git
cd SEAL || exit
CC=clang CXX=clang++ cmake -S . -B build
CC=clang CXX=clang++ cmake --build build
sudo cmake --install build
- toolchains: cmake, g++/clang++, python3
- termux(for android)
mkdir build && cd build || exit
CC=clang CXX=clang++ cmake -S . -B build
CC=clang CXX=clang++ cmake --build build
Non-interactive version only (Generate Makefile using llvm-clang
and mingw32-make
):
make pplp # after cmake
to choose toolchains in cmake
CC=clang CXX=clang++ cmake .. -G=...
After build you will find the follow executable program in your directory:
./demo
-- Local version to test the protocol./server && ./client
-- C/S version./ts && ./tc
-- Generate Benchmark in*.csv
format.
To get manual of specific program, type:
./server --help
the manual
usage: ./server [options] ...
options:
-h, --host ip of server (string [=127.0.0.1])
-p, --port port of server (unsigned short [=51022])
-u, --xb coordinate1 of server (unsigned long [=123456888])
-v, --yb coordinate2 of server (unsigned long [=132465777])
-r, --radius radius/thershold (unsigned long [=128])
-?, --help print this message
get_pos.py
can print pos, integrate it in pplp by:
./build/server $(python3 ./src/get_pos.py)
- Port mapping. (anyway, a host with public ip is necessary)
- e.g. Use frp. You may need add the following field.
[common] tls_enable=true
The following guide help build a vm in termux. Not sure if pplp can be directly built on termux
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable main@' "$PREFIX"/etc/apt/sources.list
apt update && apt upgrade
ssh on termux
pkg install openssh -y
/etc/ssh/sshd_config
cat "Port 8022" >>/etc/ssh/sshd_config # banned 1~1024 (no root...)
sshd # For access to GPS of android (no root...)
install ubuntu on termux (22.04 currently)
pkg install proot proot-distro -y
proot-distro install ubuntu
proot-distro login ubuntu
apt install python3 openssh-server -y
# nano /etc/ssh/sshd_config
cat "Port 9022" >>/etc/ssh/sshd_config
cat "PermitRootLogin yes" >>/etc/ssh/sshd_config
/usr/sbin/sshd
build pplp, then run
./client -h of server of server <ip >-p <port >$(ssh user127.0.0.1 -p 8022 "termux-location" | python3 get_pos_mobile.py)
When open
sshd
, you might need tomkdir -p <something>
.
- Add serialization for Bloom Filter
- Implementing C/S demo
-
Hash function (on blind distance) -
Set parms of RNG (size of random number) -
Secure parms