SlideShare a Scribd company logo
1 of 52
Download to read offline
CNIT 141
Cryptography for Computer Networks
9. Hard Problems
Topics
• Computational Hardness
• Complexity Classes
• The Factoring Problem
• The Discrete Logarithm Problem
• How Things Can Go Wrong
Computational Hardness
Computational Hardness
• Computationally hard problems
• Also called intractable problems
• Take an unreasonable amount of time to
solve
• Regardless of hardware
Measuring Running Time
• Search an array of n elements to find x
• Number of loops between 1 and n
• Expected value: n/2
• Complexity is linear in n
• Doubling n doubles running time
search(x, array, n):
for i from 1 to n
if (array[i] == x) return i;
return 0;
Complexity Classes
• Searching a list: linear or O(n)
• Sorting a list: linear-logarithmic or O(n log n)
• Brute-force key recovery: 

exponential or O(2n)
• Quadratic time is O(n2)
Linear is Fast
• Compared
to
exponential
or quadratic
Polynomial vs.
Superpolynomial Time
• Polynomial time includes 

O(n2), O(n3), O(n4), etc.
• They are considered practically feasible
• Superpolynomial time is anything that grows
faster than polynomial, like O(2n) or O(nlog(n)).
• They are considered impractical, or hard
Quadratic v.
Superpolynomial
Complexity Classes
• Time complexity
• TIME(n2)
• All problems solvable in O(n2)
• TIME(2n)
• All problems solvable in O(2n)
Complexity Classes
Space Complexity
• The memory required by an algorithm
• SPACE(n2)
• Require O(n2) bits of memory
Nondeterministic
Polynomial Time
• P is the class of all polynomial-time algorithms
• NP is the class of non-deterministic
polynomial-time algorithms
• Problems for which a solution can be verified
in polynomial time
• Even though the solution may be hard to find
NP Problems
• Recovering a secret key with known plaintext
• Easy to verify whether a key is correct (P)
• Finding the key is hard but that's a different
problem
• Link Ch 9c
Problems Outside 

NP and P
• Consider brute-forcing the one-time pad
• You cannot recognize the solution when you
find it
• This is very hard, not in P and not in NP
• Verify that no solution exists to a problem
• Must test all possible solutions
• An unlimited number of possibilities
NP-Complete Problems
• The hardest problems in the class NP
• We don't know how to solve them in
polynomial time
• But they are all equally hard
• An efficient solution for any one NP-complete
problem can be used to solve all the others
NP-Complete Problems
NP-Hard
• Some video games are NP-complete
• Some are even harder: NP-hard
• Provably as difficult as NP-complete
problems
P vs. NP
• If you could solve the hardest NP problem in
polynomial time
• You could solve all NP problems in
polynomial time
• NP would equal P
• No one has proven this yet, there's a $1 million
bounty for the proof
Does P = NP?
• Most theorists say no
• If it did, any easily-
verified solution would
be easy to find, in
principle
• All cryptography
would be insecure, in
principle
• In practice, it might
not matter (link Ch 9d)
Quantum Computers
• Link Ch 9e
• Link Ch 9f
Practical Cryptography
• If breaking a cipher were NP-complete
• That would be a very strong cipher
• But NP-complete problems are impractical for
cryptography
• Because they are easy in specific cases
• So real cryptography uses problems that are
probably not NP-hard
Lattice Problems
• Including Learning With Errors
• The only NP-hard problems successfully used
in cryptography
• The basis for New Hope
• The front-runner for post-quantum encryption
• Links Ch 9i, 9j
The Factoring Problem
The Factoring Problem
• Given a large number N that is the product of
two primes p and q
• Find p and q
• How difficult is this problem?
• Prime numbers cannot be divided evenly by
any number other than themselves and one
• 1, 2, 3, 5, 7, 11 are prime
• 9=3x3 and 15=3x5 are not prime
Factoring Large Numbers
in Practice
• Simplest algorithm
• Try dividing by all numbers from 2 to N-1
• If n is the number of bits in N
• This is O(2n) --a hard problem
• Requires 2256 operations for 256-bit N
Factoring Large Numbers
in Practice
• Improved algorithm
• Try only primes from 2 to sqrt(N)
• This is O(2n/2/n) --still hard, but easier
• Requires 2120 operations for 256-bit N
Factoring Large Numbers
in Practice
• Fastest known algorithm
• General number field sieve (GNFS)
• Requires 270 operations for 1024-bit N
• Requires 290 operations for 2048-bit N
• So we recommend 4096-bit keys for 128 bits
of security
Experimental Results
• In 2005, a 663-bit N was factored using 75
cpu-years
• In 2009, a 768-bit N was factored using 2000
cpu-years
• People speculate that the NSA can factor a
1024-bit N
Is Factoring 

NP-Complete?
• No polynomial-time algorithm is known
• Suggesting that factoring is not in P
• However, we can easily verify a factor once it
is found
• So factoring is in NP
• Factoring is probably easier than NP-
complete problems, but this has not been
proven
Quantum Computers
• Can factor numbers easily using quantum
algorithms
• But they don't work well enough yet
Hardness Assumption
• Cryptography starts from a problem which is
assumed to be hard
• The encryption is proven to be at least as hard
as that "hard" problem
• Factoring and discrete logarithm problems
are used as hardness assumptions
The Discrete Logarithm
Problem
What is a Group?
• A set of elements and an operation ✖ that
obey certain group axioms
• Example: Zp*
• Numbers from 1 to p-1, where p is prime
• Z5* contains {1, 2, 3, 4}
Group Axioms
• Closure
• Associativity
• Identity existence
• Inverse existence
Group Axioms
• Closure
• For any two elements x and y in the group
• x ✖ y is in the group
• Associativity
• For any three elements x, y, and z
• (x ✖ y) ✖ z = x ✖ (y ✖ z)
Group Axioms
• Identity existence
• There is an identity element e such that
• e ✖ x = x ✖ e = x
• Inverse existence
• For any x in the group, there exists y such
that
• x ✖ y = y ✖ x = e
Commutative Groups
• For all x and y in the group.
• x ✖ y = y ✖ x
Cyclic Groups
• There's at least one element g such that
• g1, g2, g3, ... mod p,
• Span all group elements
• g is called the generator of the group
The Hard Thing
• The DLP consists of finding y for which
• gy = x
• Within a group Zp*, where p is a prime number
• And x is a known group element
• This problem is about as hard as factoring
How Things Can Go
Wrong
Unlikely Problems
• These are possible but experts don't expect
them to happen
• Someone finding a fast algorithm to factor
numbers
• Someone proving that P = NP
When Factoring is Easy
• This 1024-bit number is easily factored,
because it has a small factor
Other Easily-Factored
Numbers
• If p and q are not random
• Near 2b
• Or some bits of p or q are known
• Or if N is small, such as 128-bit RSA
OpenSSL Allows Short
Keys
Original RSA Paper
• Recommended 512-bit keys (in 1978)
• Link Ch 9g
• 2015 paper presents two attacks
• Logjam MITM attack downgrades TLS to
"export-grade" with 512-bit keys
• State-level adversaries can probably find a
1024-bit secret prime number used by
millions of servers, and it appears that the
NSA has done so
• Link Ch 9h
CNIT 141: 9. Hard Problems
CNIT 141: 9. Hard Problems

More Related Content

What's hot

5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream CiphersSam Bowne
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsSam Bowne
 
CNIT 141: 8. Authenticated Encryption
CNIT 141: 8. Authenticated EncryptionCNIT 141: 8. Authenticated Encryption
CNIT 141: 8. Authenticated EncryptionSam Bowne
 
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
 
CNIT 127: Ch 18: Source Code Auditing
CNIT 127: Ch 18: Source Code AuditingCNIT 127: Ch 18: Source Code Auditing
CNIT 127: Ch 18: Source Code AuditingSam Bowne
 
Discrete Logarithmic Problem- Basis of Elliptic Curve Cryptosystems
Discrete Logarithmic Problem- Basis of Elliptic Curve CryptosystemsDiscrete Logarithmic Problem- Basis of Elliptic Curve Cryptosystems
Discrete Logarithmic Problem- Basis of Elliptic Curve CryptosystemsNIT Sikkim
 
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...JatinJatin30
 
DIGITAL ELECTRONICS- Number System
DIGITAL ELECTRONICS- Number SystemDIGITAL ELECTRONICS- Number System
DIGITAL ELECTRONICS- Number SystemTrinity Dwarka
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsSam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
Post quantum cryptography - thesis
Post quantum cryptography - thesisPost quantum cryptography - thesis
Post quantum cryptography - thesisSamy Shehata
 
Advanced encryption standard (aes)
Advanced encryption standard (aes)Advanced encryption standard (aes)
Advanced encryption standard (aes)farazvirk554
 

What's hot (20)

Cryptography
CryptographyCryptography
Cryptography
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash Functions
 
CNIT 141: 8. Authenticated Encryption
CNIT 141: 8. Authenticated EncryptionCNIT 141: 8. Authenticated Encryption
CNIT 141: 8. Authenticated Encryption
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
CNIT 127: Ch 18: Source Code Auditing
CNIT 127: Ch 18: Source Code AuditingCNIT 127: Ch 18: Source Code Auditing
CNIT 127: Ch 18: Source Code Auditing
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 
Computational Complexity
Computational ComplexityComputational Complexity
Computational Complexity
 
Discrete Logarithmic Problem- Basis of Elliptic Curve Cryptosystems
Discrete Logarithmic Problem- Basis of Elliptic Curve CryptosystemsDiscrete Logarithmic Problem- Basis of Elliptic Curve Cryptosystems
Discrete Logarithmic Problem- Basis of Elliptic Curve Cryptosystems
 
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
 
DIGITAL ELECTRONICS- Number System
DIGITAL ELECTRONICS- Number SystemDIGITAL ELECTRONICS- Number System
DIGITAL ELECTRONICS- Number System
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash Functions
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
Homomorphic encryption
Homomorphic encryptionHomomorphic encryption
Homomorphic encryption
 
Aes
AesAes
Aes
 
Post quantum cryptography - thesis
Post quantum cryptography - thesisPost quantum cryptography - thesis
Post quantum cryptography - thesis
 
Advanced encryption standard (aes)
Advanced encryption standard (aes)Advanced encryption standard (aes)
Advanced encryption standard (aes)
 
Des lecture
Des lectureDes lecture
Des lecture
 
Ch08
Ch08Ch08
Ch08
 

Similar to CNIT 141: 9. Hard Problems

CNIT 141 9. Hard Problems
CNIT 141 9. Hard ProblemsCNIT 141 9. Hard Problems
CNIT 141 9. Hard ProblemsSam Bowne
 
NP-Completeness-myppt.pptx
NP-Completeness-myppt.pptxNP-Completeness-myppt.pptx
NP-Completeness-myppt.pptxSanchayKedia2
 
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxmteteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxmzoobiarana76
 
Intro to TensorFlow and PyTorch Workshop at Tubular Labs
Intro to TensorFlow and PyTorch Workshop at Tubular LabsIntro to TensorFlow and PyTorch Workshop at Tubular Labs
Intro to TensorFlow and PyTorch Workshop at Tubular LabsKendall
 
Towards a mathematical understanding of intelligence
Towards a mathematical understanding of intelligenceTowards a mathematical understanding of intelligence
Towards a mathematical understanding of intelligenceVadim Kosoy
 
CNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic CurvesCNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic CurvesSam Bowne
 
CNIT 141: 12. Elliptic Curves
CNIT 141: 12. Elliptic CurvesCNIT 141: 12. Elliptic Curves
CNIT 141: 12. Elliptic CurvesSam Bowne
 
Rubyconf Neural Networks
Rubyconf Neural NetworksRubyconf Neural Networks
Rubyconf Neural Networkshexgnu
 
CNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic CurvesCNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic CurvesSam Bowne
 

Similar to CNIT 141: 9. Hard Problems (20)

CNIT 141 9. Hard Problems
CNIT 141 9. Hard ProblemsCNIT 141 9. Hard Problems
CNIT 141 9. Hard Problems
 
NP-Completeness-myppt.pptx
NP-Completeness-myppt.pptxNP-Completeness-myppt.pptx
NP-Completeness-myppt.pptx
 
Np complete
Np completeNp complete
Np complete
 
PNP.pptx
PNP.pptxPNP.pptx
PNP.pptx
 
PNP.pptx
PNP.pptxPNP.pptx
PNP.pptx
 
Np complete
Np completeNp complete
Np complete
 
UNIT-V.ppt
UNIT-V.pptUNIT-V.ppt
UNIT-V.ppt
 
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxmteteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
teteuueieoeofhfhfjffkkkfkfflflflhshssnnvmvvmvv,v,v,nnxmxxm
 
Complexity theory
Complexity theory Complexity theory
Complexity theory
 
Np completeness
Np completenessNp completeness
Np completeness
 
AA ppt9107
AA ppt9107AA ppt9107
AA ppt9107
 
Intro to TensorFlow and PyTorch Workshop at Tubular Labs
Intro to TensorFlow and PyTorch Workshop at Tubular LabsIntro to TensorFlow and PyTorch Workshop at Tubular Labs
Intro to TensorFlow and PyTorch Workshop at Tubular Labs
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 5
Unit 5Unit 5
Unit 5
 
Modern Cryptography
Modern CryptographyModern Cryptography
Modern Cryptography
 
Towards a mathematical understanding of intelligence
Towards a mathematical understanding of intelligenceTowards a mathematical understanding of intelligence
Towards a mathematical understanding of intelligence
 
CNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic CurvesCNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic Curves
 
CNIT 141: 12. Elliptic Curves
CNIT 141: 12. Elliptic CurvesCNIT 141: 12. Elliptic Curves
CNIT 141: 12. Elliptic Curves
 
Rubyconf Neural Networks
Rubyconf Neural NetworksRubyconf Neural Networks
Rubyconf Neural Networks
 
CNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic CurvesCNIT 141 12. Elliptic Curves
CNIT 141 12. Elliptic Curves
 

More from Sam Bowne

3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3Sam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis MethodologySam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)Sam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers Sam Bowne
 
6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)Sam Bowne
 

More from Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
 
6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)
 

Recently uploaded

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 

Recently uploaded (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

CNIT 141: 9. Hard Problems

  • 1. CNIT 141 Cryptography for Computer Networks 9. Hard Problems
  • 2. Topics • Computational Hardness • Complexity Classes • The Factoring Problem • The Discrete Logarithm Problem • How Things Can Go Wrong
  • 4. Computational Hardness • Computationally hard problems • Also called intractable problems • Take an unreasonable amount of time to solve • Regardless of hardware
  • 5. Measuring Running Time • Search an array of n elements to find x • Number of loops between 1 and n • Expected value: n/2 • Complexity is linear in n • Doubling n doubles running time search(x, array, n): for i from 1 to n if (array[i] == x) return i; return 0;
  • 6. Complexity Classes • Searching a list: linear or O(n) • Sorting a list: linear-logarithmic or O(n log n) • Brute-force key recovery: 
 exponential or O(2n) • Quadratic time is O(n2)
  • 7. Linear is Fast • Compared to exponential or quadratic
  • 8. Polynomial vs. Superpolynomial Time • Polynomial time includes 
 O(n2), O(n3), O(n4), etc. • They are considered practically feasible • Superpolynomial time is anything that grows faster than polynomial, like O(2n) or O(nlog(n)). • They are considered impractical, or hard
  • 11. • Time complexity • TIME(n2) • All problems solvable in O(n2) • TIME(2n) • All problems solvable in O(2n) Complexity Classes
  • 12. Space Complexity • The memory required by an algorithm • SPACE(n2) • Require O(n2) bits of memory
  • 13. Nondeterministic Polynomial Time • P is the class of all polynomial-time algorithms • NP is the class of non-deterministic polynomial-time algorithms • Problems for which a solution can be verified in polynomial time • Even though the solution may be hard to find
  • 14. NP Problems • Recovering a secret key with known plaintext • Easy to verify whether a key is correct (P) • Finding the key is hard but that's a different problem
  • 16. Problems Outside 
 NP and P • Consider brute-forcing the one-time pad • You cannot recognize the solution when you find it • This is very hard, not in P and not in NP • Verify that no solution exists to a problem • Must test all possible solutions • An unlimited number of possibilities
  • 17. NP-Complete Problems • The hardest problems in the class NP • We don't know how to solve them in polynomial time • But they are all equally hard • An efficient solution for any one NP-complete problem can be used to solve all the others
  • 19.
  • 20. NP-Hard • Some video games are NP-complete • Some are even harder: NP-hard • Provably as difficult as NP-complete problems
  • 21. P vs. NP • If you could solve the hardest NP problem in polynomial time • You could solve all NP problems in polynomial time • NP would equal P • No one has proven this yet, there's a $1 million bounty for the proof
  • 22. Does P = NP? • Most theorists say no • If it did, any easily- verified solution would be easy to find, in principle • All cryptography would be insecure, in principle • In practice, it might not matter (link Ch 9d)
  • 25. Practical Cryptography • If breaking a cipher were NP-complete • That would be a very strong cipher • But NP-complete problems are impractical for cryptography • Because they are easy in specific cases • So real cryptography uses problems that are probably not NP-hard
  • 26. Lattice Problems • Including Learning With Errors • The only NP-hard problems successfully used in cryptography • The basis for New Hope • The front-runner for post-quantum encryption • Links Ch 9i, 9j
  • 28. The Factoring Problem • Given a large number N that is the product of two primes p and q • Find p and q • How difficult is this problem? • Prime numbers cannot be divided evenly by any number other than themselves and one • 1, 2, 3, 5, 7, 11 are prime • 9=3x3 and 15=3x5 are not prime
  • 29. Factoring Large Numbers in Practice • Simplest algorithm • Try dividing by all numbers from 2 to N-1 • If n is the number of bits in N • This is O(2n) --a hard problem • Requires 2256 operations for 256-bit N
  • 30. Factoring Large Numbers in Practice • Improved algorithm • Try only primes from 2 to sqrt(N) • This is O(2n/2/n) --still hard, but easier • Requires 2120 operations for 256-bit N
  • 31. Factoring Large Numbers in Practice • Fastest known algorithm • General number field sieve (GNFS) • Requires 270 operations for 1024-bit N • Requires 290 operations for 2048-bit N • So we recommend 4096-bit keys for 128 bits of security
  • 32. Experimental Results • In 2005, a 663-bit N was factored using 75 cpu-years • In 2009, a 768-bit N was factored using 2000 cpu-years • People speculate that the NSA can factor a 1024-bit N
  • 33. Is Factoring 
 NP-Complete? • No polynomial-time algorithm is known • Suggesting that factoring is not in P • However, we can easily verify a factor once it is found • So factoring is in NP • Factoring is probably easier than NP- complete problems, but this has not been proven
  • 34. Quantum Computers • Can factor numbers easily using quantum algorithms • But they don't work well enough yet
  • 35. Hardness Assumption • Cryptography starts from a problem which is assumed to be hard • The encryption is proven to be at least as hard as that "hard" problem • Factoring and discrete logarithm problems are used as hardness assumptions
  • 37. What is a Group? • A set of elements and an operation ✖ that obey certain group axioms • Example: Zp* • Numbers from 1 to p-1, where p is prime • Z5* contains {1, 2, 3, 4}
  • 38. Group Axioms • Closure • Associativity • Identity existence • Inverse existence
  • 39. Group Axioms • Closure • For any two elements x and y in the group • x ✖ y is in the group • Associativity • For any three elements x, y, and z • (x ✖ y) ✖ z = x ✖ (y ✖ z)
  • 40. Group Axioms • Identity existence • There is an identity element e such that • e ✖ x = x ✖ e = x • Inverse existence • For any x in the group, there exists y such that • x ✖ y = y ✖ x = e
  • 41. Commutative Groups • For all x and y in the group. • x ✖ y = y ✖ x
  • 42. Cyclic Groups • There's at least one element g such that • g1, g2, g3, ... mod p, • Span all group elements • g is called the generator of the group
  • 43. The Hard Thing • The DLP consists of finding y for which • gy = x • Within a group Zp*, where p is a prime number • And x is a known group element • This problem is about as hard as factoring
  • 44. How Things Can Go Wrong
  • 45. Unlikely Problems • These are possible but experts don't expect them to happen • Someone finding a fast algorithm to factor numbers • Someone proving that P = NP
  • 46. When Factoring is Easy • This 1024-bit number is easily factored, because it has a small factor
  • 47. Other Easily-Factored Numbers • If p and q are not random • Near 2b • Or some bits of p or q are known • Or if N is small, such as 128-bit RSA
  • 49. Original RSA Paper • Recommended 512-bit keys (in 1978) • Link Ch 9g
  • 50. • 2015 paper presents two attacks • Logjam MITM attack downgrades TLS to "export-grade" with 512-bit keys • State-level adversaries can probably find a 1024-bit secret prime number used by millions of servers, and it appears that the NSA has done so • Link Ch 9h