SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptographyzahid-mian
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation harshit chavda
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701Amit Pathak
 
13 asymmetric key cryptography
13   asymmetric key cryptography13   asymmetric key cryptography
13 asymmetric key cryptographydrewz lin
 
Mathematics of Asymmetric cryptography
Mathematics of Asymmetric cryptographyMathematics of Asymmetric cryptography
Mathematics of Asymmetric cryptographySou Jana
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash functionChirag Patel
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithmsRashmi Burugupalli
 
Traditional symmetric-key cipher
Traditional symmetric-key cipherTraditional symmetric-key cipher
Traditional symmetric-key cipherVasuki Ramasamy
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
Idea(international data encryption algorithm)
Idea(international data encryption algorithm)Idea(international data encryption algorithm)
Idea(international data encryption algorithm)SAurabh PRajapati
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSADr.Florence Dayana
 
Secure Hash Algorithm (SHA-512)
Secure Hash Algorithm (SHA-512)Secure Hash Algorithm (SHA-512)
Secure Hash Algorithm (SHA-512)DUET
 
Secret key cryptography
Secret key cryptographySecret key cryptography
Secret key cryptographyPrabhat Goel
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithmSunita Kharayat
 
Principles of public key cryptography and its Uses
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its UsesMohsin Ali
 

Mais procurados (20)

Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
 
S/MIME
S/MIMES/MIME
S/MIME
 
13 asymmetric key cryptography
13   asymmetric key cryptography13   asymmetric key cryptography
13 asymmetric key cryptography
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
Mathematics of Asymmetric cryptography
Mathematics of Asymmetric cryptographyMathematics of Asymmetric cryptography
Mathematics of Asymmetric cryptography
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash function
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
Traditional symmetric-key cipher
Traditional symmetric-key cipherTraditional symmetric-key cipher
Traditional symmetric-key cipher
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
Idea(international data encryption algorithm)
Idea(international data encryption algorithm)Idea(international data encryption algorithm)
Idea(international data encryption algorithm)
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Secure Hash Algorithm (SHA-512)
Secure Hash Algorithm (SHA-512)Secure Hash Algorithm (SHA-512)
Secure Hash Algorithm (SHA-512)
 
Product Cipher
Product CipherProduct Cipher
Product Cipher
 
Secret key cryptography
Secret key cryptographySecret key cryptography
Secret key cryptography
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
 
Principles of public key cryptography and its Uses
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its Uses
 

Semelhante a 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
 
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 hashingDmitriy Selivanov
 
Дмитрий Селиванов, 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...Mail.ru Group
 
Deep Learning for Cyber Security
Deep Learning for Cyber SecurityDeep Learning for Cyber Security
Deep Learning for Cyber SecurityAltoros
 
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..Madhumita Tamhane
 
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 hungVu Hung Nguyen
 
CMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & QuantifiersCMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & Quantifiersallyn joy calcaben
 
"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 @...Adrian Florea
 
Cuckoo Search Algorithm: An Introduction
Cuckoo Search Algorithm: An IntroductionCuckoo Search Algorithm: An Introduction
Cuckoo Search Algorithm: An IntroductionXin-She Yang
 
Limits of Computation
Limits of ComputationLimits of Computation
Limits of ComputationJoshua Reuben
 
The Limits of Computation
The Limits of ComputationThe Limits of Computation
The Limits of ComputationJoshua Reuben
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiersblaircomp2003
 
Largedictionaries handout
Largedictionaries handoutLargedictionaries handout
Largedictionaries handoutcsedays
 

Semelhante a 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!
 
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
 
Дмитрий Селиванов, 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...
 
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
 

Mais de Mahbubur Rahman

Randomized Algorithm- Advanced Algorithm
Randomized Algorithm- Advanced AlgorithmRandomized Algorithm- Advanced Algorithm
Randomized Algorithm- Advanced AlgorithmMahbubur Rahman
 
Cloudonomics in Advanced Cloud Computing
Cloudonomics in Advanced Cloud ComputingCloudonomics in Advanced Cloud Computing
Cloudonomics in Advanced Cloud ComputingMahbubur Rahman
 
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...Mahbubur Rahman
 
Geographic Routing in WSN
Geographic Routing in WSNGeographic Routing in WSN
Geographic Routing in WSNMahbubur Rahman
 
Streaming Stored Video- Computer Networking
Streaming Stored Video- Computer Networking  Streaming Stored Video- Computer Networking
Streaming Stored Video- Computer Networking Mahbubur Rahman
 
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 CipherMahbubur Rahman
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in CompilersMahbubur Rahman
 
Web Server And Database Server
Web Server And Database ServerWeb Server And Database Server
Web Server And Database ServerMahbubur Rahman
 

Mais de 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
 

Último

Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfisabel213075
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectssuserb6619e
 
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMMchpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMMNanaAgyeman13
 

Último (20)

Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdf
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
 
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMMchpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
 

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