Skip to content
/ pplp Public

Privacy-Preserving Location Proximity (based on FHE/MPC)

Notifications You must be signed in to change notification settings

phanen/pplp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PPLP: Privacy-Preserving Location Proximity (面向位置保护的隐私距离计算与近邻检测)

Build

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)

Linux/WSL

mkdir build && cd build || exit
CC=clang CXX=clang++ cmake -S . -B build
CC=clang CXX=clang++ cmake --build build

Windows

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=...

Usage

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

GPS support

get_pos.py can print pos, integrate it in pplp by:

./build/server $(python3 ./src/get_pos.py)

Reverse tunneling

  • 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

Android build

The following guide help build a vm in termux. Not sure if pplp can be directly built on termux

Modify sources.list

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 to mkdir -p <something>.

Todo

  • Add serialization for Bloom Filter
  • Implementing C/S demo
  • Hash function (on blind distance)
  • Set parms of RNG (size of random number)
  • Secure parms

About

Privacy-Preserving Location Proximity (based on FHE/MPC)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published