unit23
unit23
31
The most important properties of public key encryption scheme are
–
Different keys are used for encryption and decryption. This is a property
which set this scheme different than symmetric encryption scheme.
32
Introduction to Number Theory
Number theory is a branch of mathematics that studies the properties
and relationships of integers. In cryptography, number theory provides the
tools needed to develop algorithms for secure communication.
Fundamental Concepts in Number Theory
Divisibility and Division Algorithm
Divisibility
Divisibility refers to whether one integer can be divided by another
without leaving a remainder. If a and b are integers and b ≠ 0 , then a is
divisible by b if there exists an integer k such that a = b × k. In this case,
we say b divides a and write b ∣ a
Key Properties of Divisibility:
1. Transitivity: If a ∣ b and b ∣ c, then a ∣ c
2. Additivity: If a ∣ b, then a ∣ (b+c) for any integer c
3. Multiplicativity: If a ∣ b, then a ∣ (b×c) for any integer c.
Division Algorithm
The Division Algorithm provides a way to divide one integer by another,
yielding a quotient and a remainder. It states that for any integers a (the
dividend) and b (the divisor, where b > 0 there exist unique integers q (the
quotient) and r (the remainder) such that:
a =b×q+ r
where 0 ≤ r < b
Quotient (q): The integer result of dividing a by b
Remainder (r): The non-negative integer less than b that represents
what’s left after division.
Prime Numbers and Their Properties:
Definition: A prime number is an integer greater than 1 that has no
divisors other than 1 and itself.
33
Applications: Large prime numbers are essential for generating
cryptographic keys. For example, RSA encryption uses the product of
two large primes to form a modulus for the public and private keys.
The difficulty of factoring this large number into its prime components
underpins the security of RSA.
Euclidean Algorithm
One of the basic techniques of number theory is the Euclidean
algorithm, which is a simple procedure for determining the greatest
common divisor of two positive integers.
Two integers are relatively prime if and only if their only common
positive integer factor is 1.
Greatest Common Divisor
Recall that nonzero b is defined to be a divisor of a if a = mb for some
m, where a, b, and m are integers.
We will use the notation gcd(a, b) to mean the greatest common
divisor of a and b. The greatest common divisor of a and b is the largest
integer that divides both a and b. We also define gcd(0, 0) = 0.
35
that d|r1. This is due to the basic properties of divisibility: the relations d
|a
and d| b together imply that d | (a - q1b), which is the same as d | r1.
Modular Arithmetic:
Definition: Modular arithmetic deals with the remainder after division
of one number by another (the modulus). For instance, 7 mod 3 equals
1 because 7 divided by 3 leaves a remainder of 1.
Importance: Many cryptographic algorithms, including RSA and Diffie-
Hellman, use modular arithmetic to perform operations on large
numbers efficiently.
RSA Algorithm
RSA encryption algorithm is a type of public-key encryption algorithm.
To better understand RSA, lets first understand what is public-key
encryption algorithm.
36
The two keys are linked, but the private key cannot be derived from
the public key. The public key is well known, but the private key is secret
and it is known only to the user who owns the key.
RSA Encryption Algorithm:
RSA is the most common public-key algorithm, named after its
inventors Rivest, Shamir, and Adelman (RSA).
37
o If n = p x q, then the public key is <e, n>. A plaintext message m is
encrypted using public key <e, n>. To find ciphertext from the plain
text following formula is used to get ciphertext C.
C = me mod n
Here, m must be less than n. A larger message (>n) is treated as a
concatenation of messages, each of which is encrypted separately.
o To determine the private key, we use the following formula to
calculate the d such that:
De mod {(p - 1) x (q - 1)} = 1
Or
De mod φ (n) = 1
o The private key is <d, n>. A ciphertext message c is decrypted using
private key <d, n>. To calculate plain text m from the ciphertext c
following formula is used to get plain text m.
m = cd mod n
38
Key Management
What is Key Management?
Key management refers to the processes and procedures involved in
generating, storing, distributing, and managing cryptographic keys used in
cryptographic algorithms to protect sensitive data.
It ensures that keys used to protect sensitive data are kept safe from
unauthorized access or loss.
Symmetric Key Distribution Using Symmetric Encryption
For symmetric encryption to work, the two parties to an exchange must
share the same key, and that key must be protected from access by others.
Therefore, the term that refers to the means of delivering a key to two
parties who wish to exchange data, without allowing others to see the key.
39
For two parties A and B, key distribution can be achieved in a number
of ways, as follows:
40
A Key Distribution Scenario
The key distribution concept can be deployed in a number of ways.
The scenario assumes that each user shares a unique master key with the
key distribution
center (KDC).
41
2. The KDC responds with a message encrypted using Ka Thus, A is the
only one who can successfully read the message, and A knows that it
originated at the KDC. The message includes two items intended for
A:
Thus, A can verify that its original request was not altered before
reception by the KDC and, because of the nonce, that this is not a replay of
some previous request. In addition, the message includes two items
intended for B:
These last two items are encrypted with Kb (the master key that the
KDC shares with B). They are to be sent to B to establish the connection
and prove A's identity.
3. A stores the session key for use in the upcoming session and forwards
to B the information that originated at the KDC for B, namely, E(Kb,
[Ks || IDA]). Because this information is encrypted with Kb, it is
protected from eavesdropping. B now knows the session key (Ks),
knows that the other party is A (from IDA), and knows that the
information originated at the KDC (because it is
encrypted using Kb).
4. Using the newly minted session key for encryption, B sends a nonce,
N2, to A.
42
5. Also using Ks, A responds with f(N2), where f is a function that
performs some transformation on N2 (e.g., adding one).
43
delivers it to the two appropriate SSMs, using a unique permanent key
for each SSM.
The requesting SSM can now release the connection request packet,
and a connection is set up between the two end systems.
All user data exchanged between the two end systems are encrypted
by their respective SSMs using the onetime session key.
44
File-encrypting key, for encrypting files stored in publicly accessible
locations
The proposed technique is for use with DES and makes use of the extra 8
bits in each 64-bit DES key. That is, the eight non-key bits ordinarily
reserved for parity checking form the key tag.
The bits have the following interpretation:
One bit indicates whether the key is a session key or a master key.
One bit indicates whether the key can be used for encryption.
One bit indicates whether the key can be used for decryption.
The remaining bits are spares for future use.
45
Example:
Step 1: Alice and Bob get public numbers P = 23, G = 9
Step 2: Alice selected a private key a = 4 and
Bob selected a private key b = 3
Step 3: Alice and Bob compute public values
Alice: x =(9^4 mod 23) = (6561 mod 23) = 6
Bob: y = (9^3 mod 23) = (729 mod 23) = 16
Step 4: Alice and Bob exchange public numbers
Step 5: Alice receives public key y =16 and
Bob receives public key x = 6
Step 6: Alice and Bob compute symmetric keys
Alice: ka = y^a mod p = 65536 mod 23 = 9
Bob: kb = x^b mod p = 216 mod 23 = 9
46
Step 7: 9 is the shared secret.
Man-In-Middle attack
Alice and Bob wish to exchange keys, and Darth is the adversary. The
attack proceeds as follows
1. Darth prepares for the attack by generating two random private keys
XD1 and
XD2 and then computing the corresponding public keys YD1 and YD2.
2. Alice transmits YA to Bob.
3. Darth intercepts YA and transmits YD1 to Bob. Darth also calculates
K2 = (YA) XD2 mod q.
4. Bob receives YD1 and calculates K1 = (YD1) XB mod q.
5. Bob transmits YB to Alice.
47
6. Darth intercepts YB and transmits YD2 to Alice. Darth calculates
K1 = (YB)XD1 mod q.
7. Alice receives YD2 and calculates K2 = (YD2) XA mod q.
48
Key exchange using elliptic curves can be done in the following
manner. First pick a large integer q, which is either a prime number p or an
integer of the form 2m, and elliptic curve parameters a and b.
This defines the elliptic group of points Eq(a, b). Next, pick a base point G =
(x1, y1) in E p(a, b) whose order is a very large value n. The order n of a
point G on an elliptic curve is the smallest positive integer n such that n G =
0 and G are parameters of the cryptosystem known to all participants.
49
The first task in this system is to encode the plaintext message m to be
sent as an (x, y) point Pm. It is the point Pm that will be encrypted as a
ciphertext and subsequently decrypted.
As with the key exchange system, an encryption/decryption system
requires a point G and an elliptic group Eq (a, b) as parameters.
Each user A selects a private key n A and generates a public key P A =
nA * G. To encrypt and send a message Pm to B, A chooses a random
positive integer k and produces the ciphertext Cm consisting of the pair of
points: Cm = {kG, Pm + kPB}
Note that A has used B’s public key PB. To decrypt the ciphertext, B
multiplies the first point in the pair by B’s private key and subtracts the
result from the second point:
Pm + kPB - nB(kG) = Pm + k(nBG) - nB(kG) = Pm
50
Message authentication and Hash function
Message Authentication
Message authentication is a mechanism or service used to verify the
integrity of a message. Message authentication assures that data received
are exactly as sent by (i.e., contain no modification, insertion, deletion, or
replay) and that the purported identity of the sender is valid.
Symmetric encryption provides authentication among those who
share the secret key. Encryption of a message by a sender's private key
also provides a form of authentication.
The two most common cryptographic techniques for message
authentication are
Message authentication code (MAC) and
Secure hash function.
A MAC is an algorithm that requires the use of a secret key. A MAC takes
a variable length message and a secret key as input and produces an
authentication code. A recipient in possession of the secret key can
generate an authentication code to verify the integrity of the message.
A hash function maps a variable-length message into a fixed length hash
value, or message digest. For message authentication, a secure hash
function must be combined in some fashion with a secret key.
51
Authentication Requirements
In the context of communications across a network, the following
attacks can be identified:
1- Disclosure: Release of message contents to any person or process not
possessing the appropriate cryptographic key
2- Traffic analysis: Discovery of the pattern of traffic between parties. In a
connection-oriented application, the frequency and duration of connections
could be determined. In either a connection-oriented or connectionless
environment, the number and length of messages between parties could be
determined.
3- Masquerade: Insertion of messages into the network from a fraudulent
source. This includes the creation of messages by an opponent that are
purported to come from an authorized entity. Also included are fraudulent
acknowledgments of message receipt or non-receipt by someone other
than the message recipient.
4- Content modification: Changes to the contents of a message,
including insertion, deletion, transposition, and modification.
5- Sequence modification: Any modification to a sequence of messages
between parties, including insertion, deletion, and reordering.
6- Timing modification: Delay or replay of messages. In a connection-
oriented application, an entire session or sequence of messages could be a
replay of some previous valid session, or individual messages in the
sequence could be delayed or replayed. In a connectionless application, an
individual message (e.g., datagram) could be delayed or replayed.
7- Source repudiation: Denial of transmission of message by source. 8-
Destination repudiation: Denial of receipt of message by destination
Authentication Functions
Any message authentication or digital signature mechanism has two
levels of functionality.
52
At the lower level, there must be some sort of function that produces
an authenticator: a value to be used to authenticate a message.
This lower-level function is then used as a primitive in a higher level
authentication protocol that enables a receiver to verify the authenticity of
a message.
53
MAC algorithm is a symmetric key cryptographic technique to provide
message authentication. For establishing MAC process, the sender and
receiver share a symmetric key K.
Essentially, a MAC is an encrypted checksum generated on the
underlying message that is sent along with a message to ensure message
authentication.
54
The receiver now checks equality of freshly computed MAC with the
MAC received from the sender. If they match, then the receiver
accepts the message and assures himself that the message has been
sent by the intended sender.
If the computed MAC does not match the MAC sent by the sender, the
receiver cannot determine whether it is the message that has been
altered or it is the origin that has been falsified. As a bottom-line, a
receiver safely assumes that the message is not the genuine.
HMAC Algorithm
Overall operation of HMAC. Define the following terms:
H = embedded hash function (e.g., MD5, SHA-1, RIPEMD-160)
IV = initial value input to hash function
M = message input to HMAC(including the padding specified in the
embedded hash function)
Yi = ith block of M, 0 i (L – 1)
55
L = number of blocks in M
b = number of bits in a block
n = length of hash code produced by embedded hash function
K= secret key recommended length is n; if key length is greater
than b; the key is input to
the hash function to produce an n-bit key
K+ = K padded with zeros on the left so that the result is b bits in
length ipad = 00110110 (36 in hexadecimal) repeated b/8
times opad = 01011100 (5C in hexadecimal) repeated b/8 times
Hash Function
A Hash function is a mathematical function that converts a numerical
input value into another compressed numerical value. The input to the hash
function is of arbitrary length but output is always of fixed length. Values
returned by a hash function are called message digest or simply hash
values.
56
Applications of Cryptographic Hash Functions:
The most versatile cryptographic algorithm is the cryptographic hash
function. It is used in a wide variety of security applications and Internet
protocols.
Message Authentication:
Message authentication is a mechanism or service used to verify the
integrity of a message.
Message authentication assures that data received are exactly as sent
(i.e., there is no modification, insertion, deletion, or replay).
When a hash function is used to provide message authentication, the
hash function value is often referred to as a message digest.
Digital Signatures:
Another important application, which is similar to the message
authentication application, is the digital signature.
The operation of the digital signature is similar to that of the MAC.
In the case of the digital signature, the hash value of a message is
encrypted with a user’s private key.
Anyone who knows the user’s public key can verify the integrity of the
message that is associated with the digital signature.
Other Applications:
Hash functions are commonly used to create a one-way password file.
Hash functions can be used for intrusion detection and virus detection.
57
A cryptographic hash function can be used to construct a
pseudorandom function (PRF) or a pseudorandom number generator
(PRNG).
DIGITAL SIGNATURES
Digital signatures are the public-key primitives of message
authentication. In the physical world, it is common to use handwritten
signatures on handwritten or typed messages.
They are used to bind signatory to the message. Similarly, a digital
signature is a technique that binds a person/entity to the digital data. This
binding can be independently verified by receiver as well as any third party.
Digital signature is a cryptographic value that is calculated from the
data and a secret key known only by the signer. In real world, the receiver
of message needs assurance that the message belongs to the sender and
he should not be able to repudiate the origination of that message.
59
Arbitrated Digital Signatures
As with direct signature schemes, there is a variety of arbitrated
signature schemes. In general terms, they all operate as follows.
Every signed message from a sender X to a receiver Y goes first to an
arbiter A, who subjects the message and its signature to a number of tests
to check its origin and content.
The message is then dated and sent to Y with an indication that it has
been verified to the satisfaction of the arbiter. The presence of A solves the
problem faced by direct signature schemes: that X might disown the
message
60
Unit - III
AUTHENTICATION APPLICATIONS
Kerberos
61
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.
Components of Kerberos
The main components of Kerberos are:
Client.
Server
Authentication Server (AS)
Key Distribution Center (KDC)
Ticket Granting Server(TGS)
62
Client: The client acts on behalf of the user and initiates communication for
a service request
Server: The server hosts the service the user wants to access
Authentication Server (AS): The Authentication Server performs the initial
authentication and ticket for Ticket Granting Service
Key Distribution Center (KDC). In a Kerberos environment, the
authentication server logically separated into three parts: A database (db),
the Authentication Server (AS), and the Ticket Granting Server (TGS). These
three parts, in turn, exist in a single server called the Key Distribution
Center.
Kerberos Overview
63
Kerberos Encryption Techniques
64
Ticket Granting Server
• Thus, the user first requests a ticket-granting ticket (Ticket tgs) from the
AS.
• Each time the user requires access to a new service, the client applies to
the TGS, using the ticket to authenticate itself.
Authentication Dialogue
65
Kerberos Exchange
66
Step 1. 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.
Step 2. 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
password, generates the key, and attempts to decrypt the message. If the
correct password is supplied, the ticket is successfully recovered.
Step 4. 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.
Then it compares the user ID and network address with the incoming
information to authenticate the user. If the user is permitted access to the
server V, the TGS issues a ticket to grant access to the requested service.
Step 5: 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.
X.509 CERTIFICATES
67
X.509 is an important standard because the certificate structure and
authentication
Certificates
The heart of the X.509 scheme is the public-key certificate associated
with each user. These user certificates are assumed to be created by some
trusted certification authority (CA) and placed in the directory by the CA or
by the user.
default is version 1.
the signature field at the end of the certificate, this field has little, if any,
utility.
Issuer name: X.500 is the name of the CA that created and signed this
certificate.
Period of validity: Consists of two dates: the first and last on which the
certificate
is valid.
Subject name: The name of the user to whom this certificate refers. That
is, this
69
certificate certifies the public key of the subject who holds the
corresponding private key.
Subject’s public key information: The public key of the subject, plus an
identifier of the algorithm for which this key is to be used, together with any
associated parameters.
Issuer unique identifier: An optional-bit string field used to identify
uniquely
the issuing CA in the event the X.500 name has been reused for different
entities.
Subject unique identifier: An optional-bit string field used to identify
uniquely
the subject in the event the X.500 name has been reused for different
entities.
Extensions: A set of one or more extension fields.
Signature: Covers all of the other fields of the certificate; it contains the
hash
code of the other fields encrypted with the CA’s private key.
The unique identifier fields were added in version 2 to handle the possible
reuse of subject and/orissuer names over time. These fields are rarely
used.
The standard uses the following notation to define a
certificate:
CA << A >> = CA {V, SN, AI, CA, UCA, A, UA, Ap, TA}
where
Y<< X>> = the certificate of user X issued by certification authority Y
Y {I} = the signing of I by Y. It consists of I with an encrypted hash code
appendedV = version of the certificate
SN = serial number of the certificate
70
AI = identifier of the algorithm used to sign the
certificateCA = name of certificate authority
UCA = optional unique identifier of the
CAA = name of user A
UA = optional unique identifier of the user
AAp = public key of user A
TA = period of validity of the certificate
Email security
Email security refers to the steps where we protect the email messages
and the information that they contain from unauthorized access, and
damage. It involves
The MHS accepts a message from one user and delivers it to one or
more other users, creating a virtual MUA-to-MUA exchange environment.
Message User Agent (MUA): Operates on behalf of user actors and user
applications. It is their representative within the email service.
71
Mail Submission Agent (MSA): Accepts the message submitted by an
MUA and enforces the policies of the hosting domain and the requirements
of Internet standards. This function may be located together with the MUA
or as a separate functional model.
72
Message Store (MS): An MUA can employ a long-term MS. An MS can be
located on a remote server or on the same machine as the MUA. Typically,
an MUA retrieves messages from a remote server using POP (Post Office
Protocol) or IMAP (Internet Message Access Protocol).
Email protocols
Email protocols are a set of commands for sharing mails between two
computers. Email protocols establish communication between the sender
and receiver for the transmission of email.
73
Two types of protocols are used for transferring email. The first type
is used to move messages through the Internet from source to destination.
The protocol used for this purpose is SMTP, with various extensions and in
some cases restrictions.
Mail Access Protocols (POP3, IMAP) Post Office Protocol (POP3) allows
an email client (user agent) to download an email from an email server
(MTA). POP3 user agents connect via TCP to the server (typically port 110).
74
After authorization, the UA can issue POP3 commands to retrieve and
delete mail. As with POP3, Internet Mail Access Protocol (IMAP) also
enables an email client to access mail on an email server.
IMAP also uses TCP, with server TCP port 143. IMAP is more complex
than POP3. IMAP provides stronger authentication than POP3 and provides
other functions not supported by POP3.
PGP stands for Pretty Good Privacy (PGP) which is invented by Phil
Zimmermann.
PGP was designed to provide all four aspects of security, i.e., privacy,
integrity, authentication, and non-repudiation in the sending of email.
PGP uses a digital signature (a combination of hashing and public key
encryption) to provide integrity, authentication, and non-repudiation.
PGP uses a combination of secret key encryption and public key
encryption to provide privacy.
PGP is an open source and freely available software package for
email security.
PGP provides authentication through the use of Digital Signature.
It provides confidentiality through the use of symmetric block
encryption.
75
How PGP Works
Encryption:
76
Decryption:
The recipient uses their private key to decrypt the symmetric key.
With the symmetric key decrypted, they can then decrypt the
message.
Following are the steps taken to show how PGP uses hashing and
a combination of three keys to generate the original message:
77
S/MIME
S/MIME stands for Secure/Multipurpose Internet Mail Extensions. Through
encryption, S/MIME offers protection for business emails. S/MIME comes
under the concept of Cryptography.
S/MIME is a protocol used for encrypting or decrypting digitally signed E-
mails. This means that users can digitally sign their emails as the
owner(sender) of the e-mail.
S/MIME is defined in a number of documents, most importantly RFCs 3369,
3370, 3850 and 3851,5751,5752.
78
AUTHENTICATION
Authentication is provided by means of a digital signature, using the
general scheme, most commonly RSA with SHA-256 is used.
The sequence is as follows:
1. The sender creates a message.
2. SHA-256 is used to generate a 256-bit message digest of the
message.
3. The message digest is encrypted with RSA using the sender’s private
key, and the result is appended to the message. Also appended is
identifying information for the signer, which will enable the receiver to
retrieve the signer’s public key.
4. The receiver uses RSA with the sender’s public key to decrypt and
recover the message digest.
5. The receiver generates a new message digest for the message and
compares it with the decrypted hash code. If the two match, the
message is accepted as authentic.
79
CONFIDENTIALITY
S/MIME provides confidentiality by encrypting messages. Most
commonly AES with a 128-bit key is used, with the cipher block
chaining (CBC) mode.
One must address the problem of key distribution. In S/MIME, each
symmetric key, referred to as a content-encryption key, is used only
once. That is, a new key is generated as a random number for each
message. To protect the key, it is encrypted with the receiver’s public key.
The sequence can be described as follows:
1. The sender generates a message and a random 128-bit number to be
used as a content-encryption key for this message only.
80
2. The message is encrypted using the content-encryption key.
3. The content-encryption key is encrypted with RSA using the recipient’s
public key and is attached to the message.
4. The receiver uses RSA with its private key to decrypt and recover the
content-encryption key.
5. The content-encryption key is used to decrypt the message.
81
Data content types: - This is an arbitrary string. The object created is
called Data.
Signed- Data content type: - This type provides only integrity of data. It
contains any type & zero or more signature values. The encoded result is
called signed data.
following are the steps in the process
1. for each signer ,a message digest is created from the content using a
specific header algorithm chosen by that signer.
2. Each message digest is signal with the private key of the signs.
3. The content signature values , certificates are then collected to create
the 'signed data object'.
82
1. A pseudorandom session key is created for the symmetric key
algorithm to be used.
2. For each recipient, a copy of the session key is encrypted with the
public key of each recipient.
3. The content is encrypted using the defined Algorithm & created
session key.
4. The encrypted contents, encrypted session keys, algorithm used &
certificate are encoded using radix 64 .
Encrypted data type content type : This type is used to create an
encrypted session of any content type. This is similar to the enveloped data
content type, the encrypted data content type has no recipient. It can be
used to store the encrypted data instead of transmitting it.
The encrypted content is stored without including the key or the
algorithm.The object created is called encrypted data.
Authenticated -Data content type: This type is used to provide
authentication of the data. The object is called authenticated Data. figure
below shows the process.
83
using a pseudorandom generator, a MAC key is generated for each
recipient.
The MAC key is encrypted with the public key of the recipient.
IP Security
IP Security overview
IPsec refers to a collection of communication rules or protocols used to
establish secure network connections. Internet Protocol (IP) is the common
standard that controls how data is transmitted across the internet. IPsec
enhances the protocol’s security by introducing encryption and
authentication.
Applications of IPsec
■ Secure branch office connectivity over the Internet: A company can build
a secure virtual private network over the Internet or over a public WAN. This
enables a business to rely heavily on the Internet and reduce its need for
private networks, saving costs and network management overhead.
■ Secure remote access over the Internet: An end user whose system is
equipped with IP security protocols can make a local call to an Internet
Service Provider (ISP) and gain secure access to a company network. This
reduces the cost of toll charges for traveling employees and
telecommuters.
84
■ Enhancing electronic commerce security: Even though some Web and
electronic commerce applications have built-in security protocols; the use of
IPsec enhances that security. IPsec guarantees that all traffic designated by
the network administrator is both encrypted and authenticated, adding an
additional layer of security to whatever is provided at the application layer.
IPsec Documents
IPsec encompasses three functional areas: authentication,
confidentiality, and key management. The totality of the IPsec specification
is scattered across dozens of RFCs and draft IETF documents.
85
Architecture: Covers the general concepts, security requirements,
definitions, and mechanisms defining IPsec technology. The current
specification is RFC 4301, Security Architecture for the Internet Protocol.
Authentication Header (AH): AH is an extension header to provide
message authentication. The current specification is RFC 4302, IP
Authentication Header. Because message authentication is provided by
ESP, the use of AH is deprecated. It is included in IPsecv3 for backward
compatibility but should not be used in new applications. We do not discuss
AH in this chapter.
Encapsulating Security Payload (ESP): ESP consists of an
encapsulating header and trailer used to provide encryption or combined
encryption/ authentication. The current specification is RFC 4303, IP
Encapsulating Security Payload (ESP).
Internet Key Exchange (IKE): This is a collection of documents
describing the key management schemes for use with IPsec. The main
specification is RFC 7296, Internet Key Exchange (IKEv2) Protocol, but there
are a number of related RFCs.
Cryptographic algorithms: This category encompasses a large set of
documents that define and describe cryptographic algorithms for
encryption, message authentication, pseudorandom functions (PRFs), and
cryptographic key exchange.
IPsec Services
IPsec provides security services at the IP layer by enabling a system to
select required security protocols, determine the algorithm(s) to use for the
service(s), and put in place any cryptographic keys required to provide the
requested services.
Two protocols are used to provide security: an authentication
protocol designated by the header of the protocol, Authentication
86
Header (AH); and a combined encryption/authentication protocol
designated by the format of the packet for that protocol,
Access control
Connectionless integrity
Data origin authentication
Rejection of replayed packets (a form of partial sequence
integrity)
Confidentiality (encryption)
Limited traffic flow confidentiality
IP Security Policy
Fundamental to the operation of IPsec is the concept of a security
policy applied to each IP packet that transits from a source to a destination.
IPsec policy is determined primarily by the interaction of two databases, the
security association database (SAD) and the security policy
database (SPD).
Security Associations
A key concept that appears in both the authentication and
confidentiality mechanisms for IP is the security association (SA). An
association is a one-way logical connection between a sender and a
receiver that affords security services to the traffic carried on it.
A security association is uniquely identified by three parameters.
Security Parameters Index (SPI): A 32-bit unsigned integer
assigned to this SA and having local significance only. The SPI is
carried in AH and ESP heaers to enable the receiving system to select
the SA under which a received packet will be processed.
IP Destination Address: This is the address of the destination
endpoint of the SA, which may be an end-user system or a network
system such as a firewall or router.
87
Security Protocol Identifier: This field from the outer IP header
indicates whether the association is an AH or ESP security association
88
AH Information: Authentication algorithm, keys, key lifetimes, and
related parameters being used with AH (required for AH
implementations).
ESP Information: Encryption and authentication algorithm, keys,
initialization values, key lifetimes, and related parameters being used
with ESP (required for ESP implementations).
89