The code below is giving an error for Left(strEncrKey, 8). The error says that public property Left has no parameters return.
Code
Public Function Encrypt(ByVal strText As String) As String Dim strEncrKey As String = "welcome123" Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF} Try **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.Length) cs.FlushFinalBlock() Return Convert.ToBase64String(ms.ToArray()) Catch ex As Exception Return ex.Message End Try End Function