Merkle-Hellman Knapsack Cryptosystem Merkle offered $100 award for breaking singly - iterated knapsack Singly-iterated Merkle - Hellman KC was broken by.

Slides:



Advertisements
Similar presentations
RSA.
Advertisements

1 Complexity ©D.Moshkovitz Cryptography Where Complexity Finally Comes In Handy…
RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
22C:19 Discrete Structures Integers and Modular Arithmetic
Prime Numbers – True/False. 3. There are infinitely many primes. True We can prove this by assuming there aren’t: Multiply all the primes together,
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
7. Asymmetric encryption-
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
Co-operative Private Equality Test(CPET) Ronghua Li and Chuan-Kun Wu (received June 21, 2005; revised and accepted July 4, 2005) International Journal.
Public Key Cryptography
Csci5233 Computer Security & Integrity 1 Cryptography: Basics (2)
Public Encryption: RSA
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Chapter 3 Encryption Algorithms & Systems (Part B)
Public Key Cryptography Bryan Pearsaul. Outline What is Cryptology? Symmetric Ciphers Asymmetric Ciphers Diffie-Hellman RSA (Rivest/Shamir/Adleman) Moral.
CSCI 172/283 Fall 2010 Public Key Cryptography. New paradigm introduced by Diffie and Hellman The mailbox analogy: Bob has a locked mailbox Alice can.
Codes, Ciphers, and Cryptography-RSA Encryption
Public Key Model 8. Cryptography part 2.
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.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
CSCI 398 Research Topics in Computer Science Yana Kortsarts Computer Science Department Widener University Chester, PA.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
Lecture 15 Lecture’s outline Public algorithms (usually) that are each other’s inverse.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Network Security (A Very Brief Introduction)
Computer System Security CSE 5339/7339
RSA Ramki Thurimella.
Cryptography: RSA & DES Marcia Noel Ken Roe Jaime Buccheri.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Implementing RSA Encryption in Java
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Public Key Encryption CS432 – Security in Computing Copyright © 2005, 2008 by Scott Orr and the Trustees of Indiana University.
By Yernar.  Background  Key generation  Encryption  Decryption  Preset Bits  Example.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Design of Algorithms using Brute Force Approach. Primality Testing (given number is n binary digits)
Darci Miyashiro Math 480 April 29, 2013
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
RSA Public Key Crypto System. About RSA Announced in 1977 by Ronald Rivest, Adi Shamir, and Leonard Adleman Relies on the relative ease of finding large.
RSA Prepared by: SITI ZAINAH ADNAN
8.6. Knapsack Ciphers. The Concept At the core of the Knapsack cipher is the Knapsack problem: At the core of the Knapsack cipher is the Knapsack problem:
Merkle-Hellman Knapsack Cryptosystem
Public Key Systems 1 Merkle-Hellman Knapsack Public Key Systems 2 Merkle-Hellman Knapsack  One of first public key systems  Based on NP-complete problem.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Public Key Cryptosystems RSA Diffie-Hellman Department of Computer Engineering Sharif University of Technology 3/8/2006.
The First Ten Years of Public-Key Cryptography Paper by: Whitfield Diffie Presentation by Taotao Zhao.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
Public Key Cryptosystem Introduced in 1976 by Diffie and Hellman [2] In PKC different keys are used for encryption and decryption 1978: First Two Implementations.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
1 Security through complexity Ana Nora Sovarel. 2 Projects Please fill one slot on the signup sheet. One meeting for each group. All members must agree.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Introduction to Pubic Key Encryption CSCI 5857: Encoding and Encryption.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Encryption and Encryption and Decryption Speaker:Tsung Ray Wang Advisor:Prof.Li-Chun Wang.
Public Key Cryptosystem In Symmetric or Private Key cryptosystems the encryption and decryption keys are either the same or can be easily found from each.
CS/COE 1501 Recitation RSA Encryption/Decryption Extended Euclidean Algorithm Digital Signatures.
Public Key Cryptography. Asymmetric encryption is a form of cryptosystem in which Encryption and decryption are performed using the different keys—one.
Public Key Encryption.
Public Key Cryptosystem
PUBLIC-KEY ENCRYPTION Focusing on RSA
Knapsack Cryptosystems
Knapsack Cryptosystems
Input: A={a1, a2, … an} – public key, S - ciphertext
Poking Holes in Knapsack Cryptosystems
One Way Functions Motivation Complexity Theory Review, Motivation
The RSA Public-Key Encryption Algorithm
Presentation transcript:

Merkle-Hellman Knapsack Cryptosystem Merkle offered $100 award for breaking singly - iterated knapsack Singly-iterated Merkle - Hellman KC was broken by Adi Shamir in 1982 At the CRYPTO ’83 conference, Adleman used an Apple II computer to demonstrate Shamir’s method Merkle offered $1000 award for breaking multiply-iterated knapsack Multiply-iterated Merkle-Hellman knapsack was broken by Brickell in 1985

Classical Knapsack Problem General 0-1 knapsack problem: given n items of different values v i and weights w i, find the most valuable subset of the items while the overall weight does not exceed a given capacity W

Subset-Sum Problem Subset – Sum problem is a special case of knapsack problem when a value of each item is equal to its weight Input: set of positive integers: A = {a 1, a 2, …a n } and the positive integer S Output: TRUE, if there is a subset of A that sums to S and the subset itself FALSE otherwise. The subset-sum problem is NP-hard

Easy Knapsack Problem An easy knapsack problem is one in which set A = {a 1, a 2, …a n } is a super-increasing sequence A super-increasing sequence is one in which the next term of the sequence is greater than the sum of all preceding terms: a 2 > a 1, a 3 > a 1 + a 2,…., a n > a 1 + a 2 +…+ a n-1 Example: A= {1, 2, 4, 8, …2 n-1 } is super-increasing sequence

Polynomial Time Algorithm for Easy Knapsack Problem Input: A = {a 1, …a n } is super-increasing sequence, and S >0 Output: TRUE and P – binary array of n elements, P[i] =1 means: a i belongs to subset of A that sums to S, P[0] = 0 otherwise. The algorithm returns FALSE if the subset doesn’t exist for i  n to 1 if S  a i then P[i]  1 and S  S - a i else P[i]  0 if S != 0 then return (FALSE – no solution) else return (P[1], P[2], …P[n]).

Example Input: A= {1, 2, 4, 8}, S = 11 Solution: i = 4, S = 11 >= A[4] = 8, P[4]=1, S= S-A[4]=11-8=3 i=3, S=3 < A[3]=4, P[3]=0 i=2, S=3 >= A[2]=2, P[2]=1, S=S-A[2]=3-2=1 i=1, S=1 >= A[1]=1 P[1]=1, S=S-A[1]=1-1=0 Final answer: P[1]P[2]P[3]P[4]=1101

Merkle-Hellman Additive Knapsack Cryptosystem Alice: 1. Constructs the Knapsack cryptosystem 2. Publishes the public key 3. Receives the ciphertext 4. Decrypts the ciphertext using private key Bob: 1.Encrypts the plaintext using public key 2.Sends the plaintext to Alice

Alice Knapsack Cryptosystem Construction Chooses A = {a 1, …a n } super-increasing sequence, A is a private (easy) knapsack a 1 + …+ a n = E Chooses M - the next prime larger than E. Chooses W that satisfies 2  W < M and (W, M) = 1(W is relatively prime with M) Computes Public (hard) knapsack B = {b 1, ….b n }, where b i = Wa i (mod M), 1  i  n Keeps Private Key: A, W, M Publishes Public key: B

Example: ALICE creates Public and Private Keys Alice Private Key: A= {1, 2, 4, 8} – super increasing E = = 15 and M = 17 first prime > 15 W = 7, 2  W < 17, and (7, 17) = 1 Public Key: ( 1*7) mod 17 = 7 (2*7) mod 17 = 14 (4*7) mod 17 = 28 mod 17 = 11 (8*7) mod 17= 56 mod 17 = 5 Public Key: B = {7, 14, 11, 5}

Bob – Encryption Process Binary Plaintext P breaks up into sets of n elements long: P = {P 1, …P k } For each set P i compute C i is the ciphertext that corresponds to plaintext P i C = {C 1, …C k ) is ciphertext that corresponds to the plaintext P C is sent to Alice

Example Continue: Bob Encryption Bob Encryption: Plaintext: Bob breaks the plaintext into blocks of 4 digits (since the public key has 4 numbers) P={(1101), (0101), (1110)}={P1, P2, P3} Ciphertext: For P1 you take 1101 and multiply by public key: C1= 1*7 + 1*14 + 0*11 + 1*5 = 26 For P2 and P3 do the similar C2 = 0*7 + 1*14 + 0*11 + 1*5 = 19 C3 = 1*7 +1*14 +1*11 + 0*5 = 32 Bob Sends Alice the following ciphertext: C={26, 19, 32}

Alice – Decryption Process Computes w, the multiplicative inverse of W mod M: wW  1 (mod M) The connection between easy and hard knapsacks: Wa i = b i (mod M) or wb i = a i (mod M) 1  i  n For each C i computes: S i = wC i (mod M) Plaintext P i could be found using polynomial time algorithm for easy knapsack

Example continue: Alice Decryption: w = 5 – multiplicative inverse of 7 (mod 17) 5*26 (mod 17) = 11 5*19 (mod 17) = 10 5* 32 (mod 17) = 7 Plaintext: P1 = 1101 (11 = 1*1 + 1*2 +0*4 + 1*8) P2 = 0101 (10 = 0*1 + 1*2 + 0*4 + 1*8) P3 = 1110 (7 = 1*1 + 1*2 + 1*4 + 0*8)

Final Project For final project you will implement the additive knapsack cryptosystem encryption, decryption and cryptanalysis. The project will be divided into 3 parts Part I: Encryption and Decryption– 80% of the grade Part II: Dynamic Programming Algorithm Implementation of Cryptanalysis (without backtracking) –– 10% of the grade Part III: Dynamic Programming Algorithm Backtracking –– 10% of the grade Testing quiz will be done in class on Thursday, June 27 If you have difficulties to implement Part II or/and Part III you can receive up to 3.5 points for each part for solving testing quiz by hand.

Part I – Encryption and Decryption Write a program that can do either encryption or decryption. The program must take two inputs. The first input must be either 1 or 2, with 1 signaling encryption and 2 signaling decryption. The second input depends on the first input. In case of encryption, the second input - plaintext - is a binary string – sequence of 0’s and 1’s. You can assume that plaintext string's length is equal to public key sequence length and the maximal length of the string is 16 bits. In case of decryption, the second input - ciphertext - is a decimal number. Your program should generate the private key and the public key based on the knapsack cryptosystem algorithm. Your program should output the private and public keys as well as encrypted or decrypted message accordingly. Also, print all intermediate important results to test your program for correctness.

PART II: Ciphertext Only Cryptanalytic Attack on Merkle-Hellman Knapsack: Dynamic Programming Algorithm Input: B={b 1, b 2, … b n } – public key, C - ciphertext Output: The binary array P – plaintext Algorithm: Let Q[i, j] be TRUE if there is a subset of first i elements of B that sums to j, 0 ≤ i ≤ n, 0 ≤ j ≤ C Step 1: Computation of P Q[0][0]  TRUE for j = 1 to C do: Q[0][j]  FALSE for i = 1 to n do: for j = 0 to C do: if (j – B[i] < 0): Q[i][j] = Q[i-1][j] else: Q[i][j] = Q[i-1][j-B[i]] or Q[i-1][j]

Step 2: Backtracking Let P be an array of n + 1 elements initialized to 0 i  n, j  C while i > 0: if (j – B[i]) ≥ 0): if (Q[i-1][j-B[i]] is True): P[i]  P[i] + 1 j  j – B[i] i  i – 1 else: i  i – 1 Output: array P, elements of P that equal to 1 construct a desired subset of B that sums to C

EXAMPLE Input: B={1, 4, 5, 2}, C =3 Q[i-1][j-B[i]] or Q[i-1][j] j = 0j = 1j = 2j = 3 i = 0TRUEFALSE i = 1 B[1] =1 TRUE Element is taken FALSE i = 2 B[2] = 4 TRUE FALSE i = 3 B[3] = 5 TRUE FALSE i = 4 B[4] = 2 TRUE Element is taken

Part I Bonus BONUS – 10 points: plaintext string's length is an exact multiple of the public key sequence length BONUS – 10 points: the plaintext is the string of lower case letters. In this case your program first will find the binary equivalent for each letter and after that will use the regular algorithm.