Running CipherExamplePBE

The CipherExamplePBE sample application uses the Entrust implementation of the Password-based Encryption (PBE) 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.CipherExamplePBE <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.CipherExamplePBE Passw0rd 100
 
Installing providers... DONE
 
Creating key and parameters... DONE
salt: 55:E2:70:FD:CE:8B:B9:AD
iterationCount: 100
 
Encrypting data... DONE
input plaintext: 00:01:02:03:04:05:06:07:08:09
output ciphertext: 02:6A:FA:C0:24:8E:C7:B4:CD:C5:7A:E0:37:24:7E:47
 
Decrypting data... DONE
input ciphertext: 02:6A:FA:C0:24:8E:C7:B4:CD:C5:7A:E0:37:24:7E:47
output plaintext: 00:01:02:03:04:05:06:07:08:09