Generate a 3DES key using keytool
Introduction to keytool
Keytool generates 3DES key
C:\ Program Files\ Java\ jre1.8.0_161\ bin > keytool-genseckey-alias test-TDES-keyalg DESede-keysize 168-storetype jceks-keystore key-TDES.store enter the KeyStore password: enter the new password again: enter the key password (if it is the same as the KeyStore password, press enter): the Warning:JCEKS KeyStore uses a special format. It is recommended that you use "keytool-importkeystore-srckeystore key-TDES.store-destkeystore key-TDES.store-deststoretype pkcs12" to migrate to the industry standard format PKCS12.
View the KeyStore:
C:\ Program Files\ Java\ jre1.8.0_161\ bin > keytool-list-v-storetype jceks-keystore key-TDES.store enter KeyStore password: KeyStore type: JCEKS KeyStore provider: SunJCE your KeyStore contains 1 entry alias: test-tdes creation date: 2018-5-22 entry type: SecretKeyEntry** * * Warning:JCEKS KeyStore uses a dedicated format. It is recommended that you use "keytool-importkeystore-srckeystore key-TDES.store-destkeystore key-TDES.store-deststoretype pkcs12" to migrate to the industry standard format PKCS12. Note:-keyalg:DESede corresponds to a 168bit (valid) length key, not 192 position des corresponds to a 56bit (valid) length key, not 64. -keysize: 168-storetype: jceks keytool supports three key storage formats: jks, jceks and pksc12, as long as jceks supports storing symmetric keys.
TripleDES is used when jceks protects Keystore private key.