Unit 1 Network Security Lecture Notes
Unit 1 Network Security Lecture Notes
UNIT I- INTRODUCTION
1. SECURITY TRENDS
This definition introduces three key objectives that are at the heart of computer security:
• Confidentiality: This term covers two related concepts:
• Data confidentiality: Assures that private or confidential information is not made
available or disclosed to unauthorized individuals.
• Privacy: Assures that individuals control or influence what information related to them
may be collected and stored and by whom and to whom that information may be
disclosed.
• Integrity: This term covers two related concepts:
• Data integrity: Assures that information and programs are changed only in a specified
and authorized manner.
• System integrity: Assures that a system performs its intended function in an
unimpaired manner, free from deliberate or inadvertent unauthorized manipulation of the
system.
• Availability: Assures that systems work promptly and service is not denied
to authorized
users
These three concepts form what is often referred to as the CIA triad (Figure 1.1). The three
concepts embody the fundamental security objectives for both data and for information and
computing services
verifying that users are who they say they are and that each input arriving at the system came
from a trusted source.
• Accountability: The security goal that generates the requirement for actions of an entity to
be traced uniquely to that entity. This supports non repudiation, deterrence, fault isolation,
intrusion detection and prevention, and after-action recovery and legal action.
• Computer Security - Generic name for the collection of tools designed to protect data and
to thwart hackers.
• Network Security - Measures to protect data during their transmission.
• Internet Security - Measures to protect data during their transmission over a collection of
interconnected networks Our Focus is on Internet Security which consists of measures to deter,
prevent, detect and correct security violations that involve the transmission and storage of
information
Computer and network security is both fascinating and complex. Some of the reasons follow:
1. Security is not as simple as it might first appear to the novice. The requirements seem to be
straightforward; indeed, most of the major requirements for security services can be given self-
explanatory, one-word labels: confidentiality, authentication, non repudiation, or integrity
3. Typically, a security mechanism is complex, and it is not obvious from the statement of a
particular requirement that such elaborate measures are needed.
CCS354 - NETWORK SECURITY / YEAR-III / SEM-06
4. Having designed various security mechanisms, it is necessary to decide where to use them.
This is true both in terms of physical placement and in a logical sense
.
5. Security mechanisms typically involve more than a particular algorithm or protocol.
Computer and network security is essentially a battle of wits between a perpetrator who tries to find
holes and the designer or administrator who tries to close them. The great advantage that the attacker
has is that he or she need only find a single weakness, while the designer must find and eliminate all
weaknesses to achieve perfect security.
6. There is a natural tendency on the part of users and system managers to perceive little
benefit from security investment until a security failure occurs.
7. Security requires regular, even constant, monitoring, and this is difficult in today‟s short-
term, overloaded environment.
8. Security is still too often an afterthought to be incorporated into a system after the design is
complete rather than being an integral part of the design process.
9. Many users and even security administrators view strong security as an impediment to
efficient and user-friendly operation of an information system or use of information.
A model for much of what we will be discussing is captured, in very general terms, in
Figure 1.3. A message is to be transferred from one party to another across some sort of
Internet service.
A security-related transformation on the information to be sent, Examples include the
encryption of the message, which scrambles the message so that it is unreadable by the opponent,
and the addition of a code based on the contents of the message, which can be used to verify the
identity of the sender
Some secret information shared by the two principals and, it is hoped, unknown to the
opponent. An example is an encryption key used in conjunction with the transformation to
scramble the message before transmission and unscramble it on reception.
Figure 1.3 Model for Network Security
All the techniques for providing security have two components:
This general model shows that there are four basic tasks in designing a particular security
service:
1. Design an algorithm for performing the security-related transformation.
The algorithm should be such that an opponent cannot defeat its purpose.
2. Generate the secret information to be used with the algorithm.
3. Develop methods for the distribution and sharing of the secret information.
4. Specify a protocol to be used by the two principals that makes use of the security algorithm
and the secret information to achieve a particular security service
A general model of these other situations is illustrated by Figure 1.4, which reflects a
concern for protecting an information system from unwanted access. Most readers are familiar
with the concerns caused by the existence of hackers, who attempt to penetrate systems that can
be accessed over a network. The hacker can be someone who, with no malign intent, simply
gets satisfaction from breaking and entering a computer system. The intruder can be a disgruntled
employee who wishes to do damage or a criminal who seeks to exploit computer assets for
financial gain (e.g., obtaining credit card numbers or performing illegal money transfers).
ITU-T Recommendation X.800, Security Architecture for OSI, defines such a systematic
approach. The OSI security architecture is useful to managers as a way of organizing the task of
providing security. This architecture was developed as an international standard, computer and
communications vendors have developed security features for their products and services that
relate to this structured definition of services and mechanisms.
The OSI security architecture focuses on security attacks, mechanisms, and services.
• Security attack: Any action that compromises the security of information owned by an
organization.
ATTACKS
The security attacks can be classified into two types’ passive attacks and active attacks. A passive attack
attempts to learn or make use of information from the system but does not affect system resources. An
active attack attempts to alter system resources or affect their operation.
Passive Attacks:
Two types of passive attacks are the release of message contents and traffic analysis.
The release of message contents is easily understood (Figure 1.5a).A telephone conversation, an
electronic mail message, and a transferred file may contain sensitive or confidential information. We
would like to prevent an opponent from learning the contents of these transmissions.
A second type of passive attack, traffic analysis, is subtler (Figure 1.5b). Suppose that we had a way of
masking the contents of messages or other information traffic so that opponents, even if they captured the
message, could not extract the information from the message. The common technique for masking
contents is encryption. If we had encryption protection in place, an opponent might still be able to observe
the pattern of these messages.
Passive attacks are very difficult to detect, because they do not involve any alteration of the data.
Typically, the message traffic is not sent and received in an apparently normal fashion and the sender nor
receiver is aware that a third party has read the messages or observed the traffic pattern.
Figure 1.5 Passive Attacks
Active Attacks:
Active attacks involve some modification of the data stream or the creation of a false stream and can be
subdivided into four categories: masquerade, replay, modification of messages, and denial of service.
A masquerade takes place when one entity pretends to be a different entity (Figure 1.6a). A masquerade
attack usually includes one of the other forms of active attack. For example, authentication sequences can
be captured and replayed after a valid authentication sequence has taken place, thus enabling an
authorized entity with few privileges to obtain extra privileges by impersonating an entity that has those
privileges.
Replay involves the passive capture of a data unit and its subsequent retransmission to produce an
unauthorized effect (Figure 1.6b).
Modification of messages simply means that some portion of a legitimate message is altered, or that
messages are delayed or reordered, to produce an unauthorized effect (Figure 1.6c). For example, a
message meaning “Allow John Smith to read confidential file accounts” is modified to mean “Allow
Fred Brown to read confidential file account.
The denial of service prevents or inhibits the normal use or management of communications facilities
(Figure 1.6d). This attack may have a specific target.
Active attacks present the opposite characteristics of passive attacks. Whereas passive attacks are
difficult to detect, measures are available to prevent their success.
Figure 1.6 Active Attacks
SECURITY SERVICES:
Table 1.3 lists the security mechanisms defined in X.800. The mechanisms are divided into
those that are implemented in a specific protocol layer, such as TCP or an application-layer
protocol, and those that are not specific to any particular protocol layer or security service
Steganography is a technique for hiding a secret message within a larger one in such a
way that others cannot discern the presence or contents of the hidden message.
An original message is known as the plaintext, while the coded message is called the ciphertext. The
process of converting from plaintext to ciphertext is known as enciphering or encryption; restoring the
plaintext from the ciphertext is deciphering or decryption. The many schemes used for encryption
constitute the area of study known as cryptography.
Such a scheme is known as a cryptographic system or a cipher. Techniques used for deciphering a
message without any knowledge of the enciphering details fall into the area of cryptanalysis.
Cryptanalysis is what the layperson calls “breaking the code” The areas of cryptography and cryptanalysis
together are called cryptology.
SYMMETRIC CIPHER MODEL:
A symmetric encryption scheme has five ingredients (Figure 1.7):
• Plaintext: This is the original intelligible message or data that is fed into the algorithm as input.
• Encryption algorithm: The encryption algorithm performs various substitutions and
transformations on the plaintext.
• Secret key: The secret key is also input to the encryption algorithm. The key is a value
independent of the plaintext and of the algorithm. The algorithm will produce a different output
depending on the specific key being used at the time. The exact substitutions and transformations
performed by the algorithm depend on the key
•Ciphertext: This is the scrambled message produced as output. It depends on the plaintext and
the secret key. For a given message, two different keys will produce two different ciphertexts.
The ciphertext is an apparently random stream of data and, as it stands, is unintelligible.
• Decryption algorithm: This is essentially the encryption algorithm run in reverse. It takes
the cipher text and the secret key and produces the original plaintext.
1. We need a strong encryption algorithm. At a minimum, we would like the algorithm to be such
that an opponent who knows the algorithm and has access to one or more ciphertexts would be
unable to decipher the ciphertext or figure out the key. This requirement is usually stated in a
stronger form: The opponent should be unable to decrypt ciphertext or discover the key even if
he or she is in possession of a number of ciphertexts together with the plaintext that produced
each ciphertext.
2. Sender and receiver must have obtained copies of the secret key in a secure fashion and must
keep the key secure. If someone can discover the key and knows the algorithm, all
communication using this key is readable.
With the message X and the encryption key K as input, the encryption algorithm forms
the ciphertext Y=[Y1,Y2,…….YN] .We can write this as Y=E(K,X)This notation indicates that is
produced by using encryption algorithm E as a function of the plaintext X , with the specific
function determined by the value of the key K .
The intended receiver, in possession of the key, is able to invert the transformation:
X=D(K,Y)
An opponent, observing Y but not having access K to X or, may attempt to recover X or K or
both X and K. It is assumed that the opponent knows the encryption (E) and decryption (D)
algorithms. If the opponent is interested in only this particular message, then the focus of the
effort is to recover X by generating a plaintext estimate X. Often, however, the opponent is
interested in being able to read future messages as well, in which case an attempt is made to
recover K by generating an estimate K.
Cryptography:
1. The number of keys used. If both sender and receiver use the same key, the system is
referred to as symmetric, single-key, secret-key, or conventional encryption. If the sender and receiver
use different keys, the system is referred to as asymmetric, two-key, or public-key encryption.
2. The way in which the plaintext is processed. A block cipher processes the input one block
of elements at a time, producing an output block for each input block. A stream cipher processes the
input elements continuously, producing output one element at a time, as it goes along.
3. Cryptanalysis and Brute-Force Attack
Typically, the objective of attacking an encryption system is to recover the key in use rather than simply
to recover the plaintexts of a single ciphertext. There are two general approaches to attacking a
conventional encryption scheme:
• Cryptanalysis: Cryptanalytic attacks rely on the nature of the algorithm plusperhaps some
knowledge of the general characteristics of the plaintext oreven some sample plaintext– ciphertext
pairs. This type of attack exploits the characteristics of the algorithm to attempt to deduce a specific
plaintext or to deduce the key being used.
• Brute-force attack: The attacker tries every possible key on a piece of cipher text until an
intelligible translation into plaintext is obtained. On average, half of all possible keys must be tried
to achieve success.
Table 1.4 summarizes the various types of cryptanalytic attacks based on the amount of information
known to the cryptanalyst. The most difficult problem is presented when all that is available is the
ciphertext only.
Table 1.4 Types of Attacks on Encrypted Messages
A brute-force attack involves trying every possible key until an intelligible translation of the
ciphertext into plaintext is obtained.
SUBSTITUTION TECHNIQUES:
The two basic building blocks of all encryption techniques are substitution and transposition. A
substitution technique is one in which the letters of plaintext are replaced by other letters or by numbers
or symbols.1 If the plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext
bit patterns with ciphertext bit patterns.
1. Caesar Cipher
The earliest known, and the simplest, use of a substitution cipher was by Julius Caesar.
The Caesar cipher involves replacing each letter of the alphabet with the letter standing three
places further down the alphabet. For example,
plain: meet me after the toga party
cipher: PHHW PH DIWH WRJ SDUW
WK D B
U H
Note that the alphabet is wrapped around, so that the letter following Z is A. We can define the
transformation by listing all possibilities, as follows:
plain: a b c d e f g h i j k l m n o p q r s t u v w x y z
cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
Then the algorithm can be expressed as follows. For each plaintext letter, substitute the cipher
text letter:
C = E(3, p) = (p + 3) mod 26
A shift may be of any amount, so that the general Caesar algorithm is
C = E(k, p) = (p + k) mod 26
where takes on a value in the range 1 to 25.The decryption algorithm is simply
p = D(k, C) = (C - k) mod 26
If it is known that a given ciphertext is a Caesar cipher, then a brute-force cryptanalysis is easily
performed: simply try all the 25 possible keys. Three important characteristics of this problem
enabled us to use a bruteforce cryptanalysis:
1. The encryption and decryption algorithms are known.
2. There are only 25 keys to try.
3. The language of the plaintext is known and easily recognizable.
Figure 1.9 Brute-Force Cryptanalysis of Caesar Cipher
2. Monoalphabetic Ciphers
With only 25 possible keys, the Caesar cipher is far from secure.A dramatic increasein
the key space can be achieved by allowing an arbitrary substitution. A permutation of a finite
set of elements is an ordered sequence of all the elements of, with each element appearing
exactlyonce. For example, if S ={a,b,c} , there are six permutations of :
abc, acb, bac, bca, cab, cba
In general, there are n! permutations of a set of elements, because the first element can
be chosen in one of n ways, the second in n-1 ways, the third in n-2 ways, and so on.
Recall the assignment for the Caesar cipher: plain:
a b c d e f g h I j kl m n o p q r s t u v w x y z
cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
If, instead, the “cipher” line can be any permutation of the 26 alphabetic characters, then
there are 26! or greater than 4*1026 possible keys. This is 10 orders of magnitude greater than
the key space for DES and would seem to eliminate brute-force techniques for cryptanalysis.
Such an approach is referred to as a monoalphabetic substitution cipher, because a single
cipher alphabet (mapping from plain alphabetto cipher alphabet) is used per message.
Playfair Cipher:
The best-known multiple-letter encryption cipher is the Playfair, which treats digrams in the plaintext as
single units and translates these units into ciphertext digrams. The Playfair algorithm is based on the use
of a 5 × 5 matrix of letters constructed using a keyword. Here is an example, solved by Lord Peter
Wimsey inDorothy Sayers‟s Have His Carcase
In this case, the keyword is monarchy. The matrix is constructed by filling in the letters of the keyword
(minus duplicates) from left to right and from top to bottom, and then filling in the remainder of the
matrix with the remaining letters in alphabetic order. The letters I and J count as one letter. Plaintext is
encrypted two letters at a time, according to the following rules:
1. Repeating plaintext letters that are in the same pair are separated with a filler letter, such as x,
so that balloon would be treated as ba lx lo on.
2. Two plaintext letters that fall in the same row of the matrix are each replaced by the letter to
the right, with the first element of the row circularly following the last. For example, ar is
encrypted as RM.
3. Two plaintext letters that fall in the same column are each replaced by the letter beneath, with
the top element of the column circularly following the last. For example, mu is encrypted as CM.
4. Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its own row and
the column occupied by the other plaintext letter. Thus, hs becomes BP and ea becomes IM (or
JM, as the encipherer wishes).
The Playfair cipher is a great advance over simple monoalphabetic ciphers. For one thing, whereas there
are only 26 letters, there are 26 × 26 = 676 digrams, so that identification of individual digrams is more
difficult. Furthermore, the relative frequencies of individual letters exhibit a much greater range than that
of digrams, making frequency analysis much more difficult. For these reasons, the Playfair cipher was
for a long time considered unbreakable. It was used as the standard field system by the British Army in
World War I and still enjoyed considerable use by the U.S. Army and other Allied forces during World
War II.
3. Hill Cipher
Another interesting multiletter cipher is the Hill cipher, developed by the mathematician
Lester Hill in 1929. Define the inverse M-1of a square matrix M by the equation M(M-1)= M-
1
M=I, where I is the identity matrix. I is a square matrix that is all zeros except for ones along
the main diagonal from upper left to lower right. The inverse of a matrix does not always exist,
but when
The determinant is k11k22 -k12k21. For a 3×3 matrix, the value of the determinant is
.k11k22k33 + k21k32k13 + k31k12k23 - k31k22k13 - k21k12k33 - k11k32k23. If a square matrix
A has a nonzero determinant, then the inverse of the matrix is computed as [A-1] ij=(det A)-1 (-
1)i+j (Dij)where (Dij ) is the subdeterminant formed by deleting the jth row and the ith
column of A, det(A) is the determinant of A, and (det A)-1 is the multiplicative inverse of (det A)
mod 26. Continuing our example,
THE HILLALGORITHM This encryption algorithm takes m successive plaintext letters and
substitutes for them m ciphertext letters. The substitution is determined by m linear equations in
which each character is assigned a numerical value (a=0,b=1,…z=25). For m=3, the system can
be described as
This can be expressed in terms of row vectors and matrices:
OR
C = PK mod 26
where C and P are row vectors of length 3 representing the plaintext and ciphertext, and K is a 3
×3 matrix representing the encryption key. Operations are performed mod 26.For example,
consider the plaintext “paymoremoney” and use the encryption Key
As with Playfair, the strength of the Hill cipher is that it completely hides single-letter frequencies.
Indeed, with Hill, the use of a larger matrix hides more frequency information. Thus, a 3 ×3 Hill
cipher hides not only single-letter but also two-letter frequency information.
Consider this example. Suppose that the plaintext “hillcipher” is encrypted using a Hill cipher to yield the
ciphertext HCRZSSXNSP. Thus, we know that (78) Kmod26=(72)11 11)Kmod26=(17 25); and so on.
Using the first two plaintext–ciphertext pairs, we have
TRANSPOSITION TECHNIQUES:
All the techniques examined so far involve the substitution of a ciphertext symbol for a plaintext symbol.
A very different kind of mapping is achieved by performing some sort of permutation on the plaintext
letters. This technique is referred to as a transposition cipher. The simplest such cipher is the rail fence
technique, in which the plaintext is written down as a sequence of diagonals and then read off as a
sequence of rows. For example, to encipher the message “meet me after the toga party” with a rail fence
of depth 2, we write the following:
STEGANOGRAPHY:
A plaintext message may be hidden in one of two ways. The methods of steganography
conceal the existence of the message, whereas the methods of cryptography render the message
unintelligible to outsiders by various transformations of the text.
A simple form of steganography, but one that is time-consuming to construct, is one in
which an arrangement of words or letters within an apparently innocuous text spells out the real
message. For example, the sequence of first letters of each word of the overall message spells out
the hidden message. Figure shows an example in which a subset of the words of the overall
message is used to convey the hidden message.
Various other techniques have been used historically; some examples are the following:
Character marking: Selected letters of printed or typewritten text are overwritten in pencil.
The marks are ordinarily not visible unless the paper is held at an angle to bright light.
Invisible ink: A number of substances can be used for writing but leave no visible trace until
heat or some chemical is applied to the paper.
Pin punctures: Small pin punctures on selected letters are ordinarily not visible unless the paper
is held up in front of a light.
Typewriter correction ribbon: Used between lines typed with a black ribbon, the results of
typing with the correction tape are visible only under a strong light
Steganography has a number of drawbacks when compared to encryption. It requires a lot of
overhead to hide a relatively few bits of information, although using a scheme like that proposed
in the preceding paragraph may make it more effective. Also, once the system is discovered, it
becomes virtually worthless. This problem, too, can be overcome if the insertion method
depends on some sort of key.
The advantage of steganography is that it can be employed by parties who have something
to lose should the fact of their secret communication (not necessarily the content) be discovered.
Encryption flags traffic as important or secret or may identify the sender or receiver as someone
with something to hide.
These are weaker as compared to modern The encryption algorithm formed by this
encryption encryption technique is stronger as compared
to traditional encryption algorithms
It believes in the concept of security through Its security depends on the publicly known
obscurity mathematical algorithm
Context of Cryptography:
Asymmetric Encryption is another encryption method that uses two keys, which is a new and
sophisticated encryption technique. This is because it integrates two cryptographic keys for implementing
data security. These keys are termed as Public Key and Private Key.
The "public key", as the name implies, is accessible to all who want to send an encrypted message. The
other is the "private key" that is kept secure by the owner of that public key or the one who is encrypting.
Encryption of information is done through public key first, with the help of a particular algorithm. Then
the private key, which the receiver possesses, will use to decrypt that encrypted information. The same
algorithm will be used in both encodings as well as decoding.
PUBLIC KEY CRYPTOGRAPHY:
The concept of public key cryptography evolved from an attempt to attack two of the
mostdifficult problems associated with symmetric encryption. Key distribution under
symmetric key encryption requires either
(1) Two communicantsalready share a key, which someone has been distributed to them
(2) The use of a key distribution center.
• Digital signatures.
Public key algorithms rely on one key for encryption and a different but related key for decryption.These
algorithms have the following important characteristics:
addition, some algorithms, such as RSA, also exhibit the following characteristic:
• Either of the two related keys can be used for encryption, with the other used for
decryption.
INGREDIANTS OF PUBLIC KEY CRYPTOGRAPHY
1. Plaintext: This is the readable message or data that is fed into the algorithm as input.
2. Encryption algorithm: The encryption algorithm performs various transformations on the
plaintext.
3. Public and private keys: This is a pair of keys that have been selected so that if one is used for
encryption, the other is used for decryption. The exact transformations performed by the algorithm
depend on the public or private key that is provided as input.
4. Ciphertext: This is the scrambled message produced as output. It depends on the plaintext and the
key. For a given message, two different keys will produce two different cipher texts.
5. Decryption algorithm: This algorithm accepts the ciphertext and the matching key and
produces the original plaintext.
Encryption:
Let the plaintext be X=[X1, X2. X3, . .,X ] where m is the number of letters in some finite alphabets.
Suppose A wishes to send a message to B.
B generates a pair of keys: a public key KUb and a private key KRb KRb is known only to B, whereas
KUb is publicly available and therefore accessible by A.
With the message X and encryption key KUb as input, A forms the cipher text Y=[Y1, Y2, Y3› Y n] i.e.,
Y=EKUb(X)
The receiver can decrypt it using the private key KRb i.e., X=D KRb(Y)
The other approach (using sender―s private key for encryption and sender―s public key for decryption)
will provide authentication which is illustrated in the following diagram(Fig 2.26).
The encrypted message serves as a digital signature. It is important to emphasize that the encryption process
just described does not provide confidentiality.
CCS354 - NETWORK SECURITY / YEAR-III / SEM-05 / NIET / AI & DS
1. Encryption /decryption: The sender encrypts a message with the recipient‘s public key.
2. Digital signature: The sender ―signs" a message with its private key. Signing is achieved by a
cryptographic algorithm applied to the message or to a small block of data that is a function of the
message.
3. Key exchange: Two sides cooperate to exchange a session key. Several different approaches
are possible, involving the private key(s) of one or both parties.
4. HASH FUNCTION:
A variation on the message authentication code is the one way hash function. As with MAC, a hash
function accepts a variable size message M as input and produces a fixed-size output, referred to as hash
code H(M).
Unlike a MAC, a hash code does not use a key but is a function only of the input message. The
hash code is also referred to as a message digest or hash value. There are varieties of ways in which a hash
code can be used to provide message authentication, as follows:
In Fig (a) The message plus the hash code is encrypted using symmetric encryption. This is identical to
that of internal error control strategy. Because encryption is applied to the entire message plus the hash
code, confidentiality is also provided.
In Fig (b) Only the hash code is encrypted, using symmetric encryption. This reduces the processing
burden for those applications that do not require confidentiality.
In Fig (c) Only the hash code is encrypted, using the public key encryption and using the sender‟s private
key. It provides authentication plus the digital signature.
In Fig (d) If confidentiality as well as digital signature is desired, then the message plus the public key
encrypted hash code can be encrypted using a symmetric secret key.
In Fig (e) This technique uses a hash function, but no encryption for message authentication. This
technique assumes that the two communicating parties share a common secret value „S‟. The source
computes the hash value over the concatenation of M and S and appends the resulting hash value to M.
In Fig(f) Confidentiality can be added to the previous approach by encrypting the entire message plus
the hash code.
h = H(M)
where M is a variable-length message and H(M) is the fixed-length hash value.
The hash value is appended to the message at the source at a time when the message is assumed or known
to be correct. The receiver authenticates that message by recomputing the hash value.
Requirements for a Hash Function
H(x) is relatively easy to compute for any given x, making both hardware and software implementations practical.
For any given value h, it is computationally infeasible to find x such that H(x) = h. This is sometimes referred to
in the literature as the one-way property.
For any given block x, it is computationally infeasible to find y x such that H(y) = H(x). This is sometimes
referred to as weak collision resistance.
It is computationally infeasible to find any pair (x, y) such that H(x) = H(y). This is sometimes referred to as
strong collision resistance.
The first three properties are requirements for the practical application of a hash function to message
authentication.
The fourth property, the one-way property, states that it is easy to generate a code given a message but virtually
impossible to generate a message given a code.
The fifth property guarantees that an alternative message hashing to the same value as a given message
cannot be found. This prevents forgery when an encrypted hash code is used.
The sixth property refers to how resistant the hash function is to a type of attack known as the birthday
attack.
HMAC
➢ To use hash functions that perform well in software and for which code is freely and
widely available.
➢ To allow for easy replacement of the embedded hash function in case faster or more secure
hash functions are found or required.
➢ To preserve the original performance of the hash function without incurring a
significant degradation.
➢ To use and handle keys in a simple way.
➢ To have a well understood cryptographic analysis of the strength of the
authentication mechanism based on reasonable assumptions about the embedded
hash function.
The first two objectives are important to the acceptability of HMAC. HMAC treats
HMAC Algorithm:
Definition of terms used in algorithm.
H = embedded hash function (e.g., MD5, SHA-1, RIPEMD-160)
Yi =i th block of M, 0 ≤ i ≤ (L – 1)
L =number of blocks in M
Message authentication protects two parties who exchange messages from any third party. However, it does not
protect the two parties against each other.
Disputes created by message authentication are:
➢ Creation of fraud message.
➢ Deny the sending of message
For example, suppose that John sends an authenticated message to Mary, the following disputes that could
arise:
CCS354 - NETWORK SECURITY / YEAR-III / SEM-05 / NIET / AI & DS
1 Mary may forge a different message and claim that it came from John. Mary would simply have to
create a message and append an authentication code using the key that John and Mary share.
2. John can deny sending the message. Because it is possible for Mary to forge a message, there is
no way to prove that John did in fact send the message.
Properties of digital signature :
➢ It must verify the author and the date and time of the signature.
➢ It must to authenticate the contents at the time of the signature.
➢ It must be verifiable by third parties, to resolve disputes.
Confidentiality can be provided by encrypting the entire message plus signature with a shared secret key
(symmetric encryption). Note that it is important to perform the signature function first and then an outer
confidentiality function. In case of dispute, some third party must view the message and its signature.
If the signature is calculated on an encrypted message, then the third party also needs access to the decryption
key to read the original message. However, if the signature is the inner operation, then the recipient can store
the plaintext message and its signature for later use in dispute resolution.
The validity of the scheme just described depends on the security of the sender‟s private key.
➢ If a sender later wishes to deny sending a particular message, the sender can claim that the private
key was lost or stolen and that someone else forged his or her signature.
➢ Another threat is that some private key might actually be stolen from X at time T. The opponent
can then send a message signed with X‟s signature and stamped with a time before or equal to T.