-
Notifications
You must be signed in to change notification settings - Fork 1
Distributed hash table.
License
esote/dht
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
DHT is a distributed hash table based on the Kademlia paper: https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf. It also uses the S/Kademlia extension "crypto puzzles" to impede Eclipse and Sybil attacks (see the PROTOCOL, section 14 "Node ID Generation" for details). S/Kademlia paper: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.68.4986&rep=rep1&type=pdf DHT also includes many other security measures: - Node IDs are Ed25519 keypairs. - All messages are signed by the node's private key. - All messages are encrypted with the recipient's public key. - Fixed-size (UDP) messages are padded to avoid leaking message type. The network is completely decentralized. For more details read the PROTOCOL. To operate a node: 1. Install golang: golang.org/dl On Linux distributions like Ubuntu, Fedora, etc. you should be able to install a "golang" package through your package manager. 2. Download dht with: go get -u github.com/esote/dht/cmd/dht This will create a "dht" executable in your go/bin folder. Add ~/go/bin to PATH. 3. Create a working directory, for example mkdir /tmp/dht 3. Start a node dht /tmp/dht start PORT The program will ask for a password to encrypt the node's private key. 4. Stop a node dht /tmp/dht stop 5. Bootstrap another node dht /tmp/dht bootstrap ID IP:PORT Bootstrap a node, ID must be full base64 code, IP must be an IPv4 or IPv6 address (hostnames not allowed). 6. Store a file on the network dht /tmp/dht store /PATH/TO/FILE 7. Load a file from the network dht /tmp/dht load KEY /PATH/TO/OUTPUT KEY must be full base64 code.