Skip to main content

Module e2e

Module e2e 

Source
Expand description

End-to-end encryption between backend and frontend: the relay forwards terminal data it cannot read. See docs/architecture.md, “End-to-end encryption”, for the design.

The backend makes a Secret and prints it; the user gives it to the frontend, and it never goes to the relay. Both derive Keys from it and the session ID, one key per direction. A Sealer seals what one side sends, an Opener opens what the other side sent and refuses anything forged, altered, or seen before.

Structs§

InvalidSecret
A secret that is not 64 hex digits.
Keys
The session’s two keys, derived from the secret and the session ID.
Opener
Opens what the other side sends one way. It keeps the last number from each sender and takes only later ones: the relay can drop or delay messages, never replay or reorder them unnoticed.
Sealer
Seals what one side sends one way. Each message gets the next number; with the sender’s random ID, it makes the nonce, which is so never used twice with the key.
Secret
The session’s shared secret: 32 random bytes, printed by the backend as 64 hex digits. Never logged: its Debug hides it.

Enums§

Direction
Which way a message goes: each way has its own key.
Kind
What a sealed message holds, bound into it: a relay cannot pass one kind off as another.
OpenError
Why a sealed message was refused.

Functions§

decode_size
The size in a sealed resize’s plaintext, if it is one.
encode_size
A terminal size as the plaintext of a sealed resize: columns, then rows, big-endian.

Type Aliases§

SenderId
Who sealed a message: the random ID of one sealer.