Wissenssammlung
fuer Linux, U.n.i.x, Netzwerke ...
Fachliche
Korrektheit ist nicht
gewaehrleistet, Vollstaendigkeit eh net..
.
GnuPG
...
..
.
Autor: Thomas Ulrich Nockmann (November ©2003)
SCHRITT 1:
Erstellen eines Schlüsselpaares, bestehend aus privatem und
öffentlichem Schlüssel:
########
billy@hell:~$ gpg --gen-key
gpg (GnuPG) 1.2.2; Copyright (C) 2003 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
Please select what kind of key you want:
(1) DSA and ElGamal (default)
(2) DSA (sign only)
(5) RSA (sign only)
Your selection? 1
DSA keypair will have 1024 bits.
About to generate a new ELG-E keypair.
minimum keysize is 768 bits
default keysize is 1024 bits
highest suggested keysize is 2048 bits
What keysize do you want? (1024) 2048
Reqüsted keysize is 2048 bits
Please specify how long the key should be valid.
0 = key dös not expire
= key expires in n days
w = key expires in n weeks
m = key expires in n months
y = key expires in n years
Key is valid for? (0) 0
Key dös not expire at all
Is this correct (y/n)? y
You need a User-ID to identify your key; the software constructs the
user id from Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) "
Real name: Billy Gate
Email address: billyboy@köln-lug.de
Comment: Köln LUG - die kölner Linux und U.n.i.x Gruppe
You selected this USER-ID:
"Billy Gate (Köln LUG - die kölner Linux und U.n.i.x
Gruppe) "
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.
We need to generate a lot of random bytes. It is a good idea to
perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
.+++++.++++++++++..
[...]
public and secret key created and signed.
key marked as ultimately trusted.
pub 1024D/691A6339 2003-07-16 Billy Gate (Köln LUG -
die kölner Linux und U.n.i.x Gruppe)
Key fingerprint = 7396 34F3 7197 1EA6 9C79 86CE B6CE D134 691A 6339
sub 2048g/43BCB900 2003-07-16
billy@hell:~$
########
SCHRITT 2:
Als naechstes habe ich ein Wiederrufzertifikat(revocation
certificate) erstellt, was dafür verwenet werden kann, um den
Schlüssel bei bedarf als "wiederrufen(revoked)" zu markieren.
Gründe dafür gibt es verschiedene; bei mir war es die inkorrekte
Systemzeit;-)
Dafür wird der private Schlüssel verwendet und daher habe ich hier
an dieser Stelle einen Fantasiewert eingetragen, den es nicht geben
kann. Ist doch klar?
########
billy@hell:~$ gpg -o rev_billyboy@köln-lug.de.asc --gen-revoke 4X11Y3Z9
sec 1024D/691A6339 2003-07-16 Billy Gate (Köln LUG -
die kölner Linux und U.n.i.x Gruppe)
Create a revocation certificate for this key? y
Please select the reason for the revocation:
0 = No reason specified
1 = Key has beebilly@hell:~$n compromised
2 = Key is superseded
3 = Key is no longer used
Q = Cancel
(Probably you want to select 1 here)
Your decision? o
Invalid selection.
Your decision? 0
Enter an optional description; end it with an empty line:
Reason for revocation: No reason specified
(No description given)
Is this okay? y
You need a passphrase to unlock the secret key for
user: "Billy Gate (Köln LUG - die kölner Linux und
U.n.i.x Gruppe) "
1024-bit DSA key, ID 691A6339, created 2003-07-16
ASCII armored output forced.
Revocation certificate created.
Please move it to a medium which you can hide away; if Mallory gets
access to this certificate he can use it to make your key unusable.
It is smart to print this certificate and store it away, just in
case your media become unreadable. But have some caution: The
print system of your machine might store the data and make it
available to others!
billy@hell:~$
########
########
billy@hell:~$ ls -l rev_tun\@köln-lug.de.asc
- -rw-r--r-- 1 tun tun 263 Jul 16 10:30
rev_billyboy@köln-lug.de.asc
billy@hell:~$
########
SCHRITT 3:
Sodann habe ich ersteinmal die Rechte geaendert.
########
billy@hell:~$ chmod 400 rev_tun\@köln-lug.de.asc
billy@hell:~$ ls -l rev_tun\@köln-lug.de.asc
- -r-------- 1 tun tun 263 Jul 16 10:30
rev_billyboy@köln-lug.de.asc
billy@hell:~$
########
SCHRITT 4:
Die Datei auf einem externen Medium sichern, auf dem Rechner
löschen sowie das Medium in ein Bankschliessfach legen;-)
SCHRITT 5:
Den öffendlichen Schlüssel auf einem Schlüsselserver
veröffendlichen.
########
billy@hell:~$ gpg --keyserver wwwkeys.de.pgp.net --send-key 691A6339
gpg: success sending to `wwwkeys.de.pgp.net' (status=200)
billy@hell:~$
########
SCHRITT 6:
Jetzt habe ich 'mal von einem anderen Rechner aus probiert welche
Schlüssel gefunden werden. Da waren also mein erster
wiederrufener(1) und mein neür nunmehr gültiger(2) Schlüssel
aufzufinden:
########
billy@hell1:~$ gpg --keyserver wwwkeys.de.pgp.net --search-keys
billyboy@köln-lug.de
gpg: searching for "billyboy@köln-lug.de" from HKP server
wwwkeys.de.pgp.net
Keys 1-2 of 2 for "billyboy@köln-lug.de"
(1) Billy Gate (Köln LUG: billyboy@köln-lug.de)
(revoked)
1024 bit DSA key 6D87671B, created 2003-07-15
(2) Billy Gate (Köln LUG - die kölner Linux und
U.n.i.x Gruppe)
1024 bit DSA key 691A6339, created 2003-07-15
Enter number(s), N)ext, or Q)uit > 1
gpg: key 6D87671B: invalid self-signature on user id "Billy Gate (Köln LUG: billyboy@köln-lug.de) "
gpg: key 6D87671B has been created 53022 seconds in future (time
warp or clock problem)
[...]
gpg: key 6D87671B: invalid revocation certificate: timestamp
conflict - skipped
gpg: key 6D87671B: no valid user IDs
gpg: this may be caused by a missing self-signature
gpg: Total number processed: 1
gpg: w/o user IDs: 1
billy@hell1:~$
########
########
billy@hell1:~$ gpg --keyserver wwwkeys.de.pgp.net --search-keys
billyboy@köln-lug.de
gpg: searching for "billyboy@köln-lug.de" from HKP server
wwwkeys.de.pgp.net
Keys 1-2 of 2 for "billyboy@köln-lug.de"
(1) Billy Gate (Köln LUG: billyboy@köln-lug.de)
(revoked)
1024 bit DSA key 6D87671B, created 2003-07-15
(2) Billy Gate (Köln LUG - die kölner Linux und
U.n.i.x Gruppe)
1024 bit DSA key 691A6339, created 2003-07-15
Enter number(s), N)ext, or Q)uit > 2
gpg: key 691A6339: "Billy Gate (Köln LUG - die kölner
Linux und U.n.i.x Gruppe) " not changed
gpg: Total number processed: 1
gpg: unchanged: 1
billy@hell1:~$
########
SCHRITT 6:
Desweiteren habe ich den gültigen Schlüssel importiert.
########
billy@hell1:~$ gpg --keyserver wwwkeys.de.pgp.net --recv-keys
691A6339
gpg: key 691A6339: "Billy Gate (Köln LUG - die kölner
Linux und U.n.i.x Gruppe) " not changed
gpg: Total number processed: 1
gpg: unchanged: 1
billy@hell1:~$
########
########
- -bash-2.05b$ gpg --keyserver wwwkeys.de.pgp.net --recv-keys 691A6339
gpg: WARNUNG: Sensible Daten könnten auf Platte ausgelagert werden.
gpg: siehe http://www.gnupg.org/de/faq.html für weitere
Informationen
gpg: Der Schlüssel 691A6339 wurde 837 Sekunden in der Zukunft
erzeugt (Zeitreise oder Uhren stimmen nicht überein)
gpg: Schlüssel 691A6339: Ungültige Eigenbeglaubigung für User-ID
"Billy Gate (Köln LUG - die kölner Linux und U.n.i.x
Gruppe) "
gpg: Der Schlüssel 691A6339 wurde 837 Sekunden in der Zukunft
erzeugt (Zeitreise oder Uhren stimmen nicht überein)
gpg: Schlüssel 691A6339: Ungültige Unterschlüssel-Anbindung
gpg: Schlüssel 691A6339: Keine gültigen User-IDs
gpg: dies könnte durch fehlende Eigenbeglaubigung verursacht worden
sein
gpg: Anzahl insgesamt bearbeiteter Schlüssel: 1
gpg: ohne User-ID: 1
- -bash-2.05b$ date
Mi 16 Jul 2003 10:12:22 CEST
- -bash-2.05b$
########
Ups, wat is'n dat?
Hier habe ich von einem dritten Rechner aus, dessen Systemzeit
ebenfalls nicht stimmt, den selbigen Schlüssel ebenfalls
importiert, was gpg jedoch entsprechend kommentierte.
Abhilfe schafft - die Systemzeit korregieren!
Ich für meinen Teil erkenne nun an, dass es sinnvoll ist, seine
Systemzeit(en) zu pflegen;-)
SCHRITT 7:
Um den korrupten Schlüssel zu wiederrufen, habe ich das für diesen
Schlüssel erstellte Wiederrufzertifikat(revocation certificate)
importiert.
########
billy@hell:~$ gpg --import revcert.asc
########
und den nun neu erzeugten öffnedlichen Schlüssel wiederum auf dem
Schlüsselserver hinterlegt.
########
billy@hell:~$ gpg --keyserver wwwkeys.de.pgp.net --send-key 59BC83D9
gpg: success sending to `wwwkeys.de.pgp.net' (status=200)
billy@hell:~$
########
Desweiteren sind interessant:
gpg --list-keys [USER-ID|KEY-ID]
gpg --list-secret-keys [USER-ID|KEY-ID]
gpg --list-sigs [USER-ID|KEY-ID]
gpg --fingerprint [USER-ID|KEY-ID]
Das alles stellt natürlich nur einen Ausschnitt der Möglichkeiten
von pgp/gpg dar und erhebt keinerlei Anspruch auf ...
Aber vielleicht ist es ja als Einstieg zu verwenden und ich hoffe,
dass ich nichts vergessen habe zu dokumentieren.
Deshalb, wie immer: Ohne Gewaehr.
Ach ja, der private Schlüssel heisst privat, weil er P_R_I_V_A_T
ist.
Und nochetwas: wenn Ihr diese Mail lest und dabei wie zum Beispiel
Kmail lest, der Schlüssel sei nicht vertraünswürdi, so kann er
das ja auch nicht sein, da Ihr ihn erst in diesen Status versetzen
müsst.
Köln LUG
-
die kölner
Linux
und
U.n.i.x
Gruppe
|
|
CopyMiddle © 2007 by
Köln LUG - die kölner Linux und U.n.i.x Gruppe
|
|