Changed to using a secure random number source