Department of CSE(Honors)
CRYPTANALYSIS & CYBER
DEFENSE
Topic:
SECURE HASH ALGORITHM
(SHA-512)
Session -25
CREATED BY K. VICTOR BABU
AIM OF THE SESSION
Demonstrate hash algorithm like Secure Hash Algorithm (SHA-512).
INSTRUCTIONAL
OBJECTIVES
The objective of this session is to introduce the basic concepts of Hash Functions. It provides the necessary
theoretical background and demonstrates attacks on hash functions.
LEARNING OUTCOMES
At the end of this session, you should be able to:
Demonstrate SHA-512 hash algorithm.
CREATED BY K. VICTOR BABU
Module Description
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
This session starts with the introduction of SHA-512. It
illustrates block diagram of SHA-512 and the
operations being carried in a single round of SHA-512
in detail.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
The algorithm outputs a 512-bit message digest from an input
message with a maximum length of less than 2128 bits. 1024-bit
blocks of the input are processed at once.
a. Append Padding Bits: The message is padded to make it
exactly 896 modulo 1024 in length. Even if the message is of the
desired length, padding is always applied. The range of padding
bits is therefore from 1 to 1024. A single 1 bit precedes the
necessary amount of 0 bits in the padding.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
b.Append Length: The message has a block of 128 bits
added to it.The most significant byte is placed first in this
block, which is interpreted as an unsigned 128-bit integer
and contains the length of the original message (before
padding).
The result of the first two stages is a message with a length
that is an integer multiple of 1024 bits.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
c.Initialize hash buffer. The hash function's intermediate and
final results are stored in a 512-bit buffer.Eight 64-bit registers
(designated as a, b, c, d, e, f, g, and h) can be used to
represent the buffer. The following 64-bit numbers
(represented in hexadecimal values) are used as the registers'
initial values:. Big-endian format, which places the most
important byte of a word at the low-address (leftmost) byte
position, is how these values are stored.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
d. Process message in 1024-bit (128-word) blocks: The heart
of the algorithm is a module that consists of 80 rounds.
e. Output. After all 1024-bit blocks have been processed, the
output from the th stage is the 512-bit message digest.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
1 SHA-512 Block Diagram
Note: Copyrights of this diagram are reserved for original author
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
• Each round updates the contents of the buffer using the 512-bit buffer value
abcdefgh as input.
• The intermediate hash value Hi-1 is present in the buffer at the start of the first
round. Each round t uses a 64-bit value Wt that is taken from the 1024-bit block that
is currently being processed.
• These values are obtained using the message scheduling that is detailed below.
Additionally, an additive constant Kt is utilized for each of the 80 rounds.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
• The first 64 bits of the cube roots of the first 80 prime numbers are
represented by these words. A "randomized" set of 64-bit patterns are
provided by the constants, which should get rid of any regularities in the
input data.
• The result is created by adding the input from the first round Hi-1 to the
output of the eighty-first round. Using addition modulo 264, each of the
eighth words in the buffer is separately added to each of the corresponding
words in Hi-1.
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
SHA-512 Processing of a Single 1024 Bit Block
Note: Copyrights of this diagram are reserved for original author
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Secure Hash Algorithm (SHA-512)
Single Round Processing of SHA-512
Note: Copyrights of this diagram are reserved for original author
CREATED BY K. VICTOR BABU
SESSION DESCRIPTION
Activities (One Minute Paper):
• 1. State the value of the padding field in SHA-512 if the length of the message is
• a. 1919 bits
• b. 1920 bits
• c. 1921 bits
• 2. State the value of the length field in SHA-512 if the length of the message is
• a. 1919 bits
• b. 1920 bits
• c. 1921 bits
CREATED BY K. VICTOR BABU
Summary
SHA-512 is a trusted and extensively used cryptographic hash function, to sum
up. It offers robust security features, a huge hash size, and a wide range of
applications in different security systems. However, it is crucial to take into
account the particular needs and potential weaknesses related to its
execution.
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
1. Abbreviate SHA-512
a) Secure Hash Algorithm 512
b) Secure Hashing Algorithm 512
c) Strong Hash Algorithm 512
d) Secure Hash Function 512
2. How long is the output hash value generated by SHA-512?
a) 256 bits
b) 384 bits
c) 512 bits
d) 1024 bits
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
3. What family is SHA-512 a member of?
a) SHA-1
b) SHA-2
c) SHA-3
d) MD5
4. What kinds of attacks is SHA-512 intended to withstand?
a) Birthday attacks
b) Collision attacks
c) Side-channel attacks
d) Differential attacks
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
5. What is the maximum length of input that SHA-512 can handle?
a) Up to 128 bits
b) Up to 256 bits
c) Up to 512 bits
d) Arbitrary length
6. Which family of cryptographic hash methods does SHA-512 belong to?
a) SHA-1
b) SHA-2
c) SHA-3
d) MD5
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
7. What is the SHA-512 output size?
a) 128 bits
b) 256 bits
c) 384 bits
d) 512 bits
8. How many compression rounds does SHA-512 employ?
a) 64 rounds
b) 80 rounds
c) 128 rounds
d) 256 rounds
CREATED BY K. VICTOR BABU
SELF-ASSESSMENT QUESTIONS
9. What size blocks are used when SHA-512 is used?
a) 128 bits
b) 256 bits
c) 512 bits
d) 1024 bits
10. Which statement regarding padding in SHA-512 is accurate??
a) It adds a '0' bit followed by a '1' bit.
b) It adds a '1' bit followed by zeros.
c) It adds a '1' bit followed by the original message
length.
d) It adds a '0' bit followed by the original message
length.
CREATED BY K. VICTOR BABU
TERMINAL QUESTIONS
1. Demonstrate Single block processing of SHA-512
2. Illustrate Single Round Operations of SHA-512
3. Summarize the steps involved in generating Hash Code using SHA 512.
4. What is the difference between little-endian and big-endian format?
5. What basic arithmetical and logical functions are used in SHA?
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