|
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02 |
||||||||
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
public final class 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, ECB, key, mode, rbs |
Constructor Summary | |
---|---|
Arcfour() Creates an uninitialized Arcfour instance. |
Method Summary | |
---|---|
java.lang.String |
algName() Returns the name of the algorithm. |
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. |
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 |
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, RandomBitsSource rbs) 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. |
PrivateKey |
unwrapPrivateKey(byte[] encKey) Unwraps a private key using this cipher. |
SymmetricKey |
unwrapSymmetricKey(byte[] encKey, AlgorithmIdentifier algID) Unwraps a symmetric key using this cipher. |
byte[] |
wrapKey(PrivateKey key) Wraps a private key using this cipher. |
byte[] |
wrapKey(SymmetricKey key) Wraps a symmetric key using this cipher. |
Methods inherited from class oracle.security.crypto.core.Cipher |
---|
assertDecryption, assertEncryption, assertKeyUnwrap, assertKeyWrap, cloneKey, decodeOp, decrypt, decrypt, decrypt, encodeOp, encrypt, encrypt, encrypt, finalize, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getIV, getMode, getPaddingID, initialize, initialize, initialize, releaseOp |
Methods inherited from class oracle.security.crypto.core.Coder |
---|
decode, decode, encode, encode |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Arcfour()
Method Detail |
---|
public void initialize(AlgorithmIdentifier algID, Key key, RandomBitsSource rbs) throws AlgorithmIdentifierException, InvalidKeyException
initialize
in class Cipher
algID
- The AlgorithmIdentifier whose params will be used to configure the cipher.key
- The Key instance that will be used by the cipher internally.rbs
- The RandomBitsSourfce to use in this cipherAlgorithmIdentifierException
- 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
- If there is a problem with the Key instance the Cipher is being initialized with.public void initialize(SymmetricKey key) throws InvalidKeyException
key
- The Key instance that will be used by the cipher internally.InvalidKeyException
- 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 Cipher
input
- 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
Cipher
decrypt
in class Cipher
input
- The buffer in which data to be decrypted is stored.inOff
- The offset within buffer of the start of data.len
- The length of the data.output
- The array to place the decrypted bytes.outOff
- The offset of the start of the decrypted bytes.CipherException
- 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 Cipher
input
- 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
- Not used for the Arcfour cipher.CipherException
- 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
Cipher
encrypt
in class Cipher
input
- The array of bytes to encrypt.inOff
- The offset of the start of data to encrypt.len
- The length of the data to encrypt.output
- The array to place the encrypted bytes.outOff
- The offset of the start of the encrypted bytes.CipherException
- 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 byte[] wrapKey(PrivateKey key) throws CipherException
wrapKey
in class Cipher
key
- The private key to wrap.CipherException
- If the Cipher was not initialized, if the Cipher was used for key-wrapping without being re-initialized or if an error occurred during the wrapping process.public byte[] wrapKey(SymmetricKey key) throws CipherException
wrapKey
in class Cipher
key
- The symmetric key to wrap.CipherException
- If the Cipher was not initialized, if the Cipher was used for key-wrapping without being re-initialized or if an error occurred during the wrapping process.public PrivateKey unwrapPrivateKey(byte[] encKey) throws CipherException
unwrapPrivateKey
in class Cipher
encKey
- The encrypted key.CipherException
- If the Cipher was not initialized, if the Cipher was used for unwrapping without being re-initialized, if an error occurred during the encryption process or if the decrypted key is not a PrivateKey
.public SymmetricKey unwrapSymmetricKey(byte[] encKey, AlgorithmIdentifier algID) throws CipherException
unwrapSymmetricKey
in class Cipher
encKey
- The encrypted key.algID
- The algorithm identifier of the wrapped symmetric key (optional).CipherException
- If the Cipher was not initialized, if the Cipher was used for unwrapping without being re-initialized or if an error occurred during the encryption process.public void erase()
Cipher
erase
in class Cipher
public java.lang.String algName()
algName
in class Coder
public AlgorithmIdentifier getAlgID()
AlgID.RC4
algorithm identifier.getAlgID
in class Cipher
public final int getBlockSize()
1
, since Arcfour
is a stream cipher.getBlockSize
in class Cipher
|
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |