|
Oracle Security Developer Tools Crypto Java API Reference 10g (10.1.4.0.1) B28171-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
oracle.security.crypto.core.Coder
oracle.security.crypto.core.Cipher
oracle.security.crypto.core.Arcfour
The Arcfour stream cipher, as described in the IETF Internet Draft A Stream Cipher Encryption Algorithm "Arcfour" (Kaukonen, Thayer 1999), which is equivalent to the RC4 stream cipher.
| Field Summary |
| Fields inherited from class oracle.security.crypto.core.Cipher |
CBC, decryptionKey, ECB, encryptionKey, key, mode, NULL_PADDING, PKCS5_PADDING, rbs |
| Constructor Summary | |
Arcfour()Creates an uninitialized Arcfour instance. |
|
| Method Summary | |
java.lang.String |
algName()Returns the name of the algorithm. |
int |
blockSize()Deprecated. Use getBlockSize() |
byte[] |
decrypt(byte[] input, int inOff, int len, boolean unpad)Decrypts a sequence of bytes of specified length. |
void |
decrypt(byte[] input, int inOff, int len, byte[] output, int outOff)Decrypts a sequence of bytes of specified length and places the original plaintext message in the given output buffer starting at the given offset. |
void |
decryptOp(byte[] input, int inOff, byte[] output, int outOff)Deprecated. Use a decrypt method instead. |
byte[] |
encrypt(byte[] input, int inOff, int len, boolean pad)Encrypts a sequence of bytes of specified length and, if specified, performs padding. |
void |
encrypt(byte[] input, int inOff, int len, byte[] output, int outOff)Encrypts a sequence of bytes of specified length and places the resulting ciphertext in the given output buffer starting at the given offset. |
void |
encryptOp(byte[] input, int inOff, byte[] output, int outOff)Deprecated. Use an encrypt method instead. |
void |
erase()Erases any sensitive information (such as buffers and subkey tables) stored in this cipher object. |
AlgorithmIdentifier |
getAlgID()Returns a clone of the AlgID.RC4 algorithm identifier. |
int |
getBlockSize()Returns 1, since Arcfour is a stream cipher. |
void |
initialize(AlgorithmIdentifier algID, Key key)This method may be used to initialize the Cipher for use. |
void |
initialize(SymmetricKey key)This method may be used to initialize the Arcfour instance for use. |
void |
setAlgID(AlgorithmIdentifier algID)Deprecated. Use an initialize method instead. |
void |
setDecryptionKey(Key key)Deprecated. Use an initialize method instead. |
void |
setEncryptionKey(Key key)Deprecated. Use an initialize method instead. |
void |
setIV(byte[] iv)Deprecated. Use an initialize method. |
void |
setKey(SymmetricKey key)Deprecated. Use an initialize method instead. |
void |
setMode(int mode)Deprecated. Use an initialize method. |
void |
setPadding(int padding)Deprecated. Use an initialize method. |
| Methods inherited from class oracle.security.crypto.core.Cipher |
assertDecryption, assertEncryption, cloneKey, decodeOp, decrypt, decrypt, decrypt, decryptOp, encodeOp, encrypt, encrypt, encrypt, encryptOp, getDecryptionKey, getEncryptionKey, getInstance, getInstance, getInstance, getInstance, getInstance, getIV, getKey, getMode, getPadding, getPaddingID, initialize, pad, releaseOp, setRandomBitsSource, unpad |
| Methods inherited from class oracle.security.crypto.core.Coder |
decode, decode, encode, encode, initialize |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Arcfour()
| Method Detail |
public void initialize(AlgorithmIdentifier algID,
Key key)
throws AlgorithmIdentifierException,
InvalidKeyException
initialize in class CipheralgID - is the AlgorithmIdentifier whose params will be used to configure the cipher.key - is the Key instance that will be cloned and used by the cipher internally. The internal instance will be erased when Cipher.erase() is called.AlgorithmIdentifierException - is thrown if the algID's OID isn't valid for the Cipher instance being initialized or if the params are not valid for the algID's OID.InvalidKeyException - is thrown if there is a problem with the Key instance the Cipher is being initialized with.
public void initialize(SymmetricKey key)
throws InvalidKeyException
key - is the Key instance that will be cloned and used by the cipher internally. The internal instance will be erased when Cipher.erase() is called.InvalidKeyException - is thrown if there is a problem with the Key instance the Cipher is being initialized with.
public byte[] decrypt(byte[] input,
int inOff,
int len,
boolean unpad)
throws CipherException
decrypt in class Cipherinput - Buffer in which data to be decrypted is stored.inOff - Offset within buffer of the start of data.len - The length of the dataunpad - The padding parameter is meaningless for Arcfour.CipherException - if cipher not initialized, data is not a multiple of the block size and no padding is specified, etc.
public void decrypt(byte[] input,
int inOff,
int len,
byte[] output,
int outOff)
throws CipherException
Cipherdecrypt in class Cipherinput - array of bytes to decryptinOff - offset of the start of the data to decryptlen - the length of the data to decryptoutput - array to place the decrypted bytesoutOff - offset of the start of the decrypted bytesCipherException - is thrown if the Cipher was not initialized, if the Cipher was used for encryption without being re-initialized, if the data is not a multiple of the block size, or if an error occurred during the decryption process.
public byte[] encrypt(byte[] input,
int inOff,
int len,
boolean pad)
throws CipherException
encrypt in class Cipherinput - buffer in which data to be encrypted is stored.inOff - offset within buffer of the start of the data.len - the length of the data.pad - is meaningless for the Arcfour cipher.CipherException - is thrown if the Cipher is not initialized, data is not a multiple of the block size and no padding is specified, etc.
public void encrypt(byte[] input,
int inOff,
int len,
byte[] output,
int outOff)
throws CipherException
Cipherencrypt in class Cipherinput - array of bytes to encryptinOff - offset of the start of data to encryptlen - the length of the data to encryptoutput - array to place the encrypted bytesoutOff - offset of the start of the encrypted bytesCipherException - is thrown if the Cipher was not initialized, if the Cipher was used for decryption without being re-initialized, if the data is not a multiple of the block size, or if an error occurred during the encryption process.public void erase()
Ciphererase in class Cipherpublic java.lang.String algName()
algName in class Coderpublic AlgorithmIdentifier getAlgID()
AlgID.RC4 algorithm identifier.getAlgID in class Cipherpublic final int getBlockSize()
1, since Arcfour is a stream cipher.getBlockSize in class Cipherpublic final int blockSize()
getBlockSize()1, since Arcfour is a stream cipher.blockSize in class Cipher
public void decryptOp(byte[] input,
int inOff,
byte[] output,
int outOff)
throws CipherException
decryptOp in class Cipherinput - buffer in which data to be decrypted is stored.inOff - offset within input buffer of the start of data.output - buffer to place the decrypted bytes inoutOff - offset within output buffer where the encrypted byte will be stored.CipherException - is thrown if the Cipher is not initialized, length of data is not equal to the block size, etc.
public void encryptOp(byte[] input,
int inOff,
byte[] output,
int outOff)
throws CipherException
encryptOp in class CipherinOff - offset within input buffer of the start of dataoutOff - offset within output buffer where the encrypted bytes will be storedinput - buffer in which data to be encrypted is storedoutput - buffer to place the encrypted bytes inCipherException - is thrown if the Cipher is not initialized, length of data is not equal to the block size, etc.
public void setAlgID(AlgorithmIdentifier algID)
throws AlgorithmIdentifierException
setAlgID in class CipherAlgorithmIdentifierException
public void setKey(SymmetricKey key)
throws InvalidKeyException
setKey in class Cipherkey - the encryption/decryption keyInvalidKeyException - is thrown if the the key is not valid for the Cipher instance
public void setEncryptionKey(Key key)
throws InvalidKeyException
setEncryptionKey in class Cipherkey - the encryption keyInvalidKeyException - is thrown if the the key is not valid for the Cipher instance
public void setDecryptionKey(Key key)
throws InvalidKeyException
setDecryptionKey in class Cipherkey - the decryption keyInvalidKeyException - is thrown if the the key is not valid for the Cipher instancepublic void setMode(int mode)
setMode in class Cipherpublic void setPadding(int padding)
Padding.NONE.setPadding in class Cipher
public void setIV(byte[] iv)
throws CipherException
setIV in class Cipheriv - the initialization vectorCipherException
|
Oracle Security Developer Tools Crypto Java API Reference 10g (10.1.4.0.1) B28171-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||