Encripted and Decripted a string in C#

Manna
Posted by Manna under C# category on | Points: 40 | Views : 1627
Used purpose: Security for in your password string

Used this coding on button OnClick event

// using Namespace 'using System.Web.Security;'

//Encript your string

System.Web.Security.FormsAuthenticationTicket fat = new FormsAuthenticationTicket("test", true, 10);

string encripted = System.Web.Security.FormsAuthentication.Encrypt(fat);
Response.Write(encripted);


//Decript your encripted string

string encriptedtext = "9ACB6522270410DCFFF55C312661D76C2B0E1E6EE0F8526644ACF9C92E690EDE78507F79F8DF6C4D7C7E05A8D3D9AF9CEB7B8108947784ABD14DD045E5F02973F150901B1C0D6019D6EAB916E02D3D93C6FF041F36D31D4400AB87D9AEBA9BC84A753380";
fat = System.Web.Security.FormsAuthentication.Decrypt(encriptedtext);
Response.Wri
te(encriptedtext);

Comments or Responses

Login to post response