Help with Serialization

Posted on 2010-01-09
Medium Priority
Last Modified: 2013-12-17
Hi Everyone,

I am attempting to write some code that serializes an object and saves it to file. However for secuirty reasons i dont want anyone to be able to open one of these files and read the xml text within, so i wish to pass it through an RC4 class i have written, the RC4 side of things is working nicely, however I am having issues with the encrypted text being saved to file. The only thing i can think of is that due the the actual characters appearing in the encrypted text objects are interpreting them differently.

For example, loading the encrypted text from the file using StreamReader gives you different text than if i were to load it via a FileStream, filling a buffer and using Encoding.GetString()

I am at a loss as to what to do, can anyone offer any suggestions?


Question by:locdang
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 36

Accepted Solution

Miguel Oz earned 2000 total points
ID: 26276736
Save The RC4 string as CDATA.

Note: Be careful with the Encoding when reading/writing the file. Unicode (UTF-16) would be the way to go

Author Closing Comment

ID: 31675108
Exactly what i needed, thanks a lot!

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question