public IdealPasswordParameters(String password) {
final int targetTimeMsec = 2000;
int iterations = 16384;
KeyCrypterScrypt scrypt = new KeyCrypterScrypt(iterations);
long now = System.currentTimeMillis();
scrypt.deriveKey(password);
long time = System.currentTimeMillis() - now;
log.info("Initial iterations took {} msec", time);
// N can only be a power of two, so we keep shifting both iterations and doubling time taken
// until we are in sorta the right general area.