0% found this document useful (0 votes)
59 views37 pages

MISS-1103 System and Network Security - File-03 - Digital Signature & Cryptographic Hash Function - KMA

This document discusses digital signatures and cryptographic hash functions. It begins by defining a digital signature as a digital code that uniquely identifies the sender and verifies the integrity of an electronically transmitted message. The process of creating a digital signature involves hashing the message, encrypting the hash with a private key, and attaching it to the message. When received, the recipient decrypts the signature, hashes the message, and compares the hashes to verify authenticity. Digital signatures provide authentication of the sender, verify data integrity, and ensure non-repudiation of the message. Cryptographic hash functions are also discussed as they relate to generating the message digest for the digital signature process.

Uploaded by

Wasif Imran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views37 pages

MISS-1103 System and Network Security - File-03 - Digital Signature & Cryptographic Hash Function - KMA

This document discusses digital signatures and cryptographic hash functions. It begins by defining a digital signature as a digital code that uniquely identifies the sender and verifies the integrity of an electronically transmitted message. The process of creating a digital signature involves hashing the message, encrypting the hash with a private key, and attaching it to the message. When received, the recipient decrypts the signature, hashes the message, and compares the hashes to verify authenticity. Digital signatures provide authentication of the sender, verify data integrity, and ensure non-repudiation of the message. Cryptographic hash functions are also discussed as they relate to generating the message digest for the digital signature process.

Uploaded by

Wasif Imran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

Department of Information & Communication Technology

Bangladesh University of Professionals

MISS-1103:
System and Network Security
for
MISS Program- Batch 2022

Lecture File: 03
Digital Signature and Cryptographic Hash Function
Prepared by:
K M Akkas Ali
[email protected], [email protected]

Professor
Institute of Information Technology (IIT)
Jahangirnagar University, Dhaka-1342
File-03: Digital Signature & Hash Function
Topic to be Discussed
 To be familiar with the general idea behind digital

Prepared by: K M Akkas Ali, Professor, IIT, JU


signature
 To make a difference between conventional signature
and digital signature
 To illustrate the processes of signing and verification
used by digital signature
 To define security services provided by a digital
signature
 To describe some applications of digital signatures
 To introduce general ideas behind hash function
 To discuss the usage and application of hash function
 To know the desirable properties of a hash function

Slide-2
What is Digital Signature?
 Digital signature is a digital code that can be attached
to an electronically transmitted message that uniquely
identifies the sender and provides the integrity of the
message.

Prepared by: K M Akkas Ali, Professor, IIT, JU


 It was first proposed in 1976 by Whitfield Diffie of Stanford
University.
 Typically the signature is formed by taking the hash of
the message (called message digest) and encrypting
the digest with the creator’s private key.
 The encrypted message digest is known as a digital signature.
 The signature is then added at the end of each message that is to
be sent to the recipient.
 The recipient decrypts the signature using sender’s public key and
verifies that the message digest is correct and the message has
come from the genuine sender. If the transmitted message is
changed, the digital signature is invalidated.
 Like a written signature on a document, the purpose of
a digital signature is to guarantee that the individual
sending the message really is who he or she claims to
be.
Slide-3
Process of Creating Digital Signature
 The process of creating a digital signature is outlined below:
1. Sender generates a message.
2. He/she then creates a “digest” of the message using cryptographic
hash function.

Prepared by: K M Akkas Ali, Professor, IIT, JU


Sender Site

3. Sender encrypts the message digest with his/her private key for
authentication. This encrypted message digest is called digital
signature.
4. Sender attaches the digital signature to the end of the message that is
to be sent. The message attached with digital signature is known as
digitally signed message.
5. The sender encrypts the digitally signed message with the recipient’s
public key and sends it to the recipient.
6. After receiving, the recipient decrypts the entire message with his/her
private key.
7. The recipient detaches the message and digital signature.
8. He/she creates a “digest” of the received message using the same
Receiver Site

hash function the sender used.


9. The recipient decrypts the digital signature and finds the “digest” that
the sender created.
10. The recipient then compares the two digests. If they are equal, the
message is granted, otherwise it will be rejected.

Slide-4 The processes are illustrated in the figure on the next slide..
Digital Signature Process

Prepared by: K M Akkas Ali, Professor, IIT, JU


Figure: Illustration of digital signature process:
Slide-5
Digital Signature Vs. Conventional Signature
Key-point Conventional Signature Digital Signature
Inclusion a conventional signature is But, when we sign a document
included in the document; it is digitally, we send the signature as a
part of the document. separate document.; a digital
signature is a separate document.

Prepared by: K M Akkas Ali, Professor, IIT, JU


 E.g., when we write a
check, the signature is on  The sender sends two documents-
the check; it is not a the message and the signature.
separate document.
 The recipient receives both
documents and verifies that the
signature belongs to the supposed
sender. If this is proven, the
message is kept; otherwise, it is
rejected.
Verification A conventional signature on a For a digital signature, the recipient
method document is verified by receives the message and the
comparing the signature on it signature.
with the signature on file.
 The recipient needs to apply a
verification technique to the
combination of the message and
the signature to verify the
authenticity.

Slide-6
Digital Signature Vs. Conventional Signature
Key-point Conventional Digital Signature
Signature
Relationship For a conventional For a digital signature, there is a
signature, there is one-to-one relationship between a
normally a one-to- signature and a message.

Prepared by: K M Akkas Ali, Professor, IIT, JU


many relationship  Each message has its own signature.
between a signature  The signature on one message can
and documents. not be used in another message.
 For example, if Bob receives two
 A person uses the messages, one after another, from
same signature to Alice, he can not use the signature of
sign many the first message to verify the
documents. second. Each message needs a new
signature.
Duplicity In conventional In digital signature, there is no such
signature, a copy of distinction unless there is a factor of
the signed document time (such as a timestamp) on the
can be distinguished document.
from the original one  For example, suppose Alice sends a
on file. document instructing Bob to pay Eve.
If the intercepts the documents and
the signature, she can replay it later
to get money again from Bob.

Slide-7
Services Provided by Digital Signature

A digital signature serves three important purposes:


1. Provides authentication of the sender
2. Verifies data integrity

Prepared by: K M Akkas Ali, Professor, IIT, JU


3. Provides non-repudiation

Slide-8
Services Provided by Digital Signature
Message Authentication:
 A digital signature’s main function is to verify that a message or document,
in fact, comes from the claimed sender. That is, to provide authentication
is the main function of digital signature.

Prepared by: K M Akkas Ali, Professor, IIT, JU


Message Integrity:
 The integrity of the message is preserved even if we sign the whole
message because we cannot get the same signature if the message is
changed. Therefore, digital signature provides the integrity of the
message.

Non-repudiation:
 Attaching a digital signature with message prevents repudiation. This
ensures that the sender should not be able to later deny that he/she sent a
message. Non-repudiation prevents sender and vendor in a transaction or
communication activity from later falsely denying that the transaction
occurred.
N.B. As contrast to encryption scheme, digital signature does not provides the
confidentiality of the message.
Slide-9
Digital Signature Vs. Cryptosystem
 A digital signature needs a asymmetric-key
cryptosystem. The signer signs the message with her
private key; the verifier verifies it with the signer’s
public key.

Prepared by: K M Akkas Ali, Professor, IIT, JU


 A cryptosystem uses the private and public keys of the
receiver. On the other hand, a digital signature uses the
private and public keys of the sender.
 A digital signature does not provide confidential
communication. But a cryptosystem can provide the
confidentiality of a message.
 A cryptosystem can not provide the authenticity of the
message originator, but a digital signature can.

Slide-10
What is Hashing?
 Hashing is the transformation of a string of characters into a
usually shorter fixed-length value or key that represents the
original string.
 Hashing is a cryptographic technique that produces hash values

Prepared by: K M Akkas Ali, Professor, IIT, JU


using an algorithm or hash function for accessing data or for
security purposes.
 A hash value (or simply hash), also called a message digest, is a
number generated from a string of text. The hash is substantially
smaller than the text itself.
 In hashing, a fixed-length message digest is created out of a
variable-length message. The digest is normally much smaller than
the message.
 It plays a vital role in security system that creates a unique, fixed-
length signature for a message or data set.
 People commonly use them to compare sets of data. Since a hash
is unique to a specific message, even minor changes to that
message result in a dramatically different hash. Therefore it is
very resistant to tampering.

Slide-12
What is Hashing (cont…)
 Hashing also refers to a search technique or a method of accessing data records,
where search time is independent of the number of the elements in the
collection.
 Hashing is used to index and retrieve items in a database because it is faster to
find the item using the shorter hashed key than to find it using the original value.

Prepared by: K M Akkas Ali, Professor, IIT, JU


 For example, consider a list of names in a database:
 Rassel Akram
 Asif Afzal Khan
 Khan Ataus Samad
 Anuradha Mondol
 Each of these names would be the key in the database for that person's data. A
database search mechanism would first have to start looking character-by-
character across the name for matches until it found the match.
 But if each of the names were hashed, it might be possible to generate a unique
four-digit key or index for each name. So you might get something like:
 1345 Rassel Akram
 3097 Asif Afzal Khan
 4060 Khan Ataus Samad
 7350 Anuradha Mondol
 A search for any name would first consist of computing the hash value (using the
same hash function used to store the item) and then comparing for a match
using that value. This is much more efficient than searching through all the
records till the matching record is found. Because, to find a match across four
digits, each having only 10 possibilities is faster, than across an unpredictable
value length where each character had 26 possibilities.
Slide-13
Importance of Hashing

 Hashing is used to index and retrieve items in a database


because it is faster to find the item using the shorter hashed
key than to find it using the original value.

Prepared by: K M Akkas Ali, Professor, IIT, JU


 In addition to faster data retrieval, hashing is also used to
encrypt and decrypt digital signatures (used to authenticate
message senders and receivers).
 Hashing plays vital a role in security systems where it is used
to ensure that transmitted messages have not been tampered
with.
 The sender generates a hash of the message, encrypts it, and
sends it with the message itself. The recipient then decrypts
both the message and the hash, produces another hash from
the received message, and compares the two hashes. If they
are the same, there is a very high probability that the
message was transmitted intact.

Slide-14
Hash Function
 A hash function is a formula or an algorithm that-
 takes large data sets of variable length as input, and
 returns smaller data sets of fixed length as output.

 Since, the output is smaller than the input data, a hash

Prepared by: K M Akkas Ali, Professor, IIT, JU


function compresses an n-bit message string to create an m-
bit string where n is normally greater than m.
 The values returned by a hash function are called hash values,
hash codes, hash sums, checksums or simply hashes.
 Hash function creates hash value in such a way that it is
extremely unlikely that some other text will produce the same
hash value.

 A hash table (also called hash map) is used


to implement an associative array that can
map keys to values. A hash table uses a
hash function to compute an index into an
array of buckets or slots, from which the
correct value can be found.
Slide-14
Cryptographic Hash Function
 A cryptographic hash function is a hash function that takes an
arbitrary block of data as input and returns a fixed-size bit
string as output. The returned value is called the cryptographic
hash value.

Prepared by: K M Akkas Ali, Professor, IIT, JU


 Cryptographic hash function creates hash value in such a way
that any (accidental or intentional) change to the data will
change the hash value. Therefore, it is extremely unlikely that
some other text will produce the same hash value.
 Hash function or hash algorithm creates a unique digital
fingerprint of data which is called the message digest, hash
value or simply digest.
 Hash algorithm is primarily used for comparison purpose, not
for encryption.

Slide-15
Cryptographic Hash Function
 In cryptographic hash function, even a small changes in the input
would cause a large change in the output.
 Figure below shows how the slight changes input (here in the word
"over") drastically change the resulting output.

Prepared by: K M Akkas Ali, Professor, IIT, JU


Slide-16
Illustration: Cryptographic Hash Function
 An illustration of the potential use of a cryptographic hash is as
follows:
 Alice poses a tough math problem to Bob and claims she has solved it.
 Bob would like to try it himself, but would yet like to be sure that Alice

Prepared by: K M Akkas Ali, Professor, IIT, JU


is not bluffing. Therefore, Alice writes down her solution, computes its
hash and tells Bob the hash value (whilst keeping the solution secret).
Then, when Bob comes up with the solution himself a few days later,
Alice can prove that she had the solution earlier by revealing it and
having Bob hash it and check that it matches the hash value given to
him before.

Slide-17
Use of Hash Function
 Cryptographic hash functions have many information security
applications, such as in-
 digital signatures
 message authentication codes (MACs)

Prepared by: K M Akkas Ali, Professor, IIT, JU


 other forms of authentication

 Hash functions are primarily used to generate fixed-length


output data that acts as a shortened reference to the original
data. This is useful when the output data is too cumbersome
to use in its entirety.
 For example, consider a list of person’s names. Here, name of each
person is of variable length. Searching for a person's name in the list is
slow; time required to retrieve each name may also vary. But if each
name could be hashed to a fixed length integer, then searching and
retrieving each name will be performed in faster with constant time.

 Hash functions are also used to accelerate table lookup or data


comparison tasks such as finding items in a database,
detecting duplicated or similar records in a large file, finding
similar stretches in DNA sequences, and so on.

Slide-18
Hash Functions Used in Cryptography
 The two commonly used hash functions are MD5 and SHA-1.
 MD5:
 MD stands for Message Digest.

Prepared by: K M Akkas Ali, Professor, IIT, JU


 Several MD hash algorithms designed by Ron Rivest are MD2, MD4
and MD5.
 The last version MD5 is more secured than the previous versions.
 It divides the message into blocks of 512 bits and creates a 128-bit
digest.
 SHA-1:
 SHA stands for Secure Hash Algorithm.
 This standard was developed by NIST (National Institute of
Standards and Technology).
 This standard is mostly based on MD5.
 Several versions of SHA standard were realsed: SHA-1, SHA-224,
SHA-256, SHA-384 and SHA-512.
 SHA-1 returns a string of 160 bits.
 Both MD5 and SHA-1 hash functions are built with the Merkle-
Damgard construction.
Slide-19
Hash Functions Used in Cryptography
Merkle-Damgard Scheme:
 The Merkle-Damgard construction method takes an arbitrary
sized input and breaks the input into fixed size blocks of the
same size as the output. It applies a one way compression

Prepared by: K M Akkas Ali, Professor, IIT, JU


function to each of the blocks in turn, combining a block of
input with the output of the previous block. The last block has
bits representing the length of the entire message.
 A one way compression function takes two fixed size inputs - the key
and the plain text - and returns one single output - the cipher text
which is the same size as the plain text.
 An example of such a function is the Davis-Meyer compression function.
It feeds the previous hash value (Hi-1) as the plaintext to be encrypted.
It uses the each block of the message (m i) as the key. The output
ciphertext is then XORed with the previous hash value (H i-1) to produce
the next hash value (Hi). In the first round when there is no previous
hash value it uses a predefined inital value (H 0).

Slide-21
Application of Hash Function in Cryptography

Hash functions are used for:


 Verifying the integrity of message and file
 Verifying password for secure login

Prepared by: K M Akkas Ali, Professor, IIT, JU


 fingerprints of keys
 authentication
 digital signatures

 Verifying the integrity of files or messages:


 An important application of secure hashes is verification of
message integrity. Determining whether any changes have been
made to a message (or a file), for example, can be accomplished
by comparing message digests calculated before, and after,
transmission (or any other event).
 For this reason, most digital signature algorithms only confirm the
authenticity of a hashed digest of the message to be "signed".
Verifying the authenticity of a hashed digest of the message is
considered proof that the message itself is authentic.

Slide-21
Application of Hash Function in Cryptography
 Verifying password for secure login:
 A related application of hash function is password verification.
 Storing all user passwords as plaintext character can result in a massive
security breach if the password file is compromised.
 One way to reduce this danger is to only store the hash digest of each

Prepared by: K M Akkas Ali, Professor, IIT, JU


password instead of the plaintext password in the table (a file) that is
stored by user identification.
 Any user can read the contents of the file, but, because the hash
function is a one-way function, it is almost impossible to guess the
value of the password.
 When the password is created , the system hashes it and stores the
hash in the password file.
 When the user sends her user ID and password, the system creates a
hash of the password and then compare the hash value with the one
stored in the file.
 If there is a match, the user is granted access; otherwise, access is
denied.

Slide-22
Application of Hash Function in Cryptography
 File or data identifier:
 A message digest can also serve as a means of reliably identifying
a file;
 One of the main applications of a hash function is to allow the fast

Prepared by: K M Akkas Ali, Professor, IIT, JU


look-up of a data in a hash table. Being hash functions of a
particular kind, cryptographic hash functions lend themselves well
to this application too.

 Authentication:
 Authentication is the assurance that the communicating entity is
the one that it claims to be.
 Cryptographic hash function can be used for provide
authentication.

Slide-23
Application of Hash Function in Cryptography
 Digital Signature:
 Digital signature, first proposed in 1976 by Whitfield Diffie of
Stanford University, is a digital code (encrypted message digest)
that can be attached to an electronically transmitted message that

Prepared by: K M Akkas Ali, Professor, IIT, JU


uniquely identifies the sender.
 Like a written signature, the purpose of a digital signature is to
guarantee that the individual sending the message really is who he
or she claims to be. It is linked to the data in such a manner that if
the data is changed, the digital signature is invalidated.
 When making a digital signature, cryptographic hash functions are
generally used to construct the message digest.
 A digital signature servers three important purposes:
 Verifies data integrity.
 Provides authentication of the sender.
 Provides non-repudiation

Slide-24
Properties of Cryptographic Hash Function
 A desirable cryptographic hash function should have the following
properties:
 A hash function produces a fixed length value from a variable length source.
 It is easy to compute the hash value for any given message.
 Secure- Non-reversible function/ One-way function:

Prepared by: K M Akkas Ali, Professor, IIT, JU


 Pre-image resistance: Given a hash h, it should be difficult to find any
message m such that h = hash(m). That is, it is infeasible to generate a
message that has a given hash.
 A function with this property is called a one-way function.
 Functions that lack this property are vulnerable to preimage attacks.
 Second pre-image resistance: Given a message m1, it should be difficult
to find another message m2 such that m1 ≠ m2 and hash(m1) = hash(m2).
 Functions that lack this property are vulnerable to second-preimage
attacks.
 It is infeasible to modify a message without changing the hash.

Slide-25
Properties of Cryptographic Hash Function
 Collision resistance: It should be difficult to find two different messages m 1
and m2 with the same hash h. Such a pair is called a cryptographic hash
collision.
 This property is sometimes referred to as strong collision
resistance. It requires a hash value at least twice as long as that

Prepared by: K M Akkas Ali, Professor, IIT, JU


required for preimage-resistance; otherwise collisions may be
found by a birthday attack.
 A hash function must be referentially transparent, i.e., if called twice on
input that is "equal" (for example, strings that consist of the same sequence
of characters), it should give the same result.
 A hash procedure must be deterministic—meaning that for a given input
value, it must always generate the same hash value.
 Hash functions are destructive, as the original data is lost when hashed.
 A small change in the input m would cause a large change in the output of
the hash function.
 It should be impossible for an adversary to find two messages with
substantially similar digests; or to infer any useful information about the
data, given only its digest. Therefore, a cryptographic hash function should
behave as much as possible like a random function while still being
deterministic and efficiently computable.
 The above properties of a cryptographic hash function imply that a
malicious adversary cannot replace or modify the input data without
changing its digest. Thus, if two strings have the same digest, one can be
Slide-26 very confident that they are identical.
Simple Hash Function
Some Popular Hash Function:
Here are some relatively simple hash functions that have been
used:
 Division-remainder method

Prepared by: K M Akkas Ali, Professor, IIT, JU


 Mid-square method
 Folding method

Division-remainder method:
 Using this method, choose a number m that is larger than
the number n of keys in K (K is a set of keys). Generally,
the number m is chosen to be a prime number. The hash
function H is defined as:
H(k)= k (mod m) or, H(k)= k (mod m)+1
 Here k (mod m) denotes the remainder when k is divided by
m.
 The second formula is used when we want the hash
Slide-27
addresses to range from 1 to m rather than from 0 to m-1.
Simple Hash Function
Example: Division-remainder method:
Suppose a company with 68 employees assigned a 4-digit employee number
to each employee which is used as the primary key. Apply the division
method of hash function to each of the following employee number:

Prepared by: K M Akkas Ali, Professor, IIT, JU


3205, 7148, 2345
Solution:
 Since, there are 68 employees in the company, two digit employee
number is sufficient to represent them.
 Highest 2 digit number is 99 and 97 is the nearest 2 digit prime
number of 99. So, we divide each of the 4 digit employee number by
97.
H(3205)= 3205 (mod 97)= 04.
H(7148)= 7148 (mod 97)= 67
H(2345)= 2345 (mod 97)= 17
 In the case that the memory addresses begin with 01 rather than 00,
we choose that the function H(k) = k(mod m)+1 to obtain. H(3205)=
3205 (mod 97)+1= 4+1=05

Slide-28
Simple Hash Function
Mid-square method:
 Using this method, the key k is squared. Then the hash
function H is defined by:

Prepared by: K M Akkas Ali, Professor, IIT, JU


H(k)=l,
Where l is obtained by deleting digits from both ends of k 2.

Example: Mid-square method


Suppose a company with 68 employees assigned a 4-digit employee number
to each employee which is used as the primary key. Apply the mid-square
method of hash function to each of the following employee number:
3205, 7148, 2345
Solution:

K 3205 7148 2345


K2 10272025 51093904 5499025
H(k) = I 72 93 99

 Observe that the 4th and 5th digits counting from right are chosen for
Slide-29 the hash address.
Simple Hash Function
Folding method:
 Using this method, the key k is portioned into a number of parts, k 1, k2,
k3, …..kr, where each part, except possibly the last, has the same number
of digits as the required address. Then the parts are added together,
ignoring the last carry if any. That is:

Prepared by: K M Akkas Ali, Professor, IIT, JU


 H(k)=k1+k2+k3+…..+kr , where the leading-digit carries, if any, are
ignored.
Example: Folding method
Suppose a company with 68 employees assigned a 4-digit employee number to
each employee which is used as the primary key. Apply the folding method of
hash function to each of the following employee number:
3205, 7148, 2345

Solution:
Chop the key into two parts and then add them.
K 3205 7148 2345
H(k)=K1+k2 32+05=37 71+48=119 23+45=77
H(k) 37 19 77

 Observed that the leading digit from the 2nd function is ignored.
 Alternatively, reverse folding method may be used as:

Slide-30 H(3205)= 32+50=82


Message Authentication Code (MAC) Vs. Digital Signature
Is a message digest the same as a message authentication code?
 A message authentication code (MAC) is a short piece of
information used to authenticate a message.
 A MAC algorithm accepts as input a secret key and a message to be

Prepared by: K M Akkas Ali, Professor, IIT, JU


authenticated.
 It outputs a MAC, which is sometimes called a tag.

 The MAC value protects both a message's integrity as well as


its authenticity by allowing verifiers (who also possess the
same secret key) to detect any changes to the message
content.
 A message authentication code is different than a digital
signature.
 MAC values are both generated and verified using the same
secret key.
 While using MAC, sender and receiver of a message must agree on
keys before initiating communications. As is the case with private
key encryption.

 A message authentication code does not provide the


Slide-31
property of non-repudiation offered by digital signature.
Message Authentication Code (MAC) Vs. Hash Code
 MAC is a technique for message authentication which involves the use of a
secret key to generate from a small block of data, known as a message
authentication code, that is appended to the message.
 This technique assumes that two communicating parties, say Alice and
Bob, share a common secret key KAB. When Alice has a message to send
to Bob, she calculates the message authentication code as a complex
function of the message and the key: MACM = F(KAB, M).
 The message plus code 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 message authentication
code.
 The received code is compared
to the calculated code.

Slide-28
Message Authentication Code (MAC) Vs. Hash Code
 If we assume that only the receiver and the sender know the identity
of the secret key, and if the received code matches the calculated
code, then

1. The receiver is assured that the message has not been


altered.
 If an attacker alters the message but does not alter the code, then the
receiver’s calculation of the code will differ from the received code.
 Because the attacker is assumed not to know the secret key, the
attacker cannot alter the code to correspond to the alterations in the
message.

2. The receiver is assured that the message is from the alleged


sender.
 Because no one else knows the secret key, no one else could prepare
a message with a proper code.

3. If the message includes a sequence number (such as is used with


X.25, HDLC, and TCP), then the receiver can be assured of the
proper sequence, because an attacker cannot successfully alter
the sequence number.

Slide-29
Message Authentication Code (MAC) Vs. Hash Code
 An alternative to the message authentication code is the one-way
hash function.
 A hash function accepts a variable-size message M as input and
produces a fixed-size message digest H(M) as output. The purpose of
a hash function is to produce a “fingerprint” of a file, message, or
other block of data.
 Typically, the message is padded out to an integer multiple of some
fixed length (e.g., 1024 bits) and the padding includes the value of the
length of the original message in bits.
 Unlike the MAC, a hash function does not take a secret key as
input. To authenticate a message, the message digest is sent with the
message in such a way that the message digest is authentic.

Slide-30
Message Authentication Code (MAC) Vs. Hash Code
 Figure below illustrates three ways in
which the message can be
authenticated using a hash code.
 The message digest can be encrypted
using symmetric key encryption (part a); if
it is assumed that only the sender and
receiver share the encryption key, then
authenticity is assured.
 The message digest can also be encrypted
using public-key encryption (part b);
 Part c illustrate a technique, known as a
keyed hash MAC where authentication is
done without using encryption. It assumes
that two communicating parties, say A and
B, share a common secret key K which is
incorporated into the process of generating
a hash code.
 When A has a message to send to B, it calculates the hash function over the
concatenation of the secret key and the message: MDM = H(KMK). It then sends
[ MMDM] to B. Because B possesses K, it can recompute H(KMK) and verify MDM.
Because the secret key itself is not sent, it should not be possible for an attacker
to modify an intercepted message. As long as the secret key remains secret, it
should not be possible for an attacker to generate a false message.
Slide-31
Discussion Points

1. To be familiar with the general idea behind digital signature


2. To define security services provided by a digital signature

Prepared by: K M Akkas Ali, Professor, IIT, JU


3. To describe some applications of digital signatures
4. To introduce general ideas behind hash function
5. To discuss the usage and application of hash function
6. To know the desirable properties of a hash function

Slide-36
Slide-37
Thank you…
Have a question?

Prepared by: K M Akkas Ali, Professor, IIT, JU

You might also like