C# “Bad Data” exception when decrypting encrypted file
Hey I'm very new to encryption and decryption, or even the c# language to be honest. Basically, I have a tcp chat server that "saves" logs and encrypts the text file. This is how I encrypt (based from the MSDN sample): public static void EncryptFile(string strInputFileName, string strOutputFileName, string strKey) { FileStream fsIn = new FileStream(strInputFileName, FileMode.Open, FileAccess.Read); FileStream fsOut = new FileStream(strOutputFileName, FileMode.Create, FileAccess.Write); DESCryptoServiceProvider des = new DESCryptoServiceProvider(); des.Key = ASCIIEncoding.ASCII.GetBytes(strKey)