Presentation is loading. Please wait.

Presentation is loading. Please wait.

Securing Email. 2 Outline n Electronic mail protocols n Electronic mail content security  PGP -- Pretty Good Privacy  PEM -- Privacy Enhanced Mail 

Similar presentations


Presentation on theme: "Securing Email. 2 Outline n Electronic mail protocols n Electronic mail content security  PGP -- Pretty Good Privacy  PEM -- Privacy Enhanced Mail "— Presentation transcript:

1 Securing Email

2 2 Outline n Electronic mail protocols n Electronic mail content security  PGP -- Pretty Good Privacy  PEM -- Privacy Enhanced Mail  S/MIME

3 3 n Structure of email servers  Usually the sender does not directly talk to the receiver  Dedicated mail server (in x.400 structure, it is called message transfer agents: MTA)  The source and destination are called mail user agents (MUA)  The email could go through several MTAs

4 4 n Advantages of multiple store-and- forward MTAs  Adaptable to temporary network partitions  Easy to form chain of trust  Easy to implement traffic control within a company  Easy to connect partitions of networks using different protocols

5 Electronic Mail Three major components: n user agents n mail servers n simple mail transfer protocol: SMTP User Agent n a.k.a. “mail reader” n composing, editing, reading mail messages n e.g., Eudora, Outlook, elm, pine, Netscape Messenger n outgoing, incoming messages stored on server user mailbox outgoing message queue mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP

6 6 Electronic Mail: mail servers Mail Servers n mailbox contains incoming messages for user n message queue of outgoing (to be sent) mail messages n SMTP protocol between mail servers to send email messages  client: sending mail server  “server”: receiving mail server n Note that “mail server” behaves both as SMTP server and SMTP client mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP

7 7 Electronic Mail: SMTP [RFC 5321] n uses TCP to reliably transfer email message from client to server, port 25/587 n direct transfer: sending server to receiving server n three phases of transfer  handshaking (greeting)  transfer of messages  closure n command/response interaction  commands: ASCII text  response: status code and phrase n messages must be in 7-bit ASCII

8 8 Scenario 1: Alice sends message to Bob 1) Alice uses UA to compose message and “to” bob@someschool.edu 2) Alice’s UA sends message to her mail server; message placed in message queue 3) Client side of SMTP opens TCP connection with Bob’s mail server 4) SMTP client sends Alice’s message over the TCP connection 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his user agent to read message user agent mail server mail server user agent 1 2 3 4 5 6

9 9 Scenario 2: Alice sends message to Bob 1) Alice runs a telnet client 2) Alice’s telnet client opens a TCP connection to some mail server (could be Bob’s mail server) at port 25 3) Alice uses SMTP commands to compile a message which will be sent to Bob. 4) SMTP client (mail server 3) sends Alice’s message over the TCP connection to mail server 5 (Bob’s mail server) 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his user agent to read message telnet client mail server mail server user agent 1 2 3 4 5 6

10 10 S: 220 smtp.example.com ESMTP Postfix /* 220: service ready */ C: HELO relay.example.org /* identify urself */ S: 250 Hello relay.example.org, I am glad to meet you /* request ok */ C: MAIL FROM: S: 250 Ok C: RCPT TO: S: 250 Ok C: DATA S: 354 End data with. /* start mail input */ C: From: "Bob Example" C: To: Alice Example C: Date: Tue, 15 Jan 2008 16:02:43 -0500 C: Subject: Test message C: C: Hello Alice. C: This is a test message with 5 header fields and 4 lines in the message body. C: Your friend, C: Bob C:. S: 250 Ok: queued as 12345 C: QUIT S: 221 Bye {The server closes the connection} /* close channel */

11 11 SMTP: final words n SMTP uses persistent connections n SMTP requires message (header & body) to be in 7-bit ASCII SMTP server uses CRLF.CRLF to determine end of message (CRLF stands for carriage return and line feed) Comparison with HTTP: n HTTP: pull n SMTP: push n both have ASCII command/response interaction, status codes n HTTP: each object encapsulated in its own response msg n SMTP: multiple objects sent in multipart msg

12 12 n Distribution lists  You may need to send to a group of people  Can be summarized as distribution lists  How to map a single list name to a group of real email address:  Remote exploder  Local exploder  Can form a hierarchy: list in list

13 13 n Two distribution lists may contain each other: we need to handle duplicated sending n Advantages of local exploder:  It is easy to prevent mail forwarding loops  It is easy for the sender to avoid sending multiple copies to the same user  It is easier to handle billing issues

14 14 n Advantages of remote exploder  You can send email to a list of users whose identities are not known to you  Reduce the amount of traffic sent by sender  Improve efficiency: multiple lists can be handled by different DL maintainers

15 15 Mail message format SMTP (RFC 5321): protocol for exchanging email msgs RFC 822: Standard for the format of ARPA Internet text messages : n header lines, e.g.,  To:  From:  Subject: different from SMTP commands! n body  the “message”, ASCII characters only header body blank line

16 16 Message format: multimedia extensions n MIME: multipurpose Internet mail extension, RFC 2045, 2046, 2049 etc n additional lines in msg header declare MIME content type From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data....................................base64 encoded data multimedia data type, subtype, parameter declaration method used to encode data MIME version encoded data

17 17 n How is base64 working: n Turn every three bytes to four 6-bit sequences n Each 6-bit sequence is mapped to a printable character: A—Z, a—z, 0—9, +,/ n How to handle padding n Add “=“ at the end n Number of “=“ depends on the original message

18 18 MIME types Content-Type: type/subtype; parameters Text example subtypes: plain, html (e.g., text/plain; charset=“ISO-8859-1”) Image example subtypes: jpeg, gif (e.g, image/gif) Audio example subtypes: basic (8-bit mu-law encoded), 32kadpcm (32 kbps coding), RCF 1911 Video example subtypes: mpeg, quicktime Application n other data that must be processed by reader before “viewable” example subtypes: msword, octet-stream

19 19 Multipart Type From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=StartOfNextPart --StartOfNextPart Dear Bob, Please find a picture of a crepe. --StartOfNextPart Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data....................................base64 encoded data --StartOfNextPart Do you want the recipe?

20 20 n Annoying text format issues  There is no single standard for text representation  E.g.: new line, line length, high bits, etc  Intermediate server may change your email format  Problem: email ruined, integrity and signature not working  Reformat data for such issues

21 21 Mail access protocols n SMTP: delivery/storage to receiver’s server n SMTP is a push protocol, and it is good for message sending — we need a separate protocol for message retrieval n Mail access protocol: retrieval from server  POP: Post Office Protocol [RFC 1939]  authorization (agent server) and download  IMAP: Internet Mail Access Protocol [RFC 1730][port 143]  more features (more complex)  manipulation of stored msgs on server  HTTP: Hotmail, Yahoo!, etc. user agent sender’s mail server user agent SMTP access protocol receiver’s mail server

22 22 n POP3 [tcp port 110]  Can work with temporary network connections, view and manipulate email offline  Retrieve and delete from the server  POP3 UIDL can leave a copy  Use a unique identifier to represent an email  Support encryption through SSL or TLS

23 POP3 protocol (port 110) telnet xxxxxx.uncc.edu 110 authorization phase n client commands:  user: declare username  pass: password n server responses  +OK  -ERR transaction phase, client: list: list message numbers retr: retrieve message by number dele: delete n quit C: list S: 1 498 S: 2 912 S:. C: retr 1 S: S:. C: dele 1 C: retr 2 S: S:. C: dele 2 C: quit S: +OK POP3 server signing off S: +OK POP3 server ready C: user yonwang S: +OK C: pass ******* S: +OK user successfully logged on

24 24 n IMAP: Internet Message Access Protocol  Support both online and offline operation  Leave copy of email on server  Multiple clients access the same mailbox  Support encrypted login  Access to MIME parts and partial fetch  Message state information  Create directory in your mailbox  Server side search

25 25 n Problems of IMAP  The search algorithm on the server can consume a lot of resources  Complexity of the software

26 26 POP3 and IMAP More about POP3 n Previous example uses “download and delete” mode. n Bob cannot re-read e-mail if he changes client n “Download-and-keep”: copies of messages on different clients n POP3 is stateless across sessions n Create folders and see the same view from any computer? Not possible! IMAPv4 (port 143) n Keep all messages in one place: the server n Allows user to organize messages in folders n IMAP keeps user state across sessions:  names of folders and mappings between message IDs and folder name

27 27 n Some expected security features of secure email  Privacy: only the receiver can read the message  Authentication: authenticate the sender identity  Integrity  Non-repudiation  Proof of submission  Proof of delivery  Hiding the existence of the message  Anonymity: even the receiver does not know who the sender is

28 28 n More features of secure email  Accounting  Self-destruct  Message sequence integrity

29 29 Details of secure email n Establishing keys  There are many possibilities of keys: sender, receiver, MTA, distribution list exploder, etc  Public key approach  Sender can get receiver’s public key by  Out-of-band mechanism  Through PKI  Piggybacking of certificates  Secret key approach  Through KDC or tickets

30 30 n Confidentiality  Many sources to violate email confidentiality: eavesdropper, MTA, company network administrator  End-to-end privacy  It is not efficient to use public key to encrypt the whole message  It is not efficient when you have multiple receivers  Solution: use a symmetric key to encrypt message, and use public key to encrypt the symmetric key

31 31 n Privacy with the distribution list exploder  Remote DLE: the sender only needs to share a key with the DLE  Local DLE: establish key with every receiver in the list

32 32 n Authenticating sender  Signing the message digest with sender’s private key  Encrypt the digest with pair wise key  Source authentication with distribution lists  It is easy if we use digital signature  If we are using secret key, DLE will attach its authentication information

33 33 n Message integrity  Most of time it is integrated with source authentication  Integrity without source authentication  Ransom  The problem when you sign a hash result  How is the hash result calculated (attack with the signatures)

34 34 n Non-repudiation  With public keys  With the digital signature  Deniability based on public key technology  Alice generates a symmetric key  E pub-B ( Sign-A (key) )  Use this key to encrypt the message  Bob can prove that Alice generates the key, but not Alice sends that message  Non-repudiation with secret keys  through notary (trusted third party)

35 35 n Proof of submission  The sending MTA provides a signed digest of the email n Proof of delivery  Receiver signs a receipt n A famous problem in cryptography  Simultaneous contract signing

36 36 n Anonymity  Through a proxy  Onion routing issues  Anonymous email service: craigslist  Anonymous IETF mailing list

37 37 Possible attacks n Spoofing (unbelievably easy!)  a third party may impersonate Alice and send a fake/modified message to Bob n Eavesdropping  a party sitting between Alice’s UA and Bob’s mail server may peep communications between them n Replay  a party sitting between Alice and Bob may re-send to Bob an old message from Alice n Attacks on mail access protocols such as POP3, IMAP, etc n Other attacks such as DoS n Traffic analysis n Last one: should Bob trust his mail server? Or in another word: do you trust the postman who delivers a letter to you?

38 38 TCP Achieve secure email in the network stack IP Network driver Appl Content security S/MIME, Proxies, SET, PGP Application Layer Transport Layer Network Layer Data link Layer SSL, TLS, SOCKS AH, ESP (in IPSec), Packet filtering, Tunneling (L2TP, PPTP, L2F), CHAP (challenge handshake protocol) PAP (password auth. protocol), MS-CHAP

39 39 Use electronic mail securely n Preventing spoofing and replay  Digital signature with one-way hash  Timestamps etc. n Preventing eavesdropping  Encryption (transport layer or application layer) n Preventing attacks on mail access protocols  SSL (openSSL) n Preventing other attacks: general network security problems (DoS on a mail server)

40 40 Use Email securely n Content layer security:  Transparent on the underlying layer  PEM  PGP  S/MIME

41 41 Privacy Enhanced Mail (PEM) n Attempt to add security to SMTP n Text only: MIME didn’t exist yet n Attempt to build a CA hierarchy along X.500 lines  Hierarchy with a single root !! n Solved the data formatting problem with base64 encoding  Encode 3 binary bytes as 4 NVT ASCII characters  The same encoding was later used in PGP 2.X, mime...

42 42 n PEM certificate hierarchy  Want to use a centralized root  Three types of certificate authorities  High assurance  Discretionary Assurance  No Assurance

43 43 PGP n By Phil Zimmermann n Check out http://www.pgp.com or http://web.mit.edu/network/pgp.html Available for Windows/Linux/Macintosh n Getting the PGP and install it on your computer n Crypto is useful only if it is USED!!

44 44 S/MIME n Who will win?  PGP for personal email security  S/MIME for commercial and organization use n Standards page: http://www.ietf.org/html.charters/smim e-charter.html http://www.ietf.org/html.charters/smim e-charter.html n Main RFCs: 2630, 2632, 2633

45 45 Reminder: Multipart Type From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=StartOfNewPart --StartOfNewPart Dear Bob, Please find a picture of a crepe. --StartOfNextPart Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data....................................base64 encoded data --StartOfNewPart Do you want the reciple?

46 46 S/MIME n Similar to PGP, offers signature and encryption functions. It cryptographically protects MIME entity n Based on CMS (cryptographic message syntax)  Encapsulation syntax for data protection

47 47 Protocols n Content encryption algorithm: 3DES (DES EDE3 CBC), RC2/40 (more algorithms are being added) n Key encryption algorithm: Diffie- hellman n Message digest algorithm: SHA-1, MD5 n Signature algorithm: DSA, RSA

48 48 User Agent n S/MIME user agents should handle the following tasks:  Key generation  Registration  Certificate storage and retrieval including certificate management

49 49 Applications n Secure e-mail n EDI (Electronic Data Interchange) n Online Services n Healthcare applications n Internet push products n Indeed, used for any kind of data content protection

50 50 Adopted in: n Microsoft Exchange n Lotus Notes n Novell Groupwise n Netscape Communicator n Eudora n etc..


Download ppt "Securing Email. 2 Outline n Electronic mail protocols n Electronic mail content security  PGP -- Pretty Good Privacy  PEM -- Privacy Enhanced Mail "

Similar presentations


Ads by Google