27 releases (16 breaking)

0.16.1 Mar 4, 2024
0.15.0 Jan 9, 2024
0.14.0 Dec 4, 2023
0.13.0 Oct 31, 2023
0.0.0 Jun 24, 2021

#1 in #onion-service

Download history 268/week @ 2023-11-24 287/week @ 2023-12-01 249/week @ 2023-12-08 187/week @ 2023-12-15 197/week @ 2023-12-22 120/week @ 2023-12-29 299/week @ 2024-01-05 364/week @ 2024-01-12 341/week @ 2024-01-19 133/week @ 2024-01-26 233/week @ 2024-02-02 238/week @ 2024-02-09 167/week @ 2024-02-16 321/week @ 2024-02-23 2104/week @ 2024-03-01 303/week @ 2024-03-08

2,947 downloads per month
Used in 26 crates (8 directly)

MIT/Apache

725KB
13K SLoC

tor-cell

Coding and decoding for the cell types that make up Tor's protocol

Overview

Tor's primary network protocol is oriented around a set of messages called "Cells". They exist at two primary layers of the protocol: the channel-cell layer, and the relay-cell layer.

Channel cells are sent between relays, or between a client and a relay, over a TLS connection. Each of them encodes a single Channel Message. Channel messages can affect the channel itself (such as those used to negotiate and authenticate the channel), but more frequently are used with respect to a given multi-hop circuit.

Channel message that refer to a circuit do so with a channel-local identifier called a Circuit ID. These messages include CREATE2 (used to extend a circuit to a first hop) and DESTROY (used to tear down a circuit). But the most frequently used channel message is RELAY, which is used to send a message to a given hop along a circuit.

Each RELAY cell is encrypted and decrypted (according to protocols not implemented in this crate) until it reaches its target. When it does, it is decoded into a single Relay Message. Some of these relay messages are used to manipulate circuits (e.g., by extending the circuit to a new hop); others are used to manipulate anonymous data-streams (by creating them, ending them, or sending data); and still others are used for protocol-specific purposes (like negotiating with an onion service.)

For a list of most of the cell types used in Tor, see tor-spec.txt. Other cell types are defined in rend-spec-v3.txt (for onion services) and padding-spec.txt (for padding negotiation).

This crate is part of Arti, a project to implement Tor in Rust.

License: MIT OR Apache-2.0

Dependencies

~24MB
~449K SLoC