Abelian Square-Free Dithering and Recoding for Iterated Hash Functions

Slides:



Advertisements
Similar presentations
Merkle Damgard Revisited: how to Construct a hash Function
Advertisements

Hash Function. What are hash functions? Just a method of compressing strings – E.g., H : {0,1}*  {0,1} 160 – Input is called “message”, output is “digest”
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Multiplication Rule. A tree structure is a useful tool for keeping systematic track of all possibilities in situations in which events happen in order.
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.
MD5 Message Digest Algorithm CS265 Spring 2003 Jerry Li Computer Science Department San Jose State University.
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 Hash Algorithms.
1 Pertemuan 09 Hash and Message Digest Matakuliah: H0242 / Keamanan Jaringan Tahun: 2006 Versi: 1.
Hash Functions Nathanael Paul Oct. 9, Hash Functions: Introduction Cryptographic hash functions –Input – any length –Output – fixed length –H(x)
MD4 1 MD4. MD4 2 MD4  Message Digest 4  Invented by Rivest, ca 1990  Weaknesses found by 1992 o Rivest proposed improved version (MD5), 1992  Dobbertin.
Hash Functions 1 Hash Functions Hash Functions 2 Cryptographic Hash Function  Crypto hash function h(x) must provide o Compression  output length is.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
1 Cryptography and Network Security (Various Hash Algorithms) Fourth Edition by William Stallings Lecture slides by Lawrie Brown (Changed by Somesh Jha)
Team Grey Skies – Pete Biancaniello and Anton Schraut January 18 th, 2012.
Lecture 15 Lecture’s outline Public algorithms (usually) that are each other’s inverse.
Acknowledgements: William Stallings.William Stallings All rights Reserved Session 4 Public Key Cryptography (Part 2) Network Security Essentials Application.
Smartening the Environment using Wireless Sensor Networks in a Developing Country Presented By: Al-Sakib Khan Pathan A Neighbour Discovery Approach for.
Abelian Square-Free Dithering and Recoding for Iterated Hash Functions Ronald L. Rivest MIT CSAIL ECRYPT Hash Function Conference June 23, 2005.
9.3 Addition Rule. The basic rule underlying the calculation of the number of elements in a union or difference or intersection is the addition rule.
Cryptography Wei Wu. Internet Threat Model Client Network Not trusted!!
Hashing Algorithms: Basic Concepts and SHA-2 CSCI 5857: Encoding and Encryption.
Theory of Computation II Topic presented by: Alberto Aguilar Gonzalez.
CSCI 172/283 Fall 2010 Hash Functions, HMACs, and Digital Signatures.
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
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 8. Greedy Algorithms.
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.
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 CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.3 Hash Functions.
On the Notion of Pseudo-Free Groups Ronald L. Rivest MIT Computer Science and Artificial Intelligence Laboratory TCC 2/21/2004.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Dan Boneh Collision resistance The Merkle-Damgard Paradigm Online Cryptography Course Dan Boneh.
Information Security and Management 11. Cryptographic Hash Functions Chih-Hung Wang Fall
Hash Algorithms Ch 12 of Cryptography and Network Security - Third Edition by William Stallings Modified from lecture slides by Lawrie Brown CIM3681 :
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
1 Message Authentication using Message Digests and the MD5 Algorithm Message authentication is important where undetected manipulation of messages can.
Data Integrity / Data Authentication. Definition Authentication (Signature) algorithm - A Verification algorithm - V Authentication key – k Verification.
@Yuan Xue 285: Network Security CS 285 Network Security Hash Algorithm Yuan Xue Fall 2012.
Chapter 12 – Hash Algorithms
If the hash algorithm is properly designed and distributes the hashes uniformly over the output space, "finding a hash collision" by random guessing is.
Substitution Ciphers.
On the Notion of Pseudo-Free Groups
CSCE 715: Network Systems Security
Security of Message Digests
Hash table CSC317 We have elements with key and satellite data
MD5 A Hash Algorithm….
Matlab Training Session 4: Control, Flow and Functions
Cryptographic Hash Functions
Data Structures and Algorithms
Cryptography and Network Security (Various Hash Algorithms)
Cryptographic Hash Functions
Cryptographic Hash Functions Part I
ICS 454 Principles of Cryptography
Chapter 9: Huffman Codes
Analysis & Design of Algorithms (CSCE 321)
Information Redundancy Fault Tolerant Computing
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
ICS 454 Principles of Cryptography
Cryptographic Hash Functions Part I
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Lecture 4: Hash Functions
Error Detection and Correction
Hash Function Requirements
IV. Convolutional Codes
Simple Hash Functions Network Security.
Presentation transcript:

Abelian Square-Free Dithering and Recoding for Iterated Hash Functions Ronald L. Rivest MIT CSAIL ECRYPT Hash Function Conference June 23, 2005

Outline Dean/Kelsey/Schneier Attacks Square-Free Sequences Prouhet-Thue-Morse Sequences Towers of Hanoi Abelian Square-Free Sequences Keränen’s Sequence Dithering and Recoding Open Questions Conclusions

Typical Iterated hashing f h0 h1 h2 h3 hL hL-1 H(M) M1 M2 ML M3 Message extended with 10* & length (MD) f is compression function. h0 is initialization vector (IV) hi is i-th chaining variable Last chaining variable hL is hash output H(M)

Dean/Kelsey/Schneier Attacks f h0 h1 h2 h3 hL hL-1 H(M) M1 M2 ML M3 Assumes one can find fixpoint h for f,M0: h = f(h,M0) Can then have message expansion attacks that find second preimage by Finding many fixpoint pairs (h,M) Finding a fixpoint h in actual chain for given message Finding another shorter path from h0 to some chaining variable Creating second preimage with this new starting path using message expansion to handle Merkle-Damgard strengthening

Dithering and Recoding Make hash function round dependent on round index i as well as hi-1 and Mi Dithering: include dither input di to compression function: hi = f(hi-1,Mi,di) Recoding: Include dither input as part of i-th message block hi = f(hi-1,M’i) where M’i = (Mi,di) (These are equivalent, of course…)

Iterated hashing with dithering f h0 h1 h2 h3 hL hL-1 H(M) M1 M2 ML M3 d1 d2 d3 dL How to choose dither input di? Could choose di = i Could choose di = ri (pseudo-random) Use square-free sequence di (repetition-free sequence; no repeated symbols or subwords.)

Square-Free Sequence A sequence is square-free if it contains no two equal adjacent subwords. Examples: abracadabra is square-free hobbit is not (repeated “b” ) banana is not (repeated “an” ) Dithering with a square-free sequence prevents message expansion attacks. (Would need fixpoint that works for all dither inputs.)

Infinite square-free sequences There exists infinite square-free sequences over 3-letter alphabet. Start with parity sequence: 0110100110010110… i-th element is parity of integer i. This (Prouhet-Thue-Morse, or PTM) sequence is only cube-free, but… Sequence of inter-zero gap lengths in PTM is square-free: 2102012101202102012021…

Generating infinite sf sequences Or: Take two copies of PTM sequence; shift second one over by one, then code vertical pairs: A = 00, B = 01, C = 10, D = 11: 0 1 1 0 1 0 0 1 1 0 0 1 0 1 … - 0 1 1 0 1 0 0 1 1 0 0 1 0 … - C D B C B A C D B A C B C … Result is also square-free.

Towers of Hanoi Sequence 1 2 3 Optimal play moves small disk on odd moves cyclically 1->2->3->1->2->3…; even moves are then forced. Code moves with six letters as A[1->2], B[1->3],C[2->1],D[2->3],E[3->1],F[3->2] Optimal sequence is square-free! (Shallit &c)

Towers of Hanoi Sequence 1 2 3 Code moves with six letters as A[1->2], B[1->3],C[2->1],D[2->3],E[3->1],F[3->2] Optimal play: A B D A E F A B D C… Easy to generate sequence for infinitely many disks…

Abelian square-free sequences An even stronger notion of “repetition-free” than (ordinary) square-free. A sequence is abelian square-free if it contains no two adjacent subwords yy’ where y’ is a permutation of y (possibly identity permutation). Example: abelianalien is square-free but not abelian square-free, since “alien” is a permutation of “elian”.

Infinite ASF sequences exist Thm (Keränen). There exists infinite ASF sequences on four letters. Keränen’s sequence based on “magic sequence” S of length 85: abcacdcbcdcadcdbdabacabadbabcbdbcbacbcdcacbabdabacadcbcdcacdbcbacbcdcacdcbdcdadbdcbca Let (w) denote word w with all letters shifted one letter cyclically: (abcacd) = bcdbda

Generating infinite asf sequence(I) Start with Keränen’s magic sequence S = abcac…dcbca (length 85) Apply morphism: a  S = abcac…dcbca b  (S) = bcdbd…adcdb c  2(S) = cdaca…badac d  3(S) = dabdb…cbabd simultaneously to all letters. Repeat to taste (each sequence is prefix of next, and of infinite limit sequence).

Generating infinite asf sequence(II) Count i = 0 to infinity in base 85 Apply simple four-state machine to base-85 representation of i (high-order digit processed first). Output a/b/c/d is last state. Requires constant (amortized) time per output symbol.

Dithering with ASF sequence Since Keränen’s ASF sequence on four letters is so easy to generate efficiently, we propose using it to dither an iterated hash function. This add negligible computational overhead, and only two new bits of input to compression function.

Recoding with ASF sequence Can also recode message using given ASF sequence. (This is essentially equivalent to dithering, just viewed another way…)

Open Questions Can Dean/Kelsey/Schneier attacks be adapted to defeat use of ASF sequences in hash function? Does ASF really add anything over SF? Are there generalizations of ASF that could be used? (“Even more” pattern-free?) Where else in cryptography can ASF sequences be used?

Conclusions Abelian square-free sequences seem to be a very inexpensive way to prevent repetitive inputs from causing vulnerabilities in hash functions. (Thanks to Jeff Shallit and Veikko Keränen for teaching me about square-free and abelian square-free sequences.)

(The End)

Iterated hashing f f f f M1 M2 ML Recoding g H(M) h0 h1 h2 h3 hL’-1

Iterated hashing with dithering M1 M2 ML Recoding f M’1 M’2 f M’3 f f M’L’ g h0 H(M) h1 h2 h3 hL’-1 hL’ d1 d2 d3 dL’