[Mono-list] Encryption in CSharp and Mono?
cgranade at gmail.com
Sun Feb 18 12:06:37 EST 2007
Personally, I'd recommend the C# port of the Bouncy Castle project for
many different applications: http://www.bouncycastle.org/
On 2/15/07, Atsushi Eno <atsushi at ximian.com> wrote:
> Small followup: sometimes people use Encoding.UTF8 (or even worse,
> Encoding.ASCII) to convert byte arrays and strings. It is not safe
> since there are invalid byte sequences and/or character sequences
> that cannot be converted to the destination type in both ways.
> Convert.[From|To]Base64String() are correct solutions.
> Atsushi Eno
> Sebastien Pouliot wrote:
> > 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
> > _______________________________________________
> > Mono-list maillist - Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> Mono-list maillist - Mono-list at lists.ximian.com
More information about the Mono-list