security issue

dears
i have a problem here i have a windows app which synchronize with a web site
and get news from the site and save it on the client's pc as xml and also save the user setting as xml the problem here that the xml is readable i don't want the client to be able to read those file so i decided to serialize the file as binary files
here's my serialization function



publicbool Serialize(string fileName,object Object)
{
try
{
FileStream fs =new FileStream(fileName, FileMode.Create);
BinaryFormatter formatter =new BinaryFormatter();
formatter.Serialize(fs, Object);
returntrue;

}
catch
{
returnfalse;

}

}


usualy i read the xml as string and serialize it and save it on the file with extension bin the problem here that the user still can read the file if he open it using notepad
so does anyone have any idea about how fix this problem or another way to hide the data

[1526 byte] By [Timo81] at [2008-2-13]
# 1
what about encrypting the file with a specific hash, or even simpler convert to XML string to a 64 string before serializing.
simple base 64 encoding example


public string ToBase64(object data)
{
MemoryStream mStream = new MemoryStream();
StreamWriter wr = new StreamWriter(mStream);
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(mStream,data);
mStream.Flush();
mStream.Close();
byte[] bytes = mStream.ToArray();
return Convert.ToBase64String(bytes);
}


de_henny at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified