/*
* Create an MD5 password encryptor that uses an 8-byte salt with one
* hash iteration. This encryptor should be capable of validating
* legacy uPortal passwords.
*/
md5Encryptor = new ConfigurablePasswordEncryptor();
SimpleDigesterConfig md5Config = new SimpleDigesterConfig();
md5Config.setIterations(1);
md5Config.setAlgorithm("MD5");
md5Config.setSaltSizeBytes(8);
md5Encryptor.setConfig(md5Config);
/*
* Create a stronger SHA-256 password encryptor for setting and
* validating new passwords.
*/
sha256Encryptor = new ConfigurablePasswordEncryptor();
SimpleDigesterConfig shaConfig = new SimpleDigesterConfig();
shaConfig.setIterations(1000);
shaConfig.setAlgorithm("SHA-256");
shaConfig.setSaltSizeBytes(8);
sha256Encryptor.setConfig(shaConfig);