10.8.0.2/32
Coins: purple padlock = private key (never leaves), key coin = public key, gold = session keyEnvelopes: one UDP message each; key badge = handshake, padlock = encrypted dataYellow board: the server's peer list, public key plus allowed IPsPink block: the attacker; a green shield means its packet was dropped in silenceWireGuard between your laptop (10.8.0.2 inside the tunnel) and your home server (203.0.113.5, UDP 51820). Each side keeps its private key (purple padlock coin) and swaps only its public key coin, once. The server's peer list pairs the laptop's public key with its allowed IPs. The attacker's packets reach the server and are dropped without any reply. A 148-byte initiation and a 92-byte response make the same golden session keys on both sides in one round trip; pings then travel in locked envelopes (ChaCha20-Poly1305) and the server checks the inner source against the allowed IPs. 198.51.100.23, 203.0.113.5 and 192.0.2.66 are RFC 5737 documentation addresses; 10.8.0.2, 10.8.0.1 and 192.168.1.0/24 are private RFC 1918 addresses. All keys are illustrative. Port 51820 is the conventional choice, not a fixed one. A home router would forward that UDP port to the server.

Keys and peers

  1. WireGuard runs on your laptop and on your home server. Each makes a key pair: a private key that never leaves the device and a public key it can share. Both are 32-byte Curve25519 keys.

The attack fails

1-RTT handshake

Inside the tunnel

WireGuard and IPsec

The message, field by field

;; step 1/11 · keys · setup
;; at the laptop + home server
on each device, once:
  private key   32 random bytes (Curve25519), kept on the device
  public key    32 bytes, computed from the private key
  config files show them as 44 characters of base64
fixed crypto, no choices to make:
  Curve25519 · ChaCha20-Poly1305 · BLAKE2s

Sizes are from the WireGuard whitepaper: initiation 148 bytes, response 92 bytes, data = 16-byte header + padded packet + 16-byte tag. Sessions are re-keyed after 120 seconds of use, and keys older than 180 seconds are refused.