using System.Security.Cryptography;
public class EncryptionObject
public static void Main()
string str = ConvHexToStr("5F2C223F563F3F3F");
byte[] salt = new byte[8]
Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes(str, salt, 1000);
AesCryptoServiceProvider Aes = new AesCryptoServiceProvider();
Aes.Key = rfc2898DeriveBytes.GetBytes(Aes.KeySize / 8);
Aes.IV = rfc2898DeriveBytes.GetBytes(Aes.BlockSize / 8);
Aes.Mode = CipherMode.CBC;
Console.WriteLine("Hello World");
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)
string json = JsonConvert.SerializeObject(o, Formatting.Indented);