Replaced System.Random with a crypto random implementation