password encoding for registration