Convert Figma logo to code with AI

WireGuard logowireguard-monolithic-historical

Historical monolithic WireGuard repository, split into wireguard-tools, wireguard-linux, and wireguard-linux-compat.

2,323
296
2,323
3

Top Related Projects

26,201

An open source, self-hosted implementation of the Tailscale control server

10,355

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.

23,221

The easiest, most secure way to use WireGuard and 2FA.

Cloudflare Tunnel client (formerly Argo Tunnel)

15,699

A scalable overlay networking tool with a focus on performance, simplicity and security

29,343

Set up a personal VPN in the cloud

Quick Overview

The WireGuard/wireguard-monolithic-historical repository is a historical archive of the WireGuard project, which is a fast, modern, and secure VPN protocol. This repository contains the original monolithic codebase of WireGuard, which has since been split into multiple repositories for better maintainability.

Pros

  • Simplicity: The monolithic codebase provides a straightforward and easy-to-understand structure for the WireGuard project.
  • Historical Significance: The repository serves as an important historical record of the project's development and evolution.
  • Comprehensive: The monolithic codebase includes all the necessary components and features of the WireGuard protocol.
  • Stable: The historical nature of the repository ensures that the codebase is stable and well-tested.

Cons

  • Maintainability: As the project has grown, the monolithic codebase can become more difficult to manage and maintain.
  • Modularity: The lack of modular design can make it harder to work on specific components of the project independently.
  • Scalability: The monolithic approach may not be as scalable as a more modular design, especially as the project continues to evolve.
  • Flexibility: The rigid structure of the monolithic codebase may limit the flexibility and adaptability of the project.

Code Examples

This repository is a historical archive and does not contain any active code. It is a monolithic codebase that has since been split into multiple repositories for better maintainability.

Getting Started

Since this repository is a historical archive, there are no specific getting started instructions. The current active development of the WireGuard project is happening in the WireGuard/wireguard-tools and WireGuard/wireguard-linux-compat repositories.

Competitor Comparisons

26,201

An open source, self-hosted implementation of the Tailscale control server

Pros of headscale

  • Implements a control server for Tailscale networks, offering a self-hosted alternative
  • Written in Go, providing good performance and cross-platform compatibility
  • Actively maintained with regular updates and community contributions

Cons of headscale

  • Less mature and battle-tested compared to the WireGuard implementation
  • May lack some advanced features or optimizations present in the original WireGuard codebase
  • Potentially smaller user base and community support

Code Comparison

While a direct code comparison is not particularly relevant due to the different purposes of these projects, we can highlight some key differences in their implementation:

headscale (Go):

func (h *Headscale) handleRegister(w http.ResponseWriter, r *http.Request) {
    // Registration logic
}

wireguard-monolithic-historical (C):

static int wg_socket_init(struct wg_device *wg)
{
    // Socket initialization logic
}

The headscale project focuses on implementing a control server in Go, while the WireGuard monolithic historical repository contains the core WireGuard implementation in C. This reflects their different purposes and design philosophies.

10,355

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.

Pros of Netmaker

  • Provides a comprehensive network management solution built on top of WireGuard
  • Offers a user-friendly web interface for easier configuration and management
  • Supports advanced features like access control and multi-cloud networking

Cons of Netmaker

  • More complex setup compared to the simpler WireGuard implementation
  • Requires additional resources to run the management infrastructure
  • May introduce potential security vulnerabilities due to increased attack surface

Code Comparison

Netmaker (Go):

func (network *Network) CreateAccessKey(uses int, name string) (*AccessKey, error) {
    accessKey := AccessKey{
        Name:      name,
        Uses:      uses,
        Value:     GenerateKey(),
        Network:   network.NetID,
        Expiration: time.Now().Add(time.Hour * 24).Unix(),
    }
    // ... (additional code)
}

WireGuard (C):

static int wg_set_device(struct net_device *dev, void __user *userconf)
{
    struct wireguard_device *wg = netdev_priv(dev);
    struct wg_device wg_device;
    int ret;

    // ... (additional code)
}

The code snippets demonstrate the different approaches and languages used in each project. Netmaker focuses on higher-level network management features, while WireGuard provides low-level VPN functionality.

23,221

The easiest, most secure way to use WireGuard and 2FA.

Pros of Tailscale

  • User-friendly interface and easier setup for non-technical users
  • Built-in features like access controls, user management, and DNS
  • Cross-platform support with clients for various operating systems

Cons of Tailscale

  • Closed-source components, limiting customization and auditing
  • Dependency on Tailscale's infrastructure for coordination
  • Potential privacy concerns due to centralized control

Code Comparison

Tailscale (Go):

func (c *Conn) Close() error {
    c.mu.Lock()
    defer c.mu.Unlock()
    if c.closed {
        return nil
    }
    c.closed = true
    return c.pconn.Close()
}

WireGuard (C):

static void noise_handshake_init(struct noise_handshake *handshake,
                 struct noise_static_identity *static_identity,
                 const u8 peer_public_key[NOISE_PUBLIC_KEY_LEN],
                 const u8 peer_pre_shared_key[NOISE_SYMMETRIC_KEY_LEN],
                 struct wireguard_peer *peer)
{
    memset(handshake, 0, sizeof(*handshake));
    handshake->entry.type = HANDSHAKE_ZEROED;
    handshake->static_identity = static_identity;
    memcpy(handshake->remote_static, peer_public_key, NOISE_PUBLIC_KEY_LEN);
    if (peer_pre_shared_key)
        memcpy(handshake->pre_shared_key, peer_pre_shared_key,
               NOISE_SYMMETRIC_KEY_LEN);
    handshake->peer = peer;
}

Cloudflare Tunnel client (formerly Argo Tunnel)

Pros of cloudflared

  • More actively maintained with frequent updates and contributions
  • Broader functionality, including Cloudflare Tunnel and DNS-over-HTTPS support
  • Better documentation and community support

Cons of cloudflared

  • Larger codebase, potentially more complex to understand and modify
  • Tied specifically to Cloudflare's ecosystem, less flexible for general VPN use
  • May have higher resource requirements due to additional features

Code Comparison

wireguard-monolithic-historical (C):

static inline void curve25519_copy(u8 *dst, const u8 *src)
{
    memcpy(dst, src, 32);
}

cloudflared (Go):

func copyBuffer(dst, src []byte) int {
    return copy(dst, src)
}

Both projects implement buffer copying, but cloudflared uses Go's built-in copy function, while wireguard-monolithic-historical uses C's memcpy. This reflects the different language choices and coding styles between the projects.

15,699

A scalable overlay networking tool with a focus on performance, simplicity and security

Pros of Nebula

  • Designed for overlay networks across multiple cloud providers and regions
  • Built-in security features like certificate-based authentication and encryption
  • Supports advanced networking features like NAT traversal and automatic route optimization

Cons of Nebula

  • More complex setup and configuration compared to WireGuard
  • Potentially higher resource usage due to additional features
  • Less widespread adoption and community support

Code Comparison

WireGuard (C):

static inline void chacha20poly1305_encrypt(u8 *dst, const u8 *src, const size_t src_len,
                                            const u8 *ad, const size_t ad_len,
                                            const u64 nonce, const u8 key[CHACHA20POLY1305_KEY_SIZE])
{
    chacha20(dst, src, src_len, key, nonce);
    poly1305_mac(dst + src_len, dst, src_len, ad, ad_len, key);
}

Nebula (Go):

func (f *Interface) encrypt(b, nb []byte, nonce uint64) {
    f.writeLock.Lock()
    defer f.writeLock.Unlock()

    f.nonce.Store(nonce)
    f.cipher.Seal(nb[:0], f.nonce.Bytes(), b, nil)
}
29,343

Set up a personal VPN in the cloud

Pros of algo

  • User-friendly setup process with automated deployment scripts
  • Supports multiple cloud providers and platforms
  • Includes additional security features like DNS-based adblocking

Cons of algo

  • Less flexible and customizable than wireguard-monolithic-historical
  • May have higher resource usage due to additional features
  • Potentially more complex codebase for users who want to modify or extend functionality

Code comparison

algo:

def deploy_strongswan(self):
    self.copy_ipsec_files()
    self.configure_ipsec()
    self.start_strongswan()

wireguard-monolithic-historical:

static int wg_peer_create(struct wg_device *wg, struct wg_peer *new_peer)
{
    struct wg_peer *peer;
    int ret;

    lockdep_assert_held(&wg->device_update_lock);

The algo project focuses on high-level deployment scripts and configuration, while wireguard-monolithic-historical contains low-level C code for the WireGuard protocol implementation. This reflects their different purposes: algo aims for ease of use and deployment, while wireguard-monolithic-historical provides the core functionality and performance of the WireGuard protocol.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

WireGuard — fast, modern, secure kernel VPN tunnel

by Jason A. Donenfeld of Edge Security

WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. It runs over UDP.

More information may be found at WireGuard.com.

License

This project is released under the GPLv2.