Added code for password encoding