← Project 2 overview

Project 2A: Message Flows

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.

1 · The programs

Click a program for what it can see, what it can't, and what it has to do.

2 · Step through a query

3 · Who holds which key

KeyMade byHeld byUsed for
DNS egress public key
keys/dns_egress.pub
keygen, onceAnyone. The client loads it from --egress-key.seal() the query so only the DNS egress can open it
DNS egress private key
keys/dns_egress.key
keygen, onceThe DNS egress onlyunseal() the query
reply_keyThe client, with new_key(), fresh for every queryThe client, and the DNS egress once it unseals the queryencrypt() 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.