If the decrypting key is 448, then what is the key size? Suppose I am encrypting a plain text with a key by choosing some random numbers between 0 to 1000 then how I can calculate the key size?


closed as unclear what you're asking by DrLecter, user991, e-sushi, archie, Gilles May 12 '14 at 10:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ "If the decrypting key" for what "is 448"? $\;$ $\endgroup$ – user991 May 12 '14 at 6:51
  • $\begingroup$ I find the question answerable, even if there are several possible answers, starting with ≈9.967 bit (key size as entropy), 10 bit (bit size of fixed-size bitstring coding all possible keys), and marginally 9 bit (number of bits in actual key), or anything above that (name your definition of key size tied to a particular encoding). $\endgroup$ – fgrieu May 12 '14 at 11:43

If the keys of a cryptosystem are obtained

by choosing some random numbers between 0 to 1000

(where numbers is understood as meaning integers), then there are $1001$ equaly probable keys. Hence the key size (or key entropy) is $\log_2(1001)=\log(1001)/\log(2)\approx9.967\text{ bit}$, and the representation of the key as a bitstring must be $10\text{ bit}$ at least (obtained by rounding up).

The actual value ($448$) of the key is only relevant to check that $0\le448\le1000$.

  • $\begingroup$ Can you round up the result of log_2? Please validate my answer :) $\endgroup$ – user9070 May 12 '14 at 10:04
  • $\begingroup$ @TruthSerum: when keys are non-negative integers coded in binary, the size of the bitstring coding the key is $\lceil\log_2(m)\rceil$ where $m$ is the number of possible keys (with $m=n+1$ if $n$ is the maximum key); that matches your $1+\lfloor\log_2(n)\rfloor$. We should plug $m=1001$ into that (giving 10 bit), not $m=448$ (giving 9 bit) which would yield the bit size of the number coding a particular value of the key, which I think is less relevant. $\endgroup$ – fgrieu May 12 '14 at 11:13

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