2

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?

bobH
  • 21
  • 1

1 Answers1

1

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.

fgrieu
  • 149,326
  • 13
  • 324
  • 622
kodlu
  • 25,146
  • 2
  • 30
  • 63