public static string DecodePassword(string password, EPasswordFormat passwordFormat, string passwordSalt) { var retval = string.Empty; if (passwordFormat == EPasswordFormat.Clear) { retval = password; } else if (passwordFormat == EPasswordFormat.Hashed) { throw new Exception("can not decode hashed password"); } else if (passwordFormat == EPasswordFormat.Encrypted) { var encryptor = new DesEncryptor { InputString = password, DecryptKey = passwordSalt }; encryptor.DesDecrypt(); retval = encryptor.OutString; } return(retval); }
public static string Decrypt(string inputString) { if (string.IsNullOrEmpty(inputString)) return string.Empty; var encryptor = new DesEncryptor { InputString = inputString, DecryptKey = "TgQQk42O" }; encryptor.DesDecrypt(); return encryptor.OutString; }
private static string Decrypt(string inputString) { if (string.IsNullOrEmpty(inputString)) { return(string.Empty); } var encryptor = new DesEncryptor { InputString = inputString, DecryptKey = "TgQQk42O" }; encryptor.DesDecrypt(); return(encryptor.OutString); }
public static string DecryptStringBySecretKey(string inputString, string secretKey) { if (string.IsNullOrEmpty(inputString)) { return(string.Empty); } inputString = inputString.Replace("0add0", "+").Replace("0equals0", "=").Replace("0and0", "&").Replace("0question0", "?").Replace("0quote0", "'").Replace("0slash0", "/"); var encryptor = new DesEncryptor { InputString = inputString, DecryptKey = secretKey }; encryptor.DesDecrypt(); return(encryptor.OutString); }