Lightway is reimplemented in Rust for a leaner, more secure VPN protocol

ExpressVPN news
2 mins
ExpressVPN's Lightway is recoded in Rust.

Five years ago, when we built Lightway, we aimed to create a VPN protocol from scratch that could adapt to the modern, mobile world. Focusing on the needs of consumer VPN users, we kept the codebase light to boost performance and used well-established cryptography for security.

The majority of ExpressVPN’s users are connecting with Lightway and do so in a fraction of a second. A VPN should work seamlessly, and Lightway helps to achieve that. To keep Lightway on the cutting edge, we’ve reimplemented it from C into Rust—a programming language that’s matured in recent years to become one of the most powerful and popular among developers for high-performance systems. 

This required a total overhaul of Lightway and the result is a leaner, more secure VPN that can be easily improved upon. And to ensure the security posture of Lightway in Rust, we’ve commissioned two separate firms to conduct independent audits of it.

To the average ExpressVPN user, however, Lightway should seem familiar, retaining all its features like post-quantum encryption, ad blocking, and tracker blocking

Why we switched Lightway from C to Rust

The digital world is constantly changing, and we continuously review and consider how to improve our software amid these changes. While C is still widely used and influential, Rust is a more modern coding language that better meets our expectations for coding excellence.

For Lightway, we determined that moving from C to Rust would bring certain advantages.

Security: Rust offers far greater security for VPN protocols than C, enabling us to eliminate whole avenues of attack vectors and weaknesses. The biggest threats in C simply cannot exist in Rust, thanks to Rust’s memory safety: bugs and attack vectors related to memory access become immediately invalidated. As before, Lightway uses wolfSSL, a well-established, open-source cryptography library. 

Performance: because the Rust code is simpler and more expressive, its performance capabilities and efficiency are greater than they could ever be in C. Rust also enables us to do safer multi-core processing, enabling the VPN to run more efficiently and take advantage of more processing power. This translates to lower power consumption on users’ devices and better performance.

Ease of expansion: widely recognized as one of the best modern coding languages, Rust enables us to code more intuitively and allows us to build on Lightway’s existing codebase more easily. This means we can make improvements and build new features with fewer lines of code than would be needed in C, making future versions faster, with less bloat.

With this change to Rust, Lightway will remain open source, allowing anyone to scrutinize it and empowering other VPN developers to adopt it. The two new rigorous, independent audits, from Cure53 and Praetorian, have validated that the recode of Lightway meets the highest security standards as well as the expectations of our users.

The VPN protocol of the future

Just as security threats morph through innovation, so too must the tools to combat them. Often this means looking ahead and applying protections pre-emptively. We’ve applied this principle by adding post-quantum protections to Lightway, leveraging ML-KEM to protect users against threats expected to emerge with advancements in computing power.

By coding in Rust, we ensure that Lightway remains on the cutting edge well into the future. In the long-term, Rust’s coding principles mean Lightway will stay lean, even when we expand it. Others in the VPN industry can adopt it with greater ease and confidence, setting a new standard for secure protocols.

Phone protected by ExpressVPN.
Protect your online privacy and security

30-day money-back guarantee

A phone with a padlock.
We take your privacy seriously. Try ExpressVPN risk-free.
What is a VPN?
ExpressVPN is dedicated to your online security and privacy. Posts from this account will focus on company news or significant privacy and security stories.