Securing Data send by a C# program over http

Hey Guys,

I am sending a string over the http in my c# program.
It's not a browser based program.

I want to know hoe can i secure that string.

The I secure the website with SSL and then send the string with https, or that will not work because it's not from a browser?

Thanks
sonu19Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
Check this forum post. It will provide some insight.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2674639&SiteID=1
0
Phil_AgcaoiliCommented:
For data at rest (on your system), you use DPAPI to Encrypt and Decrypt Data. Here's more info: http://www.obviex.com/samples/dpapi.aspx

To encrypt data in motion, I also recommend you use HttpWebRequest for HTTPS requests as implemeting a HTTP stack using SSLStream class is not trivial.  This will save you many months of work.

Good luck.
0
sonu19Author Commented:
I want to decrypt data in java and encrypt in c#
0
Phil_AgcaoiliCommented:
For C#, use DPAPI for encrypt.
For Java, use javax.crypto and java.security.

Here are some samples for Java:
http://forum.java.sun.com/thread.jspa?threadID=734949&messageID=4227225
http://exampledepot.com/egs/javax.crypto/DesFile.html

The C# DPAPI samples are listed above.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
OS Security

From novice to tech pro — start learning today.