473,385 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

FormsAuthentication.Encrypt and Decrypt not playing nicely

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


Nov 19 '05 #1
0 1269

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Benoît | last post by:
Hi, I have generated two keys : "C:>openssl req -nodes -new -x509 -keyout ben.key -out ben.crt -days 3650" I try to encrypt/decrypt a string like "JOHN" with these asymetrics keys. With the...
0
by: Aaron | last post by:
Is the native Encrypt/Decrypt functionality with .NET PGP compatible?
4
by: Hrvoje Voda | last post by:
Does anyone knows a good example of how to encrypt/decrypt a string? Hrcko
1
by: Tommy | last post by:
I want to encrypt the values of my cookies. I found out that I could create a FormsAuthenticationTicket, and use the FormsAuthentication.Encrypt method to encrypt the cookie. However, I do not...
2
by: Gawel | last post by:
Hajo, in book about security in ASP.NET I read that if I use Form authentication and need to make its data secure then I need to use SSL for all pages, not only for e.g. login page. It is...
7
by: Jean Christophe Avard | last post by:
Hi! I am designing an application wich comes with image file. These images are copyrighted and they have to be accessible only from within the application. At first, I tought I was going to store...
1
by: Y Store Tools | last post by:
I've just started playing with mcrypt for encryption but not sure if I'll need to write my own. Basically I don't need anything advanced for protection but want to mask the data so it's not easily...
2
bferguson94
by: bferguson94 | last post by:
Design a program that allows the user to encrypt or decrypt a file. This means you will need to ask the user the direction to shift (left or right) and the number of places to shift (should they...
2
by: Rich Howard | last post by:
I'm working on an application that works as a remote client for integrating with corporate services. It's packaged as a downloadable Windows installer, allowing a user to install it and then...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.