Skip to content

What Happens When a VPN Tunnel's Encryption Keys Rotate?

A VPN tunnel does not use one key forever. This article explains what key rotation (rekeying) is, why it exists, what happens to your traffic while it runs and when a rekey can show up as a hiccup.

10 min readUpdated Nov 3, 2026By XPASS Editorial Team

What Happens When a VPN Tunnel's Encryption Keys Rotate?

A VPN tunnel feels like one steady thing: you press connect, a small icon appears, and for the next hour or the next day your traffic flows through it. Underneath, though, the secret values that scramble that traffic are not steady at all. They are replaced again and again, often every few minutes or after a set amount of data, and the tunnel keeps running through each swap. This is called key rotation, or rekeying.

This article explains what happens when a tunnel's encryption keys rotate: why the replacement exists, what the two ends do while it runs, why you almost never notice it, and the few situations where a rekey can show up as a short stall. It is general knowledge about how VPN protocols are designed. It does not describe the settings of any particular app, and no VPN can promise a perfectly smooth connection on every network.

What a session key is, and why it is not permanent

When your device and a VPN server start a tunnel, they first run a key exchange to agree on a shared secret that nobody watching the network can compute. That secret is then turned into session keys, which a cipher uses to encrypt and authenticate each packet. If you want the full picture of how the cipher itself works, read what VPN encryption is.

The word session matters. These keys are meant for this one conversation between these two devices, not for all time. Your long-term credentials, such as the username and password you sign in with, stay the same. The session keys are disposable working keys derived during the connection.

Why not simply keep the first set until you disconnect? Because the longer one key is used, the more it carries and the more it is worth attacking. Think of a hotel keycard that is reprogrammed for each guest. If a card is lost, only that stay is affected. Rotating keys inside a running tunnel applies the same idea to a single long visit.

Why VPN protocols rotate keys

There are a few practical reasons, and protocol designers usually have all of them in mind at once.

  1. Limit the amount of data under one key. Ciphers have safe usage limits. Some use counters or nonces that must never repeat with the same key. A tunnel that runs for days at high volume could approach those limits, so the key must be replaced before they are reached.
  2. Limit the damage of a single exposure. If a session key were ever stolen or derived, rotation caps the window: traffic from before and after that key's lifetime stays out of reach of that one secret.
  3. Give an attacker less to work with. Analysis of encrypted traffic gets harder when no single key covers a large amount of it.
  4. Forward secrecy. Each new key is derived from a fresh key exchange rather than from the old key. That means that learning an old session key does not reveal the next one, and a recorded conversation cannot be unlocked later just because one long-term secret leaks. This property is described in the design documents of modern protocols such as TLS 1.3 and WireGuard.
  5. Cleaning up stale state. Rekeying is also a natural moment to check that the other side is still alive and still the party you think it is.

None of this means that your connection is in danger when a key has been in use for a while. Rotation is a standard safety margin built into the design, not an emergency response.

What happens during a rekey, step by step

The details differ between protocols, but the shape is similar. Here is a simplified, protocol-neutral sequence.

  1. A timer or counter fires. One side notices that the current key has reached its time limit or has encrypted a set number of packets. In some protocols either side can start the process; in others it is the original initiator.
  2. A new exchange runs inside the tunnel. The two ends exchange fresh key material, often using the existing protected channel to carry the messages. A new shared secret is computed, and new session keys are derived from it.
  3. The new keys are installed alongside the old ones. For a short overlap, both the old and new keys are valid. Packets already in flight that were encrypted with the old key can still be decrypted.
  4. Traffic switches to the new keys. Once both sides confirm they hold the new keys, new packets are encrypted with them.
  5. The old keys are discarded. After a short grace period the previous keys are erased from memory, so they can no longer protect or reveal anything.

The IKEv2 specification calls the whole thing creating a new "child" security association and then deleting the old one, and notes that the old and new can co-exist during the changeover. The WireGuard whitepaper describes a handshake repeated after a few minutes of use, with the new session replacing the old one without the user doing anything. Different words, same idea: make before break.

A plain example

Imagine a courier company that sends sealed boxes between two offices. Each box is locked with a padlock, and both offices hold identical copies of the current padlock key. Every so often they agree on a new padlock design over a phone call. For a few minutes they accept boxes locked with either the old or the new padlock. Once the new padlock is working at both ends, they stop accepting the old one and destroy its keys. A person ordering parcels sees no change in service. If the phone call drops halfway, the offices simply keep using the old padlock until they can try again.

Why you rarely notice it

Three design choices keep a rekey invisible.

  • It runs in the background. The app and the operating system handle it. You do not sign in again, and your IP address and server stay the same.
  • Old keys stay valid briefly. Because of the overlap, packets in transit are not suddenly undecryptable.
  • The messages are tiny. A rekey exchanges a few small messages. Compared with video or a large download, the data volume is negligible.

Your apps also do not know that it happened. A web page, a video call or a download continues on the same connections, because the rotation happens below them, at the tunnel layer. This is why the rotation does not log you out of websites.

When a rekey can show up as a hiccup

Most rekeys pass without a trace. A few conditions can make one visible.

Situation What you may see Why it can happen
Weak or congested Wi-Fi or mobile signal A brief freeze of a few seconds, then recovery Rekey messages are delayed or lost and must be retried
Switching networks at the moment of a rekey The tunnel reconnects The path changed while keys were being replaced
Device was asleep or the app was suspended A pause after waking, then traffic resumes Timers ran while the device was inactive; see reconnecting after sleep
Strict firewall or NAT that drops idle mappings Occasional drops at regular intervals The rekey packet arrived after the network had forgotten the connection
Server under heavy load or being restarted A reconnect, sometimes a short outage The other end could not complete its half of the exchange

If drops occur at a regular rhythm, such as roughly the same number of minutes apart, a rekey interval may be involved. That is a clue, not a diagnosis. Many other things repeat on a schedule, including router tasks, power saving and DHCP lease renewals.

What to try if rekeying seems to cause drops

These steps are safe for any VPN app and need no special settings.

  1. Note the pattern. Write down when the stalls happen. Regular spacing suggests a timer; random timing suggests signal or network trouble.
  2. Test on another network. Try a different Wi-Fi network or mobile data. If the problem disappears, the first network is the likely cause, not the VPN.
  3. Move closer to the router or to better signal. Rekey messages are small, but they still need to arrive.
  4. Disable aggressive power saving for the app. Battery optimisation can pause background timers and delay the exchange.
  5. Reconnect once. Disconnecting and connecting again starts a clean tunnel with new keys from the beginning.
  6. Keep the app updated. Update VPNclient from the official store link on your My Pass page, because reconnection and timer handling are improved over time.
  7. Leave protocol settings at the default. Unless support suggests otherwise, keep the app's default connection settings.
  8. Look at timeouts separately. If the tunnel never even starts, the issue is in the handshake or data timeout rather than in rotation.

If you still see a repeating pattern after these checks, contact support with the times and the network type. A short, specific description helps far more than "the VPN is bad."

What key rotation does not do

  • It does not hide you from the sites you visit. Rotating keys protects the tunnel, not your accounts, cookies or browser identity.
  • It does not guarantee a stable connection. If the network underneath is unreliable, any tunnel may drop, whatever its key schedule.
  • It does not change your IP address. The server address you use stays the same through a rekey.
  • It does not repair a compromised device. If malware runs on your phone or computer, it sees your data before encryption. See what a VPN cannot protect you from.
  • It does not make a VPN anonymous or fully secure. Key rotation is one good design practice among many. It reduces certain risks and does not remove all of them.
  • You cannot always tune it. Consumer apps generally fix the interval, and changing it is rarely needed. Longer is not always better and shorter is not always safer; the designers pick values that balance safety and efficiency.

Common questions and misunderstandings

Does a rekey mean my VPN was attacked? No. It is routine and scheduled. An unexpected disconnect has many ordinary causes, such as weak signal or a sleeping device.

Is my password re-sent at each rotation? No. Your sign-in credentials are used when you start the connection. Rekeying uses the already-established tunnel and its own key material.

If keys rotate, is old traffic safe forever? Rotation and forward secrecy make it harder to unlock old traffic from one leaked secret. They are not a promise about the future, since technology and attacks change. The industry is already preparing for stronger algorithms, with post-quantum designs under active study.

Should I disconnect and reconnect often to refresh keys? There is no need. The protocol does it for you. Reconnect only to fix a real problem.

Summary

A VPN tunnel does not rely on one key for its whole life. Session keys are replaced regularly through a fresh exchange that runs in the background, with old and new keys overlapping briefly so traffic keeps flowing. The practical result is a smaller amount of data under any single key, a limited window if one is ever exposed, and forward secrecy for past traffic. You rarely see it, and when you do, it is usually a weak network, a sleeping device or a busy server, not a problem with the rotation itself. If you would like a tunnel to try this on, you can look at the options on the pricing page.

Frequently asked questions

What is key rotation in a VPN?

Key rotation, also called rekeying, is the process of replacing the session keys that encrypt a tunnel with fresh ones. It happens automatically while the tunnel stays up, so the connection continues without you signing in again.

Why do VPN tunnels change keys instead of using one forever?

A key that is used for a long time protects more data and gives an attacker more material and more time to work with. Replacing keys limits how much traffic any single key covers, and if a key were ever exposed, only the traffic from that period would be affected.

Will I notice when my VPN rotates its keys?

Usually not. A well-designed rekey happens in the background while old keys keep working until the new ones are ready. On a poor network you might see a brief stall if the rekey messages are delayed or lost.

Does key rotation change my IP address or location?

No. Rotating the keys does not change the server you are connected to or the address you appear to use. It only changes the secret values that encrypt the traffic.

Can I control how often the keys rotate?

In most consumer VPN apps you cannot. The interval is set by the protocol and the server. If you suspect rekeying is causing drops, see the troubleshooting steps in this article or contact support.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Need a VPN for a short trip or a busy month?

XPASS sells prepaid passes for a set number of days. You pay once and nothing renews automatically.

See passes

Keep reading

VPN Security

How VPN Key Exchange Works

How can your phone and a VPN server agree on a secret key while everyone watches? This article walks through a small Diffie-Hellman example, the role of authentication and how real protocols build their session keys.

10 min read

VPN Security

What Is VPN Encryption?

VPN encryption scrambles your data between your device and the VPN server. Here is how keys, ciphers and the handshake work, and what encryption cannot do.

10 min read

VPN Security

WireGuard PersistentKeepalive Explained

A plain explanation of WireGuard's PersistentKeepalive setting: why idle tunnels go quiet, how NAT timers cause it, when to use 25 seconds and when to leave it off.

9 min read