Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem with decryption

Reply
Thread Tools

Problem with decryption

 
 
Showjumper
Guest
Posts: n/a
 
      01-26-2006

I solved my previous problem. The new one is that the password is not being
decrypted but rather is still in the enrypted format. I am using Rijndael
emcryption. Below is the decryption code.
And here is th eline to return the decrypted password. Any help is
appreciated Thanks Ashok
Return s.DecryptToString(encryptedData,
CType(HttpContext.Current.Application("Key"), Rijndael))

Public Shared Function DecryptToString(ByVal dataToDecrypt As Byte(), ByVal
crypt As SymmetricAlgorithm) As String
' Create a cryptographic stream for decryption.
Dim ms As MemoryStream = New MemoryStream
Dim cs As CryptoStream = New CryptoStream(ms, crypt.CreateDecryptor(),
CryptoStreamMode.Write)
' Write the binary data to the memory stream.
cs.Write(dataToDecrypt, 0, dataToDecrypt.Length)
cs.FlushFinalBlock()
' Read the unencrypted data from the stream into a string,
' with the help of the BinaryReader.
Dim r As BinaryReader = New BinaryReader(ms)
ms.Position = 0
Dim decryptedData As String = r.ReadString()
r.Close()
Return decryptedData
End Function



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Homework help - File encrpytion/decryption problem... Chad C++ 5 05-11-2012 05:07 AM
FormsAuthentication.Decryption problem Rodrigo m. Ferreira ASP .Net 0 08-28-2008 11:38 PM
Problem with decryption Showjumper ASP .Net 4 01-27-2006 10:40 PM
Problem with decryption Showjumper ASP .Net 2 01-23-2006 06:29 PM
OpenSSL decryption problem Roland Schmitt Ruby 1 10-18-2004 03:50 PM



Advertisments