[Mono-list] Encryption in CSharp and Mono?

Sebastien Pouliot sebastien.pouliot at gmail.com
Thu Feb 15 13:28:17 EST 2007


On Thu, 2007-02-15 at 19:11 +0100, Stojance Dimitrovski wrote:
> I need to encrypt a string with quite a strong encryption, but the
> output needs to be a UTF8 encoded string. 

Encryption works on bytes (in and out). 

However it's easy to convert a string into a byte array (input), encrypt
it and the convert the (encrypted byte array) into a base64 string
(which is a valid UTF8 string).

There are variations but trying to be simpler than that (3 steps) will
only cause you pain.

> I've been googling for it and there are some examples that show up but
> I am just not sure enogh for them.
> 
> I kinda remember about .NET having something like System.Cryptography
> or...

Sure you used Google ?

The namespace is System.Security.Cryptography. However you won't find a
class that deals with strings in it. The conversion (string/bytes) can
be done using System.Convert class and using the encoding classes in the
System.Text namespace.

> Help!?
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list



More information about the Mono-list mailing list