Running CipherExampleRSA
The CipherExampleRSA sample application uses the Entrust implementation of the RSA 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.CipherExampleRSA [<key_size>]|
Parameter |
Value |
|
<key_size> |
The key size in bits, as a multiple of 512. Selecting a large key size will cause the sample to run very long. |
For example:
C:\etjava\examples>java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.crypto.CipherExampleRSA 2048Installing providers... DONEGenerating key pair... DONEEncrypting data... DONEinput plaintext: 00:01:02:03:04:05:06:07:08:09output ciphertext: 47:F5:08:D9:99:41:CC:40:5C:AC:44:07:97:B0:CF:71:67:B5:3B:21:2E:C2:DD:82:ED:89:F1:A3:FE:06:0F:7B:20:79:CC:09:01:95:33:7D:B2:95:B1:BE:59:56:99:FA:B8:91:37:3A:FD:F9:73:54:01:36:2C:42:E3:64:A9:5E:65:B8:E2:E8:AE:B4:6B:72:32:10:11:51:CA:2F:25:BA:38:30:63:D1:66:15:BE:4A:4D:4C:FB:E2:4F:BC:AE:C8:60:F2:D9:82:FB:1E:2D:45:24:A0:0E:30:E9:A8:B2:4B:2B:40:F7:EB:C8:77:33:6B:12:98:21:2D:13:40:E9:CA:33:43:37:F3:5D:1D:C5:41:20:00:7E:F5:CB:46:05:AB:44:1F:86:CD:82:9C:C5:79:54:B7:C0:C5:BD:6B:92:DD:2C:76:81:EC:55:AE:69:A4:06:DC:A4:72:1E:2E:FF:56:DD:CD:FE:04:3E:9B:4C:4A:D5:1D:1A:E1:6E:FB:FE:D8:A1:CB:AF:B9:D5:15:A2:28:08:2F:B1:2E:20:DD:F2:56:FD:46:4F:46:B7:1D:84:D9:28:B6:86:A0:57:E1:E0:88:D7:B2:D6:FB:EB:E0:23:23:36:E4:85:EC:81:AF:5C:81:41:C9:57:13:E5:F1:88:43:86:3C:7E:1A:2B:83:11:3DDecrypting data... DONEinput ciphertext: 47:F5:08:D9:99:41:CC:40:5C:AC:44:07:97:B0:CF:71:67:B5:3B:21:2E:C2:DD:82:ED:89:F1:A3:FE:06:0F:7B:20:79:CC:09:01:95:33:7D:B2:95:B1:BE:59:56:99:FA:B8:91:37:3A:FD:F9:73:54:01:36:2C:42:E3:64:A9:5E:65:B8:E2:E8:AE:B4:6B:72:32:10:11:51:CA:2F:25:BA:38:30:63:D1:66:15:BE:4A:4D:4C:FB:E2:4F:BC:AE:C8:60:F2:D9:82:FB:1E:2D:45:24:A0:0E:30:E9:A8:B2:4B:2B:40:F7:EB:C8:77:33:6B:12:98:21:2D:13:40:E9:CA:33:43:37:F3:5D:1D:C5:41:20:00:7E:F5:CB:46:05:AB:44:1F:86:CD:82:9C:C5:79:54:B7:C0:C5:BD:6B:92:DD:2C:76:81:EC:55:AE:69:A4:06:DC:A4:72:1E:2E:FF:56:DD:CD:FE:04:3E:9B:4C:4A:D5:1D:1A:E1:6E:FB:FE:D8:A1:CB:AF:B9:D5:15:A2:28:08:2F:B1:2E:20:DD:F2:56:FD:46:4F:46:B7:1D:84:D9:28:B6:86:A0:57:E1:E0:88:D7:B2:D6:FB:EB:E0:23:23:36:E4:85:EC:81:AF:5C:81:41:C9:57:13:E5:F1:88:43:86:3C:7E:1A:2B:83:11:3Doutput plaintext: 00:01:02:03:04:05:06:07:08:09