Implementing an C++ super increasing knapsack to show the encryption and decryption of message This program demonstrates the concept of super-increasing knapsack of 8 private keys. User input is required.
On Linux terminal:
g++ -std=c++11 knapsack.cpp -o knapsack
User types in 8 inputs (2,7,11,21,42,89,180,354) for super increasing knapsack
Program calculates total sum of knapsack inputs and display
User key in modulus value that is larger than sum of knapsack (881)
User key in multiplier value that must be coprime to modulus value that is earlier given (588)
User is prompted to key in message to encrypt
Program displays encypted message in bits
Program displays decrypted message in bits and back into plaintext