public class PBKDF2 extends Object
| Constructor and Description |
|---|
PBKDF2()
构造,算法PBKDF2WithHmacSHA1,盐长度16,密文长度512,迭代次数1000
|
PBKDF2(String algorithm,
int keyLength,
int iterationCount)
构造
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
encrypt(char[] password,
byte[] salt)
加密
|
String |
encryptHex(char[] password,
byte[] salt)
加密
|
public PBKDF2()
public PBKDF2(String algorithm, int keyLength, int iterationCount)
algorithm - 算法,一般为PBKDF2WithXXXkeyLength - 生成密钥长度,默认512iterationCount - 迭代次数,默认1000public byte[] encrypt(char[] password,
byte[] salt)
password - 密码salt - 盐public String encryptHex(char[] password, byte[] salt)
password - 密码salt - 盐Copyright © 2025. All rights reserved.