0% found this document useful (0 votes)
12 views18 pages

Hashing SHA

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

Hashing SHA

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

Cryptographic

Hash Functions
PROBABILITY OF HASH COLLISIONS

• Arbitrary length message -> Fixed length hash -


> Many messages will map to the same hash
• Given 1000 bit messages ->2^1000 messages
• 128 bit hash ->2^128 possible hashes
• 2^1000/2^128 = 2^872 messages/hash value
• n-bit hash-> Need avg 2^n/2 tries to find two
messages with same hash
• 64 bit hash ->2^32 tries (feasible)
• 128 bit hash ->2^64 tries (not feasible)
12.1.2 Continued
SHA-512

SHA-512 is the version of SHA with a 512-bit message


digest. This version, like the others in the SHA family
of algorithms, is based on the Merkle-Damgard
scheme.
Introduction

Message digest creation SHA-512


Continued

Message Preparation
SHA-512 insists that the length of the original message
be less than 2128 bits.

Note
SHA-512 creates a 512-bit message digest out of a
message less than 2128.
Continued

Padding and length field in SHA-512


Continued

Words

A message block and the digest as words

Each message block is taken through 80 rounds of processing.


Continued

Word Expansion
Word expansion in SHA-512
Continued

Message Digest Initialization


Compression Function
Figure Compression function in SHA-512
12.2.2 Continued
Structure of each round in SHA-512
Continued
Majority Function

Conditional Function

Rotate Functions
12.2.2 Continued
Continued

There are 80 constants, K0 to K79, each of 64 bits. Similar


These values are calculated from the first 80 prime
numbers (2, 3,…, 409). For example, the 80th prime is
409, with the cubic root (409)1/3 = 7.42291412044.
Converting this number to binary with only 64 bits in the
fraction part, we get

The fraction part: (6C44198C4A475817)16


Continued

Example 12.7
We apply the Majority function on buffers A, B, and C. If the
leftmost hexadecimal digits of these buffers are 0x7, 0xA, and 0xE,
respectively, what is the leftmost digit of the result?
Solution
The digits in binary are 0111, 1010, and 1110.
a. The first bits are 0, 1, and 1. The majority is 1.
b. The second bits are 1, 0, and 1. The majority is 1.
c. The third bits are 1, 1, and 1. The majority is 1.
d. The fourth bits are 1, 0, and 0. The majority is 0.

The result is 1110, or 0xE in hexadecimal.


Continued

Example 12.8
We apply the Conditional function on E, F, and G buffers. If the
leftmost hexadecimal digits of these buffers are 0x9, 0xA, and 0xF
respectively, what is the leftmost digit of the result?
Solution
The digits in binary are 1001, 1010, and 1111.
a. The first bits are 1, 1, and 1. The result is F1, which is 1.
b. The second bits are 0, 0, and 1. The result is G2, which is 1.
c. The third bits are 0, 1, and 1. The result is G3, which is 1.
d. The fourth bits are 1, 0, and 1. The result is F4, which is 0.

The result is 1110, or 0xE in hexadecimal.


Analysis

With a message digest of 512 bits, SHA-512 expected to


be resistant to all attacks, including collision attacks.

You might also like