User Authentication Principles Explained
User Authentication Principles Explained
[Link] Authentication:
Remote user authentication principles:
User authentication is the basis for most types of access control and for user accountability.
RFC 4949 (Internet Security Glossary) defines user authentication as the process of verifying
an identity claimed by or for a system entity.
1
Dept. of CSE(Data Science)
MODULE 4
❖ The initial requirement for performing user authentication is that the user must be
registered with the system.
❖ The following is a typical sequence for registration. An applicant applies to a
registration authority (RA) to become a subscriber of a credential service provider
(CSP).
❖ In this model, the RA is a trusted entity that establishes and vouches for the identity of
an applicant to a CSP.
❖ The CSP then engages in an exchange with the subscriber. Depending on the details of
the over all authentication system, the CSP issues some sort of electronic credential to
the subscriber.
❖ The credential is a data structure that authoritatively binds an identity and additional
attributes to a token possessed by a subscriber, and can be verified when presented to
the verifier in an authentication transaction.
❖ The token could be an encryption key or an encrypted password that identifies the
subscriber. The token may be issued by the CSP, generated directly by the subscriber,
or provided by a third party.
❖ The token and credential may be used in subsequent authentication events.
❖ The party to be authenticated is called a claimant and the party verifying that identity
is called a verifier. When a claimant successfully demonstrates possession and control
of a token to a verifier through an authentication protocol, the verifier can verify that
the claimant is the subscriber named in the corresponding credential.
❖ The verifier passes on an assertion about the identity of the subscriber to the relying
party (RP).
❖ The RP can use the authenticated information provided by the verifier to make access
control or authorization decisions.
❖ An implemented system for authentication will differ from or be more com plex than
this simplified model, but the model illustrates the key roles and functions needed for
a secure authentication system.
Means of Authentication:
2
Dept. of CSE(Data Science)
MODULE 4
There are four general means of authenticating a user’s identity, which can be used alone or
in combination:
However, each method has problems. An adversary may be able to guess or steal a password.
Similarly, an adversary may be able to forge or steal a token.
For network-based user authentication, the most important methods involve cryptographic
keys and something the individual knows, such as a password.
Mutual Authentication.
An important application area is that of mutual authentication protocols. Such pro tocols
enable communicating parties to satisfy themselves mutually about each oth er’s identity and
to exchange session keys.
This requires the prior existence of secret or public keys that can be used for this purpose.
The second issue, timeliness, is important because of the threat of message replays.
3
Dept. of CSE(Data Science)
MODULE 4
The simplest replay attack is one in which the opponent simply copies a message and replays
it later.
An opponent can replay a timestamped message within the valid time window. If both the
original and the replay arrive within then time window, this incident can be logged.
an opponent can replay a timestamped message within the valid time window, but in addition,
the opponent suppresses the original message. Thus, the repetition cannot be detected.
Another attack involves a backward replay without modification. This is a re play back to the
message sender. This attack is possible if symmetric Encryption is used and the sender cannot
easily recognize the difference between messages sent and messages received on the basis of
content.
Because of this overhead, sequence numbers are generally not used for authentication and
key exchange. Instead, one of the following two general approaches is used:
Timestamps: Party A accepts a message as fresh only if the message contains a timestamp
that, in A’s judgment, is close enough to A’s knowledge of current time. This approach
requires that clocks among the various participants be synchronized.
This protocol must be both fault tolerant, to cope with network errors, and secure, to cope
with hostile attacks. Second, the opportunity for a successful attack will arise if there is a
temporary loss of synchronization resulting from a fault in the clock mechanism of one of the
parties.
Therefore, any timestamp-based procedure must allow for a window of time sufficiently large
to accommodate network delays yet sufficiently small to minimize the opportunity for attack.
The very nature of electronic mail, and its chief benefit, is that it is not necessary for the
sender and receiver to be online at the same time.
4
Dept. of CSE(Data Science)
MODULE 4
Instead, the email message is forwarded to the receiver’s electronic mailbox, where it is
buffered until the receiver is available to read it.
The “envelope” or header of the email message must be in the clear, so that the message can
be handled by the store-and-forward email protocol, such as the Simple Mail Transfer
Protocol (SMTP) or X.400.
However, it is often desirable that the mail-handling protocol not require access to the
plaintext form of the message, because that would require trusting the mail-handling
mechanism. Accordingly, the email message should be encrypted such that the mail-handling
system is not in possession of the decryption key.
A second requirement is that of authentication. Typically, the recipient wants some assurance
that the message is from the alleged sender.
2. Kerberos
Kerberos is an authentication service developed as part of Project Athena at MIT.
❖ A user may gain access to a particular workstation and pretend to be another user
operating from that workstation.
❖ A user may alter the network address of a workstation so that the requests sent from
the altered workstation appear to come from the impersonated workstation.
❖ A user may eavesdrop on exchanges and use a replay attack to gain entrance to a
server or to disrupt operations.
Two versions of Kerberos are in common use. Version 4 [MILL88, STEI88] implementations
still exist. Version 5 [KOHL94] corrects some of the security deficiencies of version 4 and
has been issued as a proposed Internet Standard.
Motivation
If a set of users is provided with dedicated personal computers that have no network
connections, then a user’s resources and files can be protected by physically secur ing each
personal computer.
5
Dept. of CSE(Data Science)
MODULE 4
When these users instead are served by a centralized time-sharing system, the time-sharing
operating system must provide the security.
❖ Rely on each individual client workstation to assure the identity of its user or users
and rely on each server to enforce a security policy based on user identification (ID).
❖ Require that client systems authenticate themselves to servers, but trust the client
system concerning the identity of its user.
❖ Require the user to prove his or her identity for each service invoked. Also require
that servers prove their identity to clients.
The first published report on Kerberos [STEI88] listed the following requirements.
Kerberos version 4
Version 4 of Kerberos makes use of DES, in a rather elaborate protocol, to pro vide the
authentication service. Viewing the protocol as a whole, it is difficult to see the need for the
many elements contained therein.
6
Dept. of CSE(Data Science)
MODULE 4
The obvious security risk is that of impersonation. An opponent can pretend to be another
client and obtain unauthorized privileges on server machines.
To counter this threat, servers must be able to confirm the identities of clients who request
service.
An alternative is to use an authentication server (AS) that knows the passwords of all users
and stores these in a centralized database.
In addition, the AS shares a unique secret key with each server. These keys have been
distributed physicaly or in some other secure manner. Consider the following hypothetical
dialogue:
❖ In this scenario, the user logs on to a workstation and requests access to server V. The
client module C in the user’s workstation requests the user’s password and then sends
a message to the AS that includes the user’s ID, the server’s ID, and the user’s
password.
❖ The AS checks its database to see if the user has supplied the proper password for this
user ID and whether this user is permitted access to server V.
❖ If both tests are passed, the AS accepts the user as authentic and must now convince
the server that this user is authentic. To do so, the AS creates a ticket that con tains the
user’s ID and network address and the server’s ID. This ticket is encrypted using the
secret key shared by the AS and this server.
❖ This ticket is then sent back to C. Because the ticket is encrypted, it cannot be altered
by C or by an opponent.
7
Dept. of CSE(Data Science)
MODULE 4
❖ With this ticket, C can now apply to V for service. C sends a message to V con taining
C’s ID and the ticket.
❖ V decrypts the ticket and verifies that the user ID in the ticket is the same as the
unencrypted user ID in the message. If these two match, the server considers the user
authenticated and grants the requested service.
❖ Each of the ingredients of message (3) is significant. The ticket is encrypted to
prevent alteration or forgery. The server’s ID (IDV) is included in the ticket so that the
server can verify that it has decrypted the ticket properly.
❖ IDC is included in the ticket to indicate that this ticket has been issued on behalf of C.
Finally, ADC serves to counter the following threat. An opponent could capture the
ticket transmitted in message (2), then use the name IDC and transmit a message of
form (3) from another workstation.
If user C logs on to a workstation in the morning and wishes to check his or her mail at a mail
server, C must supply a password to get a ticket for the mail server.
If C wishes to check the mail several times during the day, each attempt requires re entering
the password. We can improve matters by saying that tickets are reusable.
If a user wished to access a print server, a mail server, a file server, and so on, the first
instance of each access would require a new ticket and hence require the user to enter the
password.
The second problem is that the earlier scenario involved a plaintext transmis sion of the
password [message (1)].
To solve these additional problems, we introduce a scheme for avoiding plain text passwords
and a new server, known as the ticket-granting server (TGS). The new (but still hypothetical)
scenario is as follows.
8
Dept. of CSE(Data Science)
MODULE 4
The new service, TGS, issues tickets to users who have been authenticated to AS. Thus, the
user first requests a ticket-granting ticket (Tickettgs) from the AS. The client module in the
user workstation saves this ticket.
The TGS then grants a ticket for the particular service. The client saves each service-granting
ticket and uses it to authenticate its user to a server each time a particular service is requested.
❖ The client requests a ticket-granting ticket on behalf of the user by sending its user’s
ID to the AS, together with the TGS ID, indicating a request to use the TGS service.
❖ The AS responds with a ticket that is encrypted with a key that is derived from the
user’s password (Kc), which is already stored at the AS. When this response arrives at
the client, the client prompts the user for his or her password, generates the key, and
attempts to decrypt the incoming message.
❖ The client requests a service-granting ticket on behalf of the user. For this pur pose,
the client transmits a message to the TGS containing the user’s ID, the ID of the
desired service, and the ticket-granting ticket.
❖ The TGS decrypts the incoming ticket using a key shared only by the AS and the TGS
(Ktgs) and verifies the success of the decryption by the presence of its ID. It checks to
make sure that the lifetime has not expired.
❖ The client requests access to a service on behalf of the user. For this purpose, the
client transmits a message to the server containing the user’s ID and the service
granting ticket. The server authenticates by using the contents of the ticket.
9
Dept. of CSE(Data Science)
MODULE 4
If this lifetime is very short (e.g., minutes), then the user will be repeatedly asked for a
password.
If the lifetime is long (e.g., hours), then an opponent has a greater opportunity for replay.
An opponent could eavesdrop on the network and capture a copy of the ticket-granting ticket
and then wait for the legitimate user to log out.
The second problem is that there may be a requirement for servers to authenticate themselves
to users. Without such authentication, an opponent could sabotage the configuration so that
messages to a server were directed to another location.
10
Dept. of CSE(Data Science)
MODULE 4
Table 1 shows the technique for distributing the session key. As before, the client sends a
message to the AS requesting access to the TGS.
The AS responds with a message, encrypted with a key derived from the user’s password
(Kc), that contains the ticket. The encrypted message also contains a copy of the session key,
Kc,tgs, where the subscripts indicate that this is a session key for C and TGS.
Because this session key is inside the message encrypted with Kc, only the user’s client can
read it. The same session key is included in the ticket, which can be read only by the TGS.
Thus, the session key has been securely delivered to both C and the TGS.
Armed with the ticket and the session key, C is ready to approach the TGS. As before, C
sends the TGS a message that includes the ticket plus the ID of the requested service
[message (3) in Table 1].
This ticket indicates that user C has been provided with the session key Kc,tgs. In effect, the
ticket says, “Anyone who uses Kc,tgs must be C.” The TGS uses the session key to decrypt
the authenticator.
11
Dept. of CSE(Data Science)
MODULE 4
The TGS can then check the name and address from the authenticator with that of the ticket
and with the network address of the incoming message.
If all match, then the TGS is assured that the sender of the ticket is indeed the ticket’s real
owner. In effect, the authenticator says, “At time TS3, I hereby use Kc,tgs.” Note that the
ticket does not prove anyone’s identity but is a way to distribute keys securely. It is the
authenticator that proves the client’s identity.
The reply from the TGS in message (4) follows the form of message (2). The message is
encrypted with the session key shared by the TGS and C and includes a session key to be
shared between C and the server V, the ID of V, and the time stamp of the ticket. The ticket
itself includes the same session key.
C now has a reusable service-granting ticket for V. When C presents this ticket, as shown in
message (5), it also sends an authenticator. The server can decrypt the ticket, recover the
session key, and decrypt the authenticator.
The Kerberos server must have the user ID and hashed passwords of all participating users in
its database. All users are registered with the Kerberos server.
12
Dept. of CSE(Data Science)
MODULE 4
13
Dept. of CSE(Data Science)
MODULE 4
that share the same Kerberos database. The Kerberos database resides on the
Kerberos master computer system, which should be kept in a physically secure room.
A Kerberos realm is a set of managed nodes that share the same Kerberos database. The
Kerberos database resides on the Kerberos master computer system, which should be kept in
a physically secure room.
14
Dept. of CSE(Data Science)
MODULE 4
The ticket presented to the remote server (Vrem) indicates the realm in which the user was
originally authenticated. The server chooses whether to honor the remote request.
KERBEROS VERSION 5:
15
Dept. of CSE(Data Science)
MODULE 4
MUTUAL AUTHENTICATION
This protocol assumes that each of the two parties is in possession of the current
public key of the other. It may not be practical to require this assumption.
16
Dept. of CSE(Data Science)
MODULE 4
This seems to be a secure protocol that takes into account the various attacks.
However, the authors themselves spotted a flaw and submitted a revised version of the
algorithm
17
Dept. of CSE(Data Science)
MODULE 4
In this case, the message is encrypted with a one-time secret key. A also encrypts this
one-time key with B’s public key. Only B will be able to use the corresponding
private
key to recover the one-time key and then use that key to decrypt the message. This
scheme is more efficient than simply encrypting the entire message with B’s public
key.
To counter such a scheme, both the message and signature can be encrypted with the
recipient’s public key:
The latter two schemes require that B know A’s public key and be convinced
that it is timely. An effective way to provide this assurance is the digital certificate.
In addition to the message, A sends B the signature encrypted with A’s private key and
A’s certificate encrypted with the private key of the authentication server. The
recipient of the message first uses the certificate to obtain the sender’s public key and
verify that it is authentic and then uses the public key to verify the message itself. If
confidentiality is required, then the entire message can be encrypted with B’s public
key
18
Dept. of CSE(Data Science)
MODULE 4
The World Wide Web is fundamentally a client/server application running over the
Internet and TCP/IP intranets. As such, the security tools and approaches discussed
so far in this book are relevant to the issue of Web security. However, the following
characteristics of Web usage suggest the need for tailored security tools:
19
Dept. of CSE(Data Science)
MODULE 4
illustrates this difference. One way to provide Web security is to use IP security
(IPsec) (Figure 1a). The advantage of using IPsec is that it is transparent to end
users and applications and provides a general-purpose solution. Furthermore,
IPsec includes a filtering capability so that only selected traffic need incur the
overhead of IPsec processing.
Sockets Layer (SSL) and the follow-on Internet standard known as Transport
Layer Security (TLS). At this level, there are two implementation choices. For full
generality, SSL (or TLS) could be provided as part of the underlying protocol suite
in specific packages. For example, virtually all browsers come equipped with
TLS,
approach is that the service can be tailored to the specific needs of a given
application.
20
Dept. of CSE(Data Science)
MODULE 4
[Link] ARCHITECTURE:
TLS is designed to make use of TCP to provide a reliable end-to-end secure service. TLS is
not a single protocol but rather two layers of protocols, as illustrated in figure 1:
The TLS Record Protocol provides basic security services to various higher layer protocols.
In particular, the Hypertext Transfer Protocol (HTTP), which provides the transfer service
for Web client/server interaction, can operate on top of TLS. Three higher-layer protocols are
defined as part of TLS: the Handshake Protocol; the Change Cipher Spec Protocol; and the
Alert Protocol.
Two important TLS concepts are the TLS session and the TLS connection, which are defined
in the specification as follows:
TLS Connection
TLS Session
21
Dept. of CSE(Data Science)
MODULE 4
➢ Sessions help avoid repeating expensive security negotiations for every connection.
➢ Between two communicating applications (e.g., HTTP client and server), multiple
secure connections may exist.
➢ Multiple sessions could theoretically exist at the same time, but this is not used in
practice.
Session Identifier
Peer Certificate
Compression Method
Cipher Spec
➢ Specifies the hash algorithm used for MAC calculation (e.g., MD5, SHA-1).
Master Secret
22
Dept. of CSE(Data Science)
MODULE 4
Is Resumable
➢ A flag indicating whether the session can be reused to start new connections.
➢ Random byte sequences independently chosen by server and client for each
connection.
➢ Secret key used for MAC operations on data sent by the server.
➢ Secret key used for MAC operations on data sent by the client.
➢ After that, the last ciphertext block of each record becomes the IV for the next
record.
Sequence Numbers
➢ Each party keeps separate sequence numbers for sent and received messages.
➢ Sequence numbers reset to zero when a “change cipher spec” message is received or
sent.
23
Dept. of CSE(Data Science)
MODULE 4
Confidentiality
Achieved using a shared secret key defined during the Handshake Protocol.
Message Integrity
Achieved using a shared secret key defined during the Handshake Protocol.
[Link]
24
Dept. of CSE(Data Science)
MODULE 4
▪ M: message input
[Link]
Supported algorithms:
25
Dept. of CSE(Data Science)
MODULE 4
Fields:
[Link] (Optional)
Must be lossless.
[Link]
On receiving side, steps are reversed: decrypt → verify MAC → decompress → reassemble
→ deliver.
26
Dept. of CSE(Data Science)
MODULE 4
The Change Cipher Spec (CCS) Protocol is a TLS-specific protocol that updates the cipher
suite for a connection by copying the pending state into the current state.
It consists of a single 1-byte message with the value 1, whose sole purpose is to activate the
new cipher settings.
Figure illustrates:
[Link] PROTOCOL
➢ The Alert Protocol is used to convey TLS-related alerts to the peer entity. Like other
applications that use TLS, alert messages are compressed and encrypted according to
the current state.
➢ Each message in this protocol consists of two bytes. The first byte indicates the
severity of the message, taking the value warning (1) or fatal (2). If the alert is fatal,
TLS immediately terminates the connection.
➢ Other connections on the same session may continue, but no new connections on this
session can be established.
➢ The second byte contains a code that specifies the particular alert. Certain alerts are
always fatal, including: unexpected_message, which occurs when an inappropriate
message is received; bad_record_mac, triggered by an incorrect MAC;
27
Dept. of CSE(Data Science)
MODULE 4
➢ record_overflow: TLS record received has payload exceeding limits (214 + 2048
bytes) or decrypted length greater than 214 + 1024 bytes.
➢ access_denied: Valid certificate received but sender refused to proceed after applying
access control.
➢ decode_error: Message could not be decoded due to field out of range or incorrect
length.
28
Dept. of CSE(Data Science)
MODULE 4
Other Alerts:
➢ close_notify: Notifies the recipient that no more messages will be sent on this
connection; must be sent before closing the write side.
HANDSHAKE PROTOCOL
Figure shows the initial exchange needed to establish a logical connection between client and
server. The exchange can be viewed as having four phases.
PHASE 4. FINISH
29
Dept. of CSE(Data Science)
MODULE 4
➢ The TLS handshake begins when the client initiates a connection to the server. This is
done by sending a client_hello message, which indicates the client’s highest supported
TLS version and provides a random value consisting of a 32-bit timestamp and 28
bytes generated securely.
➢ This random value acts as a nonce to prevent replay attacks during key exchange. The
message also includes a session ID, which tells the server whether the client wants to
resume an existing session (nonzero value) or establish a new session (zero value).
➢ This phase sets the foundation for the security parameters that will govern the session.
➢ After receiving the client’s hello, the server responds with a server_hello message.
This message specifies the TLS version chosen for the session and includes a server-
30
Dept. of CSE(Data Science)
MODULE 4
generated random value, which will be used in key generation along with the client’s
random value.
➢ The server may either echo the client’s session ID or provide a new one if a fresh
session is being created. To authenticate itself, the server sends its digital certificate,
which may include intermediate certificates forming a chain of trust.
➢ If required by the selected key exchange algorithm, the server also sends key
exchange parameters. The server concludes this phase with a server_hello_done
message, signaling that it has finished its part of the negotiation.
➢ Once the server has responded, the client proceeds with the key exchange. If the
server requests client authentication, the client sends its certificate along with a
certificate_verify message to prove ownership of its private key.
➢ The client also sends a pre-master secret or other key exchange parameters, which
both parties will use to derive the session keys. Afterward, both client and server
send a change_cipher_spec message to indicate that future communications will
be encrypted using the negotiated parameters.
➢ Finally, each side sends a finished message, which contains a verification of all
previous handshake messages to ensure integrity.
➢ Once these steps are complete, a secure TLS session is established, allowing
encrypted communication between client and server.
PHASE 4. FINISH
CRYPTOGRAPHIC COMPUTATION
Two further items are of interest: (1) the creation of a shared master secret by means of the
key exchange; and (2) the generation of cryptographic parameters from the master secret.
31
Dept. of CSE(Data Science)
MODULE 4
• RSA: The client generates a 48-byte pre_master_secret and encrypts it with the
server’s public RSA key. The server then decrypts it using its private key to recover
the pre_master_secret.
• Diffie–Hellman (DH): Both client and server generate DH public keys and exchange
them. Each side then performs the Diffie–Hellman calculation to create the shared
pre_master_secret.
Here, the random values from the initial ClientHello and ServerHello messages are combined
as nonces to ensure uniqueness. The PRF is run until a total of 48 bytes of pseudorandom
output are produced, forming the master secret.
32
Dept. of CSE(Data Science)
MODULE 4
This process continues until enough pseudorandom output is generated to provide the
required cryptographic keys for the session. The resulting key block ensures that all
encryption and integrity mechanisms for the TLS session are securely derived from the
shared master secret.
P_hash Function
The PRF relies on a data expansion function called P_hash, which iteratively applies the
HMAC algorithm with an underlying hash function (such as MD5 or SHA-1). The function is
defined as:
• A(0) = seed
This iterative approach allows P_hash to generate as much data as needed. Each iteration
produces one segment of pseudorandom output, and multiple iterations are concatenated until
the required number of bytes is reached.
33
Dept. of CSE(Data Science)
MODULE 4
HEARTBEAT PROTOCOL
The Heartbeat protocol operates on top of the TLS Record Protocol and consists of two
message types: heartbeat_request and heartbeat_response. Its use is negotiated during Phase
1 of the TLS Handshake, where each peer indicates whether it supports heartbeats. If supported,
a peer also specifies whether it is willing to both send and receive heartbeat messages or only
send them.
A heartbeat_request message can be sent at any time. When received, it should be promptly
answered with a heartbeat_response message that includes an exact copy of the payload from
the request. The heartbeat_request message contains three fields: payload length, payload,
and padding. The payload is a random content block between 16 bytes and 64 Kbytes. The
padding is also random and is used to help perform path MTU (Maximum Transfer Unit)
discovery, by allowing the sender to determine the largest message size that can traverse the
path without being dropped.
1. It assures the sender that the recipient is still active, even if there has been no recent
activity over the TCP connection.
34
Dept. of CSE(Data Science)
MODULE 4
2. It generates network activity during idle periods to prevent idle connections from being
closed by firewalls.
SSL/TLS ATTACKS
Since SSL was first introduced in 1994 and later standardized as TLS, many attacks have been
discovered that target different parts of the protocol.
Each newly discovered vulnerability has forced updates to the protocol design, cryptographic
algorithms, and implementation practices.
These attacks highlight how complex and sensitive secure communication protocols are, and
why constant improvement is necessary to maintain security.
As early as 1998, researchers found weaknesses in the RSA encryption scheme used during
the handshake. These weaknesses allowed attackers to manipulate the formatting or exploit
flaws in how RSA was implemented. Over the years, these attacks were refined to bypass
countermeasures and execute more efficiently. Such vulnerabilities typically stem from poor
padding validation, weak randomness, or incorrect RSA implementation.
35
Dept. of CSE(Data Science)
MODULE 4
TLSv1.3
36
Dept. of CSE(Data Science)
MODULE 4
37
Dept. of CSE(Data Science)
MODULE 4
38
Dept. of CSE(Data Science)
MODULE 4
➢ SPF (Sender Policy Framework): Allows domain owners to authorize IP addresses for
sending emails; helps verify sender authenticity.
➢ DKIM (DomainKeys Identified Mail): Signs email headers and body to validate the
source domain and ensure message integrity.
S/MIME
➢ RFC 5750 – S/MIME v3.2 Certificate Handling: Specifies conventions for using
X.509 certificates in S/MIME v3.2.
➢ RFC 5751 – S/MIME v3.2 Message Specification: Main defining document for
S/MIME message creation and processing.
39
Dept. of CSE(Data Science)
MODULE 4
➢ RFC 2634 – Enhanced Security Services for S/MIME: Describes four optional
security service extensions for S/MIME.
➢ RFC 5652 – Cryptographic Message Syntax (CMS): Defines CMS for digitally
signing, digesting, authenticating, or encrypting message content.
➢ RFC 3370 – CMS Algorithms: Details conventions for using various cryptographic
algorithms with CMS.
➢ RFC 5752 – Multiple Signatures in CMS: Explains the use of multiple, parallel
signatures for a message.
OPERATIONAL DESCRIPTION:
40
Dept. of CSE(Data Science)
MODULE 4
Email Compatibility: Ensures messages are compatible with standard email systems.
AUTHENTICATION IN S/MIME
Process sequence:
3. Digest Creation: The sender generates a 256-bit message digest of the email
using SHA-256 and encrypts it with their private RSA key, attaching it along
with signer information.
4. Digest Recovery: The receiver uses the sender’s public RSA key to decrypt
and retrieve the original message digest.
5. Verification: The receiver generates a new digest from the received message
and compares it with the decrypted digest; if they match, the message is
authentic.
CONFIDENTIALITY:
41
Dept. of CSE(Data Science)
MODULE 4
3. The content-encryption key is encrypted with RSA using the recipient’s public
4. The receiver uses RSA with its private key to decrypt and recover the
content-encryption key.
➢ A digital signature can be generated for the plaintext message and appended.
➢ The message and signature are then encrypted as a single block using symmetric
encryption.
EMAIL COMPATIBILITY:
Encryption in S/MIME:
42
Dept. of CSE(Data Science)
MODULE 4
➢ If only the signature service is used, the message digest is encrypted with the
sender’s private key.
➢ If confidentiality is used, the message and signature (if present) are encrypted with a
one-time symmetric key.
➢ Many email systems allow only ASCII text, so S/MIME converts 8-bit binary data to
printable ASCII using 7-bit encoding.
➢ Base64 is commonly used: every 3 octets of binary data are mapped to 4 ASCII
characters.
➢ If a message is signed but not encrypted, the Base64 output is unreadable to casual
observers, providing a level of confidentiality.
COMPRESSION:
➢ Compression of binary encoded encrypted data is discouraged, since it will not yield
significant compression. Base64 encrypted data could very well benefit, however.
➢ If a lossy compression algorithm is used with signing, you will need to compress first,
then sign.
➢ Cryptographic Message Syntax (CMS) defines different content types used in S/MIME.
The Data type refers to the inner MIME-encoded message content, which can be
encapsulated in other security formats.
➢ SignedData is used to apply a digital signature, providing authentication and integrity
for the message.
➢ EnvelopedData contains encrypted message content and encrypted content-encryption
keys for one or more recipients, ensuring confidentiality.
➢ CompressedData is used to reduce the size of the message before transmission. The
Data content type is also used for a technique known as clear signing, where a signature
43
Dept. of CSE(Data Science)
MODULE 4
is generated for a MIME-encoded message and the message and signature are sent as
separate MIME parts.
➢ Unlike SignedData, clear-signed messages remain readable and their signatures can still
be verified even by email applications that do not support S/MIME, providing
compatibility while maintaining authentication.
cryptographic algorithms used in S/MIME. S/MIME uses the following terminology taken
from RFC 2119 (Key Words for use in RFCs to Indicate Requirement Levels, March 1997) to
specify the requirement level:
The S/MIME specification includes a discussion of the procedure for deciding which content
encryption algorithm to use. In essence, a sending agent has two decisions to make. First, the
sending agent must determine if the receiving agent is capable of decrypting using a given
encryption algorithm.
Second, if the receiving agent is only capable of accepting weakly encrypted content, the
sending agent must decide if it is acceptable to send using weak encryption. To support this
decision process, a sending agent may announce its decrypting capabilities in order of
preference for any message that it sends out. A receiving agent may store that information for
future use.
44
Dept. of CSE(Data Science)
MODULE 4
➢ If the sender has a list of the recipient’s preferred decryption algorithms, the sender
should choose the highest-priority algorithm from that list that it also supports.
➢ If there is no preference list but the sender has earlier received signed and encrypted
mail from the recipient, the sender should use the same algorithm used in the most
recent such message.
➢ If the recipient’s supported algorithms are unknown and the sender accepts the risk
that the recipient might not decrypt the message, the sender should use Triple DES.
➢ If the sender does not want to risk decryption failure, the sender must use RC2/40,
ensuring maximum compatibility.
S/MIME MESSAGES:
45
Dept. of CSE(Data Science)
MODULE 4
➢ The MIME content is first prepared in canonical form, then combined with
security-related data (like certificates and algorithm identifiers) to create a
PKCS object.
➢ This PKCS object is wrapped in MIME with proper headers for transmission.
➢ Security operations may produce binary data, so transfer encoding (typically Base64)
is applied to ensure safe transport over email systems that support only ASCII.
➢ In multipart signed messages, the signed content remains unchanged; therefore, any
non-ASCII data must be encoded (Base64 or quoted-printable) beforehand to preserve
the validity of the signature.
ENVELOPED DATA:
2. For each recipient, encrypt the session key with the recipient’s public RSA key.
algorithm used to encrypt the session key, and the encrypted session key.
SIGNED DATA:
4. Prepare a block known as SignerInfo that contains the signer’s public-key certificate, an
identifier of the message digest algorithm, an identifier of the algorithm used to encrypt the
message digest, and the encrypted message digest.
46
Dept. of CSE(Data Science)
MODULE 4
CLEAR SIGNING:
Clear signing is achieved using the multipart content type with a signed subtype. As was
mentioned, this signing process does not involve transforming the message to be signed, so that
the message is sent “in the clear.” Thus, recipients with MIME capability but not S/MIME
capability are able to read the incoming message.
REGISTRATION REQUEST:
The certification request includes certification Request Info block, followed by an identifier
of the public-key encryption algorithm, followed by the signature of the certification Request
Info block, made using the sender’s private key. The certification Request Info block includes
a name of the certificate subject (the entity whose public key is to be certified) and a bit-string
representation of the user’s public key.
A message containing only certificates or a certificate revocation list (CRL) can be sent in
response to a registration request. The message is an application/pkcs7-mime type/subtype with
an s/mime-type parameter of degenerate. The steps involved are the same as those for creating
a signed Data message, except that there is no message content and the signer Info field is
empty.
USER AGENT ROLE An S/MIME user has several key management functions to perform.
➢ Key generation: The user of some related administrative utility (e.g., one associated
with LAN management) MUST be capable of generating separate Diffie–Hellman and
DSS key pairs and SHOULD be capable of generating RSA key pairs. Each key pair
MUST be generated from a good source of nondeterministic random input and be
protected in a secure fashion. A user agent SHOULD generate RSA key pairs with a
length in the range of 768 to 1024 bits and MUST NOT generate a length of less than
512 bits.
➢ Registration: A user’s public key must be registered with a certification authority in
order to receive an X.509 public-key certificate.
47
Dept. of CSE(Data Science)
MODULE 4
➢ Certificate storage and retrieval: A user requires access to a local list of certificates
in order to verify incoming signatures and to encrypt outgoing messages. Such a list
could be maintained by the user or by some local administrative entity on behalf of a
number of users.
➢ Signed receipts: A signed receipt may be requested in a Signed Data object. Returning
a signed receipt provides proof of delivery to the originator of a message and allows
the originator to demonstrate to a third party that the recipient received the message.
➢ Security labels: A security label is a set of security information regarding the sensitivity
of the content that is protected by S/MIME encapsulation. The labels may be used for
access control, by indicating which users are permitted access to an object.
➢ Secure mailing lists: When a user sends a message to multiple recipients, a certain
amount of per-recipient processing is required, including the use of each recipient’s
public key. The user can be relieved of this work by employing the services of an
S/MIME Mail List Agent (MLA). An MLA can take a single incoming message,
perform the recipient-specific encryption for each recipient, and forward the message
➢ Signing certificates: This service is used to securely bind a sender’s certificate to their
signature through a signing certificate attribute.
An alternative email security protocol is Pretty Good Privacy (PGP), which has essentially the
same functionality as S/MIME. PGP was created by Phil Zimmerman and implemented as a
product first released in 1991.
Key Certification: S/MIME uses X.509 certificates that are issued by Certificate Authorities
(or local agencies that have been delegated authority by a CA to issue certificates). In OpenPGP,
users generate their own OpenPGP public and private keys and then solicit signatures for their
public keys from individuals or organizations to which they are known. Whereas X.509
certificates are trusted if there is a valid PKIX chain to a trusted root, an OpenPGP public key
is trusted if it is signed by another OpenPGP public key that is trusted by the recipient. This is
called the Web-of-Trust.
48
Dept. of CSE(Data Science)
MODULE 4
Key Distribution: OpenPGP does not include the sender’s public key with each message, so
it is necessary for recipients of OpenPGP messages to separately obtain the sender’s public key
in order to verify the message. Many organizations post OpenPGP keys on TLS-protected
websites: People who wish to verify digital signatures or send these organizations encrypted
mail need to manually download these keys and add them to their OpenPGP clients. Keys may
also be registered with the OpenPGP public key servers, which are servers that maintain a
database of PGP public keys organized by email address.
NIST 800-177 recommends the use of S/MIME rather than PGP because of the greater
confidence in the CA system of verifying public keys.
49
Dept. of CSE(Data Science)