in my program, I am encrypting and decrypting a .dat file using the Triple DES algorithm. It encrypts but all the characters in the desination file are replaced with these characters: �$ï/‹%
Here's the code:
public byte[] Transform(byte[] input, ICryptoTransform CryptoTransform)
{
MemoryStream memStream = new MemoryStream();
CryptoStream cryptStream = new CryptoStream(memStream, CryptoTransform, CryptoStreamMode.Write);
cryptStream.Write(input, 0, input.Length);
cryptStream.FlushFinalBlock();
memStream.Position = 0;
byte[] result = memStream.ToArray();
memStream.Close();
cryptStream.Close();
return result;
}