Skip to content

Commit 4208df0

Browse files
committed
increases salt size to 32 bytes to be equal in size for the used SHA-256 (for PBKDF2 )
1 parent e22cd13 commit 4208df0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/cryptoexamples/java/ExampleStringEncryptionPasswordBasedInOneMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static void main(String[] args) {
4444
String password = Base64.getEncoder().encodeToString(keyGen.generateKey().getEncoded());
4545

4646
// GENERATE random salt (needed for PBKDF2)
47-
final byte[] salt = new byte[12];
47+
final byte[] salt = new byte[32];
4848
SecureRandom random = SecureRandom.getInstanceStrong();
4949
random.nextBytes(salt);
5050

0 commit comments

Comments
 (0)