Use rand with max instead of SecureRandom for performance