SlideShare a Scribd company logo
1 of 22
Hashing &
Random Oracle Model
Sadman Ahmmed | B150305029
TOC
Document and Fingerprint
Pigeonhole Principle
Attacks on Random Oracle Model
Checking Integrity
Cryptographic Hash Function Criteria
Random Oracle Model
Birthday Paradox
Applications
Problem of the day (message integrity)
Alice
X
Oscar
interfere x
X > X’
X’
Solution (Hash Function)
Alice
X
Oscar
interfere x
X > X’
X’
message x (arbitrary length)
eg : 1TB
hash value y = h(x)
fixed length, eg : SHA-1 160 bits
h( x )
y = h(x)h(x) != h(x’)
Cryptographic Hash Function
01 A function h maps arbitrary strings of data to fixed length output
02 Deterministic and public, but the mapping should look “random”
h : {0, 1} ∗ → {0, 1} d
03 No secret key, all operations public, anyone can compute h, polytime
computation. Example : MD4, MD5, SHA-1
document/message message digest/fingerprint/authentication tag
Random Oracle Model ‘h’
Ideal model of the hash function. we assume there exists an
oracle h such that on input , x ∈ {0, 1}∗
yes
Message Message Digest
hello 1001
hi 1110
h : {0, 1} ∗ → {0, 1} 4
hello T H H T
Hash Table
x
If x has
seen before
y
returns h(x) it previously output
yes
generate deterministic random value
no store
output
Fact About ROC
01
Oracle cannot use formula or algorithm to create the digest
Suppose oracle uses the formula h(M) = M mon n, M1 + M2 = M3
h(M3) = (M1+M2) mod n = M1 mod n + M2 mod n = [ h(M1) + h(M2) ] mod n
should have some randomness. eg, secure bidding problem
03 In practice we use pseudo-random functions
02 Unfortunately, a random oracle does not exist since it requires infinite storage
Collision (Pigeonhole principle)
Input Space : infinity
Assume 4 bits length
Hash Space : fixed
Assume 4 bits length
n pigeonhole > n+1 pigeons > at least 1 nole is occupied by 2 pigeons
n pigeonhole > kn+1 pigeons > at least 1 nole is occupied by k+1 pigeons
Digest should be shorter than the message, so there are some digests, correspond to more
than one message. Eg, pigeonhole = 4, pigeons = 16 or n = 4, kn+1 = 16, so k is larger than 3.
At least 1 digest corresponds to (k+1) messages.
22 = 424 = 16
Obj 1
Obj 2
Obj 3
Obj 4
Obj 5
.
0
1
2
3
Birthday Paradox
How many people must be there in a room to make the probability 50% that at-least two people
in the room have same birthday?
Not easy to calculate 2 people share same rather 2 people not share the same birthday.
Probability of 23 people not having same birthday
= 365/365 x 364/365 x 363/365 x …… x (people 23) 343/365
= 364! / ( 342! X 36522 ) = .492703 > 49.3%
Chance we do = 1 - .4927 = .507 > 50.7%
Alice
Bob
Oscar
X
try to decrypt X
Done or undone
interfere X
X > X’
X’
Another Problem (One Way)
Alice
Bob
Oscar
X
Knows h( )
interfere X
X > X’
X’
Solution h(x) h(x) != h(x’)
Preimage Attack
Given y ∈ {0, 1} d
it is hard to find an x such that h(x) = y
aka. one way
Can’t be done : lossless compression, check sum
Preimage
Resistance
Cryptographic Hash Function Criteria
Birthday Problem 1 What is the
minimum number, k, of the students in
a classroom such that it is likely that at
least one student has a predefined
birthday?
Preimage Attack
Algorithm
input: h, D
Choose, any X0 ε x, |x0| = q
for any message M[i] ε x
if (h(M[i]) == D)return M[i]
else return fail
Probability that the hash of an M[i] match with D = 1/N
Probability it does not match with D = 1 - 1/N
Probability, none of q queries match with D = ( 1 - 1/N )q
Success probability Pr[success] = 1 - ( 1 - 1/N )q
e-x = 1 - x + x2/2! - x3/3! + x4/4! + ….
According Taylor Series
If N is large, replace 1-1/N = e-1/N
pr [success] = 1 - e-q/N
If probability 0.5, q = ln(0.5)N = 0.69 x 2n
Attacks on Random Oracle Model
Example :
A cryptographic hash function uses a digest of 64 bits. How many
digests does Oscar need to create to find the original message
with the probability more than 0.5?
Suppose, Oscar can test 230 messages per second
it takes ( 0.69 x 2 64 )/ 2 30 = 0.69 x 2 34 seconds, or more than 500 years.
k ≈ 0.69 × 2n ≈ 0.69 x 2 64
Alice
Bob
Oscar
X
Found x’, h(x’) = h(x)
X = give oscar 20$
X’ = give oscar 20000$
X’
TCR h(x) h(x) == h(x’)
Preimage Attack
Cryptographic Hash Function Criteria
Birthday Problem 2 What is the minimum
number, k, of the students in a classroom
such that it is likely that at least one
student has the same birthday as the
student selected by the professor?
Given x
it is hard to find x ' such that h(x) = h(x ' ) where x != x’
aka, Weak collision-resistance, target collision resistance
Second Preimage
Resistance
Preimage Attack
Algorithm
input: h, M
Calculate D = h(M)
Choose, any X0 ε x{M}, |x0| = q-1
for any message M[i] ε x
if (h(M[i]) == D)return M[i]
else return fail
pr [success] = 1 - e-(q-1)/N
If probability 0.5, q = ln(0.5)N + 1 = 0.69 x 2n + 1
Attacks on Random Oracle Model
Alice
Bob
Oscar
x1
Found x1,x2, h(x1) = h(x2)
CR, Digital Signature
(x1, y)(x2, y)
Preimage Attack
Cryptographic Hash Function Criteria
Birthday Problem 3 What is the
minimum number, k, of the students in a
classroom such that it is likely that at
least two students have the same
birthday?
It is hard to find any pair of inputs x, x '
such that h(x) = h(x ' ) where x != x’
aka , Strong collision-resistance
Collision
Resistance
Preimage Attack
Algorithm
input: h
Choose, any x0 ε , |x0| = q
for any message pair M[i], M[i`] ε x
if (h(M[i]) == h(M[i`]))return M[i], M[i`]
else return fail
P (hash of M[0] and M[1] does not collide) = 1 - 1/N
P (hash of M[0] and M[1] does not collide with M[3])
( 1 - 1/N ) ( 1 - 2/N )
Probability of q hash value does cot collide
(1- 1/N) (1 - 2/N) (1 - 3/N) ………………… ( 1 - (q-1)/N)
q-1 q-1
Pr[ No Collisions] = Σ (1 - i/N) = Σ e -i/n = e -q2/N
I=1 I=1
pr [collisions/success] = 1 - e -q2/N
If probability 0.5, q = sqrt ( ln(0.5)N ) = 1.18 x sqrt(N)
= 1.18 x 2n/2 [ N = 2n ]
Attacks on Random Oracle Model
Example :
A cryptographic hash function uses a digest of 64 bits. How many
digests does Oscar need to create to find two messages with the
same digest with the probability more than 0.5?
Suppose, Oscar can test 220 messages per second
it takes 1.18 × 212 seconds, or less than two hours
k ≈ 1.18 x 2 n/2 ≈ 1.18 x 2 64/2 ≈ 1.18 x 2 32
● Password Storage
● File Authenticity
● Digital Signature, guarantees that the message came from a said source
● Commitments: In a secure bidding, Alice wants to bid value x, but does not
want to reveal the bid until the auction is over. Alice then computes h(x), and
publicize it, which serves as her commitment. When bidding is over, then she
can reveal x, and x can be verified using h(x)
Application

More Related Content

What's hot

Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
Uday Meena
 
Intruders
IntrudersIntruders
Intruders
techn
 

What's hot (20)

Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
 
Block Ciphers and the Data Encryption Standard
Block Ciphers and the Data Encryption StandardBlock Ciphers and the Data Encryption Standard
Block Ciphers and the Data Encryption Standard
 
ECDSA/EdDSA
ECDSA/EdDSAECDSA/EdDSA
ECDSA/EdDSA
 
Elgamal Digital Signature
Elgamal Digital SignatureElgamal Digital Signature
Elgamal Digital Signature
 
An introduction to X.509 certificates
An introduction to X.509 certificatesAn introduction to X.509 certificates
An introduction to X.509 certificates
 
How Hashing Algorithms Work
How Hashing Algorithms WorkHow Hashing Algorithms Work
How Hashing Algorithms Work
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Secret Sharing Cs416
Secret Sharing Cs416Secret Sharing Cs416
Secret Sharing Cs416
 
Intruders
IntrudersIntruders
Intruders
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
Ch03
Ch03Ch03
Ch03
 
Pgp pretty good privacy
Pgp pretty good privacyPgp pretty good privacy
Pgp pretty good privacy
 
Information and data security block cipher and the data encryption standard (...
Information and data security block cipher and the data encryption standard (...Information and data security block cipher and the data encryption standard (...
Information and data security block cipher and the data encryption standard (...
 
Data encryption standard
Data encryption standardData encryption standard
Data encryption standard
 
RC4&RC5
RC4&RC5RC4&RC5
RC4&RC5
 

Similar to Random Oracle Model & Hashing - Cryptography & Network Security

Primes: a quick tour to spplications and challenges!
Primes: a quick tour to spplications and challenges!Primes: a quick tour to spplications and challenges!
Primes: a quick tour to spplications and challenges!
Ashutosh Tripathi
 
Largedictionaries handout
Largedictionaries handoutLargedictionaries handout
Largedictionaries handout
csedays
 

Similar to Random Oracle Model & Hashing - Cryptography & Network Security (20)

Primes: a quick tour to spplications and challenges!
Primes: a quick tour to spplications and challenges!Primes: a quick tour to spplications and challenges!
Primes: a quick tour to spplications and challenges!
 
Дмитрий Селиванов, OK.RU. Finding Similar Items in high-dimensional spaces: L...
Дмитрий Селиванов, OK.RU. Finding Similar Items in high-dimensional spaces: L...Дмитрий Селиванов, OK.RU. Finding Similar Items in high-dimensional spaces: L...
Дмитрий Селиванов, OK.RU. Finding Similar Items in high-dimensional spaces: L...
 
Finding similar items in high dimensional spaces locality sensitive hashing
Finding similar items in high dimensional spaces  locality sensitive hashingFinding similar items in high dimensional spaces  locality sensitive hashing
Finding similar items in high dimensional spaces locality sensitive hashing
 
Deep Learning for Cyber Security
Deep Learning for Cyber SecurityDeep Learning for Cyber Security
Deep Learning for Cyber Security
 
Hamming codes
Hamming codesHamming codes
Hamming codes
 
Error control coding bch, reed-solomon etc..
Error control coding   bch, reed-solomon etc..Error control coding   bch, reed-solomon etc..
Error control coding bch, reed-solomon etc..
 
Into to prob_prog_hari (2)
Into to prob_prog_hari (2)Into to prob_prog_hari (2)
Into to prob_prog_hari (2)
 
Proof of Kraft Mc-Millan theorem - nguyen vu hung
Proof of Kraft Mc-Millan theorem - nguyen vu hungProof of Kraft Mc-Millan theorem - nguyen vu hung
Proof of Kraft Mc-Millan theorem - nguyen vu hung
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 3
Unit 3Unit 3
Unit 3
 
CMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & QuantifiersCMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & Quantifiers
 
Losseless
LosselessLosseless
Losseless
 
"PAC Learning - a discussion on the original paper by Valiant" presentation @...
"PAC Learning - a discussion on the original paper by Valiant" presentation @..."PAC Learning - a discussion on the original paper by Valiant" presentation @...
"PAC Learning - a discussion on the original paper by Valiant" presentation @...
 
Cuckoo Search Algorithm: An Introduction
Cuckoo Search Algorithm: An IntroductionCuckoo Search Algorithm: An Introduction
Cuckoo Search Algorithm: An Introduction
 
Basics of coding theory
Basics of coding theoryBasics of coding theory
Basics of coding theory
 
Limits of Computation
Limits of ComputationLimits of Computation
Limits of Computation
 
The Limits of Computation
The Limits of ComputationThe Limits of Computation
The Limits of Computation
 
Lec 5-nn-slides
Lec 5-nn-slidesLec 5-nn-slides
Lec 5-nn-slides
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
 
Largedictionaries handout
Largedictionaries handoutLargedictionaries handout
Largedictionaries handout
 

More from Mahbubur Rahman

More from Mahbubur Rahman (9)

Randomized Algorithm- Advanced Algorithm
Randomized Algorithm- Advanced AlgorithmRandomized Algorithm- Advanced Algorithm
Randomized Algorithm- Advanced Algorithm
 
Cloudonomics in Advanced Cloud Computing
Cloudonomics in Advanced Cloud ComputingCloudonomics in Advanced Cloud Computing
Cloudonomics in Advanced Cloud Computing
 
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
 
Geographic Routing in WSN
Geographic Routing in WSNGeographic Routing in WSN
Geographic Routing in WSN
 
Streaming Stored Video- Computer Networking
Streaming Stored Video- Computer Networking  Streaming Stored Video- Computer Networking
Streaming Stored Video- Computer Networking
 
Modern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key CipherModern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key Cipher
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in Compilers
 
Web Server And Database Server
Web Server And Database ServerWeb Server And Database Server
Web Server And Database Server
 
LEX & YACC
LEX & YACCLEX & YACC
LEX & YACC
 

Recently uploaded

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 

Recently uploaded (20)

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 

Random Oracle Model & Hashing - Cryptography & Network Security

  • 1. Hashing & Random Oracle Model Sadman Ahmmed | B150305029
  • 2. TOC Document and Fingerprint Pigeonhole Principle Attacks on Random Oracle Model Checking Integrity Cryptographic Hash Function Criteria Random Oracle Model Birthday Paradox Applications
  • 3. Problem of the day (message integrity) Alice X Oscar interfere x X > X’ X’
  • 4. Solution (Hash Function) Alice X Oscar interfere x X > X’ X’ message x (arbitrary length) eg : 1TB hash value y = h(x) fixed length, eg : SHA-1 160 bits h( x ) y = h(x)h(x) != h(x’)
  • 5. Cryptographic Hash Function 01 A function h maps arbitrary strings of data to fixed length output 02 Deterministic and public, but the mapping should look “random” h : {0, 1} ∗ → {0, 1} d 03 No secret key, all operations public, anyone can compute h, polytime computation. Example : MD4, MD5, SHA-1 document/message message digest/fingerprint/authentication tag
  • 6. Random Oracle Model ‘h’ Ideal model of the hash function. we assume there exists an oracle h such that on input , x ∈ {0, 1}∗ yes Message Message Digest hello 1001 hi 1110 h : {0, 1} ∗ → {0, 1} 4 hello T H H T Hash Table x If x has seen before y returns h(x) it previously output yes generate deterministic random value no store output
  • 7. Fact About ROC 01 Oracle cannot use formula or algorithm to create the digest Suppose oracle uses the formula h(M) = M mon n, M1 + M2 = M3 h(M3) = (M1+M2) mod n = M1 mod n + M2 mod n = [ h(M1) + h(M2) ] mod n should have some randomness. eg, secure bidding problem 03 In practice we use pseudo-random functions 02 Unfortunately, a random oracle does not exist since it requires infinite storage
  • 8. Collision (Pigeonhole principle) Input Space : infinity Assume 4 bits length Hash Space : fixed Assume 4 bits length n pigeonhole > n+1 pigeons > at least 1 nole is occupied by 2 pigeons n pigeonhole > kn+1 pigeons > at least 1 nole is occupied by k+1 pigeons Digest should be shorter than the message, so there are some digests, correspond to more than one message. Eg, pigeonhole = 4, pigeons = 16 or n = 4, kn+1 = 16, so k is larger than 3. At least 1 digest corresponds to (k+1) messages. 22 = 424 = 16 Obj 1 Obj 2 Obj 3 Obj 4 Obj 5 . 0 1 2 3
  • 9. Birthday Paradox How many people must be there in a room to make the probability 50% that at-least two people in the room have same birthday? Not easy to calculate 2 people share same rather 2 people not share the same birthday. Probability of 23 people not having same birthday = 365/365 x 364/365 x 363/365 x …… x (people 23) 343/365 = 364! / ( 342! X 36522 ) = .492703 > 49.3% Chance we do = 1 - .4927 = .507 > 50.7%
  • 10. Alice Bob Oscar X try to decrypt X Done or undone interfere X X > X’ X’ Another Problem (One Way)
  • 11. Alice Bob Oscar X Knows h( ) interfere X X > X’ X’ Solution h(x) h(x) != h(x’)
  • 12. Preimage Attack Given y ∈ {0, 1} d it is hard to find an x such that h(x) = y aka. one way Can’t be done : lossless compression, check sum Preimage Resistance Cryptographic Hash Function Criteria Birthday Problem 1 What is the minimum number, k, of the students in a classroom such that it is likely that at least one student has a predefined birthday?
  • 13. Preimage Attack Algorithm input: h, D Choose, any X0 ε x, |x0| = q for any message M[i] ε x if (h(M[i]) == D)return M[i] else return fail Probability that the hash of an M[i] match with D = 1/N Probability it does not match with D = 1 - 1/N Probability, none of q queries match with D = ( 1 - 1/N )q Success probability Pr[success] = 1 - ( 1 - 1/N )q e-x = 1 - x + x2/2! - x3/3! + x4/4! + …. According Taylor Series If N is large, replace 1-1/N = e-1/N pr [success] = 1 - e-q/N If probability 0.5, q = ln(0.5)N = 0.69 x 2n Attacks on Random Oracle Model
  • 14. Example : A cryptographic hash function uses a digest of 64 bits. How many digests does Oscar need to create to find the original message with the probability more than 0.5? Suppose, Oscar can test 230 messages per second it takes ( 0.69 x 2 64 )/ 2 30 = 0.69 x 2 34 seconds, or more than 500 years. k ≈ 0.69 × 2n ≈ 0.69 x 2 64
  • 15. Alice Bob Oscar X Found x’, h(x’) = h(x) X = give oscar 20$ X’ = give oscar 20000$ X’ TCR h(x) h(x) == h(x’)
  • 16. Preimage Attack Cryptographic Hash Function Criteria Birthday Problem 2 What is the minimum number, k, of the students in a classroom such that it is likely that at least one student has the same birthday as the student selected by the professor? Given x it is hard to find x ' such that h(x) = h(x ' ) where x != x’ aka, Weak collision-resistance, target collision resistance Second Preimage Resistance
  • 17. Preimage Attack Algorithm input: h, M Calculate D = h(M) Choose, any X0 ε x{M}, |x0| = q-1 for any message M[i] ε x if (h(M[i]) == D)return M[i] else return fail pr [success] = 1 - e-(q-1)/N If probability 0.5, q = ln(0.5)N + 1 = 0.69 x 2n + 1 Attacks on Random Oracle Model
  • 18. Alice Bob Oscar x1 Found x1,x2, h(x1) = h(x2) CR, Digital Signature (x1, y)(x2, y)
  • 19. Preimage Attack Cryptographic Hash Function Criteria Birthday Problem 3 What is the minimum number, k, of the students in a classroom such that it is likely that at least two students have the same birthday? It is hard to find any pair of inputs x, x ' such that h(x) = h(x ' ) where x != x’ aka , Strong collision-resistance Collision Resistance
  • 20. Preimage Attack Algorithm input: h Choose, any x0 ε , |x0| = q for any message pair M[i], M[i`] ε x if (h(M[i]) == h(M[i`]))return M[i], M[i`] else return fail P (hash of M[0] and M[1] does not collide) = 1 - 1/N P (hash of M[0] and M[1] does not collide with M[3]) ( 1 - 1/N ) ( 1 - 2/N ) Probability of q hash value does cot collide (1- 1/N) (1 - 2/N) (1 - 3/N) ………………… ( 1 - (q-1)/N) q-1 q-1 Pr[ No Collisions] = Σ (1 - i/N) = Σ e -i/n = e -q2/N I=1 I=1 pr [collisions/success] = 1 - e -q2/N If probability 0.5, q = sqrt ( ln(0.5)N ) = 1.18 x sqrt(N) = 1.18 x 2n/2 [ N = 2n ] Attacks on Random Oracle Model
  • 21. Example : A cryptographic hash function uses a digest of 64 bits. How many digests does Oscar need to create to find two messages with the same digest with the probability more than 0.5? Suppose, Oscar can test 220 messages per second it takes 1.18 × 212 seconds, or less than two hours k ≈ 1.18 x 2 n/2 ≈ 1.18 x 2 64/2 ≈ 1.18 x 2 32
  • 22. ● Password Storage ● File Authenticity ● Digital Signature, guarantees that the message came from a said source ● Commitments: In a secure bidding, Alice wants to bid value x, but does not want to reveal the bid until the auction is over. Alice then computes h(x), and publicize it, which serves as her commitment. When bidding is over, then she can reveal x, and x can be verified using h(x) Application