SHA-3 Algorithm

What is a hash function?

Today, information security has become an integral part of any digital operation. The key role in information security is played by the concept of a cryptographic function. Cryptographic hash functions are a dedicated class of hash functions that has certain properties that make it suitable for use in cryptography.





The transformation performed by the hash function is called hashing. The original data is called an input array, "key" or "message". The transformation result (output data) is called "hash", "hash code", "hash sum".





In other words, a hash function is a computational technique that can map an undefined size of data to a fixed size of data. Or, more simply, the conversion outputs a numeric value that is characterized by the input data. A cryptographic hash function uses irreversible (one-way) mathematical functions to generate a hash value from the input. One of the common ways to generate cryptographic hashes is by using block ciphers.





Cryptographically reliable hash functions must meet the following basic requirements:





  1. The hash function must be a one-way function i.e. by the image (hash) it is impossible or almost impossible to find the original preimage (message).





  2. The hashing function must be collision resistant. A collision is a pair of original messages that have the same output value. It is believed that the relatively fast finding of a collision in a hashing algorithm makes such an algorithm unreliable from the point of view of cryptanalysis.





Let's move on to a detailed look at one of the most secure and efficient hashing algorithms today.





What is SHA-3?

SHA-3 , . -, MD5, RIPEMD, SHA-0, SHA-1 SHA-2 .





SHA-3 (Keccak) – , 2012 . 5 2015 FIPS 202. Keccak SHA-3 2012 . [1] Keccak Sponge (), -, — , MD(x).





MD(x) OR, XOR, AND, NOT. , . , MD(x) - , .





— .





- SHA-3 :





1 :

. , , ( ), .





, , , , , Keccak .





b = 25 * 2 ^ lb = state \ size  value \ of \ l = \ {0, 1, 2, 3, 4, 5, 6 \} value \ of \ b = \ {25, 50, 100, 200, 400, 800, 1600 \}





SHA-3 l 6. , , . , "l", , .





rounds = 12 + 2 * l

rounds = 12 + 12 = 24;  as l = 6

24 \ rounds \ in \ total





, SHA-3 1600 , - 24.





, , .





, "r" -.





‘1", "0". " n " , n \ * \ r . :





p = n * r;

p = length \ of \ message \ after \ padding

n = number\ of\ parts\ in\ which\ we\ divide\ 'p'

r =\ length\ of\ the\ rate





2 :

r ' ' c ' 1600, .





, "r" .(P n r: P0,P1,…,Pn-1)





, , «» (. rate) r, , / , «» (. capacity) c.





: “” “”.





3 :

Pi b (b=r+c) 2 S b. S . — , .





. , SHA-3, «» (XOR), «» (AND) (NOT). - 2. w=2^l(l=6) →w=64 S A 5×5×5.





A[i][j][k] (5i+j)×w+k S





\{θ, ρ, π, χ, ι\} .





A A':





:

i k , 0≤?<5,0≤?<?,





C(i,k) = A[i,0,k]  \oplus A[i,1,k]  \oplus A[i,2,k]  \oplus A[i,3,k]  \oplus A[i,4,k]

D(i, k) = C[(i - 1)\ mod\ 5, k]\ \oplus \ C[(i + 1)\ mod\ 5, (k - 1)\ mod \ w]

(i,j,k) 0≤i<5,0≤j<5,0≤k<W:

A'[i,j,k]=a[i,j,k]\ \oplus \ D[i,k]





:

k, , 0≤k<w:\ A′[0,0,k]=A[0,0,k]

(i,j)=(1,0). t 0 23:





  1. k, 0 ≤k<w, A'[i,j,k]=A[i,j,(k-(t+1)(t+x)/2)\ mod \ w]





  2. (i, j) = (j, (2i+3j)\ mod \ 5)





:

(i,j,k), , 0≤i<5,0≤j<5,0≤k<w:\ A′[i,j,k]=A[(i+3j)\ mod\ 5,i,k]





:

(i,j,k), , 0≤i<5,0≤j<5,





A'[i,j,k]=A[i,j,k]\ \oplus\ ((A[(i+1)\ mod\ 5, j, k]\oplus1)\ *\ A[(i+2)\ mod\ 5,j,k])





:

rc(t), - t





rc(t) :





  1. t\ mod\ 255=0, 1





  2. R=[10000000]





  3. t 1 255:





    1. R = 0\ ||\ R





    2. R[0]=R[0]\ \oplus\ R[8]





    3. R[4]=R[4]\ \oplus\ R[8]





    4. R[5] =R[5]\ \oplus\ R[8]





    5. R [6] = R [6] \ \ oplus \ R [8]





    6. R = Trunc_8 [R]





  4. R [0]





:

i_r-





  1. (i, j, k), , 0≤i <5, 0≤j <5, 0≤l <w: \ A '[i, j, k] = A [i, j, k]





  2. RC- w,





  3. i 0 l: RC [2 ^ i-1] = rc (i + 7i_r)





  4. A ' S ' b





:

  1. S A





  2. i_r 12 + 2l-n_r 12 + 2l-1: \ A '= ι (χ (π (ρ (θ (A)))), i_r)





  3. A ' S ' b





4 :





d( d— -), r S S . d .





d





SHA-3

- Keccak SHA-3 2008 [5]. 2012 Keccak SHA-3. SHA-3 - c (XOFs) SHAKE128 SHAKE256, Keccak.





Keccak, , . Keccak- Keccak -224 KECCAK -256, 4 , Dinur l.[3] 2012 [4]. 5- KECCAK -256. 4. Keccak, Keccak challenge [6] . 160 80 4 (state size 1 ) , 12 .. l 0 1 . 2^80 . , 4 SHA-3, . Dinur l. KECCAK -256 2 ^ {115} . , SHA-3, 5 .





32 AMD. [2]





Keccak, χ f. SHA-3 , , 2 ^ 2 - . ≤r-2 , (r − 1)- 1,





, , . , , 4, χ .





( ) χ Keccak. , r − 1 Keccak-f ( ).





c = br , , “” r − 1. .





, . .





, Sbox . , .





SHAKE128 (M, x)- SHA-3, Keccak [r = 1344, c = 256], X(SHA3-X 1) SHAKE128 (M, 128), SHAKE128 .





[7]





a [i, j] i=0,2 j=0,1,2,3 , , . 10. A [0, 4] , M . - . , , :





[7]





6×64 , , 2 ^ {128}. , , 128- -.





64 , 0.75 ^ {64} = 2 ^ {- 26.6}. 2 ^ {26.6} , A [0.4]. , 2 ^ {26.6}





In general, the collision search results and the described preimage attack show that today the SHA-3 / Keccak algorithm is one of the safest and most efficient hashing algorithms. Some argue that it won't be hacked in the next 20-30 years. The advancement in the world of quantum computing may shorten this time frame, but so far this algorithm is still one of the best hashing algorithms that humanity has at the moment.












All Articles