Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use AES-128bit to encrypt files and I want to compute a HMAC for each one of the encrypted files to ensure their integrity.

Can I use directly the AES KEY to compute HMAC or should I used a derived form (eg. PBKDF2 sha256) ? In other words I wonder if the HMAC can facilitate the recovery of the AES key or not...

Thank you in advance. Best regards

share|improve this question
up vote 1 down vote accepted

In general, the advice is always to use two unique keys for two distinct functions. The main reason is for separation of responsibilities.

Consider that your senior executives may have a very sensitive file that talks about an upcoming business deal. It needs to be encrypted so that only the other executives can read it.

However, you may need to ask a system administrator, security reviewer, or arbitrator to periodically authenticate or monitor the integrity of the files. If they're both using the same key, you can't separate those duties.

share|improve this answer
Thanks for the advice! Simple yet effective. – mad Nov 13 '13 at 21:35

Your Answer


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.