public void StringCrypt_Basic_Implicit() { string input = "test 123 %$#"; byte[] output = StringCrypt.Encrypt(input); string outputFinal = StringCrypt.Decrypt(output); Assert.AreEqual(input, outputFinal, "String output should be as exected after decrypt."); }
public static void SetLogin() { var Cookie = new HttpCookie( "U", StringCrypt.Encrypt(Convert.ToBase64String(StringCrypt.GetSHA1(HttpContext.Current.Request.UserAgent + HttpContext.Current.Request.UserHostAddress)), "eri01268") ); Cookie.HttpOnly = true; HttpContext.Current.Response.Cookies.Add(Cookie); }