I read about PBKDF2 on Wikipedia and seen few apps. having option to manually enter number of iterations. I am still not clear on this.

(1) With what I understood, key iterations can be used only with symmetric encryption. If a file/text is encrypted using passphrase, HASH is calculated and encrypted with AES for 'n' number of times. If iterations selected is 100 then this is done 100 times. This is done to defend against brute-force attack.

(2) Key iterations have no use with public-key encryption.

(3) Some apps. by default take 100 iterations. Few apps by default takes 2000 iterations when using AES. How many iterations are considered secure with AES-128 and AES-256?

  • $\begingroup$ For PKBDF2 the iteration count is to make the operation deliberately more expensive to defend against attack, yes. But I've not heard iterations in the context of symmetric crypto or hashes: do you mean the round count? That's not exactly the same thing in that it's not commonly varied and not expected to be: the values chosen by the designers are chosen to be sufficient for all known attacks plus a margin of safety, and it's to defeat cryptographic advances not just raw computing power. $\endgroup$ – Rup Oct 8 '16 at 11:02
  • 1
    $\begingroup$ 1) The standard is to use a hash function in HMAC mode as the underlying PRF. Yes, if the number says "100", you iterate the hash 100x before you use the result as your key. Yes, this is done to slow-down attacks. 2) They have to encrypt private keys with passphrases. 3) Anything below 10k or 50k is way too less today IMO. $\endgroup$ – SEJPM Oct 8 '16 at 12:18
  • $\begingroup$ @SEJPM In that case, while decrypting again it has to be iterated those number of times to get back the correct hash to authenticate? $\endgroup$ – RPK Oct 8 '16 at 12:52
  • 1
    $\begingroup$ yes, you have to do the same key derivation during decryption again. $\endgroup$ – SEJPM Oct 8 '16 at 12:53
  • 1
    $\begingroup$ PBKDF2 doesn't 'encrypt[] with AES' and doesn't involve AES at all, although it can be used in a scheme (e.g. an app) that also uses AES; if you read the Wikipedia article you should know this. PBKDF in general is mostly used for symmetric cryptography (mostly but not solely encryption) because one feature of passwords it that they are relatively easily shared and symmetric keys often need to be shared while asymmetric private keys should (practically) never be shared. $\endgroup$ – dave_thompson_085 Oct 8 '16 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.