David Miller (), aki a Linux kernel hálózati alrendszeréért felelős, a net-next ágon a VPN-interfész megvalósításával a projektből . A következő év elején a net-next ágon felhalmozott változások alkotják a Linux 5.6 kernel kiadásának alapját.
A WireGuard kódjának fő kernelbe juttatására tett kísérletek az utóbbi néhány évben történtek, de eredménytelenek maradtak, mivel a teljesítményjavítás érdekében használt kriptográfiai funkciók saját megvalósításaihoz voltak kötve. Eleinte ezek a funkciók a kernelhez a Zinc alacsony szintű API-jaként, amely idővel pótolhatja a meglévő Crypto API-t.
A Kernel Recipes konferencián folytatott tárgyalások után a WireGuard alkotói szeptemberben az API-csatornájuk elmúlt teljesítménye és biztonságával kapcsolatos aggályaik ellenére a kernel Crypto API használatára. A Zinc API-t továbbra is fejleszteni fogják, de külön projektként.
Novemberben a kernel fejlesztői és beleegyeztek, hogy átvigyenek a fő kernelbe egyes kódokat a Zinc-ből. Valójában a Zinc egyes komponensei a kernelbe kerülnek, de nem mint külön API, hanem a Crypto API alrendszereként. Például a Crypto API már elő van készítve a WireGuard által a ChaCha20 és Poly1305 algoritmusok gyors implementációja.
A WireGuard fő kernelbeli bevezetése kapcsán a projekt alapítója a tároló átalakításáról. A fejlesztés egyszerűsítése érdekében a monolitikus ‘WireGuard.git’ tároló, amely a elkülönült létezésre volt tervezve, három külön tárolóra vált, amelyek jobban illeszkednek a fő kernel kódjának kezeléséhez:
- — a WireGuard projektből származó változtatásokkal teljes kernel fájlfa, amelynek patch-ét a kernelbe való beépítésre fogják áttekinteni és rendszeresen átkonvertálják a net/net-next ágakba.
- — felhasználói térben futó segédprogramok és szkriptek, például wg és wg-quick tárolója. A tároló csomagok létrehozására is használható disztribúciókhoz.
- — a repository with a version of the module delivered separately from the core, including a compat.h layer to ensure compatibility with older kernels. Main development will take place in the repository wireguard-linux.git, but there is currently a possibility and need for users to support a separate version of the patches in working form.
It should be noted that the WireGuard VPN is based on modern encryption methods, providing very high performance, ease of use, and has proven itself well in several large implementations handling significant traffic volumes. The project has been developing since 2015, passed an audit and of the applied encryption methods. Support for WireGuard is already integrated into NetworkManager and systemd, and the kernel patches are included in the core distributions , Mageia, Alpine, Arch, Gentoo, OpenWrt, NixOS, és .
WireGuard employs a key routing concept that ties a private key to each network interface and uses it to connect with public keys. The exchange of public keys for connection establishment occurs similarly to SSH. For key agreement and connection without launching a separate user-space daemon, the Noise_IK mechanism from , similar to maintaining authorized_keys in SSH. Data transmission is performed through encapsulation in UDP packets. The VPN server’s IP address can be changed (roaming) without breaking the connection, and the client is automatically reconfigured.
For encryption a stream cipher and a message authentication algorithm (MAC) , developed by Daniel Bernstein (), Tanja Lange
(Tanja Lange) és Peter Schwabe. A ChaCha20 és a Poly1305 gyorsabb és biztonságosabb alternatívái az AES-256-CTR-nek és a HMAC-nek, amelyek szoftveres megvalósítása lehetővé teszi az állandó végrehajtási idő elérését, anélkül hogy külön hardvert igényelne. A közös titkos kulcs generálásához elliptikus görbéken alapuló Diffie-Hellman protokollt alkalmaznak. , also proposed by Daniel Bernstein. The algorithm used for hashing is .
Mikor the performance of WireGuard demonstrated a throughput 3.9 times higher and a responsiveness 3.8 times better compared to OpenVPN (256-bit AES with HMAC-SHA2-256). Compared to IPsec (256-bit ChaCha20+Poly1305 and AES-256-GCM-128), WireGuard shows a slight performance advantage (13-18%) and lower latency (21-23%). Tests were conducted using fast implementations of encryption algorithms developed by the project — switching to the standard Crypto API of the kernel may lead to a decrease in performance.
Forrás: opennet.ru
