This commit is contained in:
Looly 2020-06-05 10:10:02 +08:00
parent 26ccc50c89
commit 8319b00918

View File

@ -0,0 +1,20 @@
package cn.hutool.crypto.test;
import cn.hutool.crypto.Mode;
import cn.hutool.crypto.Padding;
import cn.hutool.crypto.symmetric.AES;
import org.junit.Assert;
import org.junit.Test;
public class AESTest {
@Test
public void encryptTest() {
// 构建
AES aes = new AES(Mode.CBC, Padding.PKCS5Padding,
"1234567890123456".getBytes(), "1234567890123456".getBytes());
String encryptHex = aes.encryptHex("123456");
Assert.assertEquals("d637735ae9e21ba50cb686b74fab8d2c", encryptHex);
}
}