Skip to content

What is WireGuard? A plain-language guide

WireGuard is a modern VPN protocol with a small code base and fixed encryption. Learn how it works, what it protects and where its limits are.

Published 7 min read

The short answer

WireGuard is a VPN protocol: a set of rules that two computers follow to build an encrypted tunnel between them. It is newer and much smaller than older protocols such as OpenVPN and IPsec, and it uses one fixed set of modern encryption methods. It protects your traffic on the way to the VPN server. It does not make you anonymous.

You do not install WireGuard yourself when you use a VPN app. The app speaks WireGuard for you. This guide explains what happens inside, and where the limits are.

What is WireGuard?

A VPN app needs a protocol in the same way a web browser needs HTTPS. Both sides must agree on how to prove who they are and how to encrypt the data. WireGuard is one such protocol.

It was created by Jason A. Donenfeld and is open-source software. A version of its design paper appeared at a security conference in 2017. WireGuard became part of the Linux kernel with version 5.6 in March 2020. Today it also runs on Windows, macOS, BSD, iOS and Android.

The project describes WireGuard as “an extremely simple yet fast and modern VPN” on wireguard.com. The key word is “simple”. Most of what makes WireGuard different follows from it.

How does WireGuard work?

You can picture the tunnel in three steps.

  1. Keys. Your device and the VPN server each have a pair of keys: a private key that stays secret and a public key that can be shared. Each side knows the public key of the other side. The project compares this to exchanging SSH keys.
  2. Handshake. When you connect, the two sides use those keys to check each other and to agree on temporary session keys. This takes one message in each direction.
  3. Data. Every packet your phone sends is encrypted with the session keys and sent to the server over UDP. The server checks it, decrypts it and passes it on to the internet. Replies come back the same way. A packet that fails the check is dropped.

New keys every few minutes

The protocol description says the handshake repeats every few minutes, so the session keys keep changing. This gives a property called forward secrecy: if a long-term key leaked one day, traffic that someone recorded earlier would still be unreadable.

Moving between Wi-Fi and mobile data

WireGuard has roaming built in. Each side sends data to the last address from which it received a valid packet. When your phone leaves Wi-Fi and switches to mobile data, the tunnel can carry on from the new address.

How is WireGuard different from older VPN protocols?

The older protocols you will meet most often are OpenVPN and IPsec. They are still in wide use. WireGuard takes a different road in three ways.

PointWireGuardOpenVPN and IPsec
Size of the codeSmall. The design paper says the Linux version fits in less than 4,000 lines of code.Much larger, and so harder to review in full, according to the WireGuard project.
Encryption settingsOne fixed set. There is nothing to choose.Many options, which the two sides negotiate.
How data travelsOver UDP only.OpenVPN can use UDP or TCP.

Why small matters

Less code means fewer places where a mistake can hide. The project says WireGuard is meant to be reviewable by a single person. Its protocol has also been checked with formal verification, a mathematical way to prove security properties.

Why fixed encryption matters

Older protocols let an administrator choose between many encryption methods. The WireGuard paper argues that this freedom adds a great deal of complexity. WireGuard removes the choice: it uses ChaCha20 and Poly1305 to protect packets and Curve25519 to agree on keys. For you, there is no encryption menu to get wrong.

The paper names the price of this decision openly. If a weakness is ever found in one of these methods, every device has to be updated.

What does WireGuard protect, and what does it not protect?

What it protects

  • Your traffic between your device and the VPN server. The owner of the Wi-Fi, other people on the network and your internet provider see encrypted packets that go to a VPN server. They cannot read them, and they cannot see which websites the packets are for.
  • Changes on the way. A packet that someone changed between you and the server does not pass the check and is dropped.

What it does not protect

  • Traffic after the VPN server. From the server to the website, your data is protected only if the site or app uses HTTPS.
  • Your identity. Websites see the IP address of the server instead of yours. They still recognize you when you sign in, and through cookies. A VPN does not make you anonymous. Read more in what a VPN hides.
  • Trust in the provider. The VPN server decrypts your packets to pass them on. The company that runs it is now in the position your internet provider was in. No protocol can fix a careless provider, so check a VPN before you install it.
  • Your device. WireGuard does not stop malware, phishing or unsafe apps.

Limits the project names itself

The project publishes a list of known limitations. Three of them matter to ordinary users:

  • It does not focus on hiding itself, so a network that inspects traffic may recognize a WireGuard tunnel.
  • It works over UDP only, so it may fail on a network that blocks UDP.
  • It is not, by default, built to resist attacks from future quantum computers.

What a WireGuard server has to know

A WireGuard server must know the public key of your device. While you are connected, it must also know the IP address your packets come from, so that replies can reach you. That is how the protocol works. What a provider writes down, and for how long, is a separate question. The answer belongs in its privacy policy.

Why does Jango VPN use WireGuard?

Jango VPN is an Android app that uses the WireGuard protocol to encrypt traffic between your phone and Jango VPN servers. The reasons are the ones above: a small design that experts can review, fixed modern encryption, and roaming for a phone that moves between Wi-Fi and mobile data. There is nothing to configure, so you connect with one tap on the power button.

The limits in this guide apply to Jango VPN too. It does not make you anonymous. The free plan shows ads and has a time limit. The Jango VPN app itself stays outside the tunnel, so its ads load over your normal network. The Always-on VPN setting of Android is not supported. The Features page lists what the app does, Premium explains the two plans, and the Privacy Policy says what the servers store.

WireGuard is a registered trademark of Jason A. Donenfeld. Jango VPN is an independent product. It is not affiliated with the WireGuard project and not endorsed by it. WireGuard is not tied to one VPN service either: the project publishes its own apps, including one for Android.

Questions and answers

Is WireGuard safe?

WireGuard uses modern, well-studied encryption, its protocol has been formally verified, and its code is small enough to be reviewed in full. No protocol can promise perfect security. Your safety also depends on the VPN provider and the app you use.

Does WireGuard hide my IP address?

Websites and apps see the IP address of the VPN server instead of yours. The VPN server itself must know your IP address while you are connected, and sites can still recognize you when you sign in or through cookies. WireGuard does not make you anonymous.

Is WireGuard better than OpenVPN?

WireGuard is newer, much smaller and has no encryption settings to get wrong. The WireGuard project says it intends to be considerably more performant than OpenVPN. Real speed depends on your device, the server and the network. OpenVPN can run over TCP, which WireGuard cannot.

Do I have to set up WireGuard myself?

Not when you use a VPN app. The app handles the keys and the tunnel for you. You only set WireGuard up by hand when you run your own VPN server.

Keep reading

Get Jango VPN on your Android phone

Free to download. No sign-up. One tap to connect.