Handle password confirmation and password encoding