title: How to decrypt FormsAuthenticationTicket in mvc c#?
body: <p>I am encrypt the password and store it to session value using <strong>FormsAuthenticationTicket</strong>, when I retrieve it I can not able to decrypt the password.</p>
  
  <p><strong>Encrypt like below</strong></p>
  
  <pre><code>    string pw="xyz";
      FormsAuthenticationTicket ticketpw = new FormsAuthenticationTicket(pw, true, 1000);
      string securepw = FormsAuthentication.Encrypt(ticketpw);
  
      Session["password"] = securepw;
  </code></pre>
  
  <p><strong>I tried to Decrypt Like below</strong><br>
  <strong>Try 1</strong></p>
  
  <pre><code>            FormsAuthenticationTicket ticketuname = new FormsAuthenticationTicket(pw, true, 1000);
              string secureuname = FormsAuthentication.Decrypt(pw);
  
              Session["password"] = securepw;
  </code></pre>
  
  <p><strong>Try 2</strong></p>
  
  <pre><code>            string securepw=FormsAuthentication.Decrypt(pw);               
              Session["password"] = securepw;
  </code></pre>
  
  <p><strong>Error -</strong> Can not convert FormAuthenticationTicket to String</p>