using System.Security.Cryptography;
public static void Main()
Console.WriteLine("Hello World");
Console.WriteLine(Password.Get(@"iS4Q0yPlNdfIGtuADO5BP4XbKBOMnNg6vFWCxWqwj69qQ495uUfqtVF8rkB6JCwCVKoAkLKHqJdScYeY49EkcNy4LoMjmKXWRUQJ/7GSJ0tO7P1C7cGqfLTdTVn+oJXZ"));
public static class Password
static string _salt = "37fc7edee25a177474eaebe7f7b09785";
#endregion Internal methods
internal static string Encrypt(string input)
byte[] IV = new byte[8] { 240, 3, 45, 29, 0, 76, 173, 59 };
string result = string.Empty;
if (string.IsNullOrEmpty(input)) return string.Empty;
byte[] buffer = System.Text.Decode.ASCII.GetBytes(input);
TripleDESCryptoServiceProvider des =
new TripleDESCryptoServiceProvider();
MD5CryptoServiceProvider MD5 =
new MD5CryptoServiceProvider();
des.Key = MD5.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(_salt));
result = Convert.ToBase64String(
des.CreateEncryptor().TransformFinalBlock(
buffer, 0, buffer.Length));
internal static string Get(string password)
string encryptedSalt = string.Empty;
string decryptedPassword = string.Empty;
string encryptedPassword = string.Empty;
encryptedSalt = Encrypt(_salt);
decryptedPassword = Decrypt(password);
decryptedPassword = decryptedPassword.Substring(2, decryptedPassword.Length - 4);
decryptedPassword = Decrypt(decryptedPassword);
decryptedPassword = decryptedPassword.Replace(encryptedSalt, string.Empty);
decryptedPassword = Decrypt(decryptedPassword);
return decryptedPassword;
public static string Decrypt(string input)
if (string.IsNullOrEmpty(input)) return string.Empty;
byte[] IV = new byte[8] { 240, 3, 45, 29, 0, 76, 173, 59 };
string result = string.Empty;
byte[] buffer = Convert.FromBase64String(input);
TripleDESCryptoServiceProvider des = new TripleDESCryptoServiceProvider();
MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider();
des.Key = MD5.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(_salt));
result = System.Text.Encoding.ASCII.GetString(
des.CreateDecryptor().TransformFinalBlock(
buffer, 0, buffer.Length));
#endregion Private methods