public class XXTEA extends Object implements SymmetricEncryptor, SymmetricDecryptor, Serializable
Constructor and Description |
---|
XXTEA(byte[] key)
构造
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] data)
解密
|
void |
decrypt(InputStream data,
OutputStream out,
boolean isClose)
解密,针对大数据量,结束后不关闭流
|
byte[] |
encrypt(byte[] data)
加密
|
void |
encrypt(InputStream data,
OutputStream out,
boolean isClose)
加密,针对大数据量,可选结束后是否关闭流
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encrypt, encrypt, encrypt, encrypt, encryptBase64, encryptBase64, encryptBase64, encryptBase64, encryptBase64, encryptHex, encryptHex, encryptHex, encryptHex, encryptHex
decrypt, decrypt, decryptStr, decryptStr, decryptStr, decryptStr, decryptStr, decryptStr
public byte[] encrypt(byte[] data)
SymmetricEncryptor
encrypt
in interface SymmetricEncryptor
data
- 被加密的bytespublic void encrypt(InputStream data, OutputStream out, boolean isClose)
SymmetricEncryptor
encrypt
in interface SymmetricEncryptor
data
- 被加密的字符串out
- 输出流,可以是文件或网络位置isClose
- 是否关闭流public byte[] decrypt(byte[] data)
SymmetricDecryptor
decrypt
in interface SymmetricDecryptor
data
- 被解密的bytespublic void decrypt(InputStream data, OutputStream out, boolean isClose)
SymmetricDecryptor
decrypt
in interface SymmetricDecryptor
data
- 加密的字符串out
- 输出流,可以是文件或网络位置isClose
- 是否关闭流,包括输入和输出流Copyright © 2024. All rights reserved.