bitstorm commented on a change in pull request #462: URL: https://github.com/apache/wicket/pull/462#discussion_r593762860
########## File path: wicket-util/src/main/java/org/apache/wicket/util/crypt/SunJceCrypt.java ########## @@ -153,4 +194,18 @@ protected KeySpec createKeySpec() { return new PBEKeySpec(getKey().toCharArray()); } + + /** + * Create a random salt to be used for this crypt. + * + * @return salt, always 8 bytes long + */ + public static byte[] randomSalt() + { + // must be 8 bytes - for anything else PBES1Core throws + // InvalidAlgorithmParameterException: Salt must be 8 bytes long + byte[] salt = new byte[8]; + new Random().nextBytes(salt); Review comment: Since this is a legacy class I would leave it as it is as it can not be moved to wicket-core ---------------------------------------------------------------- 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: us...@infra.apache.org