The Problem With Traditional VPNs
A VPN (Virtual Private Network) is a tunnel that encrypts your network traffic and routes it through a remote server. Think of it like a secure, private pipe running through a public space — anyone can see the pipe exists, but nobody can see what's flowing through it.
For decades, building that pipe meant choosing between two dominant protocols: IPSec and OpenVPN. Both work, but both carry enormous complexity. IPSec is a suite of protocols that must negotiate encryption algorithms, authentication methods, and key exchange mechanisms before a single byte of real data moves. OpenVPN is a TLS-based system that runs in userspace, adding latency and requiring a complex certificate infrastructure. Each has hundreds of thousands of lines of code — code that must be audited, maintained, and trusted.
WireGuard took a different approach: throw out everything that isn't essential.
The result is a VPN protocol implemented in approximately 4,000 lines of code — roughly 100 times smaller than its predecessors. It uses a single, fixed set of modern cryptographic primitives. It has no configuration knobs for cipher suites. It lives inside the Linux kernel, which means encryption and decryption happen at the lowest possible level with minimal overhead.
The design was so clean that Linus Torvalds — the creator of Linux, famously difficult to impress — called it "a work of art" and merged it directly into the Linux kernel in version 5.6 (released March 2020). This was the first new networking protocol merged into the mainline kernel in over a decade.
Why simplicity matters in security software:
- Auditability: A single security researcher can read the entire WireGuard codebase in an afternoon. A full IPSec audit requires a team of experts and months of work. Code you can't read is code you can't trust.
- Attack Surface: Every line of code is a potential location for a bug. Fewer lines means fewer places for vulnerabilities to hide. This is not theoretical — many historical VPN vulnerabilities were found in the negotiation and compatibility layers that WireGuard eliminates entirely.
- Performance: Because WireGuard runs inside the kernel (not in userspace like OpenVPN), packets are encrypted and decrypted without expensive context switches between kernel and userspace. Benchmarks consistently show WireGuard achieving 3–5× the throughput of OpenVPN on the same hardware.
Interviewers often ask: "Why would you choose WireGuard over OpenVPN or IPSec?" The answer has three dimensions: security (smaller attack surface, no downgrade attacks, modern crypto), performance (kernel-space operation, lower latency), and operability (simpler configuration, easier to audit). Avoid saying "it's faster" without explaining why — the kernel-space execution and fixed cipher suite are the mechanisms behind the speed.