@@ -17,7 +17,7 @@ public byte[] encryptWithStaticIvByteArrayWithInitializer(byte[] key, byte[] pla
1717 SecretKeySpec keySpec = new SecretKeySpec (key , "AES" );
1818
1919 Cipher cipher = Cipher .getInstance ("AES/GCM/PKCS5PADDING" );
20- cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/insecure-iv-or-nonce]
20+ cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/examples/ insecure-iv-or-nonce]
2121 cipher .update (plaintext );
2222 return cipher .doFinal ();
2323 }
@@ -30,7 +30,7 @@ public byte[] encryptWithZeroStaticIvByteArray(byte[] key, byte[] plaintext) thr
3030 SecretKeySpec keySpec = new SecretKeySpec (key , "AES" );
3131
3232 Cipher cipher = Cipher .getInstance ("AES/GCM/PKCS5PADDING" );
33- cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/unknown-iv-or-nonce-source]
33+ cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/examples/ unknown-iv-or-nonce-source]
3434 cipher .update (plaintext );
3535 return cipher .doFinal ();
3636 }
@@ -46,7 +46,7 @@ public byte[] encryptWithStaticIvByteArray(byte[] key, byte[] plaintext) throws
4646 SecretKeySpec keySpec = new SecretKeySpec (key , "AES" );
4747
4848 Cipher cipher = Cipher .getInstance ("AES/CBC/PKCS5PADDING" );
49- cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/insecure-iv-or-nonce]
49+ cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/examples/ insecure-iv-or-nonce]
5050 cipher .update (plaintext );
5151 return cipher .doFinal ();
5252 }
@@ -62,7 +62,7 @@ public byte[] encryptWithOneOfStaticIvs01(byte[] key, byte[] plaintext) throws E
6262 SecretKeySpec keySpec = new SecretKeySpec (key , "AES" );
6363
6464 Cipher cipher = Cipher .getInstance ("AES/GCM/PKCS5PADDING" );
65- cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/insecure-iv-or-nonce]
65+ cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/examples/ insecure-iv-or-nonce]
6666 cipher .update (plaintext );
6767 return cipher .doFinal ();
6868 }
@@ -78,7 +78,7 @@ public byte[] encryptWithOneOfStaticIvs02(byte[] key, byte[] plaintext) throws E
7878 SecretKeySpec keySpec = new SecretKeySpec (key , "AES" );
7979
8080 Cipher cipher = Cipher .getInstance ("AES/GCM/PKCS5PADDING" );
81- cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/insecure-iv-or-nonce]
81+ cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/examples/ insecure-iv-or-nonce]
8282 cipher .update (plaintext );
8383 return cipher .doFinal ();
8484 }
@@ -94,7 +94,7 @@ public byte[] encryptWithOneOfStaticZeroIvs(byte[] key, byte[] plaintext) throws
9494 SecretKeySpec keySpec = new SecretKeySpec (key , "AES" );
9595
9696 Cipher cipher = Cipher .getInstance ("AES/GCM/PKCS5PADDING" );
97- cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/unknown-iv-or-nonce-source]
97+ cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/examples/ unknown-iv-or-nonce-source]
9898 cipher .update (plaintext );
9999 return cipher .doFinal ();
100100 }
@@ -203,7 +203,7 @@ public byte[] encryptWithGeneratedIvByteArrayInsecure(byte[] key, byte[] plainte
203203 SecretKeySpec keySpec = new SecretKeySpec (key , "AES" );
204204
205205 Cipher cipher = Cipher .getInstance ("AES/CBC/PKCS5PADDING" );
206- cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/insecure-iv-or-nonce]]
206+ cipher .init (Cipher .ENCRYPT_MODE , keySpec , ivSpec ); // $Alert[java/quantum/examples/ insecure-iv-or-nonce]]
207207 cipher .update (plaintext );
208208 return cipher .doFinal ();
209209 }
0 commit comments