public class EncryptionAlgorithms extends Object
EncryptionAlgorithm instance.| Constructor and Description |
|---|
EncryptionAlgorithms() |
| Modifier and Type | Method and Description |
|---|---|
static SymmetricCryptoAlgorithmBuilder |
aes(byte[] keyPassword)
Creates a new builder for AES encryption algorithm with these properties:
Type of cipher: Symmetric
Operation mode: Cipher Block Chaining (CBC)
Input padding: PKCS#5
Encryption key: PBKDF2 with HMAC-SHA1 for key derivation
|
static SymmetricCryptoAlgorithmBuilder |
aes(KeyFactory<Key> keyFactory)
Creates a new builder for AES encryption algorithm with these properties:
Type of cipher: Symmetric
Operation mode: Cipher Block Chaining (CBC)
Input padding: PKCS#5
Encryption key: based on given key factory
|
static SymmetricCryptoAlgorithmBuilder |
aes(String keyPassword)
Creates a new builder for AES encryption algorithm with these properties:
Type of cipher: Symmetric
Operation mode: Cipher Block Chaining (CBC)
Input padding: PKCS#5
Encryption key: PBKDF2 with HMAC-SHA1 for key derivation
|
static AsymmetricCryptoAlgorithmBuilder |
rsa()
Creates a new builder for RSA encryption algorithm with these properties:
Type of cipher: Asymmetric
Operation mode: Electronic Codebook (ECB)
Input padding: OAEP with SHA-256 (MGF1 for masks)
If you don't have key pair, you can generate some via
RSAKeysGenerator. |
static SymmetricCryptoAlgorithmBuilder |
tripleDes(byte[] keyPassword)
Creates a new builder for 3DES encryption algorithm with these properties:
Type of cipher: Symmetric
Operation mode: Cipher Block Chaining (CBC)
Input padding: PKCS#5
Encryption key: PBKDF2 with HMAC-SHA1 for key derivation (can be overridden)
|
static SymmetricCryptoAlgorithmBuilder |
tripleDes(KeyFactory<Key> keyFactory)
Crates a new builder for 3DES encryption algorithm with these properties:
Type of cipher: Symmetric
Operation mode: Cipher Block Chaining (CBC)
Input padding: PKCS#5
Encryption key: based on given key factory
|
static SymmetricCryptoAlgorithmBuilder |
tripleDes(String keyPassword)
Creates a new builder for 3DES encryption algorithm with these properties:
Type of cipher: Symmetric
Operation mode: Cipher Block Chaining (CBC)
Input padding: PKCS#5
Encryption key: PBKDF2 with HMAC-SHA1 for key derivation (can be overridden)
|
public static SymmetricCryptoAlgorithmBuilder aes(byte[] keyPassword) throws IllegalArgumentException
You can provide salt and iterations count for PBKDF2. If you want custom encryption key derivation, you can
use aes(KeyFactory) method to specify custom factory for the key.
keyPassword - password for key derivationIllegalArgumentException - exception if passed key password is nullpublic static SymmetricCryptoAlgorithmBuilder aes(String keyPassword) throws IllegalArgumentException
You can provide salt and iterations count for PBKDF2. If you want custom encryption key derivation, you can
use aes(KeyFactory) method to specify custom factory for the key.
keyPassword - password for key derivationIllegalArgumentException - exception if passed key password is nullpublic static SymmetricCryptoAlgorithmBuilder aes(KeyFactory<Key> keyFactory) throws IllegalArgumentException
keyFactory - custom factory for encryption keyIllegalArgumentException - exception if passed key factory is nullpublic static SymmetricCryptoAlgorithmBuilder tripleDes(byte[] keyPassword) throws IllegalArgumentException
You can provide salt and iterations count for PBKDF2. If you want custom encryption key derivation, you can
use tripleDes(KeyFactory) method to specify custom factory for the key.
keyPassword - password for key derivationIllegalArgumentException - exception if passed key password is nullpublic static SymmetricCryptoAlgorithmBuilder tripleDes(String keyPassword) throws IllegalArgumentException
You can provide salt and iterations count for PBKDF2. If you want custom encryption key derivation, you can
use tripleDes(KeyFactory) method to specify custom factory for the key.
keyPassword - password for key derivationIllegalArgumentException - exception if passed key password is nullpublic static SymmetricCryptoAlgorithmBuilder tripleDes(KeyFactory<Key> keyFactory) throws IllegalArgumentException
keyFactory - custom factory for encryption keyIllegalArgumentException - exception if passed key factory is nullpublic static AsymmetricCryptoAlgorithmBuilder rsa()
RSAKeysGenerator.Copyright © 2015. All rights reserved.