Improve PRNG performance

Only regenerate the SecretKeySpec when it changes