APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.crypto.provider

pack-priv final Class DESedeCrypt

extends DESCrypt
implements DESConstants
Class Inheritance
All Implemented Interfaces
com.sun.crypto.provider.DESConstants
Imports
java.security.InvalidKeyException

This class implements the Triple DES algorithm (DES encryption, followed by DES decryption, followed by DES encryption) on a byte array of size DES_BLOCK_SIZE. Each DES operation has its own key.
Authors
Gigi Ankeny, Jan Luehe
See Also
DESConstants, DESCipher

Field Summary

Modifier and TypeField and Description
private final byte[]
private final byte[]
private byte[]
private byte[]
private byte[]
Inherited from com.sun.crypto.provider.DESCrypt:
decryptingexpandedKey

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
decryptBlock(byte[]
the buffer with the input data to be decrypted
cipher
,
int
the offset in cipherOffset
cipherOffset
,
byte[]
the buffer for the result
plain
,
int
the offset in plain
plainOffset
)

Overrides com.sun.crypto.provider.DESCrypt.decryptBlock.

Performs decryption operation.

pack-priv void
encryptBlock(byte[]
the buffer with the input data to be encrypted
plain
,
int
the offset in plain
plainOffset
,
byte[]
the buffer for the result
cipher
,
int
the offset in cipher
cipherOffset
)

Overrides com.sun.crypto.provider.DESCrypt.encryptBlock.

Performs encryption operation.

pack-priv void
init(boolean decrypting, String algorithm, byte[] keys)

Overrides com.sun.crypto.provider.DESCrypt.init.

Initializes the cipher in the specified mode with the given key.

private boolean
keyEquals(byte[] key1, int off1, byte[] key2, int off2, int len)

Inherited from com.sun.crypto.provider.DESCrypt:
cipherBlockexpandKeygetBlockSize

Field Detail

buf1back to summary
private final byte[] buf1
buf2back to summary
private final byte[] buf2
key1back to summary
private byte[] key1
key2back to summary
private byte[] key2
key3back to summary
private byte[] key3

Constructor Detail

DESedeCryptback to summary
pack-priv DESedeCrypt()

Method Detail

decryptBlockback to summary
pack-priv void decryptBlock(byte[] cipher, int cipherOffset, byte[] plain, int plainOffset)

Overrides com.sun.crypto.provider.DESCrypt.decryptBlock.

Performs decryption operation.

The input cipher text cipher, starting at cipherOffset and ending at (cipherOffset + blockSize - 1), is decrypted. The result is stored in plain, starting at plainOffset.

Parameters
cipher:byte[]

the buffer with the input data to be decrypted

cipherOffset:int

the offset in cipherOffset

plain:byte[]

the buffer for the result

plainOffset:int

the offset in plain

encryptBlockback to summary
pack-priv void encryptBlock(byte[] plain, int plainOffset, byte[] cipher, int cipherOffset)

Overrides com.sun.crypto.provider.DESCrypt.encryptBlock.

Performs encryption operation.

The input plain text plain, starting at plainOffset and ending at (plainOffset + blockSize - 1), is encrypted. The result is stored in cipher, starting at cipherOffset.

Parameters
plain:byte[]

the buffer with the input data to be encrypted

plainOffset:int

the offset in plain

cipher:byte[]

the buffer for the result

cipherOffset:int

the offset in cipher

initback to summary
pack-priv void init(boolean decrypting, String algorithm, byte[] keys) throws InvalidKeyException

Overrides com.sun.crypto.provider.DESCrypt.init.

Doc from com.sun.crypto.provider.SymmetricCipher.init.

Initializes the cipher in the specified mode with the given key.

Exceptions
InvalidKeyException:
if the given key is inappropriate for initializing this cipher
keyEqualsback to summary
private boolean keyEquals(byte[] key1, int off1, byte[] key2, int off2, int len)