Revert generateSecret funcion that was missing somewhere in the commits