Aes encryption

I want to use AES encryption provider to encrypt data. I’ve got the correct directives I need like System.Security.Cryptography and I can use other providers without problems (I have tried DES and RSA).

I get this error

error CS0246: The type or namespace
name `AesCryptoServiceProvider’ could
not be found. Are you missing a using
directive or an assembly reference?

when trying to declare this object:

AesCryptoServiceProvider AES = new AesCryptoServiceProvider();

I understand I should have probably kept this question to somewhere like stack overflow but I don’t think they could help since this seems to be a Unity specific problem?

I was able to use System.Security.Cryptography.RijndaelManaged which I believe is an implementation of AES or something like that, good enough for me as I’m just playing around with this stuff for savegame data and things of the sort.

Since Unity uses Mono, all features might not be implemented.

Maybe you can find a third party implementation?

Have a look at this helper class: Simple encryption algorithm in c#.net - Stack Overflow

Works beautifully in unity! Just add

using Common.Cryptography;

to your script and start calling AES.Encrypt and AES.Decrypt…

I have the same problem:

error CS0246: The type or namespace name `Aes’ could not be found. Are you missing a using directive or an assembly reference?

But only in the webplayer and iOs, not for a standalone player. Any way to solve this?

Hi every body, I had the same problem when I was trying to Encrypt String using AES (C#) and the solution was so simple you just need to upgrade your application Frame work from 2.0 to 3.5 at least and then you got every thing fine.
I hope that help

Check this asset : Unity Asset Store - The Best Assets for Game Making