|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.crypto.CipherSpi
|
+--de.flexiprovider.api.Cipher
|
+--de.flexiprovider.api.BlockCipher
|
+--de.flexiprovider.core.serpent.Serpent
This class implementes the Serpent block cipher. For more information, see http://www.cl.cam.ac.uk/~ rja14/serpent.html. Serpent uses a block size of 128 bits. The key size can be 128, 192, or 256 bits. Encryption/decryption takes 32 rounds.
| Inner Class Summary | |
static class |
Serpent.Serpent128_CBC
Serpent128_CBC |
static class |
Serpent.Serpent128_CFB
Serpent128_CFB |
static class |
Serpent.Serpent128_ECB
Serpent128_ECB |
static class |
Serpent.Serpent128_OFB
Serpent128_OFB |
static class |
Serpent.Serpent192_CBC
Serpent192_CBC |
static class |
Serpent.Serpent192_CFB
Serpent192_CFB |
static class |
Serpent.Serpent192_ECB
Serpent192_ECB |
static class |
Serpent.Serpent192_OFB
Serpent192_OFB |
static class |
Serpent.Serpent256_CBC
Serpent256_CBC |
static class |
Serpent.Serpent256_CFB
Serpent256_CFB |
static class |
Serpent.Serpent256_ECB
Serpent256_ECB |
static class |
Serpent.Serpent256_OFB
Serpent256_OFB |
| Field Summary | |
static java.lang.String |
ALG_NAME
The algorithm name. |
static java.lang.String |
OID
The OID of Serpent (defined by the GNU project, see http://www.gnupg.org/oids.html). |
| Fields inherited from class de.flexiprovider.api.BlockCipher |
random |
| Fields inherited from class de.flexiprovider.api.Cipher |
DECRYPT_MODE, ENCRYPT_MODE, opMode |
| Constructor Summary | |
|
Serpent()
Constructor. |
protected |
Serpent(java.lang.String modeName,
int keySize)
Constructor. |
| Method Summary | |
int |
getCipherBlockSize()
This method returns the blocksize the algorithm uses. |
int |
getKeySize(Key key)
Return the key size of the given key object. |
java.lang.String |
getName()
|
protected void |
initCipherDecrypt(SecretKey key,
AlgorithmParameterSpec params)
Initialize the block cipher with a secret key for data decryption. |
protected void |
initCipherEncrypt(SecretKey key,
AlgorithmParameterSpec params)
Initialize the block cipher with a secret key for data encryption. |
protected void |
singleBlockDecrypt(byte[] in,
int inoffset,
byte[] out,
int outoffset)
This method decrypts a single block of data. |
protected void |
singleBlockEncrypt(byte[] in,
int inoffset,
byte[] out,
int outoffset)
This method encrypts a single block of data. |
| Methods inherited from class de.flexiprovider.api.BlockCipher |
doFinal, doFinal, engineInit, getBlockSize, getIV, getOutputSize, getParameters, initDecrypt, initDecrypt, initDecrypt, initEncrypt, initEncrypt, initEncrypt, initEncrypt, setMode, setPadding, update, update |
| Methods inherited from class de.flexiprovider.api.Cipher |
doFinal, doFinal, engineDoFinal, engineDoFinal, engineGetBlockSize, engineGetIV, engineGetKeySize, engineGetOutputSize, engineGetParameters, engineInit, engineInit, engineSetMode, engineSetPadding, engineUpdate, engineUpdate, update |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final java.lang.String ALG_NAME
public static final java.lang.String OID
| Constructor Detail |
protected Serpent(java.lang.String modeName,
int keySize)
modeName - the mode to usekeySize - the key size in wordspublic Serpent()
| Method Detail |
public java.lang.String getName()
getName in class Cipher
public int getKeySize(Key key)
throws InvalidKeyException
getKeySize in class Cipherkey - the key objectInvalidKeyException - if key is invalid.public int getCipherBlockSize()
getCipherBlockSize in class BlockCipher
protected void initCipherEncrypt(SecretKey key,
AlgorithmParameterSpec params)
throws InvalidKeyException
initCipherEncrypt in class BlockCipherkey - - the SecretKey which has to be used to decrypt data.params - - algorithmParameterSpec, not used for hereInvalidKeyException - if the given key is inappropriate for initialising this
cipher.
protected void initCipherDecrypt(SecretKey key,
AlgorithmParameterSpec params)
throws InvalidKeyException
initCipherDecrypt in class BlockCipherkey - - the SecretKey which has to be used to decrypt data.params - - algorithmParameterSpec, not used for hereInvalidKeyException - if the given key is inappropriate for initialising this
cipher.
protected void singleBlockEncrypt(byte[] in,
int inoffset,
byte[] out,
int outoffset)
singleBlockEncrypt in class BlockCipherin - array of bytes containing the plaintext to be encryptedinoffset - index in array in, where the plaintext block startsout - array of bytes which will contain the ciphertext starting at
outOffsetoutoffset - index in array out, where the ciphertext block will start
protected void singleBlockDecrypt(byte[] in,
int inoffset,
byte[] out,
int outoffset)
singleBlockDecrypt in class BlockCipherin - array of bytes containig the ciphertext to be decryptedinoffset - index in array in, where the ciphertext block startsout - array of bytes which will contain the plaintext starting at
outOffsetoutoffset - index in array out, where the plaintext block will start
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||