]> git.netwichtig.de Git - user/henk/code/shell/rif.git/blob - README.md
050f0bb523cc8e42e69273745f7b170275b86f1a
[user/henk/code/shell/rif.git] / README.md
1 Hello!
2
3 Are you a real IPv6 friend?
4
5 ## Introduction
6
7 People like you and me don't want or need Facebook. However, we do
8 want to securely communicate with our friends. And chat with them. And
9 know when they are online. Let's solve this problem once-and-for-all
10 in a decentralised, sustainable and future proof way.
11
12 ## Here come's the real IPv6 friend
13
14 Instead of using a single system or server, we use IPv6 to connect to
15 our friends directly. Because each of our friends is reachable by IPv6
16 if they are online (otherwise they would not be a real IPv6 friend),
17 we can easily verify if they are online. To find out who is online,
18 just connect to their computer!
19
20 ## How it works
21
22 It's a bit geeky, but it works actually rather simple.
23 To become a real IPv6 friend, you need to do the following things:
24
25 - Generate a GPG key with a comment named RIF following the URL of
26   your computer
27 - Ensure that the URL points to the IPv6 address of your computer
28 - Setup a webserver on your computer
29 - Export your key and all real IPv6 friend keys to your webserver as
30   "rifkeys.txt
31 - For each of your friends, check whether they are online
32 - Import the friends of your friends and check whether they are
33   online, too!
34
35 ### Example: Generating a key with the right comment
36
37 In this example I choose to create an ECC based key that requires the
38 export option in gpg:
39
40 ```
41 [1:24] line:~% gpg --expert --full-gen-key
42 gpg (GnuPG) 2.2.12; Copyright (C) 2018 Free Software Foundation, Inc.
43 This is free software: you are free to change and redistribute it.
44 There is NO WARRANTY, to the extent permitted by law.
45
46 Please select what kind of key you want:
47    (1) RSA and RSA (default)
48    (2) DSA and Elgamal
49    (3) DSA (sign only)
50    (4) RSA (sign only)
51    (7) DSA (set your own capabilities)
52    (8) RSA (set your own capabilities)
53    (9) ECC and ECC
54   (10) ECC (sign only)
55   (11) ECC (set your own capabilities)
56   (13) Existing key
57 Your selection? 9
58 Please select which elliptic curve you want:
59    (1) Curve 25519
60    (3) NIST P-256
61    (4) NIST P-384
62    (5) NIST P-521
63    (6) Brainpool P-256
64    (7) Brainpool P-384
65    (8) Brainpool P-512
66    (9) secp256k1
67 Your selection? 1
68 Please specify how long the key should be valid.
69          0 = key does not expire
70       <n>  = key expires in n days
71       <n>w = key expires in n weeks
72       <n>m = key expires in n months
73       <n>y = key expires in n years
74 Key is valid for? (0) 0
75 Key does not expire at all
76 Is this correct? (y/N) y
77
78 GnuPG needs to construct a user ID to identify your key.
79
80 Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? c
81 Comment: RIF https://nico.ungleich.cloud
82 You selected this USER-ID:
83     "Nico Schottelius (RIF https://nico.ungleich.cloud) <ipv6@nico.ungleich.cloud>"
84
85 Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
86 We need to generate a lot of random bytes. It is a good idea to perform
87 some other action (type on the keyboard, move the mouse, utilize the
88 disks) during the prime generation; this gives the random number
89 generator a better chance to gain enough entropy.
90 We need to generate a lot of random bytes. It is a good idea to perform
91 some other action (type on the keyboard, move the mouse, utilize the
92 disks) during the prime generation; this gives the random number
93 generator a better chance to gain enough entropy.
94 gpg: key 27541E11E73F288D marked as ultimately trusted
95 gpg: directory '/home/nico/.gnupg/openpgp-revocs.d' created
96 gpg: revocation certificate stored as '/home/nico/.gnupg/openpgp-revocs.d/B982A8BABC030C66DEF5984527541E11E73F288D.rev'
97 public and secret key created and signed.
98
99 pub   ed25519 2019-09-09 [SC]
100       B982A8BABC030C66DEF5984527541E11E73F288D
101 uid                      Nico Schottelius (RIF https://nico.ungleich.cloud) <ipv6@nico.ungleich.cloud>
102 sub   cv25519 2019-09-09 [E]
103
104
105 ```
106
107 ### Example: Setting up a webserver
108
109 On a Debian/Devuan based distro:
110
111 ```
112 apt install nginx
113 sudo chown $(whoami) /var/www/html
114 ```
115
116
117 ### Exporting all keys
118
119 To make yourself accessible and expose who your real IPv6 friends are.
120
121 ```
122 gpg -a --export RIF > /var/www/html/rifkeys
123 ```
124
125 ### Example: List your friends
126
127 You can use the included rif-listfriends.sh or directly gpg:
128
129 ```
130 [1:40] line:~% gpg --list-keys --with-colons | grep RIF | awk -F: '{ print $10 }' | sed 's/\\x3a/:/'
131 Nico Schottelius (RIF https://nico.ungleich.cloud) <ipv6@nico.ungleich.cloud>
132 Nico Schottelius (myself) (RIF https://nico2.ungleich.cloud) <nico@nico.ungleich.cloud>
133 ```
134
135
136 ### Example: Checking which friends are online
137
138 Use the included rif-checkfriends.sh script or iterate yourself over
139 above output.
140
141 ```
142 [1:54] line:realipv6friend% sh rif-checkfriends.sh
143 Checking Nico Schottelius  on https://nico.ungleich.cloud ...
144 Nico Schottelius is online
145 Checking Nico Schottelius (myself)  on https://nico2.ungleich.cloud ...
146 Nico Schottelius (myself) is offline
147 [1:54] line:realipv6friend%
148
149 ```
150
151 ### Example: Importing friends of my friend
152
153 Importing friends of a friend is as simple as importing all the
154 exported keys! We import friends directly from the URL of a friend:
155
156 ```
157 curl -6 -s https://nico.ungleich.cloud/rifkeys | gpg --import
158 ```
159
160 You can also use
161
162 ### Example: Sending a message to a friend
163
164 Simply use your mail program for that.
165 And obviously enable signing & encrypting the email.
166
167
168 ## To be added
169
170 - advanced usage -> ipv6 email
171
172 ### CLI ideas
173
174 - **rif prepare**: check webserver, keyring, etc.
175 - **rif online**: check who is online