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.

I know how to calculate the entropy of a key that relates to its selection process. For example if the key space is $1000$, entropy of a randomly chosen key is $1000$. Suppose now you have two keys $X$ and $Y$. The finale key $Z$ is a concatenation of $X$ and $Y$. There are two ways to combine. One is to use XOR and other way is to use a Key Based Key Derivation Function (KBKDF) such as HKDF. I want to know how to calculate the entropy of $Z$ when…

  • $Z$ = $X$ XOR $Y$
  • $Z$ = HKDF($X$,$Y$)

In the XOR case should I use mutual information of $X$ and $Y$?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

With proper hashing the entopy of $Z$ is roughly the sum of both individual entropies, capped to the strength of the hash-function. For SHA-256 the limit is 256 bits, for SHA-512 it's 512 bits. Since entropy above 256 bits is meaningless, this isn't a practical limitation.

For XOR computing the entropy of $Z$ is tricky and depends on how your keys are distributed. It's probably only as strong as the stronger of the two key, which is clearly worse than the sum. If the keys are correlated it might even fail catastrophically.

=> Use HKDF with a good underlying hash

share|improve this answer
    
Hi can you show me reference where I can show this mathematically?? –  deltaaruna Nov 5 '13 at 6:43
add comment

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.