Next: Encrypted area, Previous: Plain, Up: Packet
Encrypted packets are the only files found in spools, in exchangeable storages and that are synchronized between TCP daemons.
Each encrypted packet has the following header:
+------------ HEADER --------------------+ +------------- ENCRYPTED -------------+ / \ / \ +--------------------------------------------+------+---------+----------...---+------+ | MAGIC | NICE | SENDER | RCPT | EPUB | SIGN | SIZE | BLOCK 0 | BLOCK 1 ... | JUNK | +-------------------------------------/------\------+---------+----------...---+------+ / \ +-------------------------------------+ | MAGIC | NICE | SENDER | RCPT | EPUB | +-------------------------------------+
XDR type | Value | |
---|---|---|
Magic number | 8-byte, fixed length opaque data | N N C P E 0x00 0x00 0x05 |
Niceness | unsigned integer | 1-255, packet niceness level |
Sender | 32-byte, fixed length opaque data | Sender node’s id |
Recipient | 32-byte, fixed length opaque data | Recipient node’s id |
Exchange public key | 32-byte, fixed length opaque data | Ephemeral curve25519 public key |
Signature | 64-byte, fixed length opaque data | ed25519 signature for that packet’s header over all previous fields. |
All following encryption is done in AEAD mode using ChaCha20-Poly1305 algorithms. Authenticated data is BLAKE3-256 hash of the unsigned portion of the header (the same data used in the signature). Size is XDR-encoded unsigned hyper integer, carrying the payload size, encrypted as a single AEAD-block (with the tag) independently from the following blocks. It is encoded with the zero nonce.
Payload with possible padding is divided on 128 KiB blocks blocks. They are encrypted with the same authenticated data and increasing big-endian 64-bit nonce, starting at 1.
Each node has static exchange and signature keypairs. When node A want to send encrypted packet to node B, it:
Next: Encrypted area, Previous: Plain, Up: Packet