Hi,

I have been trying to use the Microsoft example code from the following link to encrypt elements in an XML file. There is a link at the foot of the page relating to the corresponding decrypt code.

http://msdn2.microsoft.com/en-us/library/ms229746.aspx

As suggested just before the example this is ideal for applications that want to save encrypted data between times taht they are run. Encrypting the file is not a problem, this works really well. The problem comes when i attempt to decrypt the data. I get an exception stating:

"Unable to retrieve decryption key."

The XML file is then not translated back to its initial plain text form.

Has anyone used this code before and could give me some guidance as to what i'm doing wrong.

Any ideas/help would be greatfully recieved.

Thanks in advance,

Grant