Groups | Blog | Home
all groups > dotnet security > july 2006 >

dotnet security : Encrypt elements in XML file


Dominick Baier
7/12/2006 12:00:00 AM
maybe this article helps:

http://msdn.microsoft.com/msdnmag/issues/04/11/XMLSignatures/

[quoted text, click to view]

GSwan
7/12/2006 1:04:02 AM
Hi,

I'd like to be able to encrypt certain elements of an xml file which i use
in one of my applications. I found the following link of the msdn website
which looks exactly like what i want to do however i'm getting problems:

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

The link suggests that this method is used by apps wanting to store
encrypted data between the times that it runs.
The encrypt part works really well, the problems start when i try to
implement the decrypt code provided via the link at the foot of the page. I
always get the exception error "unable to retrieve decryption key".

Has anyone used this code and could give me any ideas as to what i'm doing
wrong. I wondered if it was to do with creating a new RSACryptoProvider when
the program is started which does not match with the first running of the
application (although thats me clutching at straws :) ).

Any help is greatly appreciated.

GSwan
7/12/2006 2:58:02 AM
That article certainly covers a lot of ground which i've yet to completely
get my head around. However i did focus on the XML encryption example section
which seems to outline exactly what i want to do.

I'm new to the cryptography side of thisngs and still have a question
relating to this.
The example sets an RSA variable 'billingKey' to the value returned by the
getBillingKey() method. Hypothetically would the value returned by this
method always be the same or is it random? I ask because i can't help but
feel my initial problem is caused by something like this. As i said before
though, i'm really not confident with cryptography yet.

Thanks for your quick response,

Grant

[quoted text, click to view]
AddThis Social Bookmark Button