C#: DLL as Embbeded Resource

I have two files, one is an EXE the other is a DLL (Class Library). I have embedded an XML file with sensitive data and the DLL is added as a reference to the EXE file. If the DLL is opened with Notepad, most of the information is encoded but the nodes containing the sensitive text are readable. Is there a way to encode the XML file or make the DLL so it cannot be opened by an end user?

DLL file:
...
Þ!  Þ    ~  o*  
:óþÿÿ+  *    Ý &  (  
*ë   <?xml version="1.0" encoding="utf-8"?>
<HNeedles>
  <CurrentPassword>Cry$tal</CurrentPassword>
  <FirstPreviousPassword>Sn0wFall!</FirstPreviousPassword>
  <SecondPreviousPassword>1stFr0st</SecondPreviousPassword>
</HNeedles>
 BSJB        v2.0.50727     l     #~  |  l  #Strings    è  x   #US `     #GUID   p  X  #Blob         W          ú3                  *  
                
...
LVL 3
Mister_SpockAsked:
Who is Participating?
 
xoperatorConnect With a Mentor Commented:
Hey,

If you are dealing with a sensitive data I'd better make sure is encrypted BEFORE you embed it in the DLL.
You can use any encryption you want, take the XML, encrypt it and embed it.
When you will open the file from the DLL simply decrypt it first and use it.

You can use the encryption method advice on the following link:

http://www.codeproject.com/KB/files/encryption.aspx

Please tell me if you need anything else.
0
 
bhagwantsinghCommented:
You can embed encrypted xml in your project and decrypt it in the run time.
 
Hope this will help you

http://davidhayden.com/blog/dave/archive/2005/11/22/2580.aspx
0
 
xoperatorCommented:
Hey,

Please consider the timing of both questions.

Thanks :)
0
 
Mister_SpockAuthor Commented:
Thanks for the example code. I am a DIY person so I am re-writing (mostly word for word) so I can understand what it is the code is doing. I hate it when someone uses "copy \ paste". What did they learn other than how to get someone else to do the work for them?
Merry Christmas and thank you again.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.