2
$\begingroup$

While educating my self I'm having hard time to understand what an 128 bit AES key actually means? Is it a key length or entropy?

Please explain to me trough following example (assuming AES):

Password length in characters (L) = 20 (characters)

Symbols used (N) = 95 (ASCII set)

Entropy = log2 (N^L) = 128 (is this what is called 128bit AES key?)

OR

Key length = L * 8bits = 160 bit key length ? (is this supposed to be 160bit AES key?)

When somebody says that he's using 128bit AES key, I want to know to what is he referring to, a key length or entropy?

$\endgroup$

1 Answer 1

8
$\begingroup$

When they say they are using a 128 bit AES key, they mean the length of the key is 128 bits. Technically a 128 bit AES key could have 0 bits of entropy, 128 bits of entropy, or anywhere in between.

To be secure, however, the 128 bit key should also have high entropy. Ideally, a 128 bit AES key would also have 128 bits of entropy.

A few side notes
Keep in mind that $\log_2N^L$ only computes the entropy in the key if the $L$ characters in the password were chosen randomly.

There is no such thing as a 160 bit AES key. AES supports key lengths of 128, 192, 256 bits.

$\endgroup$
7
  • $\begingroup$ You say that 128bit key can't have more than 128bit entropy? then according to formula from my post maximum value of 'N' is 256 symbol set. but AFAIK unicode symbol set is much more than 256 symbols? Which could make an 128bit AES key to have much grater entropy. am I wrong? $\endgroup$
    – codekiddy
    Commented May 14, 2014 at 15:19
  • $\begingroup$ @codekiddy Say there are 256 symbols in your symbol set and the length of the password is 20 symbols. If the symbols are chosen completely at random then the entropy of the password is $\log_2 256^{20}=160$, it also turns out that the length of the password is 160. You can't use that password directly as a 128 bit AES key since that key must have length 128. So what do you do? Out of necessity, you have to shrink the password from 160 bits to 128 bits. How do you do this without also shrinking the entropy to 128 bits? Answer: you can't. $\endgroup$
    – mikeazo
    Commented May 14, 2014 at 15:52
  • $\begingroup$ @codekiddy "Entropy effectively bounds the performance of the strongest lossless compression possible" (src). $\endgroup$
    – mikeazo
    Commented May 14, 2014 at 16:00
  • $\begingroup$ Yes, you are right, but in your comment above if you replace 256 symbol set with 3000 then the entropy will be 231bit packed into 160bit key :) Any way you answered to my original question that 128bit AES key is refering to key length and not to an entropy so I'l mark your question as answered. I recommend to anyone who is interested to read this (I just found that) schneier.com/blog/archives/2009/09/the_doghouse_cr.html $\endgroup$
    – codekiddy
    Commented May 14, 2014 at 16:01
  • 1
    $\begingroup$ @codekiddy The symbols in the set of 256 take 8 bits each to represent in their most compact representation. How many bits does it take to represent the symbols in a set of size 3000? More than 8. So the key is no longer 160 bits. In other words, going back to your original example, unicode characters take more bits to represent than ascii characters, so in bits, the password will be longer even though you only draw 20 symbols in each case. $\endgroup$
    – mikeazo
    Commented May 14, 2014 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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