Replaced random by crypto