Randomise port and generate secret