473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

encrypting serilized object

I have couple of object I serialise and store them in file between
session. If you open the files you could see the string values. I want
a way to encrypt the data so that if anyone opens the file they
shouldn't be able to read it. Just to increase the security of the
system. How can I do this?
Thanks.

Jan 5 '07 #1
6 2133
DBC: Although I am not an expert, I want to offer the following advice.

If you want to encrypt the values, the best way I can think of doing
this is to write the serialization to a temporary file, then run that
file through your favorite encryption algorithm and save the encrypted
file. Have fun :)

DBC User wrote:
I have couple of object I serialise and store them in file between
session. If you open the files you could see the string values. I want
a way to encrypt the data so that if anyone opens the file they
shouldn't be able to read it. Just to increase the security of the
system. How can I do this?
Thanks.
Jan 6 '07 #2
On 5 Jan 2007 20:26:35 -0800, "CodeLeon" <le*******@gmail.comwrote:
Be aware that encrypted data will contain apparently random bytes,
including a lot of control characters etc. It will probably be safer
to convert the encrypted byte array into Base64 or similar before
saving it.

rossum

>DBC: Although I am not an expert, I want to offer the following advice.

If you want to encrypt the values, the best way I can think of doing
this is to write the serialization to a temporary file, then run that
file through your favorite encryption algorithm and save the encrypted
file. Have fun :)

DBC User wrote:
>I have couple of object I serialise and store them in file between
session. If you open the files you could see the string values. I want
a way to encrypt the data so that if anyone opens the file they
shouldn't be able to read it. Just to increase the security of the
system. How can I do this?
Thanks.
Jan 6 '07 #3
You're right... in fact, that's what i did when i needed to create a
user database with xml. I just forgot.... sorry! That's a really good
idea, DBC, you should use rossum's advice.

rossum wrote:
On 5 Jan 2007 20:26:35 -0800, "CodeLeon" <le*******@gmail.comwrote:
Be aware that encrypted data will contain apparently random bytes,
including a lot of control characters etc. It will probably be safer
to convert the encrypted byte array into Base64 or similar before
saving it.

rossum

DBC: Although I am not an expert, I want to offer the following advice.

If you want to encrypt the values, the best way I can think of doing
this is to write the serialization to a temporary file, then run that
file through your favorite encryption algorithm and save the encrypted
file. Have fun :)

DBC User wrote:
I have couple of object I serialise and store them in file between
session. If you open the files you could see the string values. I want
a way to encrypt the data so that if anyone opens the file they
shouldn't be able to read it. Just to increase the security of the
system. How can I do this?
Thanks.
Jan 6 '07 #4
Just a thought. That should not be an issue as you can read and write it as
binary data (like any binary file). So you can remove the overhead of a
base64 conversion,which does not really buy you anything unless you want to
pass it around in email or something.

--
William Stacey [C# MVP]

"rossum" <ro******@coldmail.comwrote in message
news:as********************************@4ax.com...
| On 5 Jan 2007 20:26:35 -0800, "CodeLeon" <le*******@gmail.comwrote:
| Be aware that encrypted data will contain apparently random bytes,
| including a lot of control characters etc. It will probably be safer
| to convert the encrypted byte array into Base64 or similar before
| saving it.
|
| rossum
|
|
| >DBC: Although I am not an expert, I want to offer the following advice.
| >
| >If you want to encrypt the values, the best way I can think of doing
| >this is to write the serialization to a temporary file, then run that
| >file through your favorite encryption algorithm and save the encrypted
| >file. Have fun :)
| >
| >DBC User wrote:
| >I have couple of object I serialise and store them in file between
| >session. If you open the files you could see the string values. I want
| >a way to encrypt the data so that if anyone opens the file they
| >shouldn't be able to read it. Just to increase the security of the
| >system. How can I do this?
| >Thanks.
|
Jan 6 '07 #5
That's another good idea. Base64 is known for its overhead, and if you
are writing to a binary file.... then you don't necessarily need b64.

William Stacey [C# MVP] wrote:
Just a thought. That should not be an issue as you can read and write it as
binary data (like any binary file). So you can remove the overhead of a
base64 conversion,which does not really buy you anything unless you want to
pass it around in email or something.

--
William Stacey [C# MVP]

"rossum" <ro******@coldmail.comwrote in message
news:as********************************@4ax.com...
| On 5 Jan 2007 20:26:35 -0800, "CodeLeon" <le*******@gmail.comwrote:
| Be aware that encrypted data will contain apparently random bytes,
| including a lot of control characters etc. It will probably be safer
| to convert the encrypted byte array into Base64 or similar before
| saving it.
|
| rossum
|
|
| >DBC: Although I am not an expert, I want to offer the following advice.
| >
| >If you want to encrypt the values, the best way I can think of doing
| >this is to write the serialization to a temporary file, then run that
| >file through your favorite encryption algorithm and save the encrypted
| >file. Have fun :)
| >
| >DBC User wrote:
| >I have couple of object I serialise and store them in file between
| >session. If you open the files you could see the string values. I want
| >a way to encrypt the data so that if anyone opens the file they
| >shouldn't be able to read it. Just to increase the security of the
| >system. How can I do this?
| >Thanks.
|
Jan 7 '07 #6
All,

Thank you very much and is a very helpful. I will write some test code
and see if that resolves my problem. By anychance does any one have any
code snippets on this?

Thanks.

Jan 8 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: steve | last post by:
Hi, I know there are a few free and paid php source code encryption scripts around. Has anyone used one, and any feedback? I am interested in encrypting source that is placed on a remote host....
3
by: Piotr | last post by:
MS has published on its sites javascript encoder, which enables "encrypting" javascript code. It allows hiding js code from being seen as a text file. There is a decoder for it, available in the...
6
by: Dayne | last post by:
Guys, I am writing a database application(vb.net , sql server) and is presently storing the connection settings in a xml file...not very secure though. What is a safer method in a dynamic...
14
by: John J. Hughes II | last post by:
Using the below code I am send multiple sterilized object across an IP port. This works fine if only one object is received at a time but with packing sometimes there is more then one object or...
7
by: Richard L Rosenheim | last post by:
Anyone care to express their two cents over pros and cons of encrypting the data being transmitted (within the SOAP package) versus just utilizing a HTTPS connection? Richard Rosenheim
2
by: Amar | last post by:
Hi All, I want to insert my password into the mysql database by encrypting it so that I can also retrieve the password. Before I was using sha1() for encrypting password,but it is an one way...
2
by: SeeSharp Bint | last post by:
Visual Studio 2005, dotnet, c#. Microsoft SQL Server. Windows XP forms application. Temporarily, for my database application, I have been storing the various elements of database connection...
0
by: NavinJ | last post by:
I want to encrypt an object of my Windows Forms application using RSACryptoServiceProvider class and then serialize the encrypted object. The problem is, the RSACryptoServiceProvider.Encrypt()...
4
by: per9000 | last post by:
Hi python people, I am trying to figure out the best way to encrypt files in python. I've build a small script (see below) that encrypts the ubuntu 7.04 iso file in 2 minutes (I like python :)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.