473,508 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When to use FormsAuthenticate.Encrypte/Decrypt methods?

CW
I am really confused as to how secure FormsAuthentication really is, and I'd
appreciate if someone could shed light on it. I find information at MSDN
incomplete at best and self-contradictory other times.

I use SSL when retrieving username and password from web client. I then
validate them against user credential stored on a SQL Server. Because I set
Protection="All" in the Forms tag, I understand that the authentication
cookie would be encrypted and validated when sent from server to the web
client and vice versa. (Indeed, I can verify that it is encrypted by looking
at the cookie file on my local computer).

If that's the case, what is the use for Encrypt/Decrypt pair of methods?

Am I supposed to use
FormsAuthentication.RedirectFromLoginPage(FormsAut hentication.Encrypt((New
FormsAuthenticationTicket(1, loginId, DateTime.Now,
DateTime.Now.AddMinutes(20), False, ""))), False)

, rather than
FormsAuthentication.RedirectFromLoginPage(loginId, False) ?

If I use the former, as far as I can see, I simply encrypted the cookie a
second time (unnecessarily, I might add).

One MSDN article claimed that so long Authentication Ticket is encrypted
(and the logon credential is initially sent through SSL), then it is secure.
However, another article said that unless the entire site runs on SSL where
authentication cookies are passed between server and web clients, then one
is always subject to spoofing attacks where the authentication cookies could
be picked up and later reused by someone deploying a packet sniffer.

Can someone please clear up air on this issue?

Thanks

Nov 18 '05 #1
0 1138

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

Similar topics

0
1399
by: Mark Hanford | last post by:
I've been setting up a new MySQL/PHP site which will contain store some CC details, and have been wondering how to pass the keys. CC's are written in a similar way to: INSERT INTO cc (ccName,...
1
3950
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...
6
5133
by: Ana | last post by:
Hi! I have problems with the following scenario: My application is developed using C# under .NET. It must run on all Windows versions starting from Windows 98. The user must open different...
4
9069
by: Hrvoje Voda | last post by:
Does anyone knows a good example of how to encrypt/decrypt a string? Hrcko
8
8154
by: Gidi | last post by:
Hi, Is there Buid-In fuction in C# that Encrypt and Decrypt strings? i have a textbox which i'm writing into file, and i want to encrypt it before writing, i'm not looking for something fancy,...
7
17858
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
8
2717
by: manmit.walia | last post by:
Hello Everyone, Long time ago, I posted a small problem I had about converting a VB6 program to C#. Well with the help with everyone I got it converted. But I overlooked something and don't...
4
5658
by: Fritjolf | last post by:
Hi. I've got a strange problem... I've made a simple program to test encryption/decryption. I use Rijndael encryption and here are the most important properties. RijndaelManaged cipher =...
1
6364
by: Elliot | last post by:
When decrypt the xml, output "Unable to retrieve the decryption key." Can anyone help me solve the problem? I got the code from http://msdn.microsoft.com/en-us/library/ms229746.aspx using...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.