Skip to content

Commit

Permalink
fix: Match PBKDF2 iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
VidTu committed Apr 18, 2024
1 parent c6205b2 commit 516dfcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/ru/vidtu/ias/crypt/Crypt.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static byte[] pbkdfAesDecrypt(byte[] encrypted, String password, byte[] salt, by
try {
// Create the key.
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 300_000, 256);
KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 500_000, 256);
byte[] secret = factory.generateSecret(spec).getEncoded();
SecretKey key = new SecretKeySpec(secret, "AES");
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
Expand Down

0 comments on commit 516dfcd

Please sign in to comment.