0% found this document useful (0 votes)
112 views

SHA512

Yyy

Uploaded by

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

SHA512

Yyy

Uploaded by

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

SECURE HASH ALGORITHM (SHA)

• In recent years, the most widely used hash function has been the Secure Hash Algorithm
(SHA).
• SHA was developed by the National Institute of Standards and Technology (NIST) and
published as a federal information processing standard (FIPS 180) in 1993. When
weaknesses were discovered in SHA, now known as SHA-0, a revised version was issued
as FIPS 180-1 in 1995 and is referred to as SHA-1.
• The actual standards document is entitled “Secure Hash Standard.” SHA is based on the
hash function MD4, and its design closely models MD4. SHA-1 is also specified in RFC
3174, which essentially duplicates the material in FIPS 180-1 but adds a C code
implementation.
• SHA-1 produces a hash value of 160 bits. In 2002, NIST produced a revised version of
the standard, FIPS 180-2, that defined three new versions of SHA, with hash value
lengths of 256, 384, and 512 bits, known as SHA-256, SHA-384, and SHA-512,
respectively. Collectively, these hash algorithms are known as SHA-2
• The algorithm takes as input a message with a maximum length of less than 2128 bits and
produces as output a 512-bit message digest. The input is processed in 1024-bit blocks.
• Figure depicts the overall processing of a message to produce a digest. This follows the
general structure depicted in Figure.

• The processing consists of the following steps:


PROCESSING OF SHA
• Step 1
• Append padding bits. The message is padded so that its length is congruent to
896 modulo 1024 [length≡896(mod 1024)]. Padding is always added, even if the
message is already of the desired length.
• Thus, the number of padding bits is in the range of 1 to 1024.
• The padding consists of a single 1 bit followed by the necessary number of 0 bits.
• Step 2
• Append length. A block of 128 bits is appended to the message.
• This block is treated as an unsigned 128-bit integer (most significant byte first)
and contains the length of the original message (before the padding).
• The outcome of the first two steps yields a message that is an integer multiple of
1024 bits in length.
• In Figure, the expanded message is represented as the sequence of 1024-bit blocks
M1,M2,..MN, so that the total length of the expanded message is Nx1024 bits.
• Step 3
• Initialize hash buffer. A 512-bit buffer is used to hold intermediate and final
results of the hash function.
• The buffer can be represented as eight 64-bit registers (a, b, c, d, e, f, g, h). These
registers are initialized to the following 64-bit integers (hexadecimal values):
a = 6A09E667F3BCC908 e = 510E527FADE682D1
b = BB67AE8584CAA73B f = 9B05688C2B3E6C1F
c = 3C6EF372FE94F82B g = 1F83D9ABFB41BD6B
d = A54FF53A5F1D36F1 h = 5BE0CD19137E2179
• These values are stored in big-endian format, which is the most significant byte
of a word in the low-address (leftmost) byte position. These words were obtained
by taking the first sixty-four bits of the fractional parts of the square roots of the
first eight prime numbers.
• Step 4
• Process message in 1024-bit (128-word) blocks. The heart of the algorithm is a
module that consists of 80 rounds; this module is labeled F in Figure.
• The logic is illustrated in the next Figure.
• Each round takes as input the 512-bit buffer value, a b c d e f g h, and updates the
contents of the buffer.
• At input to the first round, the buffer has the value of the intermediate hash value,
Hi-1. Each round t makes use of a 64-bit value Wi, derived from the current 1024-
bit block being processed (Mi).
• These values are derived using a message schedule described subsequently. Each
round also makes use of an additive constant Kt, where 0<=t<=79 indicates one of
the 80 rounds. These words represent the first 64 bits of the fractional parts of the
cube roots of the first 80 prime numbers.
• The constants provide a “randomized” set of 64-bit patterns, which should
eliminate any regularities in the input data. Table shows these constants in
hexadecimal format (from left to right).
• Step 5
• Output.
• After all N 1024-bit blocks have been processed, the output from the Nth stage is
the 512-bit message digest.
• We can summarize the behavior of SHA-512 as follows:

Where,

Reference :William Stallings, Cryptography and Network Security: Principles and Practice, PHI 3rd Edition, 2006
SHA-512 PROCESSING OF A SINGLE 1024-BIT BLOCK

SHA-512 ROUND FUNCTION


• Let us look in more detail at the logic in each of the 80 steps of the processing of one
512-bit block (Figure). Each round is defined by the following set of equations:
Reference :William Stallings, Cryptography and Network Security: Principles and Practice, PHI 3rd Edition, 2006

Two observations can be made about the round function.


1. Six of the eight words of the output of the round function involve simply
permutation (b,c,d,f,g,h) by means of rotation. This is indicated by shading in
Figure.
2. Only two of the output words ( a, e) are generated by substitution. Word e is a
function of input variables (d,e,f,g,h), as well as the round word Wt and the constant
Kt. Word a is a function of all of the input variables except d, as well as the round
word Wtand the constant Kt.
ELEMENTARY SHA-512 OPERATION (SINGLE ROUND)

Reference :William Stallings, Cryptography and Network Security: Principles and Practice, PHI 3rd Edition, 2006
CREATION OF 80-WORD INPUT SEQUENCE FOR SHA-512 PROCESSING OF
SINGLE BLOCK

o
Reference :William Stallings, Cryptography and Network Security: Principles and Practice, PHI 3rd Edition, 2006

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy