Download presentation
Presentation is loading. Please wait.
1
Verilog Implementation of SHA 256 ALGORITHM
Presented by Under the guidance of Mr. Mahesh Varma Sir M.Ayyappa K.Srilakshmi kannamma P.Priyanka S.Gangadhar N.Madhu
2
ABSTRACT : The continued growth of both wired and wireless communications has increased dramatically the amount of the transmitted data. Due to this providing information security has become a more and more important subject. In order to solve these security problems, lots of research and development activities are carried out and has triggered the revolution for the generation of new cryptographic algorithms. On August 26, 2002, NIST announced the Secure Hash Standard 2 which introduces the specifications of three new Secure Hash Algorithms, SHA-2 (256, 384 and 512).The Verilog implementation of SHA-256 are proposed in this work.
3
HASH FUNCTION: These functions are sort of operations that take an arbitrary length of input and produce a condensed representation of that input. This condensed representation of an arbitrary long input is usually referred as message digest or hash value. The size of the message digest is fixed depending on the particular hash function being used. The security of a hash function is directly related to this message digest length.
4
PROPERTIES OF HASH FUNCTION:
1. Pre-image Resistance : It means that for all predefined hash values it is computationally very hard to find an input having that particular hash value. 2. Second Pre-image Resistance : It means that given an input, it is computationally very hard to find another input such that both inputs have the same hash value. 3. Collision Resistance : It means that it is computationally very difficult to find two inputs having the same hash value.
5
SECURE HASH FAMILY STANDARD 2 (SHA-2):
The SHA-2 standard supersedes the existing SHA-1,adding three new hash functions, SHA-2(256,384,512), for computing a condensed representation (message digest) of electronic data. The produced message digest ranges in length from 256 to 512-bits, depending on the selected hash function each time. The three new hash functions, specified in this standard, are called secure because for each one of them, it is computationally infeasible.
6
SHA 256: SHA stands for Secure Hash Algorithm is one of a number of cryptographic hash functions. In 2002, SHA-2 variants SHA-256, SHA-384, and SHA-512 published. SHA-256 is one-way hash function that can process a message to produce a condensed representation called a message digest. SHA-2 includes a significant number of changes from its predecessor, SHA-1.
7
BASIC PROPERTIES OF SHAS:
Algorithm Message Size (bits) Block Size Word Size Message Digest Size Operations SHA-1 < 2^64 512 32 160 +,and,or,xor,rot SHA-256 256 +,and,or,xor,shr,rot SHA-384 < 2^128 1024 64 384 SHA-512
8
SHA 256 Algorithm Structure
Pre Processing Hash Computation
9
GENERAL HASH COMPUTATIONAL FLOW :
10
SHA 256 ALGORITHM FLOW: Initialize Variables: first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19) ::::::h[0..7]: 6a09e667, bb67ae85, 3c6ef372, a54ff53a, 510e527f, 9b05688c, 1f83d9ab, 5be0cd19
11
Initialize Table Of Round Constants :
(first 32 bits of the fractional parts of the cube roots of the first 64 primes ):: k[0..63] : 428a2f98, , b5c0fbcf, e9b5dba5, 3956c25b, 59f111f1, 923f82a4, ab1c5ed5, d807aa98, 12835b01, be, 550c7dc3, 72be5d74, 80deb1fe, 9bdc06a7, c19bf174, e49b69c1, efbe4786, 0fc19dc6, 240ca1cc, 2de92c6f, 4a7484aa, 5cb0a9dc, 76f988da, 983e5152, a831c66d, b00327c8, bf597fc7, c6e00bf3, d5a79147, 06ca6351, , 27b70a85, 2e1b2138, 4d2c6dfc, 53380d13, 650a7354, 766a0abb, 81c2c92e, 92722c85, a2bfe8a1, a81a664b, c24b8b70, c76c51a3, d192e819, d , f40e3585, 106aa070, 19a4c116, 1e376c08, c, 34b0bcb5, 391c0cb3, 4ed8aa4a, 5b9cca4f, 682e6ff3, 748f82ee, 78a5636f, 84c87814, 8cc70208, 90befffa, a4506ceb, bef9a3f7, c67178f2
12
PRE PROCESSING: STEPS: Take Input Message Of Length “l” Bits. Append “1” To Input Message Calculate “K” using equation K=[448-l-1] && Then Append K Number Of Zeros To Get 448 Length Take Binary Representation Of “l” As 64 Bit Length Finally Append This 64 Bit To Message To Get Required 512 Bit Length Divide This 512 Bit Length Into 16 Input Words for i=0 to 15.
13
w[i] := w[i-16] + s0 + w[i-7] + s1
Extend the sixteen 32-bit words into sixty-four 32-bit words: for i from 16 to 63 s0 = (w[i-15] right rotate 7) xor (w[i-15] right rotate 18) xor (w[i-15] right shift 3) s1 = (w[i-2] right rotate 17) xor (w[i-2] right rotate 19) xor (w[i-2] right shift 10) w[i] := w[i-16] + s0 + w[i-7] + s1
14
Initialize hash value for this Variables:
A = H0 B = H1 C = H2 D = H3 E = H4 F = H5 G = H6 H= H7
15
T1= h + ∑ 1 + ch (e,f,g)+ k[i] + w[i]
Main loop: for i from 0 to 63 ∑ 0= (a right rotate 2) xor (a right rotate 13) xor (a right rotate 22) maj (a,b,c) = (a and b) xor (a and c) xor (b and c) T2= ∑ 0 + maj(a,b,c) ∑ 1 = (e right rotate 6) xor (e right rotate 11) xor (e right rotate 25) ch (e,f,g)= (e and f) xor ((not e) and g) T1= h + ∑ 1 + ch (e,f,g)+ k[i] + w[i] H = G D= C G = F C= B F = E B= A E = D + T A=T1+T2
16
Final hash values: H0 = H0 + A H1 = H1 + B H2 = H2 + C H3 = H3 + D H4 = H4 + E H5 = H5 + F H6 = H6 + G H7 = H7 + H
17
Message Digest: Finally we can get the 256 bit message after completion of 64 rounds i.e., H0 append H1 append H2 append H3 append H4 append H5 append H6 append H7
18
SHA 256:
19
PORT DESCRIPTION: S.NO MODE SIZE PORT DESCRIPTION 1 INPUT 2^64
PLAIN TEXT 2 100ps CLOCK 3 RESET 4 OUTPUT [255:0] ENCRYPTED DATA
20
SHA-256 OUTPUT:
21
Applications Verifying Data Integrity:
Data integrity is a very important part of a secure system. Any changes made to the files can be detected by generating the message digests of the files using a hash function. Password Authentication : Password authentication is another field that hash functions are used. For computer systems, it is insecure to store passwords in clear-text. Digital Signature: A digital signature is a type of asymmetric cryptography used to simulate the security properties of a signature in digital, rather than in written form
22
CONCLUSION: My goal of design is to compress a long message to become a short and safe message abstract with an acceptable throughput. SHA is famous message compress standard used in computer cryptography. Its improved version SHA-256 algorithm has been analyzed in this work, and implied by HDL (hardware description language). xilinx 7.1 ISE is used to synthesis the module, and then generated RTL level description circuit and simulated waveform.
23
REFERENCES: Federal Information Processing Standards (FIPS) Publication 180-1, Secure Hash Standard (SHS), U.S. DoC/NIST, April 17, 1995. NIST, Federal Information Processing Standards Publication 180-2, Secure Hash Standards (SHS), August 2001 D. R. Stinson. Cryptography: Theory and Practice. CRC Press LLC, 1995.
24
THANK YOU
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.