|
5 | 5 |
|
6 | 6 | This repository implements PriFi, an anonymous communication protocol with provable traffic-analysis resistance and small latency suitable for wireless networks. PriFi provides a network access mechanism for protecting members of an organization who access the Internet while on-site (via privacy-preserving WiFi networking) and while off-site (via privacy-preserving virtual private networking or VPN). The small latency cost is achieved by leveraging the client-relay-server topology common in WiFi networks. The main entities of PriFi are: relay, trustee server (or Trustees), and clients. These collaborate to implement a Dining Cryptographer's network ([DC-nets](https://en.wikipedia.org/wiki/Dining_cryptographers_problem)) that can anonymize the client upstream traffic. The relay is a WiFi router that can process normal TCP/IP traffic in addition to running our protocol.
|
7 | 7 |
|
| 8 | +For an extended introduction, please check our [website](https://lbarman.ch/prifi/). |
| 9 | + |
8 | 10 | For more details about PriFi, please check our [WPES 2016 paper](http://www.cs.yale.edu/homes/jf/PriFi-WPES2016.pdf).
|
9 | 11 |
|
10 | 12 |
|
11 | 13 | **Warning: This software is experimental and still under development. Do not use it yet for security-critical purposes. Use at your own risk!**
|
12 | 14 |
|
13 |
| -## Getting and running PriFi |
14 |
| - |
15 |
| -## Understanding the architecture |
16 |
| - |
17 |
| -### Structure |
18 |
| - |
19 |
| -The current code is organized in two main parts : |
20 |
| - |
21 |
| -1) `PriFi-Lib`, which is network-agnostic; it takes an interface "MessageSender" that give it functions like SendToRelay(), SendToTrustee, ... and ReceivedMessage() |
22 |
| - |
23 |
| -This is the core of the protocol PriFi. |
24 |
| - |
25 |
| -2) `PriFi-SDA-Wrapper` (what is in folder `sda`), that does the mapping between the tree entities of SDA and our roles (Relay, Trustee, Client), and provides the MessageSender interface discussed above. |
26 |
| - |
27 |
| -The SDA is a framework for Secure Distributed Algorithm, developped by DeDiS, EPFL. It help bootstrapping secure protocols. The "wrapper" is simply the link between this framework and our library `PriFi-lib` (which does not know at all about `sda`). |
28 |
| - |
29 |
| -### SOCKS |
30 |
| - |
31 |
| -PriFi anonymizes the traffic via SOCKS proxy. Once PriFi is running, you can configure your SOCKS client (e.g. browser, mail application) to connect to PriFi. |
32 |
| - |
33 |
| -The structure is a big convoluted : we have *two* socks servers. One is *in* the PriFi client code; that's the entry point of your upstream traffic, e.g. your browser connects to the socks server *in* PriFi on your local machine. |
34 |
| - |
35 |
| -Then, PriFi anonymizes the traffic with the help of the other clients and the relay. The anonymized traffic is outputted at the relay. |
36 |
| - |
37 |
| -This anonymized traffic is *SOCKS traffic*. Hence, the relay needs to connect to the second SOCKS server, which is not related to PriFi (but we provide the code for it in `socks/`). It could also be a remote, public SOCKS server. |
38 |
| - |
39 | 15 | ## Getting PriFi
|
40 | 16 |
|
41 |
| -Simply do |
42 |
| -``` |
43 |
| -git clone https://github.com/lbarman/prifi_dev |
44 |
| -``` |
45 |
| - |
46 |
| -WORK IN PROGRESS |
47 |
| - |
48 |
| -Fixed in cothority's test_ism_2_699 branch. |
49 |
| -But this branch will not be merged into anything, DeDiS working on a new version. |
50 |
| -So for the time being, we need to check out test_ism_2_699 on $GOPATH/src/github/dedis/cothority |
| 17 | +First, [get the Go language](https://golang.org/dl/). They have some `.tar.gz`, but I personally prefer to use my package manager : |
| 18 | +`sudo apt-get install golang` for Ubuntu, or `sudo dnf install golang` for Fedora 24. |
51 | 19 |
|
52 |
| -## Running PriFi |
53 |
| - |
54 |
| -### SOCKS Preamble |
| 20 | +Then, get PriFi by doing: |
55 | 21 |
|
56 |
| -As explained, you need a non-prifi SOCKS server running to handle the traffic from the relay. If you don't have one, run ours : |
57 | 22 | ```
|
58 |
| -./run-socks-proxy.sh 8090 |
| 23 | +go get github.com/lbarman/prifi |
| 24 | +./prifi.sh install |
59 | 25 | ```
|
| 26 | +Ignore the `No buildable source` after the first step, that's OK. This script gets all the dependencies (via `go get`), and make sure everything is correctly set. |
60 | 27 |
|
61 | 28 | ## Running PriFi
|
62 | 29 |
|
63 |
| -There is one big startup script `run-prifi.sh`. |
64 |
| - |
65 |
| -``` |
66 |
| -./run-prifi.sh |
67 |
| -Usage: run-prifi.sh role/operation [params] |
68 |
| - role: client, relay, trustee |
69 |
| - operation: sockstest, all, deploy-all |
70 |
| - params for role relay: [socks_server_port] (optional, numeric) |
71 |
| - params for role trustee: id (required, numeric) |
72 |
| - params for role client: id (required, numeric), [prifi_socks_server_port] (optional, numeric) |
73 |
| - params for operation all, deploy: none |
74 |
| - params for operation sockstest, deploy: [socks_server_port] (optional, numeric), [prifi_socks_server_port] (optional, numeric) |
75 |
| -
|
76 |
| -``` |
77 |
| - |
78 |
| -For instance, you can start a relay like this : |
79 |
| - |
80 |
| -``` |
81 |
| -./run-prifi.sh relay |
82 |
| -``` |
| 30 | +PriFi uses [SDA](https://github.com/dedis/cothority) as a network framework. It is easy to run all components (trustees, relay, clients) on one machine for testing purposes, or on different machines for the real setup. |
83 | 31 |
|
84 |
| -... or to specify the port of the second, non-prifi socks server, like this : |
| 32 | +Each component has a *SDA configuration* : an identity (`identity.toml`, containing a private and public key), and some knowledge of the others participants via `group.toml`. For your convenience, we pre-generated some identities in `config/identities_default`. |
85 | 33 |
|
86 |
| -``` |
87 |
| -./run-prifi.sh relay 8090 |
88 |
| -``` |
| 34 | +### Testing PriFi, all components in localhost |
89 | 35 |
|
90 |
| -You can start a client like this : |
| 36 | +You can test PriFi by running `./prifi.sh all-localhost`. This will run a SOCKS server, a PriFi relay, a Trustee, and three clients on your machine. They will use the identities in `config/identities_default`. You can check what is going on by doing `tail -f {clientX|relay|trusteeX|socks}.log`. You can test browsing through PriFi by setting your browser to use a SOCKS proxy on `localhost:8081`. |
91 | 37 |
|
92 |
| -``` |
93 |
| -./run-prifi.sh client 0 |
94 |
| -``` |
| 38 | +### Using PriFi in a real setup |
95 | 39 |
|
96 |
| -and to specify the port of the first socks proxy integrated in PriFi : |
| 40 | +To test a real PriFi deployement, first, re-generates your identity (so your private key is really private). The processed is detailed in the [README about ./prifi.sh startup script](README_prifi.sh.md). |
97 | 41 |
|
98 |
| -``` |
99 |
| -./run-prifi.sh client 0 8080 |
100 |
| -``` |
| 42 | +## More documentation : |
101 | 43 |
|
102 |
| -A typical deployement could be : |
| 44 | + - [README about the Architecture and SOCKS Proxies](README_architecture.md) |
103 | 45 |
|
104 |
| -``` |
105 |
| -./run-prifi.sh relay 8090 |
106 |
| -./run-prifi.sh trustee 0 |
107 |
| -./run-prifi.sh client 0 8080 |
108 |
| -./run-prifi.sh client 1 8081 |
109 |
| -``` |
| 46 | + - [README about ./prifi.sh startup script](README_prifi.sh.md) |
110 | 47 |
|
111 |
| -## Configuration |
112 |
| - |
113 |
| -The PriFi configuration file is in `config.demo/prifi.toml` |
114 |
| - |
115 |
| -- `DataOutputEnbaled (bool)`: Enables the link from and to the socks proxy. |
116 |
| -- `NTrustees (int)`: Number of trustees. |
117 |
| -- `CellSizeUp (int)`: Size of upstream data sent in one PriFi round (?) |
118 |
| -- `CellSizeDown (int)`: Size of upstream data sent in one PriFi round (?) |
119 |
| -- `RelayWindowSize (int)`: Number of ciphers from each trustee to buffer |
120 |
| -- `RelayUseDummyDataDown (bool)`: When true, the relay always send |
121 |
| -CellSizeDown bits down. When false, it may send only 1 bit. |
122 |
| -- `RelayReportingLimit (int)`: Unused, was for the statistics. |
123 |
| -- `UseUDP (bool)`: Enable or disable UDP broadcast for downstream data (?) |
124 |
| -- `DoLatencyTests (bool)`: Enable or disable latency tests. |
125 |
| -- `ReportingLimit (int)`: PriFi shuts down after this number of rounds if |
126 |
| -not equal to `-1`. |
| 48 | + - [README about contributing to this repository](README_contributing.md) |
127 | 49 |
|
128 | 50 | ## API Documentation
|
129 | 51 |
|
|
0 commit comments