Package org.miaixz.bus.crypto.center
Class TEA
java.lang.Object
org.miaixz.bus.crypto.center.TEA
- All Implemented Interfaces:
Serializable,Decryptor,Encryptor
TEA(Corrected Block Tiny Encryption Algorithm)算法实现
来自:https://github.com/xxtea/xxtea-java
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(byte[] data) 解密voiddecrypt(InputStream data, OutputStream out, boolean isClose) 解密,针对大数据量,结束后不关闭流byte[]encrypt(byte[] data) 加密voidencrypt(InputStream data, OutputStream out, boolean isClose) 加密,针对大数据量,可选结束后是否关闭流Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.crypto.builtin.symmetric.Decryptor
decrypt, decrypt, decryptString, decryptString, decryptString, decryptString, decryptString, decryptStringMethods inherited from interface org.miaixz.bus.crypto.builtin.symmetric.Encryptor
encrypt, encrypt, encrypt, encryptBase64, encryptBase64, encryptBase64, encryptBase64, encryptHex, encryptHex, encryptHex, encryptHex
-
Constructor Details
-
TEA
public TEA(byte[] key) 构造- Parameters:
key- 密钥,16位
-
-
Method Details
-
encrypt
public byte[] encrypt(byte[] data) Description copied from interface:Encryptor加密 -
encrypt
Description copied from interface:Encryptor加密,针对大数据量,可选结束后是否关闭流 -
decrypt
public byte[] decrypt(byte[] data) Description copied from interface:Decryptor解密 -
decrypt
Description copied from interface:Decryptor解密,针对大数据量,结束后不关闭流
-