public class RC4Utils extends Object
| 构造器和说明 |
|---|
RC4Utils(byte[] key)
Initializes the class with a byte array key.
|
RC4Utils(String key)
Initializes the class with a string key.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
byteToString(byte[] bytes) |
static String |
decrypt(String val,
String key) |
static String |
encrypt(String val,
String key) |
static byte[] |
hex2byte(byte[] b)
字符串转java字节码
|
static void |
main(String[] args) |
byte[] |
rc4(byte[] buf)
RC4 encryption/decryption.
|
byte[] |
rc4(String data)
RC4 encryption/decryption.
|
public RC4Utils(String key) throws NullPointerException
key - the encryption/decryption keyNullPointerExceptionpublic RC4Utils(byte[] key)
throws NullPointerException
key - the encryption/decryption keyNullPointerExceptionpublic byte[] rc4(String data)
data - the data to be encrypted/decryptedpublic byte[] rc4(byte[] buf)
buf - the data to be encrypted/decryptedpublic static byte[] hex2byte(byte[] b)
b - public static String byteToString(byte[] bytes)
public static void main(String[] args)
Copyright © 2016. All rights reserved.