If you use PBKDF2WithHmacSHA1 instead of PBEWithSHA1andDESede , your guess works because it supports salt. You just need to add the keyLength parameter to PBEKeySpec :
String algo = "PBKDF2WithHmacSHA1";
...
PBEKeySpec decPBESpec = new PBEKeySpec( password, salt, iterationCount, 128 );
I checked the test and the result is false .
However, note that for the encryption and decryption to work correctly, you need to use the same solon and iteration counter when generating the key.
bozu
source share