Exposing Salt and Iteration count- PBE
Hi
I am doing a PBE using the JCE apis. There are two machines M1 and M2.
In M1 I do an encryption of a data string using a password,salt and iteration count. I pass the encrypted datastring as one of the properties in a property file to the M2 where I decrypt.
I just want to know if I can pass my salt and the iteration count also as a part of the properties file. I can find in some docs that say that the salt and the iteration count need not be kept secret.
Any help would be greatly appreciated.
Thanks in advance.
# 1
You don't do ENCRYPTION, you just do HASHING (a one-way process).
And yes, you needn't keep the salt and the iteration count private. You may store the salt together with the password and fix the iteration count at some value.
The purpose of salt is to prevent simultaneous attacks an all passwords (without salt: I guess password "123", compute its hash and look it up in the whole passwort table, is there any user with matching password? with salt, this doesn't work).
# 4
Sorry, I didn't read it carefully. But the answer stays the same: The password is the only thing you must not reveal. Of cause, a secret salt would make it more secure as it would effectivelly become a part of the password.
But this seems to me to be only important if the password is too simple. If you could ensure a strong password, then everything's ok. If you can't (e.g., it gets chosen by some BFUs), then there's a problem. Keeping the salt secret could mitigate it, but not solve it, as you would need to transfer it somehow from one machine to the other.
# 5
> ... I just want to know if I can pass my salt and the iteration count also as a part of the properties file...
Yes, they don't need to be secret. The salt is designed to prevent precomputed dictionary attacks. It just needs to be unpredictable. The iteration count 'c' is designed to make password guessing more expensive by a factor of 'c'. It also makes symmetric key generation slower by a factor of 'c'. Therefore, choose as large a value of 'c' as you can tolerate.
These help to mitigate, but not eliminate, some of the weaknesses associated with passwords.