Code Monkey home page Code Monkey logo

pq-wireguard's Introduction

PQ-WireGuard

In this branch, we integrate our tweaked implementation of the crystals post-quantum algorithms in the Go implementation of Wireguard following the Fujioka contruction. Please refer to our blog-post for more information.

WIP

We are currently working on overriding the wg(8) commands to allow the users to input Kyber keys. For now, the key pair and the peers' key must be given within a configuration file when starting the interface, using the -c or --config_file flag followed by the .conf file. We included examples of such file (see peer0.conf) to showcase the accepted format and required fields.

Building

This requires an installation of go โ‰ฅ 1.13.

$ git clone https://github.com/kudelskisecurity/pq-wireguard
$ cd pq-wireguard
$ go build

Usage

Most Linux kernel WireGuard users are used to adding an interface with ip link add wg0 type wireguard. With wireguard-go, instead simply run:

$ ./wireguard -c peerX.conf wg0

This will create an interface and fork into the background. To remove the interface, use the usual ip link del wg0, or if your system does not support removing interfaces directly, you may instead remove the control socket via rm -f /var/run/wireguard/wg0.sock, which will result in wireguard-go shutting down.

To run wireguard-go without forking to the background, pass -f or --foreground:

$ ./wireguard -f -c peerX.conf wg0

When an interface is running, you may use the usual ip(8) and ifconfig(8) commands ip addr add X.X.X.X/X dev wg0 and ip link set wg0 up. See the original wireguard-go README for more details

To run with more logging you may set the environment variable LOG_LEVEL=debug.

Generating the .conf file

The public and private keys can be generated and printed using the --keygen flag.

$ ./wireguard --keygen

The IP address to use as endpoint can be extracted using the ip addr command. The port to be used can be randomly assigned among the free ports. The protocol version is set to 1, the booleans replace_allowed_ips and replace_peers are set to true.

Demo

You can watch below the video of two peers being configured side-by-side.

https://drive.google.com/file/d/1kjXPb9SclK9umB4hkgHnJSDSagKoxhQX/view?usp=sharing

License

Copyright (C) 2017-2020 WireGuard LLC. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

pq-wireguard's People

Contributors

pizzawhisperer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.