File tree Expand file tree Collapse file tree
src/main/java/com/cryptoexamples/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,9 +56,6 @@ public static void main(String[] args) {
5656 GCMParameterSpec spec = new GCMParameterSpec (16 * 8 , nonce );
5757 cipher .init (Cipher .ENCRYPT_MODE , key , spec );
5858
59- //byte[] aad = "Additional authenticated not encrypted data".getBytes();
60- //cipher.updateAAD(aad);
61-
6259 // TODO store encryption parameters as authenticated data prepended to the file content
6360
6461 // SET UP OUTPUT STREAM and write content of String
@@ -76,7 +73,7 @@ public static void main(String[] args) {
7673 // READ ENCRYPTED FILE
7774 StringBuilder stringBuilder = new StringBuilder ();
7875 cipher .init (Cipher .DECRYPT_MODE , key , spec );
79- //cipher.updateAAD(aad);
76+
8077 try (
8178 FileInputStream fileInputStream = new FileInputStream ("encryptedFile.enc" );
8279 CipherInputStream cipherInputStream = new CipherInputStream (fileInputStream , cipher )
You can’t perform that action at this time.
0 commit comments