diff --git a/python/paddle_fl/mpc/examples/data_alignment/README.md b/python/paddle_fl/mpc/examples/data_alignment/README.md deleted file mode 100644 index 8c05a42d0e9674cdd59bb76d65c33f757ca26da3..0000000000000000000000000000000000000000 --- a/python/paddle_fl/mpc/examples/data_alignment/README.md +++ /dev/null @@ -1,12 +0,0 @@ -## Data Alignment - -### 1. Introduction - -Data alignment is used for alignment of data set owned by multi parties without leaking any privacy information of data. Concretely, all data of data owners are numbered the same number for the same data. When align, all data owners input the set of data number and get a set of number for the intersection. - - - -### 2. Example - -Here is an example for data alignment between two parties. The `align.py` is a script used for each party. The set of data number of the two parties are saved in `data_0.txt` and `data_1.txt` respectively. You can directly run `run.sh` for running this example in single machine. - diff --git a/python/paddle_fl/mpc/examples/data_alignment/data_0.txt b/python/paddle_fl/mpc/examples/data_alignment/data_0.txt deleted file mode 100644 index 0bce9e3a34bfff4d96c8cb15e31be95190c39608..0000000000000000000000000000000000000000 --- a/python/paddle_fl/mpc/examples/data_alignment/data_0.txt +++ /dev/null @@ -1,7 +0,0 @@ -1 -2 -3 -4 -5 -6 -7 \ No newline at end of file diff --git a/python/paddle_fl/mpc/examples/data_alignment/data_1.txt b/python/paddle_fl/mpc/examples/data_alignment/data_1.txt deleted file mode 100644 index 85954eabcfc32c9ef6765ae90ef192256664874e..0000000000000000000000000000000000000000 --- a/python/paddle_fl/mpc/examples/data_alignment/data_1.txt +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 \ No newline at end of file diff --git a/python/paddle_fl/mpc/examples/data_alignment/run.sh b/python/paddle_fl/mpc/examples/data_alignment/run.sh deleted file mode 100644 index 2c915c3b6c6e5047ae0edcb3363b6a0d685eb7c1..0000000000000000000000000000000000000000 --- a/python/paddle_fl/mpc/examples/data_alignment/run.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -ENDPOINTS=0:127.0.0.1:11111,1:127.0.0.1:22222 - -python align.py --party_id=0 --endpoints=$ENDPOINTS --data_file=data_0.txt 2>&1 >/dev/null & - -python align.py --party_id=1 --endpoints=$ENDPOINTS --data_file=data_1.txt --is_receiver diff --git a/python/paddle_fl/mpc/examples/psi_demo/README.md b/python/paddle_fl/mpc/examples/psi_demo/README.md new file mode 100644 index 0000000000000000000000000000000000000000..79ea50fc2ce4d4e114fd5f9db8b105698e1fd3e3 --- /dev/null +++ b/python/paddle_fl/mpc/examples/psi_demo/README.md @@ -0,0 +1,25 @@ +## Data Alignment Tool + +This is an example of using the `alignment` function to build a command line tool of PSI (Private Set Intersection). + +### Usage + +```bash +python align.py --party_id=$PARTY_ID --endpoints=$END_POINTS --data_file=$FILE_NAME [--is_receiver] +``` +### Example + +Take data alignment between two parties , e.g., Alice (whose party_id is 0, IP address is 'A.A.A.A', port is 11111) and Bob (whose party_id is 1, IP address is 'B.B.B.B', port is 22222), as an example. Alice and Bob would like to find the intersection of alice_data.txt and bob_data.txt respectively, and Bob is intended to receive the final result. + +On each party: + +* **Alice** + +```bash +python align.py --party_id=0 --endpoints=0:A.A.A.A:11111,1:B.B.B.B:22222 --data_file=alice_data.txt +``` + +* **Bob** + +```bash +python align.py --party_id=1 --endpoints=0:A.A.A.A:11111,1:B.B.B.B:22222 --data_file=bob_data.txt --is_receiver diff --git a/python/paddle_fl/mpc/examples/data_alignment/align.py b/python/paddle_fl/mpc/examples/psi_demo/align.py similarity index 100% rename from python/paddle_fl/mpc/examples/data_alignment/align.py rename to python/paddle_fl/mpc/examples/psi_demo/align.py