'http://ntcnet.wordpress.com/2007/11/27/encryptdecrypt-string-vbnet/
'Return Encrypt("string is that you need to encrypt", "abc123?)
'Return Decrypt("string that has been encrypt with the above method", "abc123?)
Public Shared Function Encrypt(ByVal strText As String, ByVal strEncrKey As String) As String
' Try
Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}
Dim bykey() As Byte = System.Text.Encoding.UTF8.GetBytes(Left(strEncrKey, 8))
Dim InputByteArray() As Byte = System.Text.Encoding.UTF8.GetBytes(strText)
Dim des As New DESCryptoServiceProvider
Dim ms As New MemoryStream
Dim cs As New CryptoStream(ms, des.CreateEncryptor(bykey, IV), CryptoStreamMode.Write)
cs.Write(InputByteArray, 0, InputByteArray.Leng ...
Go to the complete details ...