This commit is contained in:
Looly 2022-09-15 22:05:09 +08:00
parent 6d3d7d4913
commit a211d6eada
2 changed files with 20 additions and 1 deletions

View File

@ -4,7 +4,7 @@ package cn.hutool.crypto;
* 模式
*
* <p>
* 加密算法模式是用来描述加密算法此处特指分组密码不包括流密码在加密时对明文分组的模式它代表了不同的分组方式
* 加密算法模式是用来描述加密算法此处特指分组密码不包括流密码在加密时对明文分组的模式它代表了不同的分组方式
*
* @author Looly
* @see <a href="https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"> Cipher章节</a>

View File

@ -0,0 +1,19 @@
package cn.hutool.crypto.symmetric;
import cn.hutool.crypto.Padding;
import org.junit.Assert;
import org.junit.Test;
public class Issue2613Test {
@Test
public void aesGcmTest(){
final AES aes = new AES("GCM", Padding.NoPadding.name(),
"1234567890123456".getBytes(),
"1234567890123456".getBytes());
final String encryptHex = aes.encryptHex("123456");
final String s = aes.decryptStr(encryptHex);
Assert.assertEquals("123456", s);
}
}