Department of CSE-
Honors
CRYPTANALYSIS & CYBER
DEFENSE
Topic:
TWO SIMPLE HASH
FUNCTIONS
Session -23
CREATED BY K. VICTOR BABU
AIM OF THE
SESSION
Understand the basic concepts of Hash Functions and simple Hash Functions.
INSTRUCTIONAL
OBJECTIVES
The objective of this session is to introduce the basic concepts of Hash Functions. It provides the
necessary theoretical background and demonstrates simple Hash Functions.
LEARNING OUTCOMES
At the end of this session, you should be able to:
Apply simple Hash Functions
CREATED BY K. VICTOR BABU
Module Description
AGENDA
This module defines Hash function. Applications of Hash algorithms are
also discussed in this module. Secure Hash Algorithm (SHA 512)
algorithms are demonstrated. Calculating Hash value using two simple
hash functions is also discussed. Similarly MD5 is also discussed.
CREATED BY K. VICTOR BABU
SESSION INTRODUCTION
AGENDA
This session describes the concepts of Hash functions and applications of hash functions.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Hash Function 1 (Bit-by-Bit XOR Operation)
The input is seen as a series of n-bit blocks, including messages, files, etc. An
n-bit hash function is created by iteratively processing each block of the
input. The bit-by-bit exclusive-OR (XOR) of each block is one of the most
basic hash functions. This can be said to be
Ci = bil XOR bi2 XOR…….bim
Ci = ith bit of hash code
m= no. of n-bit blocks in the input
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Hash Function 2
The simplest method to make things better is to rotate or shift the hash
value by one bit after each block is processed. The following is a
summary of the process.
1. Start off by setting the n-bit hash value to 0.
2. Execute the subsequent instructions on each n-bit block of data:
a. Rotate the current hash value one bit to the left.
b. XOR the block with the hash number.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Hash Function Based on Cipher Block Chaining
(CBC) Mode
Divide a message into fixed-size blocks M1,M2,……..MN and use a
symmetric encryption system such as DES to compute the hash code as
H0= Initial Value
Hi= E(Mi, Hi-1)
G=HN
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Examples
• 1. Consider the message 101110110000111110101111. Divide the message
into 3 blocks and compute the hash value uing bit-by-bit XOR Operation.
• 2. Consider the message 101110110000111110101111. Divide the message
into 3 blocks and compute the hash value using the following equations
• H0= Initial Value
• Hi= E(Mi, Hi-1)
• G=HN
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
1. Which of the following statements best sums up a basic hash function?
a) A hash function with a fixed output size
b) A hash function that uses basic arithmetic
operations
c) A hash function designed for basic data integrity
checks
d) A hash function without collision resistance
2. What is the main function of a simple hash function?
a) Generating unique hash values for data
b) Encrypting sensitive information
c) Compressing data to reduce storage space
d) Performing complex mathematical calculations
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
3. Which of the following claims regarding the output size of a simple hash function is true?
a) It is smaller than the input
size
b) It is larger than the input
size
c) It is the same as the input
size
d) It can vary based on the
input size
4. Which characteristic of cryptographic hash functions does the simple
hash function lack?
a) Deterministic output
b) Preimage resistance
c) Collision resistance
d) Avalanche effect
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
5. Which one of the following is a simple hash function example?
a) MD5
b) SHA-1
c) CRC32
d) HMAC
6. Which of the following uses simple hash functions frequently?
a) Data encryption for secure communication
b) Secure password storage
c) Digital signatures for authentication
d) Basic data integrity checks
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
7. What could go wrong if you use a straightforward hash function without collision resistance?
a) Increased computational complexity
b) Increased risk of data corruption
c) Weaker security against malicious attacks d
d) Slower data processing speed
8. Which of the subsequent processes is frequently used in basic hash
functions?
a) Bitwise XOR
b) Modular arithmetic
c) Bit shifting
d) All of the above
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
9. The hash value is frequently used as a/an in simple hash functions:
a) Encryption key
b) Data compression algorithm
c) Identifier or index for data storage
d) Authentication token
10. A simple hash function's design is more concerned with:
a) Computational efficiency
b) Cryptographic security
c) Data compression ratio
d) Input flexibility and versatility
CREATED BY K. VICTOR BABU
SUMMARY
Basic algorithms known as simple hash functions create a fixed-size hash value or
digest from an input. They are frequently used for indexing and simple data integrity
checks. These hash functions frequently make use of modular arithmetic, bitwise
operations, and fundamental arithmetic operations. They lack the sophisticated security
characteristics seen in cryptographic hash functions, such as preimage and collision
resistance. Simple hash functions typically provide outputs that are smaller than their
inputs.
CREATED BY K. VICTOR BABU
TERMINAL QUESTIONS
1. Summarize bit-by-bit XOR operation of hash function.
2. Enumerate Simple Hash functions
3. Consider the message 010001011111000010110011. Divide the message into 3 blocks and
compute the hash value uing bit-by-bit XOR Operation.
4. Consider the message 010001011111000010110011. Divide the message into 3 blocks and
compute the hash value using the following equations
H0= Initial Value
Hi= E(Mi, Hi-1)
G=HN
5. Summarize hash function using CBC Mode of operation.
CREATED BY K. VICTOR BABU
REFERENCES FOR FURTHER LEARNING OF
THE SESSION
1. Cryptography and Network Security Principles and Practice, by William
stallings, Pearson, 5th edition.
2.Applied Cryptography: Protocols, Algorthms, and Source Code in C , by Bruce
Schneier, Second Edition , John Wiley & Sons, Inc., 2015.
3.Applied Cryptography for Cyber Security and Defense: Information Encryption
and Cyphering, by Hamid R. Nemati and Li Yang, IGI Global, 2011
4.Forouzon B, “Cryptography and Network Security,” Indian Edition, TMH
(2010).
CREATED BY K. VICTOR BABU
THANK YOU
Team – CACD
CREATED BY K. VICTOR BABU