对称加密DES和非对称加密RSA的实现
Shared strKey As String = "12345678" Shared strIV As String = "12345678" Private Shared Key() As Byte = Encoding.UTF8.GetBytes(strKey.Substring(0, 8)) Private Shared IV() As Byte = Encoding.UTF8.GetBytes(strIV.Substring(0, 8)) ‘Key = New Byte() {11, 12, 13, 14, 15, 16, 17, 18} ‘IV = New Byte() {11, 12, 13, 14, 15, 16, 17, 18} Public Shared Function Encrypt(ByVal strText) As String Try Dim inputByteArray() As Byte = Encoding.UTF8.GetBytes(strText) Dim des As DESCryptoServiceProvider = New DESCryptoServiceProvider Dim ms As New MemoryStream Dim cs As New CryptoStream(ms, des.CreateEncryptor(Key,