How a VPN works
NIST’s glossary describes a VPN as “a virtual network built on top of existing networks that can provide a secure communications mechanism for data and IP information transmitted between networks.”1 Another definition there puts it as a “restricted-use, logical computer network constructed from system resources of a relatively public, physical network (such as the Internet), often by using encryption.”1
In practice, a VPN app on your phone or laptop sets up a tunnel to a VPN server. Each packet your device sends is encrypted and wrapped inside another packet addressed to that server. The server unwraps it and sends it on to the website or app, which replies to the server, and the server passes the answer back down the tunnel to you. From the outside, all anyone on your network sees is one encrypted connection to one server.
What a VPN hides, and from whom
| Who | Without a VPN | With a VPN |
|---|---|---|
| Wi-Fi owner | The sites you visit, and your lookups | An encrypted connection to a VPN server |
| Internet provider | The sites you visit, and your lookups | That you use a VPN, and how much data you send |
| Websites and apps | Your IP address and rough location | The VPN server’s IP address and location |
| The VPN service | Nothing | Carries your traffic, so its logging policy matters |
Most websites already use HTTPS, which hides the content of a page from the network. What HTTPS leaves visible is where you go: the names of the sites you look up and the servers you connect to. A VPN covers that too, as long as your DNS lookups travel inside the tunnel. When they slip outside it, that is called a DNS leak.
VPN protocols
A VPN protocol is the set of rules for building the tunnel and encrypting what goes through it. IPsec is a long-standing framework of open standards for private communications over IP networks, and NIST publishes a guide to it.2 WireGuard is a newer protocol that sets up a connection by exchanging simple public keys, much like SSH, and handles the rest itself.3 Most consumer VPN apps today use one of these, or OpenVPN.
The key exchange that opens a tunnel uses classical public key cryptography, which a large enough quantum computer could break. Traffic recorded today could be decrypted later, which is why some VPNs now add a post-quantum key exchange on top. NIST’s ML-KEM standard is “believed to be secure, even against adversaries who possess a quantum computer.”4
What a VPN does not do
- It does not stop phishing or malware. A fake login page works just as well over a VPN. You still need to check links and keep your devices updated.
- It does not hide you from your accounts. If you are logged in to an account, that service still knows it is you, whatever IP address you come from.
- It moves trust, it does not remove it. The VPN service carries your traffic in place of your internet provider, so what it records, and for how long, is the question to ask before you pick one.
Related terms
Sources
- NIST Computer Security Resource Center, Glossary: virtual private network (VPN), definitions from NIST SP 800-113 and NIST SP 800-82r3.
- NIST, SP 800-77 Rev. 1: Guide to IPsec VPNs (June 2020).
- WireGuard, WireGuard: fast, modern, secure VPN tunnel, project home page.
- NIST, FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard (August 2024).
Questions about VPNs
What is a VPN used for?
Mostly to keep public Wi-Fi and your internet provider from seeing which sites you visit, and to show sites the VPN server’s IP address and location instead of your own. Companies also use VPNs to let staff reach internal systems from outside the office.
Does a VPN hide my browsing from my internet provider?
Yes. Your provider sees that you are connected to a VPN and how much data you send, but not the sites you visit, as long as your DNS lookups go through the tunnel too.
Do I need a VPN on my phone?
If you use public or hotel Wi-Fi, it helps, because anyone running that network can otherwise see which sites you look up. On mobile data the main gain is keeping your IP address and location from the apps and sites you use.
Does a VPN slow down my internet?
A little, because traffic takes a detour through the server and is encrypted on the way. A nearby server and a modern protocol such as WireGuard keep the difference small.
Are free VPNs safe?
It depends on how the service pays for itself. A VPN carries all of your traffic, so read what it logs and whether it shows ads or sells data. Secria VPN is free on iPhone, iPad, Mac and Android, with any Secria account.