ECB, CFB, OFB, CBC,
PCBC, CTR, and CTS) and
padding schemes (PKCS5Padding, NoPadding,
ISO10126Padding).
ElectronicCodeBook, CipherFeedback, OutputFeedback, CipherBlockChaining, PCBC, CounterMode, CipherTextStealing
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final byte[] | |
| private int | |
| private static final int | |
| private static final int | |
| private FeedbackCipher | |
| private int | |
| private static final int | |
| private static final int | |
| private boolean | |
| private int | |
| private static final int | |
| private int | |
| private static final int | |
| private Padding | |
| private static final int | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv | CipherCore(SymmetricCipher impl, int blkSize)
Creates an instance of CipherCore with default ECB mode and PKCS5Padding. |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| pack-priv byte[] | Returns: the new buffer with the resultthe input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen)Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| pack-priv int | Returns: the number of bytes stored inoutputthe input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen, byte[] the buffer for the result output, int the offset in outputOffset)output where the result
is storedEncrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| private void | |
| private int | fillOutputBuffer(byte[] finalBuf, int finalOffset, byte[] output, int outOfs, int finalBufLen, byte[] input)
|
| private int | |
| pack-priv byte[] | Returns: the initialization vector in a new buffer, or null if the underlying algorithm does not use an IV, or if the IV has not yet been set.Returns the initialization vector (IV) in a new buffer. |
| pack-priv static byte[] | |
| private static int | |
| pack-priv int | Returns: the required output buffer size (in bytes)the input length (in bytes) inputLen)Returns the length in bytes that an output buffer would need to be in
order to hold the result of the next |
| private int | |
| pack-priv AlgorithmParameters | Returns: the parameters used with this cipher, or null if this cipher does not use any parameters.Returns the parameters used with this cipher. |
| pack-priv void | init(int
the operation mode of this cipher (this is one of
the following:
opmode, Key ENCRYPT_MODE, DECRYPT_MODE,
WRAP_MODE or UNWRAP_MODE)the secret key key, SecureRandom the source of randomness random)Initializes this cipher with a key and a source of randomness. |
| pack-priv void | init(int
the operation mode of this cipher (this is one of
the following:
opmode, Key ENCRYPT_MODE, DECRYPT_MODE,
WRAP_MODE or UNWRAP_MODE)the encryption key key, AlgorithmParameterSpec the algorithm parameters params, SecureRandom the source of randomness random)Initializes this cipher with a key, a set of algorithm parameters, and a source of randomness. |
| pack-priv void | |
| private byte[] | |
| pack-priv void | |
| pack-priv void | |
| private int | |
| pack-priv Key | |
| pack-priv byte[] | Returns: the new buffer with the resultthe input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen)Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| pack-priv int | Returns: the number of bytes stored inoutputthe input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen, byte[] the buffer for the result output, int the offset in outputOffset)output where the result
is storedContinues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| pack-priv byte[] |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| buffer | back to summary |
|---|---|
| private final byte[] buffer | |
| buffered | back to summary |
|---|---|
| private int buffered | |
| CBC_MODE | back to summary |
|---|---|
| private static final int CBC_MODE | |
| CFB_MODE | back to summary |
|---|---|
| private static final int CFB_MODE | |
| cipher | back to summary |
|---|---|
| private FeedbackCipher cipher | |
| cipherMode | back to summary |
|---|---|
| private int cipherMode | |
| CTR_MODE | back to summary |
|---|---|
| private static final int CTR_MODE | |
| CTS_MODE | back to summary |
|---|---|
| private static final int CTS_MODE | |
| decrypting | back to summary |
|---|---|
| private boolean decrypting | |
| diffBlocksize | back to summary |
|---|---|
| private int diffBlocksize | |
| ECB_MODE | back to summary |
|---|---|
| private static final int ECB_MODE | |
| minBytes | back to summary |
|---|---|
| private int minBytes | |
| OFB_MODE | back to summary |
|---|---|
| private static final int OFB_MODE | |
| padding | back to summary |
|---|---|
| private Padding padding | |
| PCBC_MODE | back to summary |
|---|---|
| private static final int PCBC_MODE | |
| unitBytes | back to summary |
|---|---|
| private int unitBytes | |
| CipherCore | back to summary |
|---|---|
| pack-priv CipherCore(SymmetricCipher impl, int blkSize) Creates an instance of CipherCore with default ECB mode and PKCS5Padding. | |
| checkOutputCapacity | back to summary |
|---|---|
| private int checkOutputCapacity(byte[] output, int outputOffset, int estOutSize) throws ShortBufferException | |
| doFinal | back to summary |
|---|---|
| pack-priv byte[] doFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized. The first The cipher is reset to its initial state (uninitialized) after this call.
| |
| doFinal | back to summary |
|---|---|
| pack-priv int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws IllegalBlockSizeException, ShortBufferException, BadPaddingException Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized. The first The cipher is reset to its initial state (uninitialized) after this call.
| |
| endDoFinal | back to summary |
|---|---|
| private void endDoFinal() | |
| fillOutputBuffer | back to summary |
|---|---|
| private int fillOutputBuffer(byte[] finalBuf, int finalOffset, byte[] output, int outOfs, int finalBufLen, byte[] input) throws BadPaddingException, IllegalBlockSizeException | |
| finalNoPadding | back to summary |
|---|---|
| private int finalNoPadding(byte[] in, int inOfs, byte[] out, int outOfs, int len) throws IllegalBlockSizeException | |
| getIV | back to summary |
|---|---|
| pack-priv byte[] getIV() Returns the initialization vector (IV) in a new buffer. This is useful in the case where a random IV has been created (see init), or in the context of password-based encryption or decryption, where the IV is derived from a user-provided password.
| |
| getKeyBytes | back to summary |
|---|---|
| pack-priv static byte[] getKeyBytes(Key key) throws InvalidKeyException Return the key bytes of the specified key. Throw an InvalidKeyException if the key is not usable. | |
| getNumOfUnit | back to summary |
|---|---|
| private static int getNumOfUnit(String mode, int offset, int blockSize) throws NoSuchAlgorithmException | |
| getOutputSize | back to summary |
|---|---|
| pack-priv int getOutputSize(int inputLen) Returns the length in bytes that an output buffer would need to be in
order to hold the result of the next This call takes into account any unprocessed (buffered) data from a
previous The actual output length of the next
| |
| getOutputSizeByOperation | back to summary |
|---|---|
| private int getOutputSizeByOperation(int inputLen, boolean isDoFinal) | |
| getParameters | back to summary |
|---|---|
| pack-priv AlgorithmParameters getParameters(String algName) Returns the parameters used with this cipher. The returned parameters may be the same that were used to initialize this cipher, or may contain the default set of parameters or a set of randomly generated parameters used by the underlying cipher implementation (provided that the underlying cipher implementation uses a default set of parameters or creates new parameters if it needs parameters but was not initialized with any).
| |
| init | back to summary |
|---|---|
| pack-priv void init(int opmode, Key key, SecureRandom random) throws InvalidKeyException Initializes this cipher with a key and a source of randomness. The cipher is initialized for one of the following four operations:
encryption, decryption, key wrapping or key unwrapping, depending on
the value of If this cipher requires an initialization vector (IV), it will get
it from This method also cleans existing buffer and other related state information.
| |
| init | back to summary |
|---|---|
| pack-priv void init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Initializes this cipher with a key, a set of algorithm parameters, and a source of randomness. The cipher is initialized for one of the following four operations:
encryption, decryption, key wrapping or key unwrapping, depending on
the value of If this cipher (including its underlying feedback or padding scheme)
requires any random bytes, it will get them from
| |
| init | back to summary |
|---|---|
| pack-priv void init(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException | |
| prepareInputBuffer | back to summary |
|---|---|
| private byte[] prepareInputBuffer(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws IllegalBlockSizeException, ShortBufferException | |
| setMode | back to summary |
|---|---|
| pack-priv void setMode(String mode) throws NoSuchAlgorithmException Sets the mode of this cipher.
| |
| setPadding | back to summary |
|---|---|
| pack-priv void setPadding(String paddingScheme) throws NoSuchPaddingException Sets the padding mechanism of this cipher.
| |
| unpad | back to summary |
|---|---|
| private int unpad(int outLen, int off, byte[] outWithPadding) throws BadPaddingException | |
| unwrap | back to summary |
|---|---|
| pack-priv Key unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException Unwrap a previously wrapped key.
| |
| update | back to summary |
|---|---|
| pack-priv byte[] update(byte[] input, int inputOffset, int inputLen) Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. The first
| |
| update | back to summary |
|---|---|
| pack-priv int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. The first
| |
| wrap | back to summary |
|---|---|
| pack-priv byte[] wrap(Key key) throws IllegalBlockSizeException, InvalidKeyException Wrap a key.
| |