|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.crypto.MacSpi
|
+--de.flexiprovider.api.Mac
|
+--de.flexiprovider.core.mac.CBCMac
This is an implementation of the CBC MAC (ANSI X9.9) using the "flexicore"
jce implementation. Padding is only to put 0x00 until block boundary . We
emulate (single) DES by initializing all three parts of the key identically.
For reference look at V. Oorschot et. al. Handbook of Applied Cryptography
chapter 9.5.1 As here is no support for this algorithm directly it is
constructed using the following steps: 1. generating (single)des encryption
over cipher1Input value using following algorithm:
Cipher.getInstance("DESede/CBC/NoPadding","FlexiCore"); 1.
creating an triple-DES key equivalent to DES by choosing keyA=keyB=keyC =
key1 2. decrypting result with algorithm
Cipher.getInstance("DESede","FlexiCore"); using key
keyA=keyB=keyC = key2 3. encrypting result with algorithm
Cipher.getInstance("DESede","FlexiCore"); using key
keyA=keyB=keyC = key1
| Inner Class Summary | |
static class |
CBCMac.AES128
CBC-MAC with AES128 algorithm |
static class |
CBCMac.AES192
CBC-MAC with AES192 algorithm |
static class |
CBCMac.AES256
CBC-MAC with AES256 algorithm |
static class |
CBCMac.Camellia
CBC-MAC with Camellia algorithm |
static class |
CBCMac.DESede
CBC-MAC with DESede algorithm |
static class |
CBCMac.IDEA
CBC-MAC with IDEA algorithm |
static class |
CBCMac.MARS
CBC-MAC with MARS algorithm |
static class |
CBCMac.Misty1
CBC-MAC with Misty1 algorithm |
static class |
CBCMac.RC2
CBC-MAC with RC2 algorithm |
static class |
CBCMac.RC5
CBC-MAC with RC5 algorithm |
static class |
CBCMac.RC6
CBC-MAC with RC6 algorithm |
static class |
CBCMac.SAFERPlus
CBC-MAC with SAFERPlus algorithm |
static class |
CBCMac.SAFERPlusPlus
CBC-MAC with SAFERPlusPlus algorithm |
static class |
CBCMac.Serpent
CBC-MAC with Serpent algorithm |
static class |
CBCMac.Shacal
CBC-MAC with Shacal algorithm |
static class |
CBCMac.Shacal2
CBC-MAC with Shacal2 algorithm |
static class |
CBCMac.Twofish
CBC-MAC with Twofish algorithm |
| Constructor Summary | |
protected |
CBCMac(BlockCipher blockCipher)
This constructor is called by every subclass for specifying the particular algorithm to be used for CBC-MAC computation. |
| Method Summary | |
byte[] |
doFinal()
Return the computed MAC value. |
int |
getMacLength()
Return the MAC length. |
void |
init(SecretKey key,
AlgorithmParameterSpec params)
Initialize this MAC with the given secret key and parameters. |
void |
reset()
Reset this MAC object so that it may be used for further MAC computations. |
void |
update(byte input)
Process the given byte |
void |
update(byte[] input,
int inOff,
int inLen)
Process the given number of bytes, supplied in a byte array starting at the given position. |
| Methods inherited from class de.flexiprovider.api.Mac |
doFinal, doFinal, engineDoFinal, engineGetMacLength, engineInit, engineReset, engineUpdate, engineUpdate, init, update |
| Methods inherited from class javax.crypto.MacSpi |
clone |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
protected CBCMac(BlockCipher blockCipher)
blockCipher - the cipher algorithm to use| Method Detail |
public int getMacLength()
MacgetMacLength in class Mac
public void init(SecretKey key,
AlgorithmParameterSpec params)
throws InvalidKeyException,
InvalidAlgorithmParameterException
init in class Mackey - the secret keyparams - the parametersInvalidKeyException - if the key is invalid.InvalidAlgorithmParameterException - if the parameters are invalid.public void update(byte input)
update in class Macinput - the byte to be processed
public void update(byte[] input,
int inOff,
int inLen)
update in class Macinput - byte array containing the message to be processedinOff - offset into the array to start frominLen - number of bytes to be processedpublic byte[] doFinal()
doFinal in class Macpublic void reset()
reset in class Mac
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||