Upload
hardnut
View
215
Download
0
Embed Size (px)
Citation preview
7/31/2019 Electronic Mail Security Lec # 10
1/31
Electronic Mail Security
Khalid Haseeb
Computer Science Deptt.Islamia College University, Peshawar
7/31/2019 Electronic Mail Security Lec # 10
2/31
Electronic Mail.
Electronic mail is used for sending a single
message that includes text, voic, video,
graphics to one or more recipients.
Simple Mail Transfer Protocol (SMTP) is the
standard mechanism for electronic mail in the
internet.
7/31/2019 Electronic Mail Security Lec # 10
3/31
Sending Mail. To send mail, a user creates mail
that looks very similar to postalmail, it has an envelope andmessage.
Envelope:
It contains the sender address,the receiver address and other
information. Message:
It contains headers and the body.
Header defines the sender,receiver and subject of themessage.
Body contains the actualinformation to be read by therecipient.
Mail From : [email protected]
RECPT To : [email protected]
From : khalid haseeb.
To: Qaisar Khan
Date : 31/05/2007
Subject : Network
Dear Ali.
How Are You and bla bla bla.
Envelope
Message
Header
Body
mailto:[email protected]:[email protected]:[email protected]:[email protected]7/31/2019 Electronic Mail Security Lec # 10
4/31
Receiving Mail.
The email system periodically checks themailboxes, it a user has a mail, it informs the userwith a notice.
If a user is ready to read the mail, a list isdisplayed in which each contains a summary ofthe information about a particular message in themailbox.
The summary usually contains the sender emailaddress, the subject, time of mail sent andreceived etc.
7/31/2019 Electronic Mail Security Lec # 10
5/31
Address.
The address system used by SMTP consists of
two parts:
Local Part:
Local part defines the name of a special file, called the
user mailbox, where all the mails received for a user are
stored for retrieval by the user agent.
Domain Name:
It is a logical name assigned to a host responsible for receiving
and sending emails( host is also called mail exchanger ).
Local Part @ Domain Name
Address of the mailbox
on the local site.
The domain name of
the destination.
7/31/2019 Electronic Mail Security Lec # 10
6/31
User Agent.
User Agent is a software
package that composes,reads, replies to and
forward messages.
It also handles mailboxes.
Services of UA: Composing Messages.
Reading Messages.
Replying to Messages.
Forwarding Messages.
Handling Mailboxes.
User AgentServices
ComposingMessages
ReadingMessages
Replying toMessages
ForwardingMessages
HandlingMailboxes
7/31/2019 Electronic Mail Security Lec # 10
7/31
Composing Messages.
A UA is responsible for composing the emailmessage to be sent out.
UA provide a template on the screen to be
filled in by the user. Some have built in editorwith facilities like spell checking, grammarchecking etc.
A user can also use his favorite text editor orword processor to create the message andimport it or cut and paste into the user agent.
7/31/2019 Electronic Mail Security Lec # 10
8/31
Reading Messages.
UA reads the incoming messages.
When a user invokes a UA, it first checks the mail in theincoming mailbox.
Most UA show a one line summary of each received mail
which contain the following fields: A number field.
A flag that shows if the mail is new, already read but notreplied to, read and replied to and so on.
The size of the message.
The sender.
The subject of the mail.
7/31/2019 Electronic Mail Security Lec # 10
9/31
Replying to Messages.
After reading the message, a user can use the
UA to reply to a message.
UA sends the reply to the original sender.
The reply message contains the original
message and the new message.
7/31/2019 Electronic Mail Security Lec # 10
10/31
Forwarding Messages.
Replying means sending a message to the
sender, but forwarding means to send the
message to a third party.
Forwarding allows a user to forward the
message to a third party with or without extra
comments.
7/31/2019 Electronic Mail Security Lec # 10
11/31
Handling Mailboxes.
UA normally creates two mailboxes: inbox and
outbox.
Each box is a file with special format that can
be handled by the UA.
The inbox keeps all the received emails until
they are deleted by the user.
The outbox keeps all the sent mails until the
user deletes them.
7/31/2019 Electronic Mail Security Lec # 10
12/31
User Agent Types
Two types of UA:
Command-Driven:
Command driven UA belong to the early days of electronic mail.
The are still present as the underlying UA in servers.
It accepts a one character command form the keyboard to perform itstask like type the character r at the command prompt to reply to the
sender etc.
Examples of command driven UA are mail, pine and elm etc.
GUI-Based:
Modern UA are GUI-based.
They contian GUI that allow the user to interact with the software by
using both the keyboard and mouse.
They have graphical components like icons, menu bars and windows that
make the services easy to access.
Examples are Eudora, Microsoft's outlook and Netscape.
7/31/2019 Electronic Mail Security Lec # 10
13/31
Typical Diagram.
Sender
Local Mail Server
SMTP
Remote Mail Server
SMTP
Receiver
POP3
7/31/2019 Electronic Mail Security Lec # 10
14/31
Electronic Mail Security.
In all distributed environments, electronic mail
is the most heavily used network based
application.
With the growing reliance on electronic mail
for every conceivable purpose, there grows a
demand for authentication and confidentiality
services.
Two schemes are used for this purpose:
PGP ( Pretty Good Privacy ).
S/MIME ( Secure Multipurpose Internet Mailing Extension ).
7/31/2019 Electronic Mail Security Lec # 10
15/31
Pretty Good Privacy
PGP is the result of Phil Zimermann efforts.
PGP provides confidentiality and
authentication service for electronic mail and
file storage application.
PGP has grown explosively and is now widely
used. A number of reasons can be sited for
this growth.
7/31/2019 Electronic Mail Security Lec # 10
16/31
Reasons.
It is available free worldwide in versions that run on a verity of
platforms including Windows, UNIX, Macintosh and many
more.
It is based on algorithms that have survived extensive public
review and are considered extremely secure. Specifically, the
package includes RSA, DSS, Diffie-Hellman, 3DES and SHA-1.
It has a wide range of applicability, from corporations that
wish to select and enforce a standardized scheme for
encrypting files and messages to individuals who wish tocommunicate securely with others worldwide over the
internet.
PGP is now on an Internet standards track ( RFC 3156 ).
7/31/2019 Electronic Mail Security Lec # 10
17/31
Operational Description.
The actual operations of PGP consists of five
services:
Authentication.
Confidentiality.
Compression.
E-mail compatibility.
Segmentation.
7/31/2019 Electronic Mail Security Lec # 10
18/31
Authentication.
Authentication is carried out as:
Sender creates the message.
SHA-1 is used to generate a 160-bits hash code of themessage.
The hash code is encrypted with RSA using the sendersprivate key and the result is prepended to the message.
The receiver uses RSA with the senders public key todecrypt and recover the hash code.
The receiver generates a new hash code for the messageand compares it with the decrypted hash code. If the twomatches the message is accepted as authentic.
7/31/2019 Electronic Mail Security Lec # 10
19/31
Authentication only.
M
H EP
KRa
|| ZM
EKRa[H(M)]
DP
KUa
HCompare
Z-1
7/31/2019 Electronic Mail Security Lec # 10
20/31
Confidentiality.
Confidentiality is provided by encryptingmessages to be transmitted or to be storedlocally as files.
In both cases the symmetric encryptionalgorithm ( 3DES or others ) is used.
In PGP each symmetric key is used only once.
It is commonly called session key. Session key is selected by sender and is bound
to the message and transmitted with it.
To protect the key it is encrypted with thereceivers public key.
7/31/2019 Electronic Mail Security Lec # 10
21/31
Confidentiality Steps.
The sender generates a message and a 128-bitnumber to be used as a session key for this messageonly.
The message is encrypted using ( 3DES or others )with the session key.
The session key is encrypted with RSA, using therecipient's public key and is prepeneded to the
message. The receiver uses RSA with it private key to decrypt
and recover the session key.
The session key is used to decrypt the message.
7/31/2019 Electronic Mail Security Lec # 10
22/31
Confidentiality only.
M||ECZ
Ks
Z-1DC
DP
EP
KUb EKUb[Ks] KRb
M
Ks
7/31/2019 Electronic Mail Security Lec # 10
23/31
Confidentiality and Authentication.
1. A signature is generated for the plaintext and encrypted
using RSA using senders private key. Signature is then
perpended to the message. This step provides the message
authentication
2. Plaintext message plus signature is then compressed.
3. The compressed version is then encrypted using 3DES or
other symmetric encryption algorithm and session key. This
step provides the message confidentiality.
4. Session key is encrypted using RSA and receivers public key
and prepended with the encrypted version of plaintext
message plus signature. This step provides the session key
confidentiality.
7/31/2019 Electronic Mail Security Lec # 10
24/31
Confidentiality and Authentication.
M||ECZ||
EPH
KRa
Ks
H
DC
DPEP
KUb[Ks]
KRb
DP
Z-1
M
KUa
Compare
7/31/2019 Electronic Mail Security Lec # 10
25/31
Compression.
PGP compresses the message after applying the signature but beforeencryption. This has the benefit of saving both space for E-mailtransmission and for file storage.
The signature is generated before compression for two reasons:
It is preferable to sign an uncompressed message so that one can store only
the uncompressed message together with the signature for future verification. PGP compression algorithm is not deterministic:
Various PGP compression algorithm achieve different tradeoff in running speedversus compression ratio and as a result produce different compressed forms.
However different compression algorithms are interoperable.
Therefore applying hash function signature after compression would require the
same PGP compression algorithm implementation. Message encryption is applied after compression to strengthen
cryptographic security. Because the compressed message has lessredundancy than the original message, cryptanalysis is more difficult.
7/31/2019 Electronic Mail Security Lec # 10
26/31
E-mail Compatibility.
After encryption the part or all of the resulting blockconsists of a stream of arbitrary 8-bit octate.
Many electronic mail systems (SMTP) only permitsthe use of blocks consisting of ASCII text.
Therefore PGP has to convert 8-bit binary streaminto a stream of printable ASCII characters.
The scheme used for this purpose is radix-64
conversion. It will convert a group of three octets ofbinary data into four ASCII characters.
7/31/2019 Electronic Mail Security Lec # 10
27/31
Radix-64/Base64 Encoding
11001100 10000001 00111001
Base64
110011 001000 000100 111001
(51) (8) (4) (57)
01111010 01001001 01000101 00110101
Z I E 5
7/31/2019 Electronic Mail Security Lec # 10
28/31
E-mail Compatibility.
Radix-64 expands a message by 33%.
The compression should be more than enough to
compensate for the radix-64 expansion.
Another advantage of radix-64 algorithm is that itblindly convert the input stream to radix-64 format
regardless of content, even it the input happens to
be ASCII text. If message is signed but not encrypted
and the conversion is applied to the entire block, the
output will be unreadable to the casual observer
which provides a certain level of confidentiality.
7/31/2019 Electronic Mail Security Lec # 10
29/31
Generic transmission diagram
(form A)X -- File
Signature Required
CompressX Z(X)
Confidentiality Required
Convert to radix-64
X R64[X]
YesGeneric Signature
X Signature || X
No
Encrypt key, X
X EKUb[Ks] || EKs[X]
Yes
No
7/31/2019 Electronic Mail Security Lec # 10
30/31
Generic reception diagram ( to B ).
Convert from radix 64X R64-1[X]
Confidentiality Required
Decompress
X Z-1(X)
Signature Required
Yes Decrypt key, X
K DKRb [ EKUb [Ks]];
K DK [X]
No
Strip signature form X
Verify Signature
Yes
No
7/31/2019 Electronic Mail Security Lec # 10
31/31
Segmentation and Reassembly.
Email facilities are often restricted to a maximum message length e.gInternet imposes a maximum length of 50,000 octets.
Any message longer than that must be broken up into smaller segments,each of which is mailed separately.
PGP automatically subdivides a message that is too larger into segments
that are small enough to send via E-mail. The segmentation is done after all of the other processing including the
radix-64 conversion.
Thus the session key component and signature component appear onlyonce, at the beginning of the first segment.
At the receiving end PGP strip off all of the E-mail headers form the firstsegment and the second segment and reassembles them into the originalblock before performing the steps shown in the previous slide.