It's croc in rust
Find a file
2022-09-02 22:51:32 -04:00
scripts Partially correct dockerfile 2022-02-17 20:43:55 -05:00
src Add some benchmark for upload 2022-09-02 22:51:32 -04:00
.gitignore Tweaks 2022-08-30 11:36:45 -04:00
Cargo.lock Attempt to clean up further; speed up file upload 2022-08-31 14:05:58 -04:00
Cargo.toml Attempt to clean up further; speed up file upload 2022-08-31 14:05:58 -04:00
Dockerfile Partially correct dockerfile 2022-02-17 20:43:55 -05:00
README.md Update readme 2022-08-30 10:23:50 -04:00

ruck

ruck is a command line tool used for hosting relay servers and sending end-to-end encrypted files between clients. It was heavily inspired by croc, one of the easiest ways to send files between peers. This document describes the protocol ruck uses to support this functionality.

Version

This document refers to version 0.1.0 of ruck as defined by the Cargo.toml file.

Server

The server in ruck exposes a TCP port. Its only functions are to staple connections and shuttle bytes between stapled connections. The first 32 bytes sent over the wire from a new client are used as its unique identifier. When a new client joins, if the server has another open connection with the same identifier, the connections are then stapled. The clients have some mechanism for agreeing on these identifiers, however, from the server's perspective it doesn't matter how they agree.

Once the connection is stapled, all bytes are piped across until a client disconnects or times out. The time out is set to remove idle connections. The server does nothing else with the bytes, so the clients are free to end-to-end encrypt their messages. For this reason, updates to the ruck protocol do not typically necessitate server redeployments.

Client

There are two types of clients - send and receive clients. Out of band, the clients agree on a relay server and password, from which they can derive the 32 byte identifier used by the server to staple their connections. Clients have the option of using the single-use, automatically generated passwords which ruck supplies by default. Using the passwords per the Spake2 handshake algorithm, clients generate a symmetric key with which to encrypt their subsequent messages. Once the handshake is complete, send and receive negotiate and exchange files per the following:

  • send offers a list of files and waits.
  • receive specifies which bytes it wants from these files.
  • send sends the specified bytes and waits.
  • receive sends heartbeats with progress updates.
  • send hangs up once the heartbeats stop or received a successful heartbeat.
  • receive hangs up once the downloads are complete.