APPLICATIONS AND SOLUTIONS FOR COMPLEXITY Dr. Adam P. Anthony Lecture 27.

Slides:



Advertisements
Similar presentations
CS211 Problems: unsolvable, unfeasible and unsolved Topic 3: P and NP.
Advertisements

Digital Signatures. Anononymity and the Internet.
Section 3.8: More Modular Arithmetic and Public-Key Cryptography
 The amount of time it takes a computer to solve a particular problem depends on:  The hardware capabilities of the computer  The efficiency of the.
Creating Secret Messages. 2 Why do we need to keep things secret? Historically, secret messages were used in wars and battles For example, the Enigma.
Cryptography 101 How is data actually secured. RSA Public Key Encryption RSA – names after the inventors –Rivest, Shamir, and Adleman Basic Idea: Your.
Introduction to Analysis of Algorithms
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
Apr 30, 2002Mårten Trolin1 Previous lecture – passwords Passwords for authentication –Storing hashed passwords –Use of salt Passwords for key generation.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
Algorithms. Problems, Algorithms, Programs Problem - a well defined task. –Sort a list of numbers. –Find a particular item in a list. –Find a winning.
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
Cryptography & Complexity An amazing blend of Mathematics, Computer Science, Physics and achieving “the impossible”.
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
ELECTRONIC PAYMENT SYSTEMSFALL 2001COPYRIGHT © 2001 MICHAEL I. SHAMOS Electronic Payment Systems Lecture 6 Epayment Security II.
Analysis of Algorithms COMP171 Fall Analysis of Algorithms / Slide 2 Introduction * What is Algorithm? n a clearly specified set of simple instructions.
By: Mike Neumiller & Brian Yarbrough
Encryption. Introduction Computer security is the prevention of or protection against –access to information by unauthorized recipients –intentional but.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
Lecture 5 Overview Does DES Work? Differential Cryptanalysis Idea – Use two plaintext that barely differ – Study the difference in the corresponding.
Lecture 19 Page 1 CS 111 Online Security for Operating Systems: Cryptography, Authentication, and Protecting OS Resources CS 111 On-Line MS Program Operating.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
The RSA Algorithm Rocky K. C. Chang, March
Lecture 7 Page 1 CS 236 Online Password Management Limit login attempts Encrypt your passwords Protecting the password file Forgotten passwords Generating.
HOW TO SOLVE IT? Algorithms. An Algorithm An algorithm is any well-defined (computational) procedure that takes some value, or set of values, as input.
1 Complexity Lecture Ref. Handout p
Calculating Discrete Logarithms John Hawley Nicolette Nicolosi Ryan Rivard.
Lecture 19 Page 1 CS 111 Online Symmetric Cryptosystems C = E(K,P) P = D(K,C) E() and D() are not necessarily the same operations.
1 Growth of Functions CS 202 Epp, section ??? Aaron Bloomfield.
Difficult Problems. Polynomial-time algorithms A polynomial-time algorithm is an algorithm whose running time is O(f(n)), where f(n) is a polynomial A.
IT253: Computer Organization
Cryptography: RSA & DES Marcia Noel Ken Roe Jaime Buccheri.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
Week 5 - Monday.  What did we talk about last time?  Linked list implementations  Stacks  Queues.
Analysis of Algorithms
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Section 4.4: The RSA Cryptosystem Practice HW Handwritten and Maple Exercises p at end of class notes.
Darci Miyashiro Math 480 April 29, 2013
Chapter 16 Security Introduction to CS 1 st Semester, 2012 Sanghyun Park.
MA/CSSE 473 Day 10 Primality testing summary Data Encryption RSA.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
P, NP, and Exponential Problems Should have had all this in CS 252 – Quick review Many problems have an exponential number of possibilities and we can.
Encryption No. 1  Seattle Pacific University Encryption: Protecting Your Data While in Transit Kevin Bolding Electrical Engineering Seattle Pacific University.
Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.
CRYPTOGRAPHY. WHAT IS PUBLIC-KEY ENCRYPTION? Encryption is the key to information security The main idea- by using only public information, a sender can.
Chapter 11 Theory of Computation. © 2005 Pearson Addison-Wesley. All rights reserved 11-2 Chapter 11: Theory of Computation 11.1 Functions and Their Computation.
James C. Bradas, Ph.D. Engineering & Analysis Operation 18 June 2009 Public Key Encryption.
ENCRYPTION TAKE 2: PRACTICAL DETAILS David Kauchak CS52 – Spring 2015.
COMP 424 Lecture 04 Advanced Encryption Techniques (DES, AES, RSA)
David Kauchak CS52 – Spring 2015
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Lecture 7 Page 1 CS 111 Summer 2013 Dynamic Domain Allocation A concept covered in a previous lecture We’ll just review it here Domains are regions of.
Chapter 11 Theory of Computation © 2007 Pearson Addison-Wesley. All rights reserved.
Introduction to Pubic Key Encryption CSCI 5857: Encoding and Encryption.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Cryptography By: Nick Belhumeur. Overview What is Cryptography? What is Cryptography? 2 types of cryptosystems 2 types of cryptosystems Example of Encryption.
Public Key Cryptography
Chapter 12: Theory of Computation
Password Management Limit login attempts Encrypt your passwords
IGCSE 6 Cambridge Effectiveness of algorithms Computer Science
Dynamic Domain Allocation
Chapter 11 Theory of Computation © 2007 Pearson Addison-Wesley.
Public-key Cryptography
Algorithm Analysis CSE 2011 Winter September 2018.
Chapter 12: Theory of Computation
Objective of This Course
PART VII Security.
Presentation transcript:

APPLICATIONS AND SOLUTIONS FOR COMPLEXITY Dr. Adam P. Anthony Lecture 27

NEXT WEEK  Have your presentations ready!  Submit electronic document/project on blackboard  ALL PROJECTS ARE DUE NEXT TUESDAY, AT THE START OF CLASS REGARDLESS OF WHEN YOU ARE PRESENTING  Presentation Order is posted on the course schedule

Complexity in the News  November 2010 issue Talks about recent attempt to prove P  NP rg/story/10/08/08/ /Claimed-Proof- That-P--NP rg/story/10/08/08/ /Claimed-Proof- That-P--NP  Talks about using NP- Complete problems to secure elections

Dealing with NP-Completeness  Not all hope is lost with the class NP!  We typically analyze problems in the worst case  Many cases are much easier, so we can just use a slow algorithm in this case  Even if can’t solve problems perfectly, we can still seek something that is close to perfect  An Approximation Algorithm is one that aims to do the best it can at solving a problem, though it may make mistakes  Usually we can make a faster algorithm by cutting corners, or making a lucky guess.

The Set-Cover Problem  Imagine, in a large company that we need:  Data Storage (DS)  Data Processing (DP)  Data Imaging (DI)  Image Storage (IS)  Image Sharing (IH)  And we have several vendors pushing products:  Program A can do: (DS, DP)  Program B can do: (DP, DI, IH)  Program C can do: (IS, IH)  Program D can do: (DS)  Program E can do: (IS)  Each product has the same cost, and would equally serve our needs for the specified items. Which do we choose? In large, complex instances this problem is NP- Complete!

Greedy Algorithms  Remember how nondeterministic machines always make the ‘right’ choice?  The efficiency is in the fact that they only make one choice, and throw out all other options  Greedy algorithm: don’t know the ‘right’ choice, but do know which one looks best at the time  Not always the best! (hindsight is 20/20)  Sometimes we tie! (left to guessing)

Greedy Set Cover  Imagine, in a large company that we need:  Data Storage (DS)  Data Processing (DP)  Data Imaging (DI)  Image Storage (IS)  Image Sharing (IH)  And we have several vendors pushing products:  Program A can do: (DS, DP)  Program B can do: (DP, DI, IH)  Program C can do: (IS, IH)  Program D can do: (DS)  Program E can do: (IS) GreedySetCover: Repeat Pick the program which solves the most remaining problems Until No Problems Remain This algorithm isn’t perfect, but we can prove that it finds answers that are VERY close to the best answer.

Leveraging NP-Completeness for Security  Key property of NP: solving the problem is hard, but checking the solution is easy!  Imagine a vault with the following lock:  Give a particularly difficult instance of the traveling salesman problem  If you can solve it, the vault will be opened!  TSP is not a good problem for this task, because you can’t ‘reverse engineer’ the problem from a solution  A more popular usage is Integer Factorization

Cryptography  Mostly used in military applications  Also found in business, love  Idea: always assume that the enemy will intercept our messages!  Can we still keep them from reading the message?  Cryptography: an ordered process of scrambling (encrypting) a message such that it can only be feasibly unscrambled (decrypted) if you possess the proper knowledge (key)

Traditional Cryptography  Create message, encrypt using key  Deliver message to recipient  Separately deliver the key  How do we keep it safe?

Public Key Cryptography  Manufacture 1 key, 1 lock  Instead of the SENDER locking up the message, ask the RECIPIENT for a lock  Put the message in a case, secure with lock  Send case in regular postal mail  Recipient already has key, so no separate courier required!  For convenience: manufacture locks, distribute around country

RSA Public Key Encryption System  RSA: A popular public key cryptographic algorithm  Abbreviation of authors’ last names: Rivest, Shamir Adleman  Relies on the (presumed) intractability of the problem of factoring large numbers  Public key = 2 numbers, N and e: Used to encrypt messages  Replaces the 1000 locks from last slide  Private key = 2 numbers, N and d: Used to decrypt messages  Replaces the key for that lock  N is the same for both public, private key  Mathematical relationship between N,e,d is what makes this work

12-13 Encrypting the Message  Encrypting keys: N = 91 and e = 5  Message: two = 23 ten  Encryption Step 1: 23 e = 23 5 = 6,436,343  Encryption Step 2: 6,436,343 ÷ 91 has a remainder of 4  4 ten = 100 two  Therefore, encrypted version of is 100.

12-14 Decrypting the Message 100  Decrypting keys: N = 91, d = 29  Encrypted Message: 100 two = 4 ten  Decryption Step 1: 4 d = 4 29 = 288,230,376,151,711,744  Decryption Step 2: 288,230,376,151,711,744 ÷ 91 has a remainder of 23  Original Message: 23 ten = two  Therefore, decrypted version of 100 is

Establishing an RSA public key encryption system  Where did N = 91, e = 5, and d = 29 come from? 1. Pick two prime numbers p, and q  7 and Multiply them together to get N: 7*13 = e and d can be any numbers that satisfy this equation: e*d = k(p-1)(q-1) 4. Short story: Pick p and q and the rest of the numbers fall into place, and the system works!

Security of RSA  Remember, d is kept secret, and we can’t decrypt without it!  But d is computed using p and q!  And n = p*q (Uh Oh!)  A crook can compute d but only if he/she can factor n into its prime components!  Factoring large integers is NP-Complete  Easy for small numbers (7,13)  Hard for large numbers—RSA uses p,q values with 150+ digits!

A (rejected) Homework Problem  Find the factors of 107,531  How can we solve this?  Maybe we can write a program?  0/slides/PrimeFactors.sb 0/slides/PrimeFactors.sb

Parallel Computing  If one computer is too slow, try 2!  Or 4, or 8, or 16 or 32 or 64 or 128 or 256…  Parallel computing involves the process of solving a single problem by:  Breaking it into smaller pieces  Solving each smaller piece in parallel  Putting the small solutions back together  Many computers today have 2-8 separate processors, giving it the apparent strength of multiple computers!

Types of Parallel Computing  Each processor has its own private RAM storage  Total RAM in a distributed computer: Sum of all private RAM sources  Must request access to another’s RAM  Advantages:  different processors can’t interfere with another’s work  Easy to expand  Disadvantages:  Hard to program  All processors share a single source of RAM  To access memory, just send out a Load/Store command to the Bus  But what if someone else was using that data???  Advantages:  Easier to program, locate data  Millions of example computers available  Disadvantages:  Memory Bottleneck can serialize the parallelism  Have to take care in how data is accessed, used Distributed MemoryShared Memory

Cost of Parallel Computing  Question: A problem is split into 3 parts. Each part can be solved in 5 steps. How long will it take to solve the problem if we do it in parallel?  Trick question!!  Answer:  Cost of parallelism = Cost of Splitting Data + Cost of computing the single largest part + Cost of reassembling partial solutions  For Shared memory: cost of splitting/combining is very small, but cost of computing can be much higher  For Distributed memory: cost of splitting/combining is larger, and cost of computing is (hopefully) faster

Problems with Parallelism  Splitting data is not always possible!  And when it is, it may be tricky  Concurrency problems:  Parallel writes  Race Conditions  Parallel Reads are safe  Combining results may be as much work as completing the non-parallel algorithm  For these reasons—and more—NP-complete problems remain unsolvable in the infinite case  BUT we may be able to solve larger problems than would otherwise be possible

Obvious Parallelism  Obvious parallelism occurs when data is in a List and the task involves executing a simple action on each item in the list where the action is independent of actions on all other items in the list  Many vendors now have limited support for obvious parallelism:  apply_parallel( ADD-1, List)

Example problems  Which of these are obviously parallel, which are not? Which could still be made parallel? 1. Convert a list of Fahrenheit temperatures to Celsius 2. For each item in a list, compute the product of that number times all the numbers that appear before it in the list [ ] computes [ ] 3. Take two lists, multiply each corresponding element in each list, then add the resulting products together. [2 4 6] and [4 5 9] computes = Take a list and confirm whether it is sorted 5. Search dictionary.com and record the definition of each word in a list

Quantum Computing  Bits can’t get any smaller  But electrons can be in multiple quantum states simultaneously (“superpositioning”)  qubit: can be in 2 states at once  2 qubits: 4 states at once  n qubits: 2 n states at once!   In effect, we can build massively parallel computers!  SciAm Special: How Do Quantum Computers Work?  Images: ams.org