risdenk commented on a change in pull request #327:
URL: https://github.com/apache/knox/pull/327#discussion_r421201678



##########
File path: 
gateway-spi/src/main/java/org/apache/knox/gateway/services/security/impl/ConfigurableEncryptor.java
##########
@@ -107,6 +107,14 @@ public EncryptionResult encrypt(byte[] plain) throws 
Exception {
     rnd.nextBytes(salt);
 
     SecretKey tmp = getKeyFromPassword(new String(passPhrase), salt);
+    /*
+    * the key should not be constant value, recommend code:
+    * SecureRandom random = new SecureRandom();
+    * String defaultKey = String.valueOf(random.nextInt());
+    * byte[] keyBytes = defaultKey.getBytes();
+    * keyBytes = Arrays.copyOf(keyBytes,24);
+    * SecretKey secret = new SecretKeySpec(keyBytes, alg);
+    */

Review comment:
       This is a comment and not actually fixing anything. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to