程序中需要用到其他公司的解密方法,
例如:加密:1100312540265756767996608896117050450 解密:111705014003
加密:1100476208622500367164920156101220648 解密:110122054404
'使用标准DES对称解密
Public Function DecryptDes(ByVal SourceStr As String) As String
'get encodekey string from web.config
Dim sKey As String
sKey = "00000000" 'ConfigurationSettings.AppSettings("EnCodeKey")
'put the input string into the byte array
Dim des As DESCryptoServiceProvider = New DESCryptoServiceProvider
des.Key = ASCIIEncoding.ASCII.GetBytes(sKey)
des.IV = ASCIIEncoding.ASCII.GetBytes(sKey)
Dim buffer As Byte() = Convert.FromBase64String(SourceStr)
Dim ms As MemoryStream = New MemoryStream(buffer)
Dim cs As CryptoStream = New CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Read)
Dim sr As StreamReader = New StreamReader(cs)
Return sr.ReadToEnd()
End Function
------解决方案--------------------
直接用vb.net 封装个dll,然后在pb里调用是方便
------解决方案--------------------
vb 可以做ocx 不晓得VB.net 行不行