I am using TripleDES algoritm for encryption and decryption. When I try to decrypt the value it shows Bad data exception
Is there any way to solve this?
My code:
public string DecryptTripleDES(string CypherText, string key)
{
byte[] inputBuffer = Convert.FromBase64String(CypherText);
return
Encoding.Unicode.GetString(PCIDSS.CreateDES(key).CreateDecryptor().TransformFinalBlock(inputBuffer,0, inputBuffer.Length));
}