Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Encrypt and Decrypt
Message
From
24/07/2003 15:08:10
 
 
To
24/07/2003 07:49:11
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00812762
Message ID:
00813237
Views:
22
Winan:

As far as I am aware there is no decrypt function in the Cryptography Namespace. You can store the encrypted value in the database and when you want to change it then overwrite it with the new encrypted value. See example below on MD5 128 bit encryption:


Dim txtUsername
Dim txtpassword
DIM strEncripted as string

DIM arrHashInput As Byte()
DIM arrHashOutput As Byte()
DIM objMD5 As MD5CryptoServiceProvider

'grab the page values
txtUsername = username.Text
txtpassword = password.Text
txtpassword = txtpassword.Trim()
txtpassword = txtpassword.ToUpper()

ObjMD5 = New MD5CryptoServiceProvider
arrHashInput = Convert2ByteArray( txtpassword )
arrHashOutput = objMD5.ComputeHash( arrHashInput )
strEncripted = BitConverter.ToString( arrHashOutput )


Function Convert2ByteArray( strInput as String ) as Byte()

DIM intCounter as Integer
DIM arrChar as Char()

arrChar = strInput.ToCharArray()

DIM arrByte( arrChar.Length - 1 ) as Byte

FOR intCounter = 0 To arrByte.Length - 1
arrByte( intCounter ) = Convert.ToByte( arrChar( intCounter ) )
NEXT

Return arrByte

END FUNCTION


I hope this helps you out.

Wes
Previous
Reply
Map
View

Click here to load this message in the networking platform