Write problem with encrypted keys

I am using a MSXML2::IXMLDOMNodePtr object. First I write two unencrypted keys into a file which write without any problems. Then I write one encrypted key to the same file and it writes without a problem. Then I try to write four more encrypted keys, but they all fail at the IXMLDOMNodePtr->put_text(BSTR value) function. The five encrypted strings are all encrypted using the same method, so you'd think if one works, they should all work.

Example:

IXMLDOMNodePtr->put_text("q b L¢¥ ÷ "); This works

but

IXMLDOMNodePtr->put_text("-o>a ÷oY"); This does not work

Also, if I take out all of the encryption, all values write perfectly.

Any suggestions, tips, etc is much appreciated.



Answer this question

Write problem with encrypted keys

  • Lee Brimelow

    For XML it doesn't matter that method was used to encrypt keys. It doesn't know that your text is encrypted key at all.

    You can see on the problem that you can add some text to XML node and this sometimes works and sometime doesn't.

    What is important here what characters are in the strings that you pass to put_text(). XML is quite picky and not all characters are allowed inside text nodes. If you want store binary data in the XML text nodes or attribute values you'd need to encode them with Base64 or some other encoding.



  • Write problem with encrypted keys