Once Upon a Time-Memory Tradeoff Mark Stamp Department of Computer Science San Jose State University.

Slides:



Advertisements
Similar presentations
Chapter 11. Hash Tables.
Advertisements

The Future (and Past) of Quantum Lower Bounds by Polynomials Scott Aaronson UC Berkeley.
Hash Tables.
ONE WAY FUNCTIONS SECURITY PROTOCOLS CLASS PRESENTATION.
Xiutao Feng Institute of Software Chinese Academy of Sciences A Byte-Based Guess and Determine Attack on SOSEMANUK.
Lee Jae-song 1.  How to cryptanalysis DES?  C = E K (P)  E is DES encryption funtion  K is a key, 56-bit.  P is a plaintext, C is a ciphertext, both.
Near-Duplicates Detection
Lecture 8: Lattices and Elliptic Curves
Log Files. O(n) Data Structure Exercises 16.1.
CNS2010handout 8 :: introduction to number theory1 computer and network security matt barrie.
11.Hash Tables Hsu, Lih-Hsing. Computer Theory Lab. Chapter 11P Directed-address tables Direct addressing is a simple technique that works well.
Windows Core Security1© 2006 Microsoft Corp Cryptography: Helping Number Theorists Bring Home the Bacon Since 1977 Dan Shumow SDE Windows Core Security.
Factoring 1 Factoring Factoring 2 Factoring  Security of RSA algorithm depends on (presumed) difficulty of factoring o Given N = pq, find p or q and.
Practical Techniques for Searches on Encrypted Data Author: Dawn Xiaodong Song, David Wagner, Adrian Perrig Presenter: 紀銘偉.
Asymmetric Cryptography part 1 & 2 Haya Shulman Many thanks to Amir Herzberg who donated some of the slides from
RC4 1 RC4 RC4 2 RC4  Invented by Ron Rivest o “RC” is “Ron’s Code” or “Rivest Cipher”  A stream cipher  Generate keystream byte at a step o Efficient.
Tirgul 8 Universal Hashing Remarks on Programming Exercise 1 Solution to question 2 in theoretical homework 2.
Discrete Log 1 Discrete Log. Discrete Log 2 Discrete Logarithm  Discrete log problem:  Given p, g and g a (mod p), determine a o This would break Diffie-Hellman.
Foundations of Network and Computer Security J J ohn Black Lecture #3 Aug 28 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
Hashing COMP171 Fall Hashing 2 Hash table * Support the following operations n Find n Insert n Delete. (deletions may be unnecessary in some applications)
Hellman’s TMTO 1 Hellman’s TMTO Attack. Hellman’s TMTO 2 Popcnt  Before we consider Hellman’s attack, consider simpler Time-Memory Trade-Off  “Population.
Tirgul 7. Find an efficient implementation of a dynamic collection of elements with unique keys Supported Operations: Insert, Search and Delete. The keys.
COMP 171 Data Structures and Algorithms Tutorial 10 Hash Tables.
Lecture 10: Search Structures and Hashing
1 Constructing Pseudo-Random Permutations with a Prescribed Structure Moni Naor Weizmann Institute Omer Reingold AT&T Research.
CMEA 1 CMEA. CMEA 2 CMEA  Cellular Message Encryption Algorithm  Designed for use with cell phones o To protect confidentiality of called number o For.
Chapter 13: Electronic Commerce and Information Security Invitation to Computer Science, C++ Version, Fourth Edition SP09: Contains security section (13.4)
CSCI 172/283 Fall 2010 Public Key Cryptography. New paradigm introduced by Diffie and Hellman The mailbox analogy: Bob has a locked mailbox Alice can.
Data Structures Hashing Uri Zwick January 2014.
Public Key Model 8. Cryptography part 2.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Lecture 3: Cryptographic Tools modified from slides of Lawrie Brown.
Cloud and Big Data Summer School, Stockholm, Aug., 2015 Jeffrey D. Ullman.
Hellman’s TMTO 1 Hellman’s TMTO Attack. Hellman’s TMTO 2 Popcnt  Before we consider Hellman’s attack, consider simpler Time-Memory Trade-Off  “Population.
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Hashing Table Professor Sin-Min Lee Department of Computer Science.
Public key ciphers 2 Session 6.
Cryptography Part 1: Classical Ciphers Jerzy Wojdyło May 4, 2001.
1 CSE 326: Data Structures: Hash Tables Lecture 12: Monday, Feb 3, 2003.
1 Cryptanalysis Four kinds of attacks (recall) The objective: determine the key ( Herckhoff principle ) Assumption: English plaintext text Basic techniques:
Two New Online Ciphers Mridul Nandi National Institute of Standards and Technology, Gaithersburg, MD Indocrypt 2008, Kharagpur.
Hashing Sections 10.2 – 10.3 CS 302 Dr. George Bebis.
1 Information Theory Nathanael Paul Oct. 09, 2002.
Public Key Systems 1 Merkle-Hellman Knapsack Public Key Systems 2 Merkle-Hellman Knapsack  One of first public key systems  Based on NP-complete problem.
Hashing Amihood Amir Bar Ilan University Direct Addressing In old days: LD 1,1 LD 2,2 AD 1,2 ST 1,3 Today: C
Chapter 10 Hashing. The search time of each algorithm depend on the number n of elements of the collection S of the data. A searching technique called.
Ihab Mohammed and Safaa Alwajidi. Introduction Hash tables are dictionary structure that store objects with keys and provide very fast access. Hash table.
COSC 2007 Data Structures II Chapter 13 Advanced Implementation of Tables IV.
Hashing Fundamental Data Structures and Algorithms Margaret Reid-Miller 18 January 2005.
Chapter 5: Hashing Collision Resolution: Open Addressing Extendible Hashing Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova,
Hashtables. An Abstract data type that supports the following operations: –Insert –Find –Remove Search trees can be used for the same operations but require.
Cellular Encryption CREU Project Team: Alburn Brown Orkun Kaya Isaac Rieksts Eric Thorpe.
CS6045: Advanced Algorithms Data Structures. Hashing Tables Motivation: symbol tables –A compiler uses a symbol table to relate symbols to associated.
11 RSA Variants.  Scheme ◦ Select s.t. p and q = 3 mod 4 ◦ n=pq, public key =n, private key =p,q ◦ y= e k (x)=x (x+b) mod n ◦ x=d k (y)=  y mod n.
1/16 Seeing through M IST given a Small Fraction of an RSA Private Key Colin D. Walter Comodo Research Lab (Bradford, UK)
1 Diffie-Hellman (Key Exchange) Protocol Rocky K. C. Chang 9 February 2007.
Markov Ciphers and Differential Cryptanalysis Jung Daejin Lee Sangho.
CSC 413/513: Intro to Algorithms Hash Tables. ● Hash table: ■ Given a table T and a record x, with key (= symbol) and satellite data, we need to support:
1 Diffie-Hellman (Key Exchange) Protocol Rocky K. C. Chang 9 February 2007.
Prof. Reuven Aviv, Nov 2013 Public Key Infrastructure1 Prof. Reuven Aviv Tel Hai Academic College Department of Computer Science Problem Set 1: Cryptography.
Cryptographic methods. Outline  Preliminary Assumptions Public-key encryption  Oblivious Transfer (OT)  Random share based methods  Homomorphic Encryption.
Key Exchange in Systems VPN usually has two phases –Handshake protocol: key exchange between parties sets symmetric keys –Traffic protocol: communication.
Public Key Encryption.
Hellman’s TMTO Attack Hellman’s TMTO 1.
Hashing Alexandra Stefan.
Hashing Alexandra Stefan.
Input: A={a1, a2, … an} – public key, S - ciphertext
Real-world Security of Public Key Crypto
Hashing Sections 10.2 – 10.3 Lecture 26 CS302 Data Structures
Presentation transcript:

Once Upon a Time-Memory Tradeoff Mark Stamp Department of Computer Science San Jose State University

TMTO2 This talk…  Non-cryptanalytic TMTOs  Crypto background  Hellman’s cryptanalytic TMTO  Distributed TMTO  Conclusions

TMTO3 Non-crypto TMTOs  Popcnt  Shank’s algorithm

TMTO4 Popcnt  Let x be a 32-bit integer  Define popcnt(x) = number of 1’s in binary expansion of x  How to compute popcnt(x) ?

TMTO5 Simple popcnt popcnt(x) t = 0 for i = 0 to 31 t = t + (x >> i) & 1 next i return t end popcnt

TMTO6 Efficient popcnt Initialize: table[i] = popcnt(i) for i = 0,1,…,255 popcnt(x) t = table[ x & 0xff ] + table[ (x >> 8) & 0xff ] + table[ (x >> 16) & 0xff ] + table[ (x >> 24) & 0xff ] return t end popcnt

TMTO7 Discrete Log  Let p be prime, g  {1,2,…, p  1} s.t. for any n there is a k with n = g k mod p  Discrete log: given m  {1,2,…, p  1} find e s.t. m = g e mod p  Notation: e = log g (m)  Could try each value in {1,2,…, p  1} to find e that works

TMTO8 Shank’s algorithm  Shank’s is a TMTO for discrete log  Given m, we want e = log g (m) A.Compute list L r as follows 1. Let r =  sqrt(p  1)  and compute g rj mod p for j = 0,1,…,r  1 2. Let L r be the list of ( j, g rj mod p) sorted on second coordinate

TMTO9 Shank’s alg (continued) B.Compute list L m as follows 1. Compute mg  i mod p for i = 0,1,…,r  1 2. Let L m be the list of (i, mg  i mod p) sorted on second coordinate

TMTO10 Shank’s alg. (cont. again) C.Then e = log g (m) is found by 1. Find elements of L r and L m that agree in 2nd coordinates, say, ( j, x)  L r and (i, x)  L m 2. Then e = log g (m) = rj + i mod (p  1) since g rj = mg  i mod p  Shank’s: baby step, giant step

TMTO11 Shank’s algorithm (example)  Suppose p = 257, g = 3. Then r = 16 and L r is (0,1) (3,2) (6,4) (9,8) (12,16) (15,32) (2,64) (5,128) (13,129) (10,193) (7,225) (4,241) (1,249) (14,253) (11,255) (8,256)  Suppose m = 132. Then L m is (9,23) (1,44) (3,62) (5,64) (8,69) (12,77) (15,79) (6,107) (0,132) (10,179) (2,186) (4,192) (13,197) (7,207) (11,231) (14,237)  From L r and L m we find (2,64 ) and (5,64). Then log 3 (132) = 2  = 37 and easy to verify 3 37 = 132 mod 257

TMTO12 Block cipher Consider a block cipher C = E(P, K) where P is plaintext of length n C is ciphertext of length n K is key of length k

TMTO13 Block Cipher

TMTO14 Chosen plaintext attack  We choose P and obtain C, where C = E(P, K)  Want to find the key K 1. Exhaustive key search 2. Table pre-computation  TMTO lies between 1. and 2.

TMTO15 Chain of encryptions Assume n = k. Then a chain is SP = K 0 = Starting Point K 1 = E(P, SP) K 2 = E(P, K 1 ) : EP = K t = E(P, K t  1 ) = End Point

TMTO16 Chain (another view)

TMTO17 Pre-computation  Compute m encryption chains, each of length t +1  Save only start and end points (SP 0, EP 0 ) (SP 1, EP 1 ) : (SP m-1, EP m-1 )

TMTO18 TMTO Attack  Memory: Given (SP i, EP i ), i = 0,1,…,m  1  For chosen P compute C = E(P, K)  The key K is unknown  Time: Compute chain (max of t steps) X 0 = C, X 1 = E(P, X 0 ), X 2 = E(P, X 1 ),…

TMTO19 Attack (continued)  Given the chain X 0 = C, X 1 = E(P, X 0 ), X 2 = E(P, X 1 ),…  Suppose we find X i = EP j  Then C might be in chain (SP j, EP j )  Assume C is in chain (SP j, EP j )

TMTO20 Attack (continued again)  Given C is in the chain (SP j, EP j ) and X i = EP j  Re-compute chain (SP j, EP j ) Y 0 = SP j, Y 1 = E(P,Y 0 ), Y 2 = E(P,Y 1 ),…  Then C = Y t  i = E(P, Y t  i  1 )  And Y t  i  1 = K (always?)

TMTO21 In a perfect world  Suppose the block cipher has 56 bit key  Suppose we find m = 2 28 chains, each of length t = 2 28 and no chains overlap  Memory: 2 28 pairs (SP j, EP j )  Time: about 2 28 (for attack) 1. Find C in about 2 27 tries 2. Find K with about 2 27 more tries

TMTO22 In a perfect world  All chains distinct  Ciphertext C lies within a chain EP 0 SP 0 C SP 1 SP 2 EP 1 EP 2

TMTO23 In the real world  Chains are not so well-behaved  Chains cycle and merge EP SP C

TMTO24 To reduce merging  Compute chain as K i = F(E(P, K i  1 )) where F is a permutation  Choose r different functions F  For each F choose m random SP  Each chain of length t

TMTO25 Notation  m = number of random starting points for each function F  t = length of each chain  r = number of “random” functions F  Note: mtr = total number of computed chain elements

TMTO26 Real-world issues  False alarms, avoid cycles, reduce merging, etc.  Pre-computation is lots of work (must be amortized over many attacks)  Success is not assured  What if block size not equal key length?  What is the probability of success?

TMTO27 Probability of success  Occupancy problem: b balls distributed with uniform probability to c cells  Let p l (b,c) be probability of l empty cells. Feller [3] shows

TMTO28 Success probability (continued)  Poisson approx to p l (b,c) is p l ( ) = e  l /l! where = ce  b/c  So expected number of empty cells is

TMTO29 Success probability (still more)  Expected number of occupied cells is c  = c(1  e  b/c )  Therefore P(cell i is occupied) = 1  e  b/c  TMTO attack succeeds if and only if the “cell” with key K is “occupied”

TMTO30 Success prob (last word, almost) mtr P(success) = 1  e  mtr/2 k k  k  k k k

TMTO31 The bottom line  Choose m = t = r = 2 k/3 and probability of success is about 0.63 (at least 0.55 by a more careful analysis)  Pre-computation is O(mtr) work  Each TMTO attack requires O(mr) “memory” and O(tr) “time”

TMTO32 Distinguished points  Let a distinguished point be of the form (x 0,x 1,…,x s  1,0,0,…,0)  Construct chain until distinguished point is found  If no distinguished point is found within max steps, don’t save chain  Then every EP is distinguished

TMTO33 Distinguished points +/-  Disadvantages  Chains are variable length  Some extra work to find chains  Triples (SP, EP, length)  Advantage  Distributed attack is very nice  Why? One client for each F then client only needs (P, C) and F and max chain length  no data!

TMTO34 References [1] M. Hellman, A cryptanalytic time-memory tradeoff, IEEE Trans on Info Thy, Vol. 26, No. 4, July 1980, pp [2] J.Borst, et al., On the time-memory tradeoff between exhaustive key search and table precomputation, [3] W. Feller, An Introduction to Probability Theory and Its Applications, volume 1, Wiley (1968) [4] M. Stamp, Once upon a time-memory tradeoff,