public string getDesKey() { if (string.IsNullOrEmpty(Key)) { Key = DESHelper.Decode(Constants.DEFAULT_KEY, "ABCD1234"); } return(Key); }
private void SQLFileLoading() { DirectoryInfo str = new DirectoryInfo(string.Format(@"{0}..\..\..\config\SQL.xml", Application.StartupPath)); string path = str.FullName; SQLInfo.Server = XMLHelper.ReadNode(path, "server"); SQLInfo.DB = XMLHelper.ReadNode(path, "db"); SQLInfo.UserID = XMLHelper.ReadNode(path, "userid"); SQLInfo.Password = DESHelper.Decode(XMLHelper.ReadNode(path, "password")); SQLInfo.IsSave = ("1" == XMLHelper.ReadNode(path, "issave")) ? true : false; }
public static string GetSOSCookie(string Key) { HttpCookie httpCookie = HttpContext.Current.Request.Cookies[Key]; string result; if (httpCookie != null) { result = DESHelper.Decode(httpCookie.Value, CookieHelper.EncryptKey); } else { result = ""; } return(result); }
private static string GetSign1() { string str1 = "O75eJ5spQphliWkDyBTXItr9RH/lz3O0Qj08cPVAFYjmboeyvbx3itLYU80BmCwt9IaoUmJvrk8yV6coYjJ5kKQsSQJsQd8hgsTvN9rDVGiQtUboGHa4qwRDHumg+5Cwt4rKVhorpQZrDevVmjJKLSo3ruD5b1E0OiyFzlTvSb92+il07XCHuFYHbj7a9zi7gwvCJcJS6qVj8FV7sXh0x7i9jdcB4yPQsXbSvcD9ciyLTL7XuxmZ0/vIDcc9vfE9v4DDO0cOqgasbk97834FSTu7iq2LlhjZPjG4KsW1mFvUiRucKNl62K/IFZRAa5hLTdwfIz2pD2CxrVPgQQZdi1UbygPlMsi6V3TwiV6hLm/iXnI3L6ZiNi556xzm+rjtZ3Rxbjd0t90neXFTjA9R+Yt9Mwd1xlOPoxq1JHHY4sgnVetkoj4Srg=="; //string str2 = DESHelper.Decode_(str1, "2EDxsEfp", "ICHuQplJ0YR9l7XeVNKi6FMn"); string str3 = DESHelper.Decode(str1, "ICHuQplJ0YR9l7XeVNKi6FMn", "2EDxsEfp"); string str4 = DESHelper.Encode(str3, "ICHuQplJ0YR9l7XeVNKi6FMn", "2EDxsEfp"); string request = DESHelper.Encode("" + test_request + "", strKey, strIV); string SignMD5 = "user.register" + strMerchantID + request + strMD5; SignMD5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile( SignMD5, "MD5").ToLower(); return(SignMD5); }
private static SSOContext smethod_0(HttpCookie httpCookie_0, DbContext dbContext_0 = null) { SSOContext sSOContext = new SSOContext(); if (httpCookie_0 != null && !string.IsNullOrEmpty(httpCookie_0.Value) && httpCookie_0.Value.Contains("|")) { sSOContext.username = httpCookie_0.Value.Split('|')[0]; sSOContext.password = httpCookie_0.Value.Split('|')[1]; try { sSOContext.username = DESHelper.Decode("eeeeeasy", "eeeeeas", sSOContext.username); } catch (Exception) { sSOContext.username = null; } if (dbContext_0 != null) { try { string text = dbContext_0.ExecuteScalar <string>("select UserNo from platform_user where LoginName = @0", new object[1] { sSOContext.username }); if (text == null) { sSOContext.password = null; } else { string kEY = "eeeeeasy".ToString() + text; sSOContext.password = DESHelper.Decode(kEY, "eeeeeas", sSOContext.password); } } catch (Exception) { sSOContext.password = null; } } } return(sSOContext); }