using System.Security.Cryptography;
using Microsoft.CSharp.RuntimeBinder;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
public class EncryptionObject
public static void Main()
string str1 = ConvHexToStr("5F2C223F563F3F3F");
DESCryptoServiceProvider DES = new DESCryptoServiceProvider();
DES.Key = Encoding.ASCII.GetBytes(str1);
DESCryptoServiceProvider des = DES;
Console.WriteLine("Key");
public static string ConvStrToHex(string input)
foreach (char ch in input.ToCharArray())
string str2 = string.Format("{0:X}", (object)Convert.ToInt32(ch));
public static string ConvHexToStr(string hexInput)
char[] charArray = hexInput.ToCharArray();
for (long index = 0; index <= (long)(hexInput.Length - 2); index += 2L)
string str2 = char.ConvertFromUtf32(Convert.ToInt32(charArray[index].ToString() + (object)charArray[index + 1L], 16));
private static void Dump(object o)
Console.WriteLine("\nJson:");
string json = JsonConvert.SerializeObject(o, Formatting.Indented);
Console.WriteLine("\nEncoded bytes:");
foreach (Byte b in json) {
Console.Write("[{0}]", b);