Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Variable salt length for PBE

843811Jul 7 2007
I have written some code that makes use of randomly generated salt bytes where the number of bytes in the salt are also randomly generated. This is for password-based encryption using: PBEWithMD5AndDES. When the code is run, I get the following error:

java.security.InvalidAlgorithmParameterException: Salt must be 8 bytes long

Since all the text I have read specifies that the salt should be at least 8 bytes long, I have to think that larger values should be acceptable. Is this a limitation with the algorithm being used, or does the JCE truly restrict the salt to 8 bytes? Please help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2007
Added on Jul 7 2007
0 comments
426 views