mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
6d3d7d4913
commit
a211d6eada
@ -4,7 +4,7 @@ package cn.hutool.crypto;
|
|||||||
* 模式
|
* 模式
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* 加密算法模式,是用来描述加密算法(此处特指分组密码,不包括流密码,)在加密时对明文分组的模式,它代表了不同的分组方式
|
* 加密算法模式,是用来描述加密算法(此处特指分组密码,不包括流密码)在加密时对明文分组的模式,它代表了不同的分组方式
|
||||||
*
|
*
|
||||||
* @author Looly
|
* @author Looly
|
||||||
* @see <a href="https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"> Cipher章节</a>
|
* @see <a href="https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Cipher"> Cipher章节</a>
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user