提交 c51d7b87 编写于 作者: K Kai He

move align.py to psi_demo

上级 bc2e1cb6
## 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.
#!/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
## 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册