Fuction for generating a random password