|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnetapp.manage.ARCFour
A utility class implementing ARCFOUR (the alleged RC4 algorithm) for encryption of a data stream. Until 1994 RC4 was a trade secret of RSA Data Security, Inc, when it was released anonymously to a mailing list. Because there is no proof that the leaked version was in fact RC4 and because "RC4" is a trademark, it is called "ARCFOUR", short for "Allegedly RC4". This version is ported to java from the source in zephyr's src/libnetapp/na.c. This algorithm has the property that calling crypt() with the same password on an encrypted value returns the original text.
| Constructor Summary | |
ARCFour()
Constructor using a default key. |
|
ARCFour(java.lang.String key)
Constructor using a key you specify. |
|
| Method Summary | |
char[] |
crypt(char[] input)
Encrypts or decrypt an input buffer. |
char[] |
crypt(char[] input,
char[] output)
Encrypts or decrypt. |
char[] |
crypt(java.lang.String input)
Encrypts or decrypt a string. |
static java.lang.String |
decodeAndDecrypt(java.lang.String input)
Convenience method that undoes the encoding and encrypt from encryptAndEncode() using the default key. |
static java.lang.String |
encryptAndEncode(java.lang.String input)
Convenience method that both encrypts and base-16 encodes a string using the default key. |
void |
init()
Initializes the crypto engine. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ARCFour()
public ARCFour(java.lang.String key)
| Method Detail |
public void init()
public char[] crypt(char[] input,
char[] output)
input - characters to encrypt; this may be nulloutput - location to store the encrypted result
public char[] crypt(char[] input)
input - characters to encrypt; this may be null
public char[] crypt(java.lang.String input)
input - string to encrypt; this may be null
public static java.lang.String encryptAndEncode(java.lang.String input)
input - plaintext to encrypt; this may be null
public static java.lang.String decodeAndDecrypt(java.lang.String input)
input - encrypted/encoded data to decode; this may be null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||