Skip to content

Commit

Permalink
Update AESCBC.java
Browse files Browse the repository at this point in the history
Adding Neha's fix
  • Loading branch information
tomcrofts authored Jun 6, 2024
1 parent 4ddeed0 commit df18ab9
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public class AESCBC {
private AESCBC() {
}

private static final String CYPHER = "AES/CBC/NoPadding";

@java.lang.SuppressWarnings("squid:S3329")
public static byte[] decrypt(Key secretKey, JweObject object) throws GeneralSecurityException {
// First 16 bytes are the MAC key, so we only use the second 16 bytes
Expand All @@ -33,7 +31,7 @@ public static byte[] decrypt(Key secretKey, JweObject object) throws GeneralSecu
}

public static byte[] cipher(Key key, AlgorithmParameterSpec iv, byte[] bytes, int mode) throws GeneralSecurityException {
Cipher cipher = Cipher.getInstance(CYPHER);
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
cipher.init(mode, key, iv);
return cipher.doFinal(bytes);
}
Expand Down

0 comments on commit df18ab9

Please sign in to comment.