Top Inners Fields Constructors Methods
org.bouncycastle.jcajce.provider.symmetric.util

public Class BaseBlockCipher

extends BaseWrapCipher
implements PBE
Class Inheritance
All Implemented Interfaces
org.bouncycastle.jcajce.provider.symmetric.util.PBE
Known Direct Subclasses
org.bouncycastle.jcajce.provider.symmetric.AES.ECB, org.bouncycastle.jcajce.provider.symmetric.AES.ECB128, org.bouncycastle.jcajce.provider.symmetric.AES.ECB192, org.bouncycastle.jcajce.provider.symmetric.AES.ECB256, org.bouncycastle.jcajce.provider.symmetric.AES.CBC, org.bouncycastle.jcajce.provider.symmetric.AES.CBC128, org.bouncycastle.jcajce.provider.symmetric.AES.CBC192, org.bouncycastle.jcajce.provider.symmetric.AES.CBC256, org.bouncycastle.jcajce.provider.symmetric.AES.CFB, org.bouncycastle.jcajce.provider.symmetric.AES.CFB128, org.bouncycastle.jcajce.provider.symmetric.AES.CFB192, org.bouncycastle.jcajce.provider.symmetric.AES.CFB256, org.bouncycastle.jcajce.provider.symmetric.AES.OFB, org.bouncycastle.jcajce.provider.symmetric.AES.OFB128, org.bouncycastle.jcajce.provider.symmetric.AES.OFB192, org.bouncycastle.jcajce.provider.symmetric.AES.OFB256, org.bouncycastle.jcajce.provider.symmetric.AES.GCM, org.bouncycastle.jcajce.provider.symmetric.AES.GCM128, org.bouncycastle.jcajce.provider.symmetric.AES.GCM192, org.bouncycastle.jcajce.provider.symmetric.AES.GCM256, org.bouncycastle.jcajce.provider.symmetric.AES.CCM, org.bouncycastle.jcajce.provider.symmetric.AES.CCM128, org.bouncycastle.jcajce.provider.symmetric.AES.CCM192, org.bouncycastle.jcajce.provider.symmetric.AES.CCM256, org.bouncycastle.jcajce.provider.symmetric.AES.PBEWithAESCBC, org.bouncycastle.jcajce.provider.symmetric.AES.PBEWithSHA1AESCBC128, org.bouncycastle.jcajce.provider.symmetric.AES.PBEWithSHA1AESCBC192, org.bouncycastle.jcajce.provider.symmetric.AES.PBEWithSHA1AESCBC256, org.bouncycastle.jcajce.provider.symmetric.AES.PBEWithSHA256AESCBC128, org.bouncycastle.jcajce.provider.symmetric.AES.PBEWithSHA256AESCBC192, org.bouncycastle.jcajce.provider.symmetric.AES.PBEWithSHA256AESCBC256, org.bouncycastle.jcajce.provider.symmetric.ARIA.ECB, org.bouncycastle.jcajce.provider.symmetric.ARIA.CBC, org.bouncycastle.jcajce.provider.symmetric.ARIA.CFB, org.bouncycastle.jcajce.provider.symmetric.ARIA.OFB, org.bouncycastle.jcajce.provider.symmetric.ARIA.CCM, org.bouncycastle.jcajce.provider.symmetric.ARIA.GCM, org.bouncycastle.jcajce.provider.symmetric.Blowfish.ECB, org.bouncycastle.jcajce.provider.symmetric.Blowfish.CBC, org.bouncycastle.jcajce.provider.symmetric.Camellia.ECB, org.bouncycastle.jcajce.provider.symmetric.Camellia.CBC, org.bouncycastle.jcajce.provider.symmetric.Camellia.CBC128, org.bouncycastle.jcajce.provider.symmetric.Camellia.CBC192, org.bouncycastle.jcajce.provider.symmetric.Camellia.CBC256, org.bouncycastle.jcajce.provider.symmetric.CAST5.ECB, org.bouncycastle.jcajce.provider.symmetric.CAST5.CBC, org.bouncycastle.jcajce.provider.symmetric.CAST6.ECB, org.bouncycastle.jcajce.provider.symmetric.ChaCha.BaseCC20P1305, org.bouncycastle.jcajce.provider.symmetric.DES.ECB, org.bouncycastle.jcajce.provider.symmetric.DES.CBC, org.bouncycastle.jcajce.provider.symmetric.DES.PBEWithMD2, org.bouncycastle.jcajce.provider.symmetric.DES.PBEWithMD5, org.bouncycastle.jcajce.provider.symmetric.DES.PBEWithSHA1, org.bouncycastle.jcajce.provider.symmetric.DESede.ECB, org.bouncycastle.jcajce.provider.symmetric.DESede.CBC, org.bouncycastle.jcajce.provider.symmetric.DESede.PBEWithSHAAndDES3Key, org.bouncycastle.jcajce.provider.symmetric.DESede.PBEWithSHAAndDES2Key, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.ECB, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.ECB_128, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.ECB_256, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.ECB_512, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.ECB128, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.ECB256, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.ECB512, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CBC128, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CBC256, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CBC512, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.OFB128, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.OFB256, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.OFB512, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CFB128, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CFB256, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CFB512, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CTR128, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CTR256, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CTR512, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CCM128, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CCM256, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.CCM512, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.GCM128, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.GCM256, org.bouncycastle.jcajce.provider.symmetric.DSTU7624.GCM512, org.bouncycastle.jcajce.provider.symmetric.GOST28147.ECB, org.bouncycastle.jcajce.provider.symmetric.GOST28147.CBC, org.bouncycastle.jcajce.provider.symmetric.GOST28147.GCFB, org.bouncycastle.jcajce.provider.symmetric.GOST3412_2015.ECB, org.bouncycastle.jcajce.provider.symmetric.GOST3412_2015.CBC, org.bouncycastle.jcajce.provider.symmetric.GOST3412_2015.GCFB, org.bouncycastle.jcajce.provider.symmetric.GOST3412_2015.GCFB8, org.bouncycastle.jcajce.provider.symmetric.GOST3412_2015.OFB, org.bouncycastle.jcajce.provider.symmetric.GOST3412_2015.CTR, org.bouncycastle.jcajce.provider.symmetric.IDEA.ECB, org.bouncycastle.jcajce.provider.symmetric.IDEA.CBC, org.bouncycastle.jcajce.provider.symmetric.IDEA.PBEWithSHAAndIDEA, org.bouncycastle.jcajce.provider.symmetric.Noekeon.ECB, org.bouncycastle.jcajce.provider.symmetric.RC2.ECB, org.bouncycastle.jcajce.provider.symmetric.RC2.CBC, org.bouncycastle.jcajce.provider.symmetric.RC2.PBEWithMD5AndRC2, org.bouncycastle.jcajce.provider.symmetric.RC2.PBEWithSHA1AndRC2, org.bouncycastle.jcajce.provider.symmetric.RC2.PBEWithSHAAnd128BitRC2, org.bouncycastle.jcajce.provider.symmetric.RC2.PBEWithSHAAnd40BitRC2, org.bouncycastle.jcajce.provider.symmetric.RC5.ECB32, org.bouncycastle.jcajce.provider.symmetric.RC5.ECB64, org.bouncycastle.jcajce.provider.symmetric.RC5.CBC32, org.bouncycastle.jcajce.provider.symmetric.RC6.ECB, org.bouncycastle.jcajce.provider.symmetric.RC6.CBC, org.bouncycastle.jcajce.provider.symmetric.RC6.CFB, org.bouncycastle.jcajce.provider.symmetric.RC6.OFB, org.bouncycastle.jcajce.provider.symmetric.Rijndael.ECB, org.bouncycastle.jcajce.provider.symmetric.SEED.ECB, org.bouncycastle.jcajce.provider.symmetric.SEED.CBC, org.bouncycastle.jcajce.provider.symmetric.Serpent.ECB, org.bouncycastle.jcajce.provider.symmetric.Serpent.ECB128, org.bouncycastle.jcajce.provider.symmetric.Serpent.ECB192, org.bouncycastle.jcajce.provider.symmetric.Serpent.ECB256, org.bouncycastle.jcajce.provider.symmetric.Serpent.TECB, org.bouncycastle.jcajce.provider.symmetric.Serpent.CBC, org.bouncycastle.jcajce.provider.symmetric.Serpent.CBC128, org.bouncycastle.jcajce.provider.symmetric.Serpent.CBC192, org.bouncycastle.jcajce.provider.symmetric.Serpent.CBC256, org.bouncycastle.jcajce.provider.symmetric.Serpent.CFB, org.bouncycastle.jcajce.provider.symmetric.Serpent.CFB128, org.bouncycastle.jcajce.provider.symmetric.Serpent.CFB192, org.bouncycastle.jcajce.provider.symmetric.Serpent.CFB256, org.bouncycastle.jcajce.provider.symmetric.Serpent.OFB, org.bouncycastle.jcajce.provider.symmetric.Serpent.OFB128, org.bouncycastle.jcajce.provider.symmetric.Serpent.OFB192, org.bouncycastle.jcajce.provider.symmetric.Serpent.OFB256, org.bouncycastle.jcajce.provider.symmetric.Shacal2.ECB, org.bouncycastle.jcajce.provider.symmetric.Shacal2.CBC, org.bouncycastle.jcajce.provider.symmetric.Skipjack.ECB, org.bouncycastle.jcajce.provider.symmetric.SM4.ECB, org.bouncycastle.jcajce.provider.symmetric.TEA.ECB, org.bouncycastle.jcajce.provider.symmetric.Threefish.ECB_256, org.bouncycastle.jcajce.provider.symmetric.Threefish.ECB_512, org.bouncycastle.jcajce.provider.symmetric.Threefish.ECB_1024, org.bouncycastle.jcajce.provider.symmetric.Twofish.ECB, org.bouncycastle.jcajce.provider.symmetric.Twofish.PBEWithSHA, org.bouncycastle.jcajce.provider.symmetric.XTEA.ECB
Imports
java.lang.reflect.Constructor, java.nio.ByteBuffer, java.security.AlgorithmParameters, .InvalidAlgorithmParameterException, .InvalidKeyException, .InvalidParameterException, .Key, .NoSuchAlgorithmException, .SecureRandom, java.security.spec.AlgorithmParameterSpec, javax.crypto.BadPaddingException, .Cipher, .IllegalBlockSizeException, .NoSuchPaddingException, .SecretKey, .ShortBufferException, javax.crypto.interfaces.PBEKey, javax.crypto.spec.IvParameterSpec, .PBEParameterSpec, .RC2ParameterSpec, .RC5ParameterSpec, org.bouncycastle.asn1.DEROctetString, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.crypto.BlockCipher, .BufferedBlockCipher, .CipherParameters, .CryptoServicesRegistrar, .DataLengthException, .DefaultBufferedBlockCipher, .InvalidCipherTextException, .OutputLengthException, org.bouncycastle.crypto.engines.DSTU7624Engine, org.bouncycastle.crypto.fpe.FPEEngine, .FPEFF1Engine, .FPEFF3_1Engine, org.bouncycastle.crypto.modes.AEADBlockCipher, .AEADCipher, .CBCBlockCipher, .CCMBlockCipher, .CFBBlockCipher, .CTSBlockCipher, .EAXBlockCipher, .GCFBBlockCipher, .GCMBlockCipher, .GCMSIVBlockCipher, .GOFBBlockCipher, .KCCMBlockCipher, .KCTRBlockCipher, .KGCMBlockCipher, .OCBBlockCipher, .OFBBlockCipher, .OpenPGPCFBBlockCipher, .PGPCFBBlockCipher, .SICBlockCipher, org.bouncycastle.crypto.paddings.BlockCipherPadding, .ISO10126d2Padding, .ISO7816d4Padding, .PKCS7Padding, .PaddedBufferedBlockCipher, .TBCPadding, .X923Padding, .ZeroBytePadding, org.bouncycastle.crypto.params.AEADParameters, .FPEParameters, .KeyParameter, .ParametersWithIV, .ParametersWithRandom, .ParametersWithSBox, .RC2Parameters, .RC5Parameters, org.bouncycastle.internal.asn1.cms.GCMParameters, org.bouncycastle.jcajce.PBKDF1Key, .PBKDF1KeyWithParameters, .PBKDF2Key, .PBKDF2KeyWithParameters, .PKCS12Key, .PKCS12KeyWithParameters, org.bouncycastle.jcajce.spec.AEADParameterSpec, .FPEParameterSpec, .GOST28147ParameterSpec, .RepeatedSecretKeySpec, org.bouncycastle.util.Arrays, .Strings

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static interface

Field Summary

Modifier and TypeField and Description
private AEADParameters
private static final Class<T>[]
private BlockCipher
private static final int
private BaseBlockCipher.GenericBlockCipher
private int
private BlockCipherProvider
private boolean
private int
private ParametersWithIV
private int
private String
private boolean
private String
private PBEParameterSpec
private int
Inherited from org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher:
engineParamspbeHashpbeIvSizepbeKeySizepbeTypewrapEngine

Constructor Summary

AccessConstructor and Description
protected
protected
BaseBlockCipher(BlockCipher engine, int scheme, int digest, int keySizeInBits, int ivLength)

protected
protected
BaseBlockCipher(int keySizeInBits, BlockCipherProvider provider)

protected
protected
BaseBlockCipher(int keySizeInBits, AEADBlockCipher engine)

protected
BaseBlockCipher(AEADCipher engine, boolean fixedIv, int ivLength)

protected
BaseBlockCipher(AEADBlockCipher engine, boolean fixedIv, int ivLength)

protected
BaseBlockCipher(int keySizeInBits, AEADBlockCipher engine, boolean fixedIv, int ivLength)

protected
BaseBlockCipher(BlockCipher engine, int ivLength)

protected
BaseBlockCipher(int keySizeInBits, BlockCipher engine, int ivLength)

protected
BaseBlockCipher(BlockCipher engine, boolean fixedIv, int ivLength)

protected
BaseBlockCipher(BufferedBlockCipher engine, int ivLength)

protected
BaseBlockCipher(int keySizeInBits, BufferedBlockCipher engine, int ivLength)

protected
BaseBlockCipher(BufferedBlockCipher engine, boolean fixedIv, int ivLength)

Method Summary

Modifier and TypeMethod and Description
private CipherParameters
protected byte[]
engineDoFinal(byte[]
the input buffer
input
,
int
the offset in input where the input starts
inputOffset
,
int
the input length
inputLen
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineDoFinal.

Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.

protected int
engineDoFinal(byte[]
the input buffer
input
,
int
the offset in input where the input starts
inputOffset
,
int
the input length
inputLen
,
byte[]
the buffer for the result
output
,
int
the offset in output where the result is stored
outputOffset
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineDoFinal.

Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.

protected int
protected byte[]
engineGetIV()

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineGetIV.

Returns the initialization vector (IV) in a new buffer.

protected int
engineGetKeySize(Key
the key object
key
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineGetKeySize.

Returns the key size of the given key object in bits.

protected int
engineGetOutputSize(int
the input length (in bytes)
inputLen
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineGetOutputSize.

Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update or doFinal operation, given the input length inputLen (in bytes).

protected AlgorithmParameters
protected void
engineInit(int
the operation mode of this CipherSpi object (this is one of the following: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE, or UNWRAP_MODE)
opmode
,
Key
the encryption key
key
,
final AlgorithmParameterSpec
the algorithm parameters
paramSpec
,
SecureRandom
the source of randomness
random
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineInit.

Initializes this CipherSpi object with a key, a set of algorithm parameters, and a source of randomness.

protected void
engineInit(int
the operation mode of this CipherSpi object (this is one of the following: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE, or UNWRAP_MODE)
opmode
,
Key
the encryption key
key
,
AlgorithmParameters
the algorithm parameters
params
,
SecureRandom
the source of randomness
random
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineInit.

Initializes this CipherSpi object with a key, a set of algorithm parameters, and a source of randomness.

protected void
engineInit(int
the operation mode of this CipherSpi object (this is one of the following: ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE)
opmode
,
Key
the encryption key
key
,
SecureRandom
the source of randomness
random
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineInit.

Initializes this CipherSpi object with a key and a source of randomness.

protected void
engineSetMode(String
the cipher mode
mode
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineSetMode.

Sets the mode of this cipher.

protected void
engineSetPadding(String
the padding mechanism
padding
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineSetPadding.

Sets the padding mechanism of this cipher.

protected byte[]
engineUpdate(byte[]
the input buffer
input
,
int
the offset in input where the input starts
inputOffset
,
int
the input length
inputLen
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineUpdate.

Continues a multiple-part encryption or decryption operation (depending on how this CipherSpi object was initialized), processing another data part.

protected int
engineUpdate(byte[]
the input buffer
input
,
int
the offset in input where the input starts
inputOffset
,
int
the input length
inputLen
,
byte[]
the buffer for the result
output
,
int
the offset in output where the result is stored
outputOffset
)

Overrides org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher.engineUpdate.

Continues a multiple-part encryption or decryption operation (depending on how this CipherSpi object was initialized), processing another data part.

protected void
engineUpdateAAD(byte[]
the buffer containing the AAD
input
,
int
the offset in src where the AAD input starts
offset
,
int
the number of AAD bytes
length
)

Overrides javax.crypto.CipherSpi.engineUpdateAAD.

Continues a multipart update of the Additional Authentication Data (AAD), using a subset of the provided buffer.

protected void
engineUpdateAAD(ByteBuffer
the buffer containing the AAD
src
)

Overrides javax.crypto.CipherSpi.engineUpdateAAD.

Continues a multipart update of the Additional Authentication Data (AAD).

private boolean
Inherited from org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher:
createParametersInstanceengineUnwrapengineWrap