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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only