It's probably best to move the logic of SecureRandom away from the views and into the controller.