Thursday, July 15, 2010

Decryption Code for AlertPay EPD

string Salt_Key = [Your IPN Security Code];
private readonly byte[] Ivector = Encoding.Default.GetBytes("alertpay");
private string Decrypt(string Input)
{
byte[] Buffer = Convert.FromBase64String(Input);
TripleDESCryptoServiceProvider tripleDES = new TripleDESCryptoServiceProvider();
tripleDES.Key = Encoding.Default.GetBytes(Salt_Key);
tripleDES.IV = Ivector;
//tripleDES.Padding = PaddingMode.Zeros;
tripleDES.Mode = CipherMode.CBC;
ICryptoTransform Transform = tripleDES.CreateDecryptor();
return HttpUtility.UrlDecode(Encoding.Default.GetString(Transform.TransformFinalBlock(Buffer, 0, Buffer.Length)));
}

protected void Page_Load(object sender, EventArgs e)
{
string data = [your encrypted Data];
string[] Result = Decrypt(data).Split(new char[] { '&' });
foreach(string s in Result)
Response.Write(s + "
");
}

No comments:

Post a Comment