Every message in Project 2A, Private DNS over UDP, drawn from SPEC.md. Start with the programs involved: click one for what it can see and what it has to do. Then pick a scenario and step through it to see each message byte by byte, which layers of encryption it carries, and who can open them.
You write three programs: the client, the DNS ingress and the DNS egress. The client seals its question so that only the DNS egress can read it, and sends it by way of the DNS ingress. The ingress knows who is asking but not what. The egress knows what is being asked, but every query reaches it from the ingress, so it doesn't know who. Every message is a single UDP datagram.
Click a program for what it can see, what it can't, and what it has to do.
| Key | Made by | Held by | Used for |
|---|---|---|---|
DNS egress public keykeys/dns_egress.pub | keygen, once | Anyone. The client loads it from --egress-key. | seal() the query so only the DNS egress can open it |
DNS egress private keykeys/dns_egress.key | keygen, once | The DNS egress only | unseal() the query |
reply_key | The client, with new_key(), fresh for every query | The client, and the DNS egress once it unseals the query | encrypt() the answer on the way back |
The DNS ingress holds no key at all. It can't open anything it forwards, in either direction.
Every message on this page follows SPEC.md in the Project 2A starter repository. If this page and SPEC.md ever disagree, SPEC.md is right. The encrypted bytes shown are made up; real ones look just as random.