Akash Dani

Akash Dani

  • NA
  • 87
  • 23.4k

Bad data exception in decryption

Jul 25 2019 11:54 PM
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));


Answers (1)