Wenn man Wikipedia glauben will dann ist „Curve25519 … eine elliptische Kurve, die für asymmetrische Kryptosysteme genutzt wird. Sie wird üblicherweise für digitale Signaturen und Schlüsselaustauschprotokolle genutzt und gilt als besonders schnell. Sie ist von der IETF als RFC 7748 standardisiert.“
Aber sie wird auch für Onion-Services verwendet. Deshalb mal heute zur Entspannung für 10 Minuten einen public und privaten Key auf einem Raspberry Pi (Zero) generieren. Inkl. Hostnamen. Das geht so:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// nötige Abhängigkeite installieren, wenn nicht schon vorhanden sudo apt install gcc libsodium-dev make autoconf // das Repo clonen git clone https://github.com/IT-Berater/mkp224o.git // die mkp224o App compilieren, bauen und installieren cd mkp224o/ ./autogen.sh ./configure make // Keys die mit fast oder filter starten und Hostname generieren im TW-Keys Verzeichnis, das dauert ca. 1 Minute ./mkp224o filter fast -t 1 -v -n 1 -d ./TW-Keys // Check cd TW-Keys ls |
Hier mal der lauf auf meinem Pi:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
bitcoin@pi-zero:~ $ git clone https://github.com/IT-Berater/mkp224o.git Klone nach 'mkp224o' ... remote: Enumerating objects: 1214, done. remote: Counting objects: 100% (19/19), done. remote: Compressing objects: 100% (15/15), done. remote: Total 1214 (delta 7), reused 12 (delta 4), pack-reused 1195 Empfange Objekte: 100% (1214/1214), 1.67 MiB | 819.00 KiB/s, Fertig. Löse Unterschiede auf: 100% (748/748), Fertig. bitcoin@pi-zero:~ $ cd mkp224o/ bitcoin@pi-zero:~/mkp224o $ ./autogen.sh bitcoin@pi-zero:~/mkp224o $ ./configure checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether CC supports -march=native... yes checking whether CC supports -fomit-frame-pointer... yes checking whether CC supports -nopie... no checking whether CC supports -no-pie... yes checking whether CC supports -std=c99... yes checking whether CC supports -Wall... yes checking whether CC supports -Wextra... yes checking whether CC supports -Wno-maybe-uninitialized... yes checking whether CC supports and needs -Wno-format -Wno-pedantic-ms-format... no checking whether CC supports -Wno-unused-function... yes checking whether CC supports -Wmissing-prototypes... yes checking whether CC supports -Wstrict-prototypes... yes checking whether ARGON2ID13 is supported by libsodium... yes configure: creating ./config.status config.status: creating GNUmakefile bitcoin@pi-zero:~/mkp224o $ make gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o main.c.o.tmp main.c && mv main.c.o.tmp main.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o worker.c.o.tmp worker.c && mv worker.c.o.tmp worker.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o yaml.c.o.tmp yaml.c && mv yaml.c.o.tmp yaml.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o vec.c.o.tmp vec.c && mv vec.c.o.tmp vec.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o cpucount.c.o.tmp cpucount.c && mv cpucount.c.o.tmp cpucount.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o base32_to.c.o.tmp base32_to.c && mv base32_to.c.o.tmp base32_to.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o base32_from.c.o.tmp base32_from.c && mv base32_from.c.o.tmp base32_from.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o base64_to.c.o.tmp base64_to.c && mv base64_to.c.o.tmp base64_to.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o base64_from.c.o.tmp base64_from.c && mv base64_from.c.o.tmp base64_from.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o ioutil.c.o.tmp ioutil.c && mv ioutil.c.o.tmp ioutil.c.o gcc -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -c -o keccak.c.o.tmp keccak.c && mv keccak.c.o.tmp keccak.c.o gcc -no-pie -std=c99 -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -Wmissing-prototypes -Wstrict-prototypes -O3 -march=native -fomit-frame-pointer -DED25519_donna -DSTATISTICS -DPASSPHRASE -o mkp224o.tmp main.c.o worker.c.o yaml.c.o vec.c.o cpucount.c.o base32_to.c.o base32_from.c.o base64_to.c.o base64_from.c.o ioutil.c.o keccak.c.o -lpthread -lsodium && mv mkp224o.tmp mkp224o # wir erzeugen mal Keys die mit filter und fast starten sollen... bitcoin@pi-zero:~/mkp224o $ ./mkp224o filter fast -t 1 -v -n 1 -d ./TW-Keys set workdir: ./TW-Keys/ sorting filters... done. filters: fast filter in total, 2 filters using 1 thread fastjvg2pctazqrisduqgxlqpirfso4m7h3v3lt7httqhqsatgpo3oid.onion waiting for threads to finish... done. # ok, wir haben einen Key erzeugt der mit fast... startet # wir wechseln dann in das Verzeichnis und schauen uns an was generiert wurde bitcoin@pi-zero:~/mkp224o $ cd TW-Keys/ bitcoin@pi-zero:~/mkp224o/TW-Keys $ ls # das Verzeichnis mit den Keys, da gehen wir rein fastjvg2pctazqrisduqgxlqpirfso4m7h3v3lt7httqhqsatgpo3oid.onion bitcoin@pi-zero:~/mkp224o/TW-Keys $ cd fastjvg2pctazqrisduqgxlqpirfso4m7h3v3lt7httqhqsatgpo3oid.onion/ # wir listen uns alle Dateien auf bitcoin@pi-zero:~/mkp224o/TW-Keys/fastjvg2pctazqrisduqgxlqpirfso4m7h3v3lt7httqhqsatgpo3oid.onion $ ls # diese drei Dateien wurden generiert ... hostname hs_ed25519_public_key hs_ed25519_secret_key # die hostname Datei enthält ... bitcoin@pi-zero:~/mkp224o/TW-Keys/fastjvg2pctazqrisduqgxlqpirfso4m7h3v3lt7httqhqsatgpo3oid.onion $ cat hostname fastjvg2pctazqrisduqgxlqpirfso4m7h3v3lt7httqhqsatgpo3oid.onion bitcoin@pi-zero:~/mkp224o/TW-Keys/fastjvg2pctazqrisduqgxlqpirfso4m7h3v3lt7httqhqsatgpo3oid.onion $ cat hs_ed25519_public_key == ed25519v1-public: type0 ==( bitcoin@pi-zero:~/mkp224o/TW-Keys/fastjvg2pctazqrisduqgxlqpirfso4m7h3v3lt7httqhqsatgpo3oid.onion $ |
Und alle Parameter des Programms:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
./mkp224o -h Usage: ./mkp224o filter [filter...] [options] ./mkp224o -f filterfile [options] Options: -h - print help to stdout and quit -f - specify filter file which contains filters separated by newlines -D - deduplicate filters -q - do not print diagnostic output to stderr -x - do not print onion names -v - print more diagnostic data -o filename - output onion names to specified file (append) -O filename - output onion names to specified file (overwrite) -F - include directory names in onion names output -d dirname - output directory -t numthreads - specify number of threads to utilise (default - CPU core count or 1) -j numthreads - same as -t -n numkeys - specify number of keys (default - 0 - unlimited) -N numwords - specify number of words per key (default - 1) -Z - use "slower" key generation method (initial default) -z - use "faster" key generation method (later default) -B - use batching key generation method (>10x faster than -z, current default) -s - print statistics each 10 seconds -S t - print statistics every specified ammount of seconds -T - do not reset statistics counters when printing -y - output generated keys in YAML format instead of dumping them to filesystem -Y [filename [host.onion]] - parse YAML encoded input and extract key(s) to filesystem --rawyaml - raw (unprefixed) public/secret keys for -y/-Y (may be useful for tor controller API) -p passphrase - use passphrase to initialize the random seed with -P - same as -p, but takes passphrase from PASSPHRASE environment variable |
In einen folgenden Blockbeitrag zeige ich was man damit schönes machen kann.