Skip to content

Commit

Permalink
change doFinal per
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed Jan 26, 2024
1 parent 60cd89f commit 6ada1cd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static String decrypt(String value, String password ) {
//use first 12 bytes for iv
AlgorithmParameterSpec gcmIv = new GCMParameterSpec(128, baseBytes, 0, GCM_IV_LENGTH);
aes.init( Cipher.DECRYPT_MODE, generateKeyFromString(password),gcmIv);
byte[] decrypted = aes.doFinal(baseBytes);
byte[] decrypted = aes.doFinal(baseBytes,GCM_IV_LENGTH, baseBytes.length - GCM_IV_LENGTH);
return new String(decrypted);

} catch ( InvalidKeyException | NoSuchAlgorithmException | BadPaddingException
Expand Down

0 comments on commit 6ada1cd

Please sign in to comment.