Cryptography Tutorials - Herong's Tutorial Examples - v5.42, by Herong Yang
Steps of Using DES Algorithm in JDK JCE
This section describes how to use DES algorithm provided in the JDK JCE package. Steps include building a secret key object from key material; creating and initializing a cipher object.
To use DES algorithm in the JDK JCE package, we need to use several JCE classes and follow the steps:
1. Creating a DESKeySpec object from a 8-byte key material by calling the javax.crypto.spec.DESKeySpec constructor.
2. Creating a SecretKeyFactory object with DES algorithm name, mode name, and padding name by calling the javax.crypto.SecretKeyFactory.getInstance() static method.
3. Converting the DESKeySpec object to a SecretKey object through the SecretKeyFactory object by calling the javax.crypto.SecretKeyFactory.generateSecret() method.
4. Creating a Cipher object with DES algorithm name, mode name, and padding name by calling the javax.crypto.Cipher.getInstance() static method.
5. Initializing the Cipher object with the SecretKey object by calling the javax.crypto.Cipher.init() method.
6. Ciphering through input data as byte arrays by calling the javax.crypto.Cipher.update() method.
7. Finalizing the ciphering process by calling the javax.crypto.Cipher.doFinal() method.
Table of Contents
Introduction to AES (Advanced Encryption Standard)
DES Algorithm - Illustrated with Java Programs
DES Algorithm Java Implementation
►DES Algorithm - Java Implementation in JDK JCE
DES Java Implementation in JDK by Sun
►Steps of Using DES Algorithm in JDK JCE
Testing DES Algorithm in JDK JCE
JceSunDesPaddingTest.java - JCE DES Padding Test
DES Encryption Operation Modes
PHP Implementation of DES - mcrypt
Blowfish - 8-Byte Block Cipher
Secret Key Generation and Management
Cipher - Secret Key Encryption and Decryption
RSA Implementation using java.math.BigInteger Class
Introduction of DSA (Digital Signature Algorithm)
Java Default Implementation of DSA
Private key and Public Key Pair Generation
PKCS#8/X.509 Private/Public Encoding Standards
Cipher - Public Key Encryption and Decryption
OpenSSL Introduction and Installation
OpenSSL Generating and Managing RSA Keys
OpenSSL Generating and Signing CSR
OpenSSL Validating Certificate Path
"keytool" and "keystore" from JDK
"OpenSSL" Signing CSR Generated by "keytool"
Migrating Keys from "keystore" to "OpenSSL" Key Files
Certificate X.509 Standard and DER/PEM Formats
Migrating Keys from "OpenSSL" Key Files to "keystore"