5.2 E-mail Beachte: Elektronische Post wird über mehrere eigenständige Zwischenstationen übertragen (MTAs) hat nicht Stationsadressen und/oder Portnummern als Endpunkte, sondern Mail-Adressen erfordert echte Ende-zu-Ende-Sicherung zwischen Mail Accounts (SSL genügt nicht) NS-5.2 1
PEM - Privacy-Enhanced Mail http://www.ietf.org/rfc/rfc1421.txt Internet-Norm, veraltet, nur für Text S/MIME - Secure Multi-Purpose Internet Mail Extension http://www.imc.org/smime-pgpmime.html Internet-Norm, auch für Multimedia-Mail PGP - Pretty Good Privacy (1991, Philipp Zimmermann) http://www.pgpi.org/ und andere ( 5.1.2) nicht nur für Mail, vielfach weiterentwickelt, Public Domain Mailtrust - von Teletrust e.v. (deutscher Industrieverband) entwickelt als Reaktion auf Signaturgesetz (2001) NS-5.2 2
5.2.1 S/MIME S/MIME - Secure Multi-Purpose Internet Mail Extension http://www.imc.org/smime-pgpmime.html Internet-Norm für E-Mail, auch mit multimedialen Teilen, bezieht sich auf PKCS - Public Key Cryptography Standard http://en.wikipedia.org/wiki/pkcs (siehe auch Cryptographic Message Standard (CMS)) Optionen: Signieren: jeder Empfänger kann lesen, aber nur S/MIME-fähiger Empfänger kann verifizieren Verschlüsseln Signieren und Verschlüsseln: Nachricht und Signatur werden zusammen verschlüsselt NS-5.2 3
MIME-Version: 1.0 (Apple Message framework v746.2) From: Klaus-Peter Loehr <lohr@inf.fu-berlin.de> To:... Date:... Subject: signature example Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary=apple-mail-2--1012822379 --Apple-Mail-2--1012822379 Content-Type: text/plain; Beispiel für signierte Mail: Here comes my cat: Text mit Bild in der Anlage --Apple-Mail-2--1012822379 - und zusätzlich Signatur Content-Type: image/jpeg; Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=cat.jpg;... (Bilddaten)... --Apple-Mail-2--1012822379 Content-Type: application/pkcs7-signature; name=smime.p7s; Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=smime.p7s;... (Digitale Unterschrift)... --Apple-Mail-2--1012822379 4
Digitale Unterschrift in Objekt des Typs "signierte Nachricht" (.p7s): version: Versionsnummer digestalgorithms: Hash-Verfahren contentinfo: leer (weil Text in separaten Objekten) certificates: (optional) Absender-Zertifikat (X.509v3) und evtl. Zertifikate zugehöriger CAs crls: (optional) certificate revocation lists signerinfos: Signatur (und weitere Daten) Beachte: Integrität von Empfänger- und Absenderadresse ist nicht gesichert. Absender-Authentizität wird durch Signatur gesichert. NS-5.2 5
Hinweis: S/MIME bietet noch mehr: Anforderung einer signierten Empfangsbestätigung (wie Einschreiben mit Rückschein) informelle Sicherheitsetiketten wie "geheim", "vertraulich" u.ä. (security labels) Unterstützung von Mailinglisten..... NS-5.2 6
5.2.2 PGP PGP - Pretty Good Privacy (1991, Philipp Zimmermann) http://www.pgpi.org/ http://www.pgp.com/ http://www.openpgp.org/ http://www.gnupg.org/ : GnuPG - im folgenden zugrundegelegt http://www.gnupp.de/ (BM f. Wirtschaft und Technologie) nicht nur für Mail, vielfach weiterentwickelt, Public Domain (aber auch kommerziell) PGP/MIME - PGP für E-mail http://www.imc.org/smime-pgpmime.html Regelungen für E-mail-Codierung ähnlich S/MIME diverse Plugins für Mail Tools NS-5.2 7
Beispiel (verkürzt): Mime-Version: 1.0 (Apple Message framework v746.2) Message-Id:... Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; boundary="apple-mail-5--946279245" Content-Transfer-Encoding: 7bit X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Gpgmail-State: encrypted X-Mailer: Apple Mail (2.746.2) PGP GnuPG PGP NS-5.2 8
Zur Erinnerung (Systemsicherheit WS 05/06: 9.8.2.4): keine PKI mit CAs benötigt, stattdessen Schlüsselerzeugung in eigener Regie, Zertifikate im persönlichen "web of trust" NS-5.2 9
5.2.2.1 GnuPGP auf der Befehlszeile (ohne E-mail) Schlüsselerzeugng $ gpg --gen-key gpg (GnuPG) 1.4.3; Copyright (C) 2006 Free Software Foundation. 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. ELG-E keys may be between 1024 and 4096 bits long.... DSA - Digital Signature Algorithm ( RSA, WS 05/06: 9.7.3.5) ElGamal - ein Public-Key-Verfahren (mit e = g d mod p) NS-5.2 10
... und als Bestätigung der erfolgreichen Erzeugung: You need a Passphrase to protect your secret key. Eingabe We need to generate a lot of random bytes. It is a good idea to per some other action (type on the keyboard, move the mouse, utilize th disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy..+++1+++++++.+++++..+++++.+++++.+++++.++++++++++.+++++.++++++++++++ gpg: key 3830DFA6 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, gpg: next trustdb check due at 2006-06-30 pub 1024D/3830DFA6 2006-06-29 [expires: 2006-06-30] Key fingerprint = 3EEF 3C73 315B 2245 6EBE 2A3C 172B 07B0 38 uid Klaus-Peter Lohr (Berlin) <lohr@inf.fu-berlin.de> sub 2048g/0ECBBBD5 2006-06-29 [expires: 2006-06-30] NS-5.2 11
Schlüsselbund ansehen $ gpg --list-keys /Users/lohr/.gnupg/pubring.gpg ------------------------------ pub 1024D/30539059 2006-06-25 uid Klaus-Peter Lohr (Berlin) <lohr@inf.fu-ber sub 2048g/526B4DA3 2006-06-25 pub 1024D/3830DFA6 2006-06-29 [expired: 2006-06-30] uid pet lohr (bla) <kpl@inf.fu-berlin.de> $ NS-5.2 12
Signieren eines Dokuments $ gpg --sign doc You need a passphrase to unlock the secret key for user: "Klaus-Peter Lohr (Berlin) <lohr@inf.fu-berlin.de>" 1024-bit DSA key, ID 30539059, created 2006-06-25 Enter passphrase: (hier Passphrase eingegeben) $ Dokument wird komprimiert und signiert (!) doc.gpg Verifizieren und Klartext wiederherstellen: $ gpg --decrypt doc.gpg To be or not to be, that is the question. gpg: Signature made Mon Jun 26 13:12:04 2006 CEST using DSA key I gpg: Good signature from "Klaus-Peter Lohr (Berlin) <lohr@inf.fu- $ (im Schlüsselbund wurde der richtige Schlüssel gefunden!) NS-5.2 13
Ohne Kompression: $ gpg --clearsign doc... $ Dokument wird lediglich signiert (!) doc.asc $ more doc.asc -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 To be or not to be, that is the question. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) id8dbqfen8gneklx8tbtkfkraohcaj9x1h9tr+fnewezd7rqca2l+q2wxgcfws2k Z0tf5y3dmmaeb/lNMK4hZQ4= =jdig -----END PGP SIGNATURE----- $ NS-5.2 14
Erstellung einer separaten Signatur: $ gpg --detach-sign doc You need a passphrase to unlock the secret key for user: "Klaus-Peter Lohr (Berlin) <lohr@inf.fu-berlin.de>" 1024-bit DSA key, ID 30539059, created 2006-06-25 Enter passphrase: $ liefert Signatur in doc.sig (in unleserlichem Binärformat) Verifizieren: $ gpg --verify doc.sig doc gpg: Signature made Mon Jun 26 15:04:37 2006 CEST using DSA key I gpg: Good signature from "Klaus-Peter Lohr (Berlin) <lohr@inf.fu- $ NS-5.2 15
Verschlüsseln: $ gpg --encrypt --recipient lohr doc $ Hybride Verschlüsselung mit dem öffentlichen Schlüssel des Empfängers. Entschlüsseln: $ gpg --decrypt doc.gpg You need a passphrase to unlock the secret key for user: "Klaus-Peter Lohr (Berlin) <lohr@inf.fu-berlin.de>" 2048-bit ELG-E key, ID 526B4DA3, created 2006-06-25 (main key ID Enter passphrase: gpg: encrypted with 2048-bit ELG-E key, ID 526B4DA3, created 2006 "Klaus-Peter Lohr (Berlin) <lohr@inf.fu-berlin.de>" To be or not to be, that is the question. $ NS-5.2 16
Mit einfacher symmetrischer Verschlüsselung (ohne Schlüsselbund!): Schlüssel wird ad hoc aus passphrase generiert (typischerweise zum Schutz von Dateien) $ gpg --symmetric doc Enter passphrase: Repeat passphrase: $ doc.gpg Entschlüsseln: $ gpg --decrypt doc.gpg gpg: CAST5 encrypted data Enter passphrase: gpg: encrypted with 1 passphrase To be or not to be, that is the question. gpg: WARNING: message was not integrity protected $ NS-5.2 17
5.2.2.2 PGP/MIME (GnuPG Plugin für Mac OS X) NS-5.2 18
NS-5.2 19
NS-5.2 20
NS-5.2 21
NS-5.2 22
NS-5.2 23
Mime-Version: 1.0 (Apple Message framework v746.2) To: =?ISO-8859-1?Q?Peter_L=F6hr?= lohr@inf.fu-berlin.de Message-Id: 57C0146B-66A8-4132-B039-8AEAF1F1F648@inf.fu-berlin.de Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; boundary="apple-mail-5--946279245" From: =?ISO-8859-1?Q?Peter_L=F6hr?= lohr@inf.fu-berlin.de Subject: =?ISO-8859-1?Q?Signieren_UND_Verschl=FCsseln?= Date: Mon, 26 Jun 2006 09:31:35 +0200 Content-Transfer-Encoding: 7bit X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Gpgmail-State: encrypted X-Mailer: Apple Mail (2.746.2) X-Remote-IP: 160.45.232.18 Status: This is an OpenPGP/MIME encrypted message (RFC 2440 and 3156) --Apple-Mail-5--946279245 content-type: application/pgp-encrypted content-transfer-encoding: 7bit content-description: PGP/MIME Versions Identifikation Version: 1 NS-5.2 24
--Apple-Mail-5--946279245 content-type: application/octet-stream; name="pgp.asc" content-transfer-encoding: 7bit content-description: =?ISO-8859-1?Q?Nachricht_verschl=FCsselt_mit_ content-disposition: inline; filename="pgp.asc" -----BEGIN PGP MESSAGE----- Version: GnuPG v1.4.3 (Darwin) hqioa7ugh0rsa02jeaf+m2zqtbsip5dpafbwgm/c+hvdytu44osow4nlnrd9nldk P1yYZ2hB0/lzo/16RldssHieXY5+rf/1axXtAoDu577aSZ14UDrIszoCT5kXPNA3 pyrkbp/3150mzzjn.............................. SP/rL1DmDf/OoTtEm3igr+Q6xMOiM7Y5Tn8vnBmE92Ns+K314ko/ 7Bi/MdRZfXnCNT/QunCnnHzl+pL/RwB0S2SyWGi5hH5vssDlsWCgHFEwDLbgVyJu TEXYNoiAQwCZOLVonf/x+BVWFn27W9XfpO262qg= =wksm -----END PGP MESSAGE----- --Apple-Mail-5--946279245-- NS-5.2 25
NS-5.2 26
NS-5.2 27
.jpg-datei für Bild, ferner PGP.sig: -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) id8dbqfen41deklx8tbtkfkralhpaj9t2b5cwrzdks 09xPBn0W/UwcoatU/QSqMbA= =BO2h -----END PGP SIGNATURE----- NS-5.2 28