public static T GetUserLogged <T>(string key) where T : class { if (Exist(key)) { var httpCookie = HttpContext.Current.Request.Cookies.Get(key); if (httpCookie != null) { var jsonCookie = CriptografiaSecurity.Decrypt256(Convert.FromBase64String(httpCookie.Value)); return(JsonConvert.DeserializeObject <T>(jsonCookie)); } } return(null); }
public static string EncryptPassword(string value) { return((!string.IsNullOrWhiteSpace(value)) ? CriptografiaSecurity.EncryptOne(value) : value); }
public static string DecryptTwo(string value) { return(value != null?CriptografiaSecurity.DecryptTwo(value) : null); }
public static string EncryptId(string value) { return((!string.IsNullOrWhiteSpace(value) && value != "0") ? CriptografiaSecurity.EncryptTwo(EncrypAndDecryptSecurity.Encrypt(value)) : "0"); }
public static string EncryptOne(string value) { return(value != null?CriptografiaSecurity.EncryptOne(value) : null); }