Skip to content
Vunio

WireGuard vs OpenVPN: Security, Speed and Key Differences

WireGuard and OpenVPN are the best-known open-source VPN protocols. How each one works, how they compare on security, speed and flexibility, and when to choose which.

VPNSocket Tunnel XWritten by Vunio TeamPublished 4 min read
On this page

WireGuard and OpenVPN are the two best-known open-source VPN protocols, and both have the trust of security professionals. They take very different approaches, though. OpenVPN is flexible and configurable, built on TLS and decades of real-world use. WireGuard is deliberately small, with one fixed set of modern cryptography. This guide compares them on the points that matter in practice.

How OpenVPN works

OpenVPN dates from 2001. It runs as an ordinary program (in user space) and creates a virtual network interface on your device. It uses two channels:

  • The control channel. In the words of OpenVPN's manual, "OpenVPN initiates a TLS session over the control channel". That session authenticates both sides, with certificates and optionally a username and password, and exchanges the keys for the data channel.
  • The data channel. It carries your actual traffic, encrypted with those keys. OpenVPN 2.6 negotiates AES-256-GCM, AES-128-GCM or ChaCha20-Poly1305 by default.

Because the control channel is TLS, OpenVPN builds on mature TLS libraries such as OpenSSL. Options like tls-crypt add another layer by encrypting and authenticating the control channel itself with a pre-shared key.

UDP or TCP

OpenVPN can run over UDP, its default, on port 1194, or over TCP.

  • UDP is usually faster and copes better with packet loss, because nothing retransmits at the tunnel level.
  • TCP gets through networks that block UDP and can use port 443, the HTTPS port. The cost is "TCP over TCP": when packets are lost, both the tunnel and the connections inside it retransmit, which can slow things down sharply.

How WireGuard works

WireGuard was designed by Jason A. Donenfeld and merged into the Linux kernel in version 5.6, released in 2020. Its goals were simplicity and a codebase small enough to audit.

  • Fixed cryptography. There's no cipher negotiation. WireGuard uses Curve25519 for key exchange, ChaCha20 with Poly1305 for encryption, BLAKE2s for hashing, SipHash24 for hashtable keys and HKDF for key derivation.
  • A Noise handshake. The handshake is built on the Noise protocol framework (Noise_IKpsk2), with an optional pre-shared key for extra protection.
  • Keys, not certificates. Each peer is identified by a public key, much like SSH. The key also decides which IP addresses that peer may use, an idea WireGuard calls cryptokey routing.
  • UDP only. As WireGuard's protocol page puts it, "All packets are sent over UDP."
  • Silent to strangers. A WireGuard server doesn't answer packets that aren't properly authenticated, which makes it hard to find by scanning.
  • Frequent new keys. Sessions get fresh keys every couple of minutes, which limits how much traffic any one key protects.

WireGuard vs OpenVPN at a glance

OpenVPNWireGuard
First released2001In the Linux kernel since 5.6 (2020)
HandshakeTLS on the control channelNoise_IKpsk2
EncryptionNegotiated; AES-256-GCM, AES-128-GCM or ChaCha20-Poly1305 by default in 2.6Fixed: ChaCha20-Poly1305
AuthenticationCertificates, optionally with username and passwordPublic keys
TransportUDP or TCPUDP only
Runs inUser spaceThe kernel on Linux; user space on some platforms
ConfigurationMany options, very flexibleFew options, simple
Usual port1194 (UDP), often 443 (TCP)Any UDP port; 51820 is common
Networks that block UDPTCP on port 443 can helpDoesn't connect

Speed

WireGuard often has the edge: it does less work per packet, runs in the kernel on Linux, and avoids OpenVPN's user-space overhead. It also stays silent when idle unless you turn on keepalives, which suits phones. But "often" is the key word. The distance to the server, the server's load and the quality of your network have a bigger effect than the protocol, and OpenVPN over UDP on a fast, nearby server can easily beat WireGuard on a crowded one. Be wary of any claim that one protocol is always faster.

Security

Both are considered secure when they're properly configured.

  • WireGuard has a small codebase, which is easier to audit, and no weak cipher options to choose by mistake. Its protocol has also been analysed with formal methods. The trade-offs: a server keeps each peer's last known IP address in memory, and there's no built-in way to hand out addresses dynamically, so providers build their own tooling for privacy and scale.
  • OpenVPN has a much larger codebase and many options, which leaves more room for misconfiguration. In exchange, it has a long track record and supports features organisations rely on, such as certificate revocation and username-and-password logins.

When to choose which

  • Choose WireGuard when UDP works on your network and you want a fast, simple connection that's light on the battery.
  • Choose OpenVPN when you need TCP because UDP is blocked, need username-and-password logins, or have to connect to existing OpenVPN servers.
  • Consider a web-style tunnel, such as VLESS or SSH over WebSocket and TLS, where neither works well. SSH, WebSocket and TLS tunneling explains how those work.

OpenVPN in Socket Tunnel X

Socket Tunnel X, SBRK Dev Team's Android VPN, added OpenVPN SSL support in version 1.5.5, released in October 2026, alongside its VLESS, SSH and V2Ray servers. WireGuard isn't among the protocols the app lists, so it's covered here for comparison only. For how all these options compare on a phone, read Which VPN protocol should you use on Android?

FAQ

Is WireGuard more secure than OpenVPN?

Neither is simply "more secure". WireGuard's small codebase and fixed modern cryptography leave less room for mistakes; OpenVPN's long track record and flexibility have their own value. Both are secure when properly configured.

Is WireGuard always faster?

No. It's often faster, but server distance, server load and network conditions matter more than the protocol.

Should I use OpenVPN over UDP or TCP?

UDP when it works, because it avoids the TCP-over-TCP slowdown. Switch to TCP if your network blocks UDP.

Does WireGuard work over TCP?

Not by itself: the protocol only uses UDP. Some services wrap it in other transports, but that's outside WireGuard itself.

Sources

Apps in this article

Which VPN Protocol Should You Use on Android?

A practical comparison of the protocols in Android VPN and tunnel apps (WireGuard, OpenVPN, VLESS, VMess and SSH): what each is good at, where each struggles, and how to choose.

VPN4 min read

Your apps, on every screen.

Free and official, on your phone in about a minute and on your TV in three steps.

Downloader code for Vunio Drama

Type it in the Downloader app.