add PBKDF2

This commit is contained in:
Looly
2021-03-05 21:07:36 +08:00
parent d0f37fe460
commit 71a82e0534
4 changed files with 95 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package cn.hutool.crypto.test.symmetric;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.SecureUtil;
import org.junit.Assert;
import org.junit.Test;
public class PBKDF2Test {
@Test
public void encryptTest(){
final String s = SecureUtil.pbkdf2("123456".toCharArray(), RandomUtil.randomBytes(16));
Assert.assertEquals(128, s.length());
}
}