I'd thought I'd add my two cents too -- I was playing with this (in regular 
.NET) a few weeks back, and my deduction was that the CryptoServiceProvider 
classes all call on the Windows Cryptographic Service Provider (hence the name) 
to complete its operations. Since the CSP doesn't exist on Android, I doubt 
Mono would ever implement those. I think the same would also apply to the CNG 
classes (which only work on Vista+)

You could have other requirements in your application, such as FIPS compliance, 
which the CryptoServiceProvider and CNG classes are, but then I think we'd have 
to pay someone (NIST was it?) to validate the algorithm.

Regards,
Joel

> -----Original Message-----
> From: monodroid-boun...@lists.ximian.com [mailto:monodroid-
> boun...@lists.ximian.com] On Behalf Of Atsushi Eno
> Sent: Thursday, 12 July, 2012 11:35 PM
> To: Discussions related to Mono for Android
> Subject: Re: [mono-android] Is AesCryptoServiceProvider not implemented?
> 
> First of all, the FCL part (System.* namespaces) are in general based on
> Silverlight and CoreCLR based API profile. We have some extensions but that's
> the basic. Similar design also applies to Windows Phone 7.
> 
> AesCryptoServiceProvider is only part of full .NET, not in Silverlight.
> That class depends on some congifuration stack that does not exist in those
> mobile profiles. We have no plan to implement it, there is no reason to do
> so.
> 
> On the other hand, AesManaged exists, so you could just use it instead.
> 
> Atsushi Eno
> 
> bjarke wrote:
> > Hi guys,
> >
> > loves this mailing list. I am working with some aes encryption but the
> > following implementation produces an error - The type or namespace
> > name 'AesCryptoServiceProvider' could not be found (are you missing a
> > using directive or an assembly reference?)
> >
> >    public static string EncryptString(string
> > plainSourceStringToEncrypt, string passPhrase)
> >          {
> >              //Set up the encryption objects
> >              using (AesCryptoServiceProvider acsp =
> > GetProvider(Encoding.Default.GetBytes(passPhrase)))
> >              {
> >                  byte[] sourceBytes =
> > Encoding.ASCII.GetBytes(plainSourceStringToEncrypt);
> >                  ICryptoTransform ictE = acsp.CreateEncryptor();
> >
> >                  //Set up stream to contain the encryption
> >                  MemoryStream msS = new MemoryStream();
> >
> >                  //Perform the encrpytion, storing output into the stream
> >                  CryptoStream csS = new CryptoStream(msS, ictE,
> > CryptoStreamMode.Write);
> >                  csS.Write(sourceBytes, 0, sourceBytes.Length);
> >                  csS.FlushFinalBlock();
> >
> >                  //sourceBytes are now encrypted as an array of secure
> bytes
> >                  byte[] encryptedBytes = msS.ToArray(); //.ToArray()
> > is important, don't mess with the buffer
> >
> >                  //return the encrypted bytes as a BASE64 encoded string
> >                  return Convert.ToBase64String(encryptedBytes);
> >              }
> >          }
> > Is the AesCryptoServiceProvider not implemented in mono or is it just
> > some stupid mistake - regards
> >
> > --
> > View this message in context:
> > http://mono-for-android.1047100.n5.nabble.com/Is-AesCryptoServiceProvi
> > der-not-implemented-tp5710843.html
> > Sent from the Mono for Android mailing list archive at Nabble.com.
> > _______________________________________________
> > Monodroid mailing list
> > Monodroid@lists.ximian.com
> >
> > UNSUBSCRIBE INFORMATION:
> > http://lists.ximian.com/mailman/listinfo/monodroid
> >
> >
> >
> 
> 
> _______________________________________________
> Monodroid mailing list
> Monodroid@lists.ximian.com
> 
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to