|
Sharkysoft home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--lava.security.des.DesEcbCoder
Encrypts/decrypts using DES in ECB mode.
Details: A DesEcbCoder performs encryption/decryption using DES in ECB (Electronic CodeBook) mode. ECB mode is the standard 64-bit block encryption/decryption mode defined in FIPS PUB 46. DES-ECB is a stateless "dictionary" cipher that converts the same input symbol to the same output symbol every time, regardless of input history. (The dictionary is selected by the key.) Because the input and output symbols are 64 bit blocks, only long arrays are supported in this class' ITextTransform interface methods.
In order to encrypt/decrypt bytes rather than longs, you must exercise one of the following options:
byte arrays to long arrays, encrypt the long arrays, and then convert the resulting long arrays back into byte arrays. (Class lava.array.BigEndianArray may be helpful.) When encrypting, if the number of input bytes is not a multiple of 8, then you must pad the input stream in some sensible manner, and reverse the pad after decryption. Remember, DES-ECB is a 64-bit block cipher, not a byte cipher.DesEngine directly and let it handle the byte-to-long-to-byte conversions as described in IBlockCipher64. Your input must still be in multiples of 8 bytes, however, so padding may still be necessary.byte stream encryption/decryption, such as DES-OFB-8 (see DesOfbCoder) or DES-CFB-8 (see DesCfbCoder).DesEcbCoder is the base class for DesEcbEncoder and DesEcbDecoder and contains implementations common to both classes. However, this class is abstract and cannot be instantiated because you are expected to instantiate one of the subclasses instead. DesEcbCoder is public only to make the JavaDoc documentation visible.
| Method Summary | |
void |
beginTransform()
No operation. |
int |
completeTransform(java.lang.Object dest)
No operation. |
int |
getTransformInputWidth()
Returns 64. |
int |
getTransformOutputWidth()
Returns 64. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Method Detail |
public final void beginTransform()
Details: This method is defined only to satisfy an ITextTransform interface requirement and does absolutely nothing in this implementation.
public final int completeTransform(java.lang.Object dest)
Details: This method is defined only to satisfy an ITextTransform interface requirement and does absolutely nothing in this implementation.
dest - ignoredpublic final int getTransformInputWidth()
Details: getTransformInputWidth returns 64, indicating that only 64-bit input blocks are supported.
public final int getTransformOutputWidth()
Details: getTransformOutputWidth returns 64, indicating that only 64-bit output blocks are generated.
|
Sharkysoft home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||