2
$\begingroup$

I am a bit confused about the knapsack implementation regarding the bits and block size for encryption.

In the example from this link (https://nrich.maths.org/2199), the knapsack size is 6 and the String that they encrypt has only 6-bits in 3 blocks.

My understanding is a Char can be represented by 7 to 8-bits (UTF-8) and the knapsack size must be at least of size 8 to encrypt one char. Meaning that if I want to use a knapsack for encryption/decryption I must use a knapsack size of 8. Is my understanding correct?

$\endgroup$
  • $\begingroup$ Asymmetric cryptography based on the knapsack problem has historically been broken for proposed practical parameters, which had to be raised. I have correspondingly never met a practical use. Notice that your source says "we now know that this algorithm is not secure" (which is a simplification: it is insecure for parameters making it even close to competitive with other systems). $\endgroup$ – fgrieu May 19 '17 at 7:42
1
$\begingroup$

The example there is instructional, not for implementation. Also, if you only want 26 characters plus a few punctuation marks, 5 or 6 bits would be enough.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.