Click here to Skip to main content
15,898,371 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAjax controls adding to project Pin
kumarjammula20-Jun-07 0:18
kumarjammula20-Jun-07 0:18 
AnswerRe: Ajax controls adding to project Pin
Sylvester george20-Jun-07 0:56
Sylvester george20-Jun-07 0:56 
AnswerRe: Ajax controls adding to project Pin
Sapan Roy20-Jun-07 1:00
Sapan Roy20-Jun-07 1:00 
GeneralRe: Ajax controls adding to project Pin
kumarjammula20-Jun-07 1:37
kumarjammula20-Jun-07 1:37 
QuestionCrystal report printing in VS but not in IIS Pin
danmbuen220-Jun-07 0:16
danmbuen220-Jun-07 0:16 
QuestionRe: Crystal report printing in VS but not in IIS Pin
Sylvester george20-Jun-07 3:13
Sylvester george20-Jun-07 3:13 
AnswerRe: Crystal report printing in VS but not in IIS Pin
danmbuen220-Jun-07 14:03
danmbuen220-Jun-07 14:03 
Questionhow to decrypt cookie Pin
deepalititi19-Jun-07 23:56
deepalititi19-Jun-07 23:56 
i am storing cookie object which contains user name and password in it. i am storing both in encrypted format using RSA algorithm .code is like that

Dim myCookie As HttpCookie
myCookie = New HttpCookie("myCookie")
Response.Cookies.Remove("myCookie")
Response.Cookies.Add(myCookie)

Dim rsa As System.Security.Cryptography.RSACryptoServiceProvider = New System.Security.Cryptography.RSACryptoServiceProvider

Dim struser As String = txtusername.Text.ToString
Dim ciphertext() As Byte
ciphertext = rsa.Encrypt(Encoding.Unicode.GetBytes(struser), False)

Dim strpwd As String = txtPWD.Text.ToString
Dim ciphertext1() As Byte
ciphertext1 = rsa.Encrypt(Encoding.Unicode.GetBytes(strpwd), False)

myCookie.Values.Add("user", System.Text.Encoding.Unicode.GetString(ciphertext))
myCookie.Values.Add("pass", System.Text.Encoding.Unicode.GetString(ciphertext1))

Dim deathDate As DateTime
deathDate = DateTime.Now.AddDays(1)

Response.Cookies("myCookie").Expires = deathDate

Above code is in logon button when remember me check box is clicked.

Now in page load event, i want to get back cookie object's value.
Dim myCookie As HttpCookie
myCookie = New HttpCookie("myCookie")

Dim user() As Byte
Dim pwd() As Byte

user = Encoding.Unicode.GetBytes(cookie.Values("user"))
Dim DecryptedStrAsByt() As Byte

DecryptedStrAsByt = rsa.Decrypt(user, False)

Dim DecryptedStrAsString = System.Text.Encoding.Unicode.GetString (DecryptedStrAsByt)

Got exception:
Exception Details: System.Security.Cryptography.CryptographicException: Bad Data.

on this code lin:
DecryptedStrAsByt = rsa.Decrypt(user, False)
please provide guidance why it gives exception on this line

Answer<font color=teal>Re: how to decrypt cookie </font> Pin
Sylvester george20-Jun-07 0:02
Sylvester george20-Jun-07 0:02 
GeneralRe: Re: how to decrypt cookie Pin
deepalititi20-Jun-07 0:15
deepalititi20-Jun-07 0:15 
GeneralRe: Re: how to decrypt cookie Pin
Sylvester george20-Jun-07 0:18
Sylvester george20-Jun-07 0:18 
GeneralRe: Re: how to decrypt cookie Pin
deepalititi20-Jun-07 0:27
deepalititi20-Jun-07 0:27 
Questionhow to a column at the footer using a webgrid Pin
ballameharmurali19-Jun-07 23:45
ballameharmurali19-Jun-07 23:45 
AnswerRe: how to a column at the footer using a webgrid Pin
Sandeep Akhare20-Jun-07 0:20
Sandeep Akhare20-Jun-07 0:20 
GeneralRe: how to a column at the footer using a webgrid Pin
ballameharmurali20-Jun-07 0:25
ballameharmurali20-Jun-07 0:25 
Questionreplacing text in a text file on server... Pin
rashadaliarshad19-Jun-07 23:08
rashadaliarshad19-Jun-07 23:08 
AnswerRe: replacing text in a text file on server... Pin
Sandeep Akhare19-Jun-07 23:29
Sandeep Akhare19-Jun-07 23:29 
AnswerRe: replacing text in a text file on server... Pin
Tarik Guney19-Jun-07 23:31
Tarik Guney19-Jun-07 23:31 
QuestionChange the language Pin
srinandan..19-Jun-07 22:44
srinandan..19-Jun-07 22:44 
AnswerRe: Change the language Pin
Chetan Ranpariya19-Jun-07 22:50
Chetan Ranpariya19-Jun-07 22:50 
GeneralRe: Change the language Pin
srinandan..19-Jun-07 23:01
srinandan..19-Jun-07 23:01 
GeneralRe: Change the language Pin
Chetan Ranpariya19-Jun-07 23:07
Chetan Ranpariya19-Jun-07 23:07 
GeneralRe: Change the language Pin
srinandan..19-Jun-07 23:27
srinandan..19-Jun-07 23:27 
GeneralRe: Change the language Pin
Chetan Ranpariya20-Jun-07 0:04
Chetan Ranpariya20-Jun-07 0:04 
GeneralRe: Change the language [modified] Pin
Sylvester george20-Jun-07 0:59
Sylvester george20-Jun-07 0:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.