diff --git a/src/main/java/com/mastercard/developer/encryption/aes/AESCBC.java b/src/main/java/com/mastercard/developer/encryption/aes/AESCBC.java index 28fbf11..0e10a3a 100644 --- a/src/main/java/com/mastercard/developer/encryption/aes/AESCBC.java +++ b/src/main/java/com/mastercard/developer/encryption/aes/AESCBC.java @@ -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 @@ -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); }