|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.crypto.AbstractCipher tribble.crypto.SymmetricCipher tribble.crypto.NullCipher
Null block cipher. Implements a symmetric block cipher that does not actually perform any encrypting or decrypting (i.e., it simply copies each input block to its output).
Copyright ©2005 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code
provided that the original copyright and authorship notices remain
intact.
Field Summary |
Fields inherited from class tribble.crypto.SymmetricCipher |
m_blockLen |
Fields inherited from class tribble.crypto.AbstractCipher |
m_alg, m_decrypt, m_init, m_keyLen |
Constructor Summary | |
NullCipher()
Default constructor. |
Method Summary | |
protected void |
blockDecrypt(byte[] in,
int inOff,
byte[] out,
int outOff)
Decrypt a block of ciphertext. |
protected void |
blockEncrypt(byte[] in,
int inOff,
byte[] out,
int outOff)
Encrypt a block of plaintext. |
protected void |
clear()
Reset this cipher, wiping all sensitive information. |
protected void |
initialize(byte[] key,
boolean decrypt)
Initialize this cipher. |
Methods inherited from class tribble.crypto.SymmetricCipher |
getBlockSize, test, test |
Methods inherited from class tribble.crypto.AbstractCipher |
finalize, getAlgorithm, getKeySize, getKeySizes |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NullCipher()
Method Detail |
protected void initialize(byte[] key, boolean decrypt) throws java.security.InvalidKeyException
initialize
in class AbstractCipher
key
- The symmetric (secret) key for this cipher.decrypt
- If true, this indicates that this cipher is to be initialized for
decrypting, otherwise it is to be initialized for encrypting.
java.security.InvalidKeyException
clear()
protected void clear()
This method will be called after this cipher object is no longer needed. It should overwrite any sensitive data contained within this object (e.g., encryption key schedules). This cipher object can no longer be used after this method has been called.
clear
in class AbstractCipher
initialize()
protected void blockEncrypt(byte[] in, int inOff, byte[] out, int outOff)
blockEncrypt
in class SymmetricCipher
in
- Array containing a single block of plaintext bytes to encrypt.
The length of the block is exactly equal to the cipher block size.inOff
- Index of the first byte of the plaintext block within array in to
encrypt.out
- Array that will be filled with the encrypted ciphertext block.
The length of the block is exactly equal to the cipher block size.outOff
- Index of the first byte of array out to fill with the encrypted
ciphertext block.blockDecrypt(byte[], int, byte[], int)
protected void blockDecrypt(byte[] in, int inOff, byte[] out, int outOff)
blockDecrypt
in class SymmetricCipher
in
- Array containing a single block of ciphertext bytes to decrypt.
The length of the block is exactly equal to the cipher block size.inOff
- Index of the first byte of the ciphertext block within array in
to decrypt.out
- Array that will be filled with the decrypted plaintext block.
The length of the block is exactly equal to the cipher block size.outOff
- Index of the first byte of array out to fill with the decrypted
plaintext block.blockEncrypt(byte[], int, byte[], int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |