Password saved in encrypted format

I think what I want to do should be very simple. I can’t seem to figure it out.

I want to read in a file that contains information in clear text. I want to be able to read in clear text but convert it to a password data type and save the file with the new values encrypted. I thought I should just be able to read in one document where the fields are defined as Text Field, then map it to a document where the fields defined as Password. I want to convert the document to XML and write out the file.

It seems mapping a text field to a password field does not enforce encryption.

Has anyone else ever converted Text data to Password data?

Thanks for any and all help,
JR Smith