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)
Key size: 128 bits
Block size: 128 bits
Input padding: PKCS#5
Encryption key: PBKDF2 with HMAC-SHA1 for key derivation
You can provide salt and iterations count for PBKDF2.
|
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)
Block size: 128 bits
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)
Key size: 128 bits
Block size: 128 bits
Input padding: PKCS#5
Encryption key: PBKDF2 with HMAC-SHA1 for key derivation
You can provide salt and iterations count for PBKDF2.
|
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)
Key size: 192 bits
Block size: 64 bits
Input padding: PKCS#5
Encryption key: PBKDF2 with HMAC-SHA1 for key derivation (can be overridden)
You can provide salt and iterations count for PBKDF2.
|
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)
Block size: 64 bits
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)
Key size: 192 bits
Block size: 64 bits
Input padding: PKCS#5
Encryption key: PBKDF2 with HMAC-SHA1 for key derivation (can be overridden)
You can provide salt and iterations count for PBKDF2.
|
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 © 2016. All rights reserved.