Knapsack Encryption Algorithm in Cryptography
Knapsack Encryption Algorithm in Cryptography
Source: https://www.geeksforgeeks.org/knapsack-encryption-algorithm-in-cryptography/
So, first we need to find the n-1, which is multiplicative inverse of n mod m i.e.,
n x n-1 mod(m) = 1
31 x n-1 mod(110) = 1
n-1 = 71
Now, we have to multiply 71 with each block of cipher text take modulo m.
121 x 71 mod(110) = 11
Then, we will have to make the sum of 11 from the values of private key {1, 2, 4, 10,
20, 40} i.e.,
1+10=11 so make that corresponding bits 1 and others 0 which is 100100.
Similarly,
197 x 71 mod(110) = 17
1+2+4+10=17 = 111100