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'm planning to do some block encryption with AES and Blowfish (both with 256 Bit keys) chained.

Master key generation: A 32 byte long persistent (over many years) master key is derived from a passphrase and a public salt by using PBKDF2.

Encryption:

  1. For each encryption, two separate IV's are generated for AES and Blowfish from /dev/urandom.
  2. Two one-time keys are generated by applying KDF3 on master-key+first-IV and master-key+second-IV with SHA256 as hash function and pAmt = 4.
  3. The plaintext is encrypted with AES-256 first, using the first one-time key and first IV.
  4. The result of step 3 is now encrypted with Blowfish, using the second one-time key and second IV.

What I am now worried about is:

  1. Does it actually make sense to generate one-time keys at all? Or would it be better to simply generate different IV's for both encryption algorithms and use the same key (the long-term master key)?
  2. Does the one-time keys' strength suffer from the IV's being part of them?
  3. Does the master key's strength suffer from being part of the one-time key generation in case this process is repeated very often?

Can this scenario be deemed secure?

What I'm aiming at with this kind of key-derivation is to guarantee that in case the most exposed algorithm becomes vulnerable to an attack that makes it possible to recover the key from cipher text the inner algorithm is still protecting my data due to independent keys.

Another possible strategy for encryption I thought about is the following:

  1. For each encryption, two separate IV's are generated for AES and Blowfish from /dev/urandom.
  2. The plaintext is encrypted with AES-256 first, using SHA256(master-key) as key and first IV.
  3. The result of step 3 is now encrypted with Blowfish, using SHA256(SHA256(master-key) and the second IV.

This way, each algorithm has its own, permanent key and if somebody manages to crack the outer one and get its key he is still unable to resolve the inner's (because the outer's is the hash of the inner's).

Which way is the best to go, and why?

Thank you very much for your help.

share|improve this question
    
Why do you think this question does not show any research effort, is unclear or not useful? I can imagine a plenty of situations in which the scenarios I describe occur... –  Robert Dec 17 at 12:40
    
I count about 5 questions packed into this one question. It could be helpful to break them out into a few (stand-alone) questions. –  mikeazo Dec 17 at 12:58

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.