I assume you didn't visit google in this topic... pity :(
http://www.dreamincode.net/forums/topic/156922-aes-encryption-and-c%23/[
^]
[update]
This is working for me:
string decrypt_function(byte[] Cipher_Text, byte[] Key)
{
RijndaelManaged Crypto = null;
MemoryStream MemStream = null;
ICryptoTransform Decryptor = null;
CryptoStream Crypto_Stream = null;
StreamReader Stream_Read = null;
string Plain_Text;
try
{
Crypto = new RijndaelManaged();
Crypto.Key = Key;
Crypto.Mode = CipherMode.ECB;
MemStream = new MemoryStream(Cipher_Text);
Decryptor = Crypto.CreateDecryptor(Crypto.Key, Crypto.IV);
Crypto_Stream = new CryptoStream(MemStream, Decryptor, CryptoStreamMode.Read);
Stream_Read = new StreamReader(Crypto_Stream);
Plain_Text = Stream_Read.ReadToEnd();
}
finally
{
if (Crypto != null)
Crypto.Clear();
MemStream.Flush();
MemStream.Close();
}
return Plain_Text;
}
byte[] mkey(string skey)
{
Encoding winLatinCodePage = Encoding.GetEncoding(1252);
byte[] key = Encoding.UTF8.GetBytes(skey);
byte[] k = new byte[16] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
for(int i=0;i<key.Length;i++)
{
k[i%16] = (byte)(k[i%16] ^ key[i]);
}
return k;
}
void Main()
{
string sk="keyfor$am@naT@480IsHere";
string enc="Vk5UxUzn5xAye5R/xqcvxA==";
string dec = decrypt_function(System.Convert.FromBase64String(enc), mkey(sk));
dec.Dump();
}
This is a linqpad test, but the code is there. I had done a little modification to the code from the link to: I have changed the mode.