using System.Security.Cryptography;
using System.ComponentModel;
using System.Globalization;
public static void Main()
string strText = "NjMDK5c7vIs=";
if (strText == null || strText == "")
Console.WriteLine("Enter string is empty");
byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef };
byte[] inputByteArray = new byte[strText.Length + 1];
string strEncrKey = "&%#@?,:*";
byte[] byKey = System.Text.Encoding.UTF8.GetBytes(strEncrKey.Substring(0, 8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
inputByteArray = Convert.FromBase64String(strText);
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
System.Text.Encoding encoding = System.Text.Encoding.UTF8;
Console.WriteLine(encoding.GetString(ms.ToArray()));
Console.WriteLine("Error:" + ex.Message);