fix comment

This commit is contained in:
Looly 2021-09-09 18:20:43 +08:00
parent 6b8adc8a90
commit 47f1d967ed

View File

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