public class BaseCipher extends java.lang.Object implements Cipher
Cipher.Mode| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
algorithm |
private int |
blkSize |
private javax.crypto.Cipher |
cipher |
private int |
ivsize |
private int |
kdfSize |
private int |
keySize |
private java.lang.String |
s |
private java.lang.String |
transformation |
| Constructor and Description |
|---|
BaseCipher(int ivsize,
int kdfSize,
java.lang.String algorithm,
int keySize,
java.lang.String transformation,
int blkSize) |
| Modifier and Type | Method and Description |
|---|---|
protected javax.crypto.Cipher |
createCipherInstance(Cipher.Mode mode,
byte[] key,
byte[] iv) |
java.lang.String |
getAlgorithm() |
int |
getCipherBlockSize() |
protected javax.crypto.Cipher |
getCipherInstance() |
int |
getIVSize() |
int |
getKdfSize() |
int |
getKeySize() |
java.lang.String |
getTransformation() |
void |
init(Cipher.Mode mode,
byte[] key,
byte[] iv)
Initialize the cipher for encryption or decryption with the given key and initialization vector
|
protected byte[] |
initializeIVData(Cipher.Mode mode,
byte[] iv,
int reqLen) |
protected byte[] |
initializeKeyData(Cipher.Mode mode,
byte[] key,
int reqLen) |
protected static byte[] |
resize(byte[] data,
int size) |
java.lang.String |
toString() |
void |
update(byte[] input,
int inputOffset,
int inputLen)
Performs in-place encryption or decryption on the given data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckSupported, updateprivate javax.crypto.Cipher cipher
private final int ivsize
private final int kdfSize
private final java.lang.String algorithm
private final int keySize
private final int blkSize
private final java.lang.String transformation
private java.lang.String s
public BaseCipher(int ivsize,
int kdfSize,
java.lang.String algorithm,
int keySize,
java.lang.String transformation,
int blkSize)
public java.lang.String getAlgorithm()
getAlgorithm in interface AlgorithmNameProviderpublic int getKeySize()
getKeySize in interface KeySizeIndicatorpublic java.lang.String getTransformation()
getTransformation in interface CipherInformationpublic int getIVSize()
getIVSize in interface CipherInformationpublic int getKdfSize()
getKdfSize in interface CipherInformationpublic int getCipherBlockSize()
getCipherBlockSize in interface CipherInformationpublic void init(Cipher.Mode mode, byte[] key, byte[] iv) throws java.lang.Exception
Cipherprotected javax.crypto.Cipher getCipherInstance()
protected javax.crypto.Cipher createCipherInstance(Cipher.Mode mode, byte[] key, byte[] iv) throws java.lang.Exception
java.lang.Exceptionprotected byte[] initializeKeyData(Cipher.Mode mode, byte[] key, int reqLen)
protected byte[] initializeIVData(Cipher.Mode mode, byte[] iv, int reqLen)
public void update(byte[] input,
int inputOffset,
int inputLen)
throws java.lang.Exception
Cipherprotected static byte[] resize(byte[] data,
int size)
public java.lang.String toString()
toString in class java.lang.Object