To answer the question:
javax.crypto uses low-level cryptography: encryption, decryption, and hashing. This is where the Cipher class is defined.
java.security deals with everything else: SecureRandom, key management, certificate management and signatures.
These interfaces describe JCE providers that implement specific algorithms. JRE provides some of the boxes, and BouncyCastle is another good one.
If you plan some custom ciphers for which there is no implementation yet, you will implement your own JCE provider and, in particular, extend javax.crypto.CipherSpi .
It is not difficult, but you should read the documentation on how to do this . In order for JCE to allow your provider, you will need to contact Oracle for a certificate, basically faxing a signed expression stating that you know US export restrictions on cryptographic libraries.
ykaganovich
source share