You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/softwareverde/cryptography/aes/AesKey.java
+16-6
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ public class AesKey {
19
19
20
20
privatestaticfinalStringKEY_ALGORITHM = "AES";
21
21
privatestaticfinalStringENCRYPTION_CIPHER = "AES/GCM/NoPadding"; // Using GCM instead of CBC as it provides authentication
22
+
privatestaticfinalintLEGACY_AUTHENTICATION_TAG_LENGTH = 12; // default is tag length is not specified
23
+
privatestaticfinalintAUTHENTICATION_TAG_LENGTH = 16; // max allowed value
22
24
privatestaticfinalintINITIALIZATION_VECTOR_LENGTH = 12; // IV size of 12-bytes is specifically recommended for AES-GCM (more efficient than other lengths)
23
25
24
26
privateSecretKey_key;
@@ -77,13 +79,14 @@ public byte[] encrypt(byte[] plainText) {
0 commit comments