Skip to main content
1 of 2
Giliweed
  • 597
  • 1
  • 5
  • 16

Importance of salt while generating key

I'm very curious to know this and a bit confuse too, Case1:suppose, I have two files encrypted using AES-128bit ( using same password, same salt but different Rfc2898DeriveBytes objects). If an attacker does brute force attack (imagining that he finishes this) to crack the keys, I'm guessing he needs to run the attack once to get those 2 keys.

Case2:Now, If I encrypt the files using AES-128bit (using same password but different salts and different Rfc2898DeriveBytes objects), will it make the attacker run brute force twice? if the answer is yes, then why? changing the salt doesn't change the number of possible keys (2^128).

If the answer is no then, in both cases the number of possible keys are 2^128. So, What difference does it make if the salt is different?

Giliweed
  • 597
  • 1
  • 5
  • 16