0% found this document useful (0 votes)
67 views9 pages

Public Key Algorithm Is Also Known As Asymmetric Algorithms Different Keys For Encryption and Decryption

This document discusses the knapsack algorithm for public-key encryption. It was one of the first public-key algorithms developed by Merkle and Hellman, getting its security from the knapsack problem which is NP-complete. However, the algorithm was later found to be insecure as researchers were able to break it and reconstruct the private key from the public key. The document provides details on how the knapsack algorithm works, including generating the public and private keys, encryption, and decryption of messages.

Uploaded by

ShUvO SAhA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views9 pages

Public Key Algorithm Is Also Known As Asymmetric Algorithms Different Keys For Encryption and Decryption

This document discusses the knapsack algorithm for public-key encryption. It was one of the first public-key algorithms developed by Merkle and Hellman, getting its security from the knapsack problem which is NP-complete. However, the algorithm was later found to be insecure as researchers were able to break it and reconstruct the private key from the public key. The document provides details on how the knapsack algorithm works, including generating the public and private keys, encryption, and decryption of messages.

Uploaded by

ShUvO SAhA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Introduction

 Public Key Algorithm is also known as asymmetric


algorithms
 Different keys for encryption and decryption
⚫ C = EA-Pub(P)
⚫ DA-Pr (C) = P
 Several Algorithms:
⚫ Knapsack
⚫ RSA
⚫ ElGamal

2
Knapsack Algorithms

 The first algorithm for generalized public-key


encryption
 Developed by Ralph Merkle and Martin Hellman
 It could only be used for encryption, although Adi
Shamir later adapted the system for digital signatures
 Knapsack algorithms get their security from the
knapsack problem, an NP-complete problem.
 This algorithm was later found to be insecure

3
Knapsack Problem

 Given a pile of items, each with different weights, is it


possible to put some of those items into a knapsack so
that the knapsack weighs a given amount?
 Formally: Given a set of values M1, M2,..., Mn , and a
sum S, compute the values of bi such that
S = b1M1 + b2M2 + ...+ bnMn
 The values of bi can be either zero or one.
 This problem is NP-complete

4
Knapsack Algorithm Basic
 A block of plaintext equal in length to the number of
items in the pile would select the items in the
knapsack
⚫ plaintext bits corresponding to the b values, and
⚫ the ciphertext would be the resulting sum.
 There are actually two different knapsack problems,
⚫ one solvable in linear time (easy) and
⚫ the other believed to be (hard).
 The public key is the hard knapsack
⚫ can easily be used to encrypt but cannot be used to decrypt.
 The private key is the easy knapsack
⚫ gives an easy way to decrypt messages.
5
Public and Private Key
 Private key: a superincreasing knapsack sequence
⚫ Example: {2, 3, 6, 13, 27,52}
 Public key:
⚫ Take 2 numbers n and m where n and m have no common factors
⚫ m is greater than sum of all numbers in the private key
⚫ Multiply each value in private key with ‘n mod m’. For n=31, m=105:
• 2 * 31 mod 105 = 62
• 3 * 31 mod 105 = 93
• 6 * 31 mod 105 = 81
• 13 * 31 mod 105 = 88
• 27 * 31 mod 105 = 102
• 52 * 31 mod 105 = 37
⚫ Public key = {62, 93, 81, 88, 102, 37}

6
Encryption
 Break the message into blocks equal to the number of
items in the knapsack sequence.
 Compute the total weights of the knapsacks—one for
every message block.
 For example,
⚫ m = 011000 110101 101110
⚫ b1= 011000, b2=110101, b3=101110
⚫ Public key = {62, 93, 81, 88, 102, 37}
⚫ sumb1 = 93 + 81 = 174
⚫ sumb2 = 62 + 93 + 88 + 37 = 280
⚫ sumb3 = 62 + 81 + 88 + 102 = 333
 The ciphertext c=174,280,333
7
Decryption
 Private key, m and n must be known
 Determine n-1 such that n*(n-1 )=1 (mod m).
 Multiply each of the ciphertext values by n-1 mod m
 Partition with the private knapsack to get the plaintext
values.

8
Decryption
 Example:
⚫ Private key = {2, 3, 6, 13, 27, 52}
⚫ m =105
⚫ n = 31
⚫ n-1 = 61
⚫ c = 174, 280, 333.
⚫ p1 = 174 * 61 mod 105 = 9 = 3 + 6 = 011000
⚫ p2 = 280 * 61 mod 105 = 70 = 2 + 3 + 13 + 52 = 110101
⚫ p3 = 333 * 61 mod 105 = 48 = 2 + 6 + 13 + 27 =101110
 m = 011000 110101 101110.

9
Security of Knapsacks

 Researchers have broken this scheme


⚫ First a single bit of plaintext was recovered
⚫ Then, Shamir showed that knapsacks can be broken in
certain circumstances
⚫ Finally, Shamir and Zippel found flaws in the transformation
that allowed them to reconstruct the superincreasing
knapsack from the normal knapsack
 So, private key can be constructed from the public key

10

You might also like