Problem 1: The line which prints the password is inside the loop - so as the password array is populated with each character, it will be printed out.

Problem 2: You are populating the password array with random chars from the range 33 (!) to (33 + 122 = 155) - but characters above 126 are 8 bit characters and may well display as hieroglyphics.

It looks like you initialise an array with the legal characters so you should be selecting a random character from that array. Try generating a random number N between 0 and length of arrayHex, then add arrayHex[N] to the password array.