Rosenpass: Difference between revisions
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[https://rosenpass.eu | [https://rosenpass.eu/ Rosenpass] implements a post-quantum-secure key exchange for use with e.g. [[WireGuard]]. | ||
=Setting up Rosenpass= | =Setting up Rosenpass= | ||
Line 20: | Line 20: | ||
We will first need to generate and then distribute the keypairs. | We will first need to generate and then distribute the keypairs. | ||
Creating the key pairs is simple: | Creating the key pairs is simple, but to do this securely, it should happen on the respective hosts. | ||
This way it becomes a bit elaborate to distribute the public keys to the other respective peer: | |||
<syntaxHighlight lang="bash"> | <syntaxHighlight lang="bash"> | ||
ssh root@server "rm -rf /var/secrets/{rp,wg} && mkdir -m 755 -p /var/secrets/{rp,wg} && chown systemd-network:systemd-network /var/secrets/wg" | |||
mkdir | ssh root@client "rm -rf /var/secrets/{rp,wg} && mkdir -m 755 -p /var/secrets/{rp,wg} && chown systemd-network:systemd-network /var/secrets/wg" | ||
ssh root@server "cd /var/secrets/rp && rosenpass gen-keys --secret-key pqsk --public-key pqpk" | |||
rosenpass gen-keys --secret-key | ssh root@client "cd /var/secrets/rp && rosenpass gen-keys --secret-key pqsk --public-key pqpk" | ||
rosenpass gen-keys --secret-key | |||
ssh root@server "cd /var/secrets/wg && wg genkey | tee wgsk | wg pubkey > wgpk" | |||
wg genkey | tee | ssh root@client "cd /var/secrets/wg && wg genkey | tee wgsk | wg pubkey > wgpk" | ||
wg genkey | tee | |||
rsync root@server:/var/secrets/rp/pqpk server.pqpk | |||
rsync root@client:/var/secrets/rp/pqpk client.pqpk | |||
rsync --perms --chmod=644 server.pqpk root@client:/var/secrets/rp/server.pqpk | |||
rsync --perms --chmod=644 client.pqpk root@server:/var/secrets/rp/client.pqpk | |||
ssh root@server "echo server wg pubkey is \$(cat /var/secrets/wg/wgpk)" | |||
ssh root@client "echo client wg pubkey is \$(cat /var/secrets/wg/wgpk)" | |||
</syntaxHighlight> | |||
Note down the results of the last two printed lines as these are the public keys that need to be entered in the following NixOS configuration snippets. | |||
You can create as many keypairs as you like for different connections or roles; it is also possible to reuse the same keypair for every connection. | |||
===Server setup=== | ===Server setup=== | ||
Line 207: | Line 200: | ||
rtt min/avg/max/mdev = 1.116/1.190/1.329/0.098 ms | rtt min/avg/max/mdev = 1.116/1.190/1.329/0.098 ms | ||
$ ssh | $ ssh client "ping -c3 1:c:bad:c0de::1" | ||
PING 1:c:bad:c0de::1 (1:c:bad:c0de::1) 56 data bytes | PING 1:c:bad:c0de::1 (1:c:bad:c0de::1) 56 data bytes | ||
64 bytes from 1:c:bad:c0de::1: icmp_seq=1 ttl=64 time=1.03 ms | 64 bytes from 1:c:bad:c0de::1: icmp_seq=1 ttl=64 time=1.03 ms | ||
Line 222: | Line 215: | ||
==The <code>rosenpass0</code> device does not pop up== | ==The <code>rosenpass0</code> device does not pop up== | ||
This is most likely an issue in the non- | This is most likely an issue in the non-Rosenpass part of the configuration. | ||
Please have a look at the output of the command <code>systemctl status sytemd-network</code>. | Please have a look at the output of the command <code>systemctl status sytemd-network</code>. | ||
If for example file permissions of the keys are too restrictive, then this will manifest as error messages here. | If for example file permissions of the keys are too restrictive, then this will manifest as error messages here. | ||
Line 230: | Line 223: | ||
Even if the rosenpass0 device pops up, it still might be possible that Rosenpass observes errors during setup or connect. | Even if the rosenpass0 device pops up, it still might be possible that Rosenpass observes errors during setup or connect. | ||
Please have a look at the output of the command <code>systemctl status rosenpass</code>. | Please have a look at the output of the command <code>systemctl status rosenpass</code>. | ||
If for example file permissions of the keys are too restrictive, then this will manifest as error messages here. | |||
=See also= | =See also= |