Unit 4 - Integrity and Authentication
Unit 4 - Integrity and Authentication
Authentication Requirement:
Message authentication is a procedure to verify that received messages come from the
alleged source and have not been altered. Message authentication may also verify
sequencing and timeliness. A digital signature is an authentication technique that also
includes measures to counter repudiation by either source or destination.
Message authentication is a procedure to verify that received messages come from the
alleged source and have not been altered. Message authentication may also verify
sequencing and timeliness. A digital signature is an authentication technique that also
includes measures to counter repudiation by either source or destination.
Authentication Requirements:
● Revelation: It means releasing the content of the message to someone who does
not have an appropriate cryptographic key.
● Modification in the Timings: This includes replay and delay of messages sent
between different parties. This way session tracking is also disrupted.
● Source Refusal: When the source denies being the originator of a message.
● Destination refusal: When the receiver of the message denies the reception.
1
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
The electronic equivalent of the document and fingerprint pair is the message and
digest pair. To preserve the integrity of a message, the message is passed through an
algorithm called a cryptographic hash function. The function creates a compressed
image of the message that can be used like a fingerprint.
● Authentication is used by a server when the server needs to know exactly who is
accessing their information or site.
● Authentication is used by a client when the client needs to know that the server is
system it claims to be.
● In authentication, the user or computer has to prove its identity to the server or
client.
● Usually, authentication by a server entails the use of a user name and password.
Other ways to authenticate can be through cards, retina scans, voice recognition,
and fingerprints.
Hash Function:
Hash functions are extremely useful and appear in almost all information security
applications.
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.
Hashing algorithm involves rounds of above hash function like a block cipher. Each round
takes an input of a fixed size, typically a combination of the most recent message block and
the output of the last round.
The typical features of hash functions are −
● Fixed Length Output (Hash Value)
o Hash function coverts data of arbitrary length to a fixed length. This process is
often referred to as hashing the data.
o In general, the hash is much smaller than the input data, hence hash functions
are sometimes called compression functions.
2
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
The national institute of Standard and Technology (NIST) along with NSA
developed Secure Hash Algorithm (SHA).
SHA is a modified version of MD5 and its design closely resembles MD5.
MD5: MD5 is quite fast and produce 128 bit message digest. After some initial
processing the input text is processed in 512 bit blocks(which are further divided into
16 32-bit blocks). The output of the algorithm is a set of four 32-bit blocks, which
makes up to 128-bit message digest.
Steps in MD5 Algorithm: There are four major sections of the algorithm:
Padding Bits
When you receive the input string, you have to make sure the size is 64 bits short of a
multiple of 512. When it comes to padding the bits, you must add one(1) first,
followed by zeroes to round out the extra characters.
3
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
Padding Length
You need to add a few more characters to make your final string a multiple of 512. To
do so, take the length of the initial input and express it in the form of 64 bits. On
combining the two, the final string is ready to be hashed.
The entire string is converted into multiple blocks of 512 bits each. You also need to
initialize four different buffers, namely A, B, C, and D. These buffers are 32 bits each
and are initialized as follows:
A = 01 23 45 67
B = 89 ab cd ef
C = fe dc ba 98
D = 76 54 32 10
4
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
Each 512-bit block gets broken down further into 16 sub-blocks of 32 bits each. There
are four rounds of operations, with each round utilizing all the sub-blocks, the buffers,
and a constant array value.
According to the image above, you see the values being run for a single buffer A. The
correct order is as follows:
5
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
The non-linear process above is different for each round of the sub-block.
With this, you conclude the working of the MD5 algorithm. You will now see the
advantages procured when using this particular hash algorithm.
Advantages of MD5
● Easy to Compare: Unlike the latest hash algorithm families, a 32 digit digest is
relatively easier to compare when verifying the digests.
● Storing Passwords: Passwords need not be stored in plaintext format, making them
accessible for hackers and malicious actors. When using digests, the database also
gets a boost since the size of all hash values will be the same.
6
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
SHA works with any input message that is less than 264 bits in length. The output of
SHA is a message digest, which is 160 bits in length.
The Secure Hash Algorithm (SHA) was invented by the National Security Agency
(NSA) and published in 1993 through the National Institute of Standard and
Technology (NIST) as a U.S. Federal Information Processing Standard (FIPS PUB
180).
SHA depends on and shares the similar building blocks as the MD4 algorithm. The
design of SHA introduced a new process which develop the 16-word message block
input to the compression function to an 80-word block between other things.
SHA (Secure Hash Algorithm) Family designates a family of six different hash
functions: SHA-0, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 . They take
variable length input messages and hash them to fixed-length outputs.
The first four operate on 512-bit message blocks divided into 32-bit words and the
last two on 1024-bit blocks divided into 64-bit words.
SHA-0 (the first version of SHA since replaced by SHA-1) and SHA-1 produce a
message digest of 160 bits, SHA-224 of 224 bits, SHA-256 of 256 bits, SHA-384 of
384 bits and SHA-512 of 512 bits respectively. message digest of 160 bits, SHA-224
of 224 bits, SHA-256 of 256 bits, SHA-384 of 384 bits and SHA-512 of 512 bits
respectively.
7
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
Step 1 − Append padding bits − The original message is padded and its duration is
congruent to 448 modulo 512. Padding is continually inserted although the message
already has the desired length. Padding includes a single 1 followed by the essential
number of 0 bits.
Step 3 −Initialize the buffer − The buffer includes five (5) registers of 32 bits each
indicated by A, B, C, D, and E. This 160-bit buffer can be used to influence
temporary and final outcomes of the compression function. These five registers are
initialized to the following 32-bit integers (in hexadecimal notation).
A = 67 45 23 01
B = ef cd ab 89
C = 98 ba dc fe
D = 10 32 54 76
E = c3 d2 e1 f0
The registers A, B, C, and D are actually the same as the four registers used in MD5
algorithm. But in SHA-1, these values are saved in big-endian format, which define
that the most essential byte of the word is located in the low-address byte position.
Therefore the initialization values (in hexadecimal notation) occurs as follows −
word A = 67 45 23 01
word B = ef cd ab 89
word C = 98 ba dc fe
8
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
word D = 10 32 54 76
word E = c3 d2 e1 f0
The four rounds are structurally same as one another with the only difference that
each round need a different Boolean function, which it can define as f1, f2, f3, f4 and
one of four multiple additive constants Kt (0 ≤t ≤79) which is based on the step under
consideration.
Step 5 − Output − After processing the final 512-bit message block t (considering
that the message is divided into t 512-bit blocks), and it can obtain a 160-bit message
digest.
9
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
10
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
The message plus MAC are transmitted to the intended recipient. The recipient
performs the same calculation on the received message, using the same secret key, to
generate a new MAC. The received MAC is compared to the calculated MAC.
11
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
HMAC
NIST has issued a standard (FIPS 198) for a nested MAC that is often referred to as
HMAC.The implementation of HMAC is much more complex than the simplified
nested MAC.
12
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
PASSWORDS
The simplest and oldest method of entity authentication is the password-based
authentication, where the password is something that the claimant knows. A password
is used when a user needs to access a system to use the system’s resources (login).
Each user has a user identification that is public, and a password that is private. We
can divide these authentication schemes into two groups: the fixed password and the
one-time password.
13
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
i) Fixed Password
A fixed password is a password that is used over and over again for every access.
Several schemes have been built, one upon the other.
ii) One-Time Password
A one-time password is a password that is used only once. This kind of password
makes eavesdropping useless.
BIOMETRICS
Biometrics is the measurement of physiological or behavioral features that identify a
person (authentication by something inherent). Biometrics measures features that can-
not be guessed, stolen, or shared.
Physiological Techniques
● Fingerprint
● iris
● retina
● face
● hands
● voice
● DNA
Behavioral Techniques
Behavioral techniques measure some human behavior traits. Unlike physiological
techniques, behavioral techniques need to be monitored to ensure the claimant
behaves normally and does not attempt to impersonate someone else.
● Signature
● key stroke
14
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
A secret key is established between the KDC and each member. Alice has a secret
key with the KDC, which we refer to as KAlice; Bob has a secret key with the KDC,
which we refer to as KBob; and so on. Now the question is how Alice can send a
confidential message to Bob. The process is as follows:
1. Alice sends a request to the KDC stating that she needs a session (temporary)
secret key between herself and Bob.
2. The KDC informs Bob about Alice’s request.
3. If Bob agrees, a session key is created between the two.
The secret key between Alice and Bob that is established with the KDC is used to
authenticate Alice and Bob to the KDC and to prevent Eve from impersonating either
of them.
Session Keys
A KDC creates a secret key for each member. This secret key can be used only
between the member and the KDC, not between two members. If Alice needs to
communicate secretly with Bob, she needs a secret key between herself and Bob. A
KDC can create a session key between Alice and Bob, using their keys with the
center. The keys of Alice and Bob are used to authenticate Alice and Bob to the center
and to each other before the session key is established.
After communication is terminated, the session key is no longer useful.
15
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
1. Alice sends a plaintext message to the KDC to obtain a symmetric session key
between Bob and herself. The message contains her registered identity (the word
Alice in the figure) and the identity of Bob (the word Bob in the figure). This message
is not encrypted, it is public. The KDC does not care.
2. The KDC receives the message and creates what is called a ticket. The ticket is
encrypted using Bob’s key (KB). The ticket contains the identities of Alice and Bob
and the session key (KAB). The ticket with a copy of the session key is sent to Alice.
Alice receives the message, decrypts it, and extracts the session key. She cannot
decrypt Bob’s ticket; the ticket is for Bob, not for Alice.
3. Alice sends the ticket to Bob. Bob opens the ticket and knows that Alice needs to
send messages to him using KAB as the session key.
16
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
KERBEROS:
Kerberos is an authentication protocol, and at the same time a KDC, that has
become very popular.
Several systems, including Windows 2000, use Kerberos.
Three servers are involved in the Kerberos protocol: an authentication server
(AS), a ticket-granting server (TGS), and a real (data) server that provides
services to others.
Real Server
The real server (Bob) provides services for the user (Alice). Kerberos is
designed for a client-server program, such as FTP, in which a user uses the
client process to access the server process. Kerberos is not used for
person-to-person authentication.
17
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
Operation
A client process (Alice) can access a process running on the real server (Bob) in
six steps, as shown in Figure.
1. Alice sends her request to the AS in plain text using her registered identity.
2. The AS sends a message encrypted with Alice’s permanent symmetric key,
KA-AS.
The message contains two items: a session key, KA-TGS, that is used by Alice
to contact the TGS, and a ticket for the TGS that is encrypted with the TGS
symmetric key, KAS-TGS. Alice does not know KA-AS, but when the message
arrives, she types her symmetric password. The password and the appropriate
algorithm together create KA-AS if the password is correct. The password is
then immediately destroyed; it is not sent to the network and it does not stay in
the terminal. It is used only for a moment to create KA-AS. The process now
uses KA-AS to decrypt the message sent. KA-TGS and the ticket are extracted.
3. Alice now sends three items to the TGS. The first is the ticket received from
the AS. The second is the name of the real server (Bob), the third is a timestamp
that is encrypted by KA-TGS. The timestamp prevents a replay by Eve.
18
Prof. Andleeb Sahar
UNIT IV CRYPTOGRAPHY & NETWORK SECURITY
4. Now, the TGS sends two tickets, each containing the session key between
Alice and Bob, KA-B. The ticket for Alice is encrypted with KA-TGS; the
ticket for Bob is encrypted with Bob’s key, KTGS-B. Note that Eve cannot
extract KAB because Eve does not know KA-TGS or KTGS-B. She cannot
replay step 3 because she cannot replace the timestamp with a new one (she
does not know KA-TGS). Even if she is very quick and sends the step 3
message before the timestamp has expired, she still receives the same two
tickets that she cannot decipher.
5. Alice sends Bob’s ticket with the timestamp encrypted by KA-B.
6. Bob confirms the receipt by adding 1 to the timestamp. The message is
encrypted with KA-B and sent to Alice.
Kerberos Version 5
The minor differences between version 4 and version 5 are briefly listed below:
1. Version 5 has a longer ticket lifetime.
2. Version 5 allows tickets to be renewed.
3. Version 5 can accept any symmetric-key algorithm.
4. Version 5 uses a different protocol for describing data types.
5. Version 5 has more overhead than version 4.
19
Prof. Andleeb Sahar