private void btnDecrypt_Click(object sender, EventArgs e) { byte[] data = Convert.FromBase64String("ABvAsOKcGXqc5uQ4O5Z53isJaH31Pa8+PeddljE4mSU="); //Decode64(); ICryptoTransform tfrm; MemoryStream mStream = new MemoryStream(data); byte[] decrypted = new byte[data.Length]; TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); tfrm = tdes.CreateDecryptor(UTF8Encoding.UTF8.GetBytes("0123456789ABCDEF"), UTF8Encoding.UTF8.GetBytes("ABCDEFGH")); CryptoStream encStream = new CryptoStream(mStream, tdes.CreateDecryptor(UTF8Encoding.UTF8.GetBytes("0123456789ABCDEF"), UTF8Encoding.UTF8.GetBytes("ABCDEFGH")), CryptoStreamMode.Read); encStream.Read(decrypted, 0, decrypted.length); txtDecrypted.Text = UTF8Encoding.UTF8.GetString(decrypted); }
encStream.Read(decrypted, 0, 24);