Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
    
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? –  codekiddy May 14 at 15:19
    
@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. –  mikeazo May 14 at 15:52
    
@codekiddy "Entropy effectively bounds the performance of the strongest lossless compression possible" (src). –  mikeazo May 14 at 16:00
    
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 –  codekiddy May 14 at 16:01
1  
@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. –  mikeazo May 14 at 16:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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