github-code-scanning[bot] commented on code in PR #332:
URL: https://github.com/apache/commons-compress/pull/332#discussion_r1033168787


##########
src/main/java/org/apache/commons/compress/archivers/sevenz/AES256SHA256Decoder.java:
##########
@@ -126,4 +114,99 @@
             }
         };
     }
+
+    @Override
+    OutputStream encode(OutputStream out, Object options) throws IOException {
+        return new OutputStream() {
+            private boolean isInitialized;
+            private CipherOutputStream cipherOutputStream;
+
+            private CipherOutputStream init() throws IOException {
+                if (isInitialized) {
+                    return cipherOutputStream;
+                }
+
+                AES256Options opts = (AES256Options) options;
+                final byte[] aesKeyBytes = sha256Password(opts.password, 
opts.numCyclesPower, opts.salt);
+
+                final SecretKey aesKey = new SecretKeySpec(aesKeyBytes, "AES");
+                try {
+                    final Cipher cipher = 
Cipher.getInstance("AES/CBC/PKCS5Padding"); // padding required for very small 
files (< 16 bytes)

Review Comment:
   ## Use of a broken or risky cryptographic algorithm
   
   Cryptographic algorithm [AES/CBC/PKCS5Padding](1) is weak and should not be 
used.
   
   [Show more 
details](https://github.com/apache/commons-compress/security/code-scanning/104)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to