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-AesCryptoServiceProvider-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

Reply via email to