Running CipherExamplePBES2

The CipherExamplePBES2 the sample application uses the Entrust implementation of the Password-based Encryption scheme 2 (PBES2) cipher to encrypt and decrypt binary data.

To run this sample application, execute the following command line in the etjava/examples directory.

java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.crypto.CipherExamplePBES2 ​<key_pwd>[<iter_count>]

Parameter

Value

​<key_pwd>

The password that will protect the key.

<iter_count>

The number of iterations to perform when generating the key.

For example:

C:\etjava\examples>java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.crypto.CipherExamplePBES2 Passw0rd 2000
Installing providers... DONE
 
Creating key and parameters... DONE
salt: F0:7B:F9:B5:57:09:D2:9B
iterationCount: 2000
iv: E2:77:96:EF:A5:ED:87:3A:45:9C:BA:2C:68:D2:26:28
 
Encrypting data... DONE
input plaintext: 00:01:02:03:04:05:06:07:08:09
output ciphertext: 24:44:3A:1F:5A:FC:2E:57:05:A1:A4:84:E2:B9:AF:84
 
Decrypting data... DONE
input ciphertext: 24:44:3A:1F:5A:FC:2E:57:05:A1:A4:84:E2:B9:AF:84
output plaintext: 00:01:02:03:04:05:06:07:08:09




java -classpath classes;<path to enttoolkit.jar> com.entrust.toolkit.examples.crypto.CipherExamplePBES2 <password> [iterationCount]
Similar to CipherExamplePBE but using a PBES2 cipher with parameters.