Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > c# > august 2006 >

c# : encryption in .NET 2.0


eugenet NO[at]SPAM rusmex.com
8/31/2006 8:18:41 AM
Hello,

I need to encrypt and decrypt a string in .NET Framwork 2.0.

What is the easiest way to do it?

I know that there are many different ways to use encryption in .NET,
some more complex than others. All I need is to hide from an end-user
some clear-text settings -- nothing super secretive.

The reliability of the encryption routine and the easy of development
are the primary goals.

Thank you for your advice.

Evgueni
Mythran
8/31/2006 8:44:04 AM

[quoted text, click to view]

If you need to hash something, I'd use System.Security.Cryptography.MD5 or
another class from the Cryptography. Heck, if I needed to do anything
cryptographically, I'd use the System.Security.Cryptography namespace :)

Mythran

eugenet NO[at]SPAM rusmex.com
8/31/2006 9:47:59 AM
Thank you for your posts. For my purposes, base64 encoding is the way
to go.



[quoted text, click to view]
Peter Bromberg [C# MVP]
8/31/2006 12:42:02 PM
if you want to do something reallyreallysimple, use an XOR algorithm.

You only need one method, it will XOR each character against a known value
(from 0 to 255 for ASCII) and spit out an xor-ed string that is the same
length as the original. To Decrypt it, send the xor-ed string back into the
same method. You can do all this in about 5 lines of code.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




[quoted text, click to view]
Richard Whitcher
8/31/2006 3:32:43 PM
Evgueni,

[quoted text, click to view]

As you say it's nothing super secretive, so I'm assuming that you just
need to encrypt something so the average user doesn't mess about with it.

If that is the case, a simple base64 encoding and decoding method would
do the job.

Regards,

Richard
--
Cor Ligthert [MVP]
8/31/2006 5:36:46 PM
Eugenet,

I see that you have these goals.

[quoted text, click to view]

What do you think other people want?

However here the starting links of the encrypting methods in Net

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographysymmetricalgorithmclasstopic.asp

:-)

Cor


<eugenet@rusmex.com> schreef in bericht
news:1157037521.075676.98050@p79g2000cwp.googlegroups.com...
[quoted text, click to view]

AddThis Social Bookmark Button