ECB, CFB, OFB,
CBC, PCBC) and padding schemes
(PKCS5Padding, NoPadding,
ISO10126Padding).
DESCipher
| Modifier and Type | Field and Description |
|---|---|
| private final CipherCore |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected 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)Implements abstract javax. Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| protected 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 storedImplements abstract javax. Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| protected int | Returns: the block size (in bytes), or 0 if the underlying algorithm is not a block cipherImplements abstract javax. Returns the block size (in bytes). |
| protected 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.Implements abstract javax. Returns the initialization vector (IV) in a new buffer. |
| protected int | Returns: the "effective" key size of the given key object.the key object. key)Overrides javax. Returns the key size of the given key object. |
| protected int | Returns: the required output buffer size (in bytes)the input length (in bytes) inputLen)Implements abstract javax. Returns the length in bytes that an output buffer would need to be in
order to hold the result of the next |
| protected AlgorithmParameters | Returns: the parameters used with this cipher, or null if this cipher does not use any parameters.Implements abstract javax. Returns the parameters used with this cipher. |
| protected void | engineInit(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)Implements abstract javax. Initializes this cipher with a key and a source of randomness. |
| protected void | engineInit(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)Implements abstract javax. Initializes this cipher with a key, a set of algorithm parameters, and a source of randomness. |
| protected void | engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
Implements abstract javax. Initializes this |
| protected void | engineSetMode(String
the cipher mode mode)Implements abstract javax. Sets the mode of this cipher. |
| protected void | engineSetPadding(String
the padding mechanism paddingScheme)Implements abstract javax. Sets the padding mechanism of this cipher. |
| protected Key | Returns: the unwrapped key.the key to be unwrapped. wrappedKey, String the algorithm the wrapped key is for. wrappedKeyAlgorithm, int the type of the wrapped key.
This is one of wrappedKeyType)Cipher.SECRET_KEY,
Cipher.PRIVATE_KEY, or Cipher.PUBLIC_KEY.Overrides javax. Unwrap a previously wrapped key. |
| protected 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)Implements abstract javax. Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| protected 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 storedImplements abstract javax. Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| protected byte[] | Returns: the wrapped key.the key to be wrapped. key)Overrides javax. Wrap a key. |
| core | back to summary |
|---|---|
| private final CipherCore core | |
| DESedeCipher | back to summary |
|---|---|
| public DESedeCipher() Creates an instance of DESede cipher with default ECB mode and PKCS5Padding. | |
| engineDoFinal | back to summary |
|---|---|
| protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException Implements abstract javax. 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.
| |
| engineDoFinal | back to summary |
|---|---|
| protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws IllegalBlockSizeException, ShortBufferException, BadPaddingException Implements abstract javax. 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.
| |
| engineGetBlockSize | back to summary |
|---|---|
| protected int engineGetBlockSize() Implements abstract javax. Returns the block size (in bytes).
| |
| engineGetIV | back to summary |
|---|---|
| protected byte[] engineGetIV() Implements abstract javax. 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.
| |
| engineGetKeySize | back to summary |
|---|---|
| protected int engineGetKeySize(Key key) throws InvalidKeyException Overrides javax. Returns the key size of the given key object.
| |
| engineGetOutputSize | back to summary |
|---|---|
| protected int engineGetOutputSize(int inputLen) Implements abstract javax. 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
| |
| engineGetParameters | back to summary |
|---|---|
| protected AlgorithmParameters engineGetParameters() Implements abstract javax. 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).
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException Implements abstract javax. 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.
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract javax. 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
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract javax. Doc from javax. Initializes this The If this cipher requires any algorithm parameters and
If this cipher requires algorithm parameters that cannot be derived from the input parameters, and there are no reasonable provider-specific default values, initialization will necessarily fail. If this cipher (including its feedback or padding scheme)
requires any random bytes (e.g., for parameter generation), it will get
them from Note that when a
| |
| engineSetMode | back to summary |
|---|---|
| protected void engineSetMode(String mode) throws NoSuchAlgorithmException Implements abstract javax. Sets the mode of this cipher.
| |
| engineSetPadding | back to summary |
|---|---|
| protected void engineSetPadding(String paddingScheme) throws NoSuchPaddingException Implements abstract javax. Sets the padding mechanism of this cipher.
| |
| engineUnwrap | back to summary |
|---|---|
| protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException Overrides javax. Unwrap a previously wrapped key.
| |
| engineUpdate | back to summary |
|---|---|
| protected byte[] engineUpdate(byte[] input, int inputOffset, int inputLen) Implements abstract javax. Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. The first
| |
| engineUpdate | back to summary |
|---|---|
| protected int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException Implements abstract javax. Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. The first
| |
| engineWrap | back to summary |
|---|---|
| protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException Overrides javax. Wrap a key.
| |