FormsAuthentication.Encrypt and Decrypt

Discussion in 'ASP .Net Security' started by Mike, Sep 1, 2005.

  1. Mike

    Mike Guest

    We want to use FormsAuthenticationTickets as part of our ASP.NET security.
    The current design stores the user's ticket in the db, and later uses the
    ticket to extract other data from the database. When the user logs out, we
    use the ticket to delete the ticket from the db, using the encrypted ticket
    as the key.

    Problem is, the tickets don't seem to match between being encrypted and then
    decrypted. For example, the following returns two totally different results.

    string encryptedTicket = FormsAuthentication.Encrypt(ticket);
    System.Diagnostics.Debug.WriteLine(encryptedTicket);
    FormsAuthenticationTicket anotherTicket =
    FormsAuthentication.Decrypt(encryptedTicket);
    encryptedTicket = FormsAuthentication.Encrypt(anotherTicket);
    System.Diagnostics.Debug.WriteLine(encryptedTicket);

    The two debugs product totally different results. This totally blows our
    design. Why don't they match?

    Thanks
    Mike
    Mike, Sep 1, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWlrZQ==?=
    Replies:
    0
    Views:
    955
    =?Utf-8?B?TWlrZQ==?=
    Aug 31, 2005
  2. Randall Parker
    Replies:
    0
    Views:
    1,635
    Randall Parker
    Dec 4, 2005
  3. sweety
    Replies:
    9
    Views:
    1,019
    Richard Heathfield
    Feb 7, 2006
  4. Sherwood

    FormsAuthentication Encrypt/Decrypt Problem/Issue

    Sherwood, Jan 22, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    262
    Sherwood
    Jan 22, 2005
  5. Replies:
    1
    Views:
    431
    Daniel Martin
    Jun 16, 2007
Loading...

Share This Page