5.2 E-mail - Freie Universität · 2006. 7. 6. · NS-5.2 1 5.2 E-mail Beachte: Elektronische Post...
Transcript of 5.2 E-mail - Freie Universität · 2006. 7. 6. · NS-5.2 1 5.2 E-mail Beachte: Elektronische Post...
NS-5.2 1
5.2 E-mail
Beachte: Elektronische Post
wird über mehrere eigenständige Zwischenstationen übertragen (MTAs)
hat nicht Stationsadressen und/oder Portnummern alsEndpunkte, sondern Mail-Adressen
erfordert echte Ende-zu-Ende-Sicherung zwischenMail Accounts (SSL genügt nicht)
NS-5.2 2
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 Extensionhttp://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 3
5.2.1 S/MIME
S/MIME - Secure Multi-Purpose Internet Mail Extensionhttp://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
4
MIME-Version: 1.0 (Apple Message framework v746.2)From: Klaus-Peter Loehr <[email protected]>To: ...Date: ...Subject: signature exampleContent-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary=Apple-Mail-2--1012822379--Apple-Mail-2--1012822379Content-Type: text/plain; Here comes my cat:--Apple-Mail-2--1012822379Content-Type: image/jpeg; Content-Transfer-Encoding: base64Content-Disposition: attachment; filename=cat.jpg;..... (Bilddaten) .....--Apple-Mail-2--1012822379Content-Type: application/pkcs7-signature; name=smime.p7s;Content-Transfer-Encoding: base64Content-Disposition: attachment; filename=smime.p7s;..... (Digitale Unterschrift) .....--Apple-Mail-2--1012822379
Beispiel für signierte Mail:Text mit Bild in der Anlage- und zusätzlich Signatur
NS-5.2 5
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 Absenderadresseist nicht gesichert.
Absender-Authentizität wird durch Signatur gesichert.
NS-5.2 6
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 7
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 zugrundegelegthttp://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-mailhttp://www.imc.org/smime-pgpmime.html
Regelungen für E-mail-Codierung ähnlich S/MIME
diverse Plugins für Mail Tools
NS-5.2 8
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: 7bitX-Pgp-Agent: GPGMail 1.1.2 (Tiger)X-Gpgmail-State: encryptedX-Mailer: Apple Mail (2.746.2)
PGP GnuPG
PGP
NS-5.2 9
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 10
5.2.2.1 GnuPGP auf der Befehlszeile (ohne E-mail)
Schlüsselerzeugng
$ gpg --gen-keygpg (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 itunder 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 = gd mod p)
NS-5.2 11
... 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 performsome other action (type on the keyboard, move the mouse, utilize thedisks) during the prime generation; this gives the random numbergenerator a better chance to gain enough entropy..+++1+++++++.+++++..+++++.+++++.+++++.++++++++++.+++++.++++++++++++++2+.+++++++++++++++...gpg: key 3830DFA6 marked as ultimately trustedpublic and secret key created and signed.
gpg: checking the trustdbgpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust modelgpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2ugpg: next trustdb check due at 2006-06-30pub 1024D/3830DFA6 2006-06-29 [expires: 2006-06-30] Key fingerprint = 3EEF 3C73 315B 2245 6EBE 2A3C 172B 07B0 3830 DFA6uid Klaus-Peter Lohr (Berlin) <[email protected]>sub 2048g/0ECBBBD5 2006-06-29 [expires: 2006-06-30]
NS-5.2 12
Schlüsselbund ansehen
$ gpg --list-keys/Users/lohr/.gnupg/pubring.gpg------------------------------pub 1024D/30539059 2006-06-25uid Klaus-Peter Lohr (Berlin) <[email protected]>sub 2048g/526B4DA3 2006-06-25
pub 1024D/3830DFA6 2006-06-29 [expired: 2006-06-30]uid pet lohr (bla) <[email protected]>
$
NS-5.2 13
Signieren eines Dokuments
$ gpg --sign docYou need a passphrase to unlock the secret key foruser: "Klaus-Peter Lohr (Berlin) <[email protected]>"1024-bit DSA key, ID 30539059, created 2006-06-25Enter 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 ID 30539059gpg: Good signature from "Klaus-Peter Lohr (Berlin) <[email protected]>"$
(im Schlüsselbund wurde der richtige Schlüssel gefunden!)
NS-5.2 14
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+Q2wxgCfWs2kZ0tf5y3dmmaeb/lNMK4hZQ4==jdig-----END PGP SIGNATURE-----$
NS-5.2 15
Erstellung einer separaten Signatur:
$ gpg --detach-sign docYou need a passphrase to unlock the secret key foruser: "Klaus-Peter Lohr (Berlin) <[email protected]>"1024-bit DSA key, ID 30539059, created 2006-06-25Enter passphrase:$
liefert Signatur in doc.sig(in unleserlichem Binärformat)
Verifizieren:
$ gpg --verify doc.sig docgpg: Signature made Mon Jun 26 15:04:37 2006 CEST using DSA key ID 30539059gpg: Good signature from "Klaus-Peter Lohr (Berlin) <[email protected]>"$
NS-5.2 16
Verschlüsseln:
$ gpg --encrypt --recipient lohr doc$
Hybride Verschlüsselung mit dem öffentlichen Schlüsseldes Empfängers.
Entschlüsseln:
$ gpg --decrypt doc.gpg
You need a passphrase to unlock the secret key foruser: "Klaus-Peter Lohr (Berlin) <[email protected]>"2048-bit ELG-E key, ID 526B4DA3, created 2006-06-25 (main key ID 30539059)Enter passphrase:gpg: encrypted with 2048-bit ELG-E key, ID 526B4DA3, created 2006-06-25 "Klaus-Peter Lohr (Berlin) <[email protected]>"
To be or not to be, that is the question.
$
NS-5.2 17
Mit einfacher symmetrischer Verschlüsselung (ohne Schlüsselbund!):Schlüssel wird ad hoc aus passphrase generiert(typischerweise zum Schutz von Dateien)
$ gpg --symmetric docEnter passphrase:Repeat passphrase:$ doc.gpg
Entschlüsseln:$ gpg --decrypt doc.gpggpg: CAST5 encrypted dataEnter 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 18
5.2.2.2 PGP/MIME
(GnuPG Plugin für Mac OS X)
NS-5.2 19
NS-5.2 20
NS-5.2 21
NS-5.2 22
NS-5.2 23
NS-5.2 24
Mime-Version: 1.0 (Apple Message framework v746.2)To: =?ISO-8859-1?Q?Peter_L=F6hr?= [email protected]: 57C0146B-66A8-4132-B039-8AEAF1F1F648@inf.fu-berlin.deContent-Type: multipart/encrypted; protocol="application/pgp-encrypted"; boundary="Apple-Mail-5--946279245"From: =?ISO-8859-1?Q?Peter_L=F6hr?= [email protected]: =?ISO-8859-1?Q?Signieren_UND_Verschl=FCsseln?=Date: Mon, 26 Jun 2006 09:31:35 +0200Content-Transfer-Encoding: 7bitX-Pgp-Agent: GPGMail 1.1.2 (Tiger)X-Gpgmail-State: encryptedX-Mailer: Apple Mail (2.746.2)X-Remote-IP: 160.45.232.18Status: This is an OpenPGP/MIME encrypted message (RFC 2440 and 3156)
--Apple-Mail-5--946279245content-type: application/pgp-encryptedcontent-transfer-encoding: 7bitcontent-description: PGP/MIME Versions IdentifikationVersion: 1
NS-5.2 25
--Apple-Mail-5--946279245content-type: application/octet-stream; name="PGP.asc"content-transfer-encoding: 7bitcontent-description: =?ISO-8859-1?Q?Nachricht_verschl=FCsselt_mit_OpenPGP?=content-disposition: inline; filename="PGP.asc"
-----BEGIN PGP MESSAGE-----Version: GnuPG v1.4.3 (Darwin)
hQIOA7uGh0RSa02jEAf+M2ZqTbsIp5dpAFbWGm/C+hvdytU44OSOW4nLnrD9nlDkP1yYZ2hB0/lzo/16RldssHieXY5+rf/1axXtAoDu577aSZ14UDrIszoCT5kXPNA3pyrKBP/3150mZZJn . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . SP/rL1DmDf/OoTtEm3igr+Q6xMOiM7Y5Tn8vnBmE92Ns+K314ko/7Bi/MdRZfXnCNT/QunCnnHzl+pL/RwB0S2SyWGi5hH5vssDlsWCgHFEwDLbgVyJuTEXYNoiAQwCZOLVonf/x+BVWFn27W9XfpO262qg==wkSm-----END PGP MESSAGE-----
--Apple-Mail-5--946279245--
NS-5.2 26
NS-5.2 27
NS-5.2 28
.jpg-Datei für Bild,ferner PGP.sig:
-----BEGIN PGP SIGNATURE-----Version: GnuPG v1.4.3 (Darwin)
iD8DBQFEn41deKlX8TBTkFkRAlHpAJ9t2b5CwrzdksLbVAgiu7ZrPZPXSACg5CUq09xPBn0W/UwcoatU/QSqMbA==BO2h-----END PGP SIGNATURE-----