mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix comment
This commit is contained in:
@@ -15,6 +15,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* RC4加密解密算法实现<br>
|
* RC4加密解密算法实现<br>
|
||||||
|
* 注意:由于安全问题,已经基本不在HTTPS中使用了<br>
|
||||||
* 来自:https://github.com/xSAVIKx/RC4-cipher/blob/master/src/main/java/com/github/xsavikx/rc4/RC4.java
|
* 来自:https://github.com/xSAVIKx/RC4-cipher/blob/master/src/main/java/com/github/xsavikx/rc4/RC4.java
|
||||||
*
|
*
|
||||||
* @author Iurii Sergiichuk,Looly
|
* @author Iurii Sergiichuk,Looly
|
||||||
@@ -28,12 +29,12 @@ public class RC4 implements Serializable {
|
|||||||
|
|
||||||
/** Sbox */
|
/** Sbox */
|
||||||
private int[] sbox;
|
private int[] sbox;
|
||||||
|
|
||||||
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
|
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造
|
* 构造
|
||||||
*
|
*
|
||||||
* @param key 密钥
|
* @param key 密钥
|
||||||
* @throws CryptoException key长度小于5或者大于255抛出此异常
|
* @throws CryptoException key长度小于5或者大于255抛出此异常
|
||||||
*/
|
*/
|
||||||
@@ -63,10 +64,10 @@ public class RC4 implements Serializable {
|
|||||||
public byte[] encrypt(String message) throws CryptoException {
|
public byte[] encrypt(String message) throws CryptoException {
|
||||||
return encrypt(message, CharsetUtil.CHARSET_UTF_8);
|
return encrypt(message, CharsetUtil.CHARSET_UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密
|
* 加密
|
||||||
*
|
*
|
||||||
* @param data 数据
|
* @param data 数据
|
||||||
* @return 加密后的Hex
|
* @return 加密后的Hex
|
||||||
* @since 4.5.12
|
* @since 4.5.12
|
||||||
@@ -77,7 +78,7 @@ public class RC4 implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密
|
* 加密
|
||||||
*
|
*
|
||||||
* @param data 数据
|
* @param data 数据
|
||||||
* @return 加密后的Base64
|
* @return 加密后的Base64
|
||||||
* @since 4.5.12
|
* @since 4.5.12
|
||||||
@@ -85,10 +86,10 @@ public class RC4 implements Serializable {
|
|||||||
public String encryptBase64(byte[] data) {
|
public String encryptBase64(byte[] data) {
|
||||||
return Base64.encode(crypt(data));
|
return Base64.encode(crypt(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密
|
* 加密
|
||||||
*
|
*
|
||||||
* @param data 被加密的字符串
|
* @param data 被加密的字符串
|
||||||
* @param charset 编码
|
* @param charset 编码
|
||||||
* @return 加密后的Hex
|
* @return 加密后的Hex
|
||||||
@@ -111,7 +112,7 @@ public class RC4 implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密
|
* 加密
|
||||||
*
|
*
|
||||||
* @param data 被加密的字符串
|
* @param data 被加密的字符串
|
||||||
* @param charset 编码
|
* @param charset 编码
|
||||||
* @return 加密后的Base64
|
* @return 加密后的Base64
|
||||||
@@ -253,7 +254,7 @@ public class RC4 implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 交换指定两个位置的值
|
* 交换指定两个位置的值
|
||||||
*
|
*
|
||||||
* @param i 位置1
|
* @param i 位置1
|
||||||
* @param j 位置2
|
* @param j 位置2
|
||||||
* @param sbox 数组
|
* @param sbox 数组
|
||||||
|
Reference in New Issue
Block a user