OK so today I will be sharing with you AES 256 Encryption for use between PHP and C#.
This encryption can be Encrypted in either PHP or C# and Decrypted in the other.
 
 
 
PHP Code:

function addpadding($string, $blocksize = 32)
{
    $len = strlen($string);
    $pad = $blocksize - ($len % $blocksize);
    $string .= str_repeat(chr($pad), $pad);
    return $string;
}

function strippadding($string)
{
    $slast = ord(substr($string, -1));
    $slastc = chr($slast);
    $pcheck = substr($string, -$slast);
    if(preg_match("/$slastc{".$slast."}/", $string)){
        $string = substr($string, 0, strlen($string)-$slast);
        return $string;
    } else {
        return false;
    }
}

function encrypt($string = "")
{
	$keyfile = "./AES.keyz";
	$keyfile = file($keyfile);
    $key = base64_decode($keyfile[0]);
    $iv = base64_decode($keyfile[1]);

	return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, addpadding($string), MCRYPT_MODE_CBC, $iv));
}

function decrypt($string = "")
{
	$keyfile = "./AES.keyz";
	$keyfile = file($keyfile);
    $key = base64_decode($keyfile[0]);
    $iv = base64_decode($keyfile[1]);

	$string = base64_decode($string);

	return strippadding(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $string, MCRYPT_MODE_CBC, $iv));
}

 
 
 
C# Code:

        private String AES_encrypt(String Input)
        {
            var aes = new RijndaelManaged();
            aes.KeySize = 256;
            aes.BlockSize = 256;
            aes.Padding = PaddingMode.PKCS7;
            aes.Key = Convert.FromBase64String(AES_Key);
            aes.IV = Convert.FromBase64String(AES_IV);

            var encrypt = aes.CreateEncryptor(aes.Key, aes.IV);
            byte[] xBuff = null;
            using (var ms = new MemoryStream())
            {
                using (var cs = new CryptoStream(ms, encrypt, CryptoStreamMode.Write))
                {
                    byte[] xXml = Encoding.UTF8.GetBytes(Input);
                    cs.Write(xXml, 0, xXml.Length);
                }

                xBuff = ms.ToArray();
            }

            String Output = Convert.ToBase64String(xBuff);
            return Output;
        }

        private String AES_decrypt(String Input)
        {
                RijndaelManaged aes = new RijndaelManaged();
                aes.KeySize = 256;
                aes.BlockSize = 256;
                aes.Mode = CipherMode.CBC;
                aes.Padding = PaddingMode.PKCS7;
                aes.Key = Convert.FromBase64String(AES_Key);
                aes.IV = Convert.FromBase64String(AES_IV);

                var decrypt = aes.CreateDecryptor();
                byte[] xBuff = null;
                using (var ms = new MemoryStream())
                {
                    using (var cs = new CryptoStream(ms, decrypt, CryptoStreamMode.Write))
                    {
                        byte[] xXml = Convert.FromBase64String(Input);
                        cs.Write(xXml, 0, xXml.Length);
                    }

                    xBuff = ms.ToArray();
                }

                String Output = Encoding.UTF8.GetString(xBuff);
                return Output;
        }

 
 
 
For the AES.Keyz file this is it.

    PSVJQRk9QTEpNVU1DWUZCRVFGV1VVT0ZOV1RRU1NaWQ=
    YWlFLVEZZUFNaWlhPQ01ZT0lLWU5HTFJQVFNCRUJZVA=

    32 chr string (32 * 8 = 256 bit)

For this the IV and Key MUST both be a 32 char (256bit) key. I am using a byte[]

Nice and simple to use and has helped me out more than once.
It also supports PKCS7 padding within the PHP.

Example Application
http://dl.dropbox.com/u/11393837/C%20sharp%20AES%20EnDecryption.rar

EDIT: PHP code updated, thanks to PepLamb for noticing.