public class BaseCipher extends java.lang.Object implements Cipher
Cipher.Mode
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
algorithm |
private int |
bsize |
protected javax.crypto.Cipher |
cipher |
private int |
ivsize |
private java.lang.String |
s |
private java.lang.String |
transformation |
Constructor and Description |
---|
BaseCipher(int ivsize,
int bsize,
java.lang.String algorithm,
java.lang.String transformation) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlgorithm() |
int |
getBlockSize() |
int |
getIVSize() |
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 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, wait
checkSupported, update
protected javax.crypto.Cipher cipher
private final int ivsize
private final int bsize
private final java.lang.String algorithm
private final java.lang.String transformation
private java.lang.String s
public BaseCipher(int ivsize, int bsize, java.lang.String algorithm, java.lang.String transformation)
public java.lang.String getAlgorithm()
getAlgorithm
in interface CipherInformation
public java.lang.String getTransformation()
getTransformation
in interface CipherInformation
public int getIVSize()
getIVSize
in interface CipherInformation
public int getBlockSize()
getBlockSize
in interface CipherInformation
public void init(Cipher.Mode mode, byte[] key, byte[] iv) throws java.lang.Exception
Cipher
public void update(byte[] input, int inputOffset, int inputLen) throws java.lang.Exception
Cipher
protected static byte[] resize(byte[] data, int size)
public java.lang.String toString()
toString
in class java.lang.Object