[Draft]Hash -V2 Sh3 Not Completed+Application
[Draft]Hash -V2 Sh3 Not Completed+Application
Learning Objectives
Divide the message/data into M n-bit sequence then xor all bits of a block
to produce a bit in hash
ℎ𝑖 = 𝑏𝑖,1 ⊕ 𝑏𝑖,2 ⊕ ⋯ ⊕ 𝑏𝑖,𝑀 where 𝐻 𝑀 = [ℎ1 , ℎ2 , … , ℎ𝑛 ]
Why is it insecure?
Ordering doesn’t affect the result.
Secure Hash Function Requirements
Requirement Description
Variable input size H can be applied to a block of data of any size.
Fixed output size H produces a fixed-length output.
Efficiency H(x) is relatively easy to compute for any given x,
making both hardware and software
implementations practical.
Preimage resistant (one-way For any given hash value h, it is computationally
property) infeasible to find y such that H(y) = h.
Second preimage resistant For any given block x, it is computationally infeasible
(weak collision resistant) to find y ≠ x with H(y) = H(x).
Collision resistant (strong It is computationally infeasible to find any pair (x, y)
collision resistant) with x ≠ y, such that H(x) = H(y).
Pseudorandomness Output of H meets standard tests for
pseudorandomness.
Hash Requirements Per Application
Brute-Force Attacks
Suppose that ℎ = 𝐻(𝑥) = 𝑚 (i.e. 𝑚 is the bit length of the hash result ℎ), Then the
level of effort for conducting brute-force attack it depends on the purpose of the
attack
Preimage attack: 𝟐𝒎
Pick a value 𝑥 at random and try to find another value 𝑦 such that 𝐻 𝑥 = 𝐻 𝑦
Collision Resistant Attack: 𝟐𝒎/𝟐
an adversary wishes to find two messages or data blocks, x and y, that yield the same
hash function
Birthday paradox: If we choose random variables from a uniform distribution in the range
0 through 𝑁 − 1, then the probability that a repeated element is encountered exceeds
0.5 after 𝑁 choices have been made.
A Letter in 238
Variations
Brute-Force Attack | MD5
𝑎 = 6𝐴09𝐸667𝐹3𝐵𝐶𝐶908 𝑒 = 510𝐸527𝐹𝐴𝐷𝐸682𝐷1
𝑏 = 𝐵𝐵67𝐴𝐸8584𝐶𝐴𝐴73𝐵 𝑓 = 9𝐵05688𝐶2𝐵3𝐸6𝐶1𝐹
𝑐 = 3𝐶6𝐸𝐹372𝐹𝐸94𝐹82𝐵 𝑔 = 1𝐹83𝐷9𝐴𝐵𝐹𝐵41𝐵𝐷6𝐵
𝑑 = 𝐴54𝐹𝐹53𝐴5𝐹1𝐷36𝐹1 ℎ = 5𝐵𝐸0𝐶𝐷19137𝐸2179
SHA-512
Constants K
SHA-512 | Single Round Operation
512
𝑇1 = ℎ + 𝐶ℎ(𝑒, 𝑓, 𝑔) + 𝑒 + 𝑊𝑡 + 𝐾𝑡
1
512
𝑇2 = 𝑎 + 𝑀𝑎𝑗 𝑎, 𝑏, 𝑐
0
ℎ = 𝑔, 𝑔 = 𝑓, 𝑓 = 𝑒, 𝑒 = 𝑑 + 𝑇1
, 𝑑 = 𝑐, 𝑐 = 𝑏, 𝑏 = 𝑎, 𝑎 = 𝑇1 + 𝑇2
+ = addition modulo 264
SHA-512 | 𝑊𝑡 , 0 ≤ 𝑡 < 80
Suppose you want to hash the message “abc” then the SHA-512 algorithm
prepares the message for processing as follows:
“abc” Padding
61 62 63 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18
Message Length
SHA-3