Team TDB Members: Anthony Knopp Zach Langley

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

SECURE HASHING ALGORITHM By: Ruth Betcher. Purpose: Authentication Not Encryption Authentication Requirements:  Masquerade – Insertion of message from.
SHA-1 collision found Lukáš Miňo, Richard Bartuš.
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
MD5 Generation Auto-Generated Slides To Visualize MD5 Hash Generation by Chris Fremgen.
Outline Project 1 Hash functions and its application on security Modern cryptographic hash functions and message digest –MD5 –SHA.
MD5 Generation Auto-Generated Slides To Visualize MD5 Hash Generation by Chris Fremgen.
PIITMadhumita Chatterjee Security 1 Hashes and Message Digests.
1 Chapter 5 Hashes and Message Digests Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
Announcements: 1. HW7 due next Tuesday. 2. Inauguration today! Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman,
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.
Announcements:Questions? This week: Discrete Logs, Diffie-Hellman, ElGamal Discrete Logs, Diffie-Hellman, ElGamal Hash Functions and SHA-1 Hash Functions.
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.
By: Matthew Ng. SHA stands for Secure Hash Algorithm It is based off the Merkle-Dangard hash function There are 3 versions of it with one coming in 2012.
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.
Information Security and Management 11
SHA (secure hash algorithm) Jen-Chang Liu, 2005 Adapted from lecture slides by Lawrie Brown.
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
Network Security Essentials Fifth Edition by William Stallings Fifth Edition by William Stallings.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Week 5 - Monday.  What did we talk about last time?  Cryptographic hash functions.
HASH Functions.
Hash Functions A hash function H accepts a variable-length block of data M as input and produces a fixed-size hash value h = H(M) Principal object is.
Dan Johnson. What is a hashing function? Fingerprint for a given piece of data Typically generated by a mathematical algorithm Produces a fixed length.
Brute Force Password Cracking and its Role in Penetration Testing Andrew Keener and Uche Iheadindu.
Message Authentication Code July Message Authentication Problem  Message Authentication is concerned with:  protecting the integrity of a message.
1 Hashes and Message Digests. 2 Hash Also known as –Message digest –One-way function Function: input message -> output One-way: d=h(m), but not h’(d)
Chapter 21 Public-Key Cryptography and Message Authentication.
Data & Network Security
Hash and MAC Functions CS427 – Computer Security
Improving Encryption Algorithms Betty Huang Computer Systems Lab
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
Cryptographic Hash Functions
H ASHING : SHA256 T AYLER A NGEVINE B ACHELOR OF A RTS D R. K EN B LAHA 3/13/2014.
6fb52297e004844aa81be d50cc3545bc Hashing!. Hashing  Group Activity 1:  Take the message you were given, and create your own version of hashing.  You.
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.
Lecture 2: Introduction to Cryptography
Week 4 - Friday.  What did we talk about last time?  Snow day  But you should have read about  Key management.
Cryptographic Hash Functions Prepared by Dr. Lamiaa Elshenawy
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 11 September 23, 2004.
CS426Fall 2010/Lecture 51 Computer Security CS 426 Lecture 5 Cryptography: Cryptographic Hash Function.
MD5 & Hash Encryption By Alex Buzak. Overview Purpose of MD5 and Hash Encryptions Examples MD5 Algorithm Explanation of Possible Security Risks Practical.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 10 September 21, 2004.
Information Security and Management 11. Cryptographic Hash Functions Chih-Hung Wang Fall
Lecture 5 Page 1 CS 236 Online More on Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
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.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
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.
“The quick brown fox jumps over the lazy dog”
MD5 A Hash Algorithm….
Cryptographic Hash Function
Outline Desirable characteristics of ciphers Uses of cryptography
Secured Hash Algorithm(SHA)
One-way Encryption Ideal Properties
Outline Desirable characteristics of ciphers Uses of cryptography
Originally by Yu Yang and Lilly Wang Modified by T. A. Yang
최신정보보호기술 경일대학교 사이버보안학과 김 현성.
MD5 A Hash Algorithm….
Cryptographic Hashing
SHA: Secure Hash Algorithm
The Secure Hash Function (SHA)
Cryptographic Hashing
Cryptographic Hashing Special Session
One-Way Hash Functions
Presentation transcript:

Team TDB Members: Anthony Knopp Zach Langley SHA-1 Team TDB Members: Anthony Knopp Zach Langley

Overview SHA-1 is a cryptographic hash function designed by the NSA and published by the NIST as a U.S Federal standard. It is a Merkle-Damgard construction, 160 bit digest size hash that performs 80 rounds. The spec was first published in 1995, two years after SHA-0. In 2005 SHA-1 was proven to be “broken” and various weaknesses were found in the hash function. No collisions were found but the running time to find one was proven to be much smaller than brute force.

Padding SHA-1 pads data in the following way: 1) Append the bitstring 10000…000 to the message (the amount of 0’s depends on the original message length) 2) The last two words in the message are set to be the amount of bits in the original message E.g., “hello” after padding becomes: 68656c6c 6f800000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000028

Round Function Constants: A0 = 67452301 B0 = EFCDAB89 C0 = 98BADCFE E0 = C3D2E1F0 K0..19 = 5A827999 K20..39 = 6ED9EBA1 K40..59 = 8F1BBCDC K60..79 = CA62C1D6

Original Design Original Algorithm: We originally stored the words to hash as a circular queue of sixteen 32- bit words, and used bitwise operations to compute hash Took advantage of Merkle-Damgård construction by using an append(byte) method, which would hash the data as it filled up

Original Runtime Measurements time java –Xint SHATest test.txt time java –Xint SHATestBulk 500000 Trial(#) 20mb File Results(s) 1 82.284 2 82.228 3 82.227 Average 82.246 Trial(#) bulk encrypt Results(s) 1 106.096 2 106.272 3 106.105 Average 106.157

Original Profile(File) Rank Self Accum Method Location 1 12.03% java.io .BufferedInputStream .read SHATest.java:11 2 9.66% 21.68% SHA1.compress SHA1.java:113 3 7.71% 29.40% SHA1.java:97 4 7.21% 36.61% SHA1.f SHA1.java:11 5 7.14% 43.75% SHA1.append SHA1.java:45

Original Profile(Bulk Encryptions) Rank Self Accum Method Location 1 10.23% SHA1.compress SHA1.java:113 2 8.46% 18.69% SHA1.java:97 3 7.50% 26.19% SHA1.f SHA1.java:11 4 6.83% 33.02% SHA1.java:88 5 6.09% 39.11% SHA1.java:101 6 4.88% 43.99% SHA1.java:94 7 4.05% 48.13% SHA1.java:22

Original Analysis Offending lines: data = new int[16]; int temp = circularShift(a, 5) + f(t, b, c, d) + e + data[s] + k[t/20]; if (t < 20) for (int t = 0; t <= 79; t++) { c = circularShift(b, 30); data[s] = circularShift(data[s], 1); return (x << n) | (x >>> (32 - n)); if (bytes >= 4 * data.length)

Revised Design Unrolled loop Operated on an array of 80 words, instead of masking with 16 In-lined all functions and constants Used 5 chaining values instead of an array

Revised Design Runtime time java –Xint SHATestOptimized test.txt time java –Xint SHATestBulkOptimized 1000000 Trial(#) 20mb File Results(s) 1 49.010 2 48.973 3 49.261 Average 49.081 Trial(#) 20mb File Results(s) 1 65.342 2 65.412 3 65.400 Average 65.384

Revised Design Profile (file) Rank Self Accum Method Location 1 30.40% java.io .BufferedInputStream .read SHATest.java:11 2 14.41% 44.82% OptimizedSHA1.append OptimizedSHA1.java:26 3 8.06% 52.87% 4 2.06% 54.94% 5 1.94% 56.88%

Revised Design Profile(Bulk Encryptions) Rank Self Accum Method Location 1 24.84% java.lang .AbstractStringBuilder .<init> OptimizedSHA1.java:316 2 5.79% 30.63% java.util.Arrays .copyOfRange 3 5.56% 36.19% 4 5.52% 41.70% 5 5.41% 47.11% 6 5.06% 52.18% 7 1.71% 53.89%

Revised Analysis Offending lines: String ret = Hex.toString(chain0) + Hex.toString(chain1) + Hex.toString(chain2) + Hex.toString(chain3) + Hex.toString(chain4); data[bytes >> 2] = (data[bytes >> 2] << 8) | (b & 0xff);

What We Learned We learned that the government spec for SHA-1 is very thorough in its description and implementation of SHA-1. The implementation didn’t pose much trouble. We learned that really trying to trim down run time can be a pain and requires a lot of trial and error. You can have an idea of what will reduce runtime but it turns out it doesn’t really help at all and sometimes makes it worse.

Possible Future Work There’s not much future work when it comes to implementing the algorithm. It would be interesting to implement the algorithm in another language and compare the running times between Java and the other language. Future work could also include attempting to implement some of the attacks against SHA-1 and see if we can find some collisions on smaller amounts of rounds.