Cryptographic Hashing Special Session

Slides:



Advertisements
Similar presentations
Lecture 7 Overview. Advanced Encryption Standard 10, 12, 14 rounds for 128, 192, 256 bit keys – Regular Rounds (9, 11, 13) – Final Round is different.
Advertisements

ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
1 Lecture 3: Secret Key Cryptography Outline concepts DES IDEA AES.
Cryptography and Network Security Chapter 12 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
PIITMadhumita Chatterjee Security 1 Hashes and Message Digests.
Hash functions a hash function produces a fingerprint of some file/message/data h = H(M)  condenses a variable-length message M  to a fixed-sized fingerprint.
Hashes and Message Digest Hash is also called message digest One-way function: d=h(m) but no h’(d)=m –Cannot find the message given a digest Cannot find.
Cryptography and Network Security Chapter 12
Cryptography and Network Security Hash Algorithms.
Cryptography and Network Security (CS435) Part Ten (Hash and MAC algorithms)
Chapter 4  Hash Functions 1 Overview  Cryptographic hash functions are functions that: o Map an arbitrary-length (but finite) input to a fixed-size output.
More on Numerical Computation CS-2301 B-term More on Numerical Computation CS-2301, System Programming for Non-majors (Slides include materials from.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 12 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
1 Pertemuan 09 Hash and Message Digest Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
Lecture 13 Message Signing
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
1 Cryptography and Network Security (Various Hash Algorithms) Fourth Edition by William Stallings Lecture slides by Lawrie Brown (Changed by Somesh Jha)
They are the same as registers since they store binary numbers. Called shifting registers since they shift (left or right) the binary number stored in.
Mathematics of Cryptography Part I: Modular Arithmetic
HASH Functions.
Hash and MAC Algorithms Dr. Monther Aldwairi New York Institute of Technology- Amman Campus 12/3/2009 INCS 741: Cryptography 12/3/20091Dr. Monther Aldwairi.
Estimating Square Roots The square root of a number is the value that, when multiplied by itself, gives the original number. 2 x 2 = 4 Square RootSquare.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Computer Math. The Decimal System How do we represent “One Hundred and Twenty Five”? How do we represent “One Hundred and Twenty Five”? Simple: 125 !!!
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
Data & Network Security
Hash and MAC Functions CS427 – Computer Security
1 Hash Functions. 2 A hash function h takes as input a message of arbitrary length and produces as output a message digest of fixed length
12.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 12 Cryptographic Hash Functions.
Cryptographic Hash Functions
Cryptography & Network Security: 1 IX. Hash Algorithms Look at three important hash functions (MD5, SHA-1, RIPEND-160) then look an Internet- standard.
H ASHING : SHA256 T AYLER A NGEVINE B ACHELOR OF A RTS D R. K EN B LAHA 3/13/2014.
Numerical Functions & Tricks In today’s lesson we will look at: why we might want to use mathematical techniques some useful functions other mathematical.
Lecture 8 Overview. Secure Hash Algorithm (SHA) SHA SHA SHA – SHA-224, SHA-256, SHA-384, SHA-512 SHA-1 A message composed of b bits.
Chapter 18: One-Way Hash Functions Based on Schneier.
Hash Algorithms see similarities in the evolution of hash functions & block ciphers –increasing power of brute-force attacks –leading to evolution in algorithms.
Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Chapter 11 – Hash Functions.
Cryptographic Hash Functions Prepared by Dr. Lamiaa Elshenawy
1 Chapter 12: Hash and MAC Algorithms Fourth Edition by William Stallings Lecture slides by Lawrie Brown (modified by Prof. M. Singhal, U of Kentucky)
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 11 September 23, 2004.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 10 September 21, 2004.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Information Security and Management 11. Cryptographic Hash Functions Chih-Hung Wang Fall
Floating Point. Binary Fractions. Fixed point representation Scientific Notation. Floating point Single precision, Double precision. Textbook Ch.4.8 (p )
Hash Algorithms Ch 12 of Cryptography and Network Security - Third Edition by William Stallings Modified from lecture slides by Lawrie Brown CIM3681 :
Lecture 9 Overview. RSA Invented by Cocks (GCHQ), independently, by Rivest, Shamir and Adleman (MIT) Two keys e and d used for Encryption and Decryption.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
14.0 Math Review 14.1 Using a Calculator Calculator
Chapter 12 – Hash Algorithms
Secure Hash Algorithm A SEARIES OF SHA….
CHAPTER 4 TJADEN plus Chapters 13 & 14 Crytography Decrypted Hashing Functions, Message Digests, Message Authentication Codes (MACs) Dr. Suzanne Buchele.
CSCE 715: Network Systems Security
Boolean Algebra, Bitwise Operations
Mr F’s Maths Notes Number 10. Surds.
25 Math Review Part 1 Using a Calculator
Secured Hash Algorithm(SHA)
کدهاي احراز تماميت پيام و توابع درهم ساز
Cryptographic Hashing
Campbell R. Harvey Duke University and NBER
Factoring Polynomials
Year 10.
Cryptographic Hash Functions
SHA: Secure Hash Algorithm
Cryptographic Hashing
Campbell R. Harvey Duke University and NBER
Presentation transcript:

Cryptographic Hashing Special Session Innovation and Cryptoventures Cryptographic Hashing Special Session Campbell R. Harvey Duke University and NBER

SHA Online calculators https://emn178.github.io/online-tools/sha256.html https://anders.com/blockchain/hash.html

SHA-1 [Supplementary] Original message can be long. It is processed in 512 bit chunks. Let’s call the first message “x” and it is 512 bits Message is padded if original is less than 512 bits

SHA-1 [Supplementary] Inputs: one piece at a time 512 bits are divided up into 16 32-bits pieces, xj j=0,…15 “Words” Wj are then formed There are 80 of these words because there are 80 “steps” of activity

SHA-1 [Supplementary] Inputs: 80 “words” formed The first 16 are exactly the original message divided into 32 bit pieces: Wj = xj for j=0 to 15 The next 64 words are a mash using the following: Wj = (Wj-16 Wj-14 Wj-8 Wj-3)<<1 for j=16 to 79 Where, is “XOR”; and << shifts left one bit

SHA-1 [Supplementary] Digression: bitwise Boolean operations NOT 0111 (decimal 7) = (opposite) 1000 (decimal 8) 0101 (decimal 5) AND (intersection of 1s, ‘multiply’) 0011 (decimal 3) = 0001 (decimal 1)

SHA-1 [Supplementary] 0101 (decimal 5) Digression: bitwise boolean operations 0101 (decimal 5) OR 0011 (decimal 3) = (if both 0, then 0, otherwise 1 0111 (decimal 7) 0101 (decimal 5) XOR 0011 (decimal 3) = (1 if either first or second bit 1) 0110 (decimal 6)

SHA-1 [Supplementary] The math is not hard – it is mechanical. This is hard:

SHA-1 [Supplementary] If message longer than 512 bits… Initial 512 bit message is hashed to 160 bits This 160 bit hash forms the “initial values” for the hash that will result from the next 512 bits

SHA-1 [Supplementary] There are 4 rounds each with 20 steps Initial 160 bit hash is split into 5 pieces (each 32 bits): A,B,C,D,E Notice the modular addition of the original A-E with results of 80 steps Diagrams from Paar and Pelzl, Understanding Cryptography

SHA-1 [Supplementary] Initial values of A,B,C,D,E, i.e. the starting hash, H0 A=H0(0) = 67452301 B=H0(1) = EFCDAB89 C=H0(2) = 98BADCFE D=H0(3) = 10325476 E=H0(4) = C3D2E1F0 Each is 32 bits long and the above in hexadecimal form (0-9,a,b,c,d,e,f); values the same for every hash

SHA-1 We now need to figure out what is happening in each of the 4 rounds. This is very convoluted as you will see. Note rectangle symbol with cross is addition mod 232 *Think of a clock which is mod 12. If we add 3 hours past 12 noon, that is 15 – but in mod 12 we call it 3.

SHA-1 [Supplementary] This is what happens in round t for each Wj New A=(E + ft(B,C,D) + (A)<<5 + Wj + Kt) New B=A New C=(B)<<30 New D=C New E=D The function ft changes each round as does Kt There are a total of 80 steps (4x20)

SHA-1 [Supplementary] The jumbling functions and the constants: Note ^ = AND; v = OR; - = NOT; = XOR

SHA-1 [Supplementary] The initial hash values and the constants are arbitrary but are not NSA backdoor codes: H0 is a simple four bit counter (in reverse)* Round constants, Kt, are just square roots of 2,3,5,10 The slang for this is “nothing up my sleeve” – important because proposed by NSA! *e.g. 0111 0110 0101 0100 0011 0010 0001 0000 = LE (little endian) 76543210 = BE (big endian) 67452301

SHA-1 [Supplementary] The result of the 80 steps is H1. The 160 bit hash is now the starting point (the new initial A,B,C,D,E) to process the second 512 bit part of the message (assuming the message is longer than 512 bits). Again, SHA-256 very similar but the output is 256 bits not 160 bits.

SHA-1 vs. SHA-256 [Supplementary] Produces 256 bits not 160 bits Values A-E (SHA-1, i.e. 5x32) are A-H (SHA-256, i.e. 8x32) Starting A-H determined by the fractional part of the square roots of the first 8 primes 64 rounds – not 80 steps (4 rounds each with 20 steps) Constants for every step in SHA-256, fractional part of cube root of first 64 primes

Mining in Excel [Supplementary] It is a bad idea Notice there is no need for floating point operations Hence, we do not need CPUs to do this. Miners use a specialized ASIC technology However, if you wanted to mine in Excel… https://www.youtube.com/watch?v=UZBZPOEVyJA