Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:请问ASE解密如何解密?

1楼
lhpc120 发表于:2025/1/4 23:14:00

Const key As String ="XXXXXXXXXXXXXXXX"
Const iv As String = "XXXXXXXXXXXXXXXX"

Public Function AesEncrypt(ByVal toEncrypt As String) As String
 Dim keyArray As Byte() = UTF8Encoding.UTF8.GetBytes(key)
 Dim ivArray As Byte() = UTF8Encoding.UTF8.GetBytes(iv)
 Dim toEncryptArray As Byte() = UTF8Encoding.UTF8.GetBytes(toEncrypt)
 Dim rDel As SSC.RijndaelManaged = New SSC.RijndaelManaged()
 rDel.Key = keyArray
 rDel.IV = ivArray
 rDel.Mode = SSC.CipherMode.CBC
 rDel.Padding = SSC.PaddingMode.Zeros
 Dim cTransform As SSC.ICryptoTransform = rDel.CreateEncryptor()
 Dim resultArray As Byte() = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length)
 Return Convert.ToBase64String(resultArray, 0, resultArray.Length)
End Function

Public Function AesDecrypt(ByVal toDecrypt As String) As String
 Dim keyArray As Byte() = UTF8Encoding.UTF8.GetBytes(key)
 Dim ivArray As Byte() = UTF8Encoding.UTF8.GetBytes(iv)
 Dim toEncryptArray As Byte() = Convert.FromBase64String(toDecrypt)
 Dim rDel As SSC.RijndaelManaged = New SSC.RijndaelManaged()
 rDel.Key = keyArray
 rDel.IV = ivArray
 rDel.Mode = SSC.CipherMode.CBC
 rDel.Padding = SSC.PaddingMode.Zeros
 Dim cTransform As SSC.ICryptoTransform = rDel.CreateDecryptor()
 Dim resultArray As Byte() = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length)
 Return UTF8Encoding.UTF8.GetString(resultArray)
End Function


比如我有个加密密钥是:1234567890123456
加密后的值为:"SWG12MXQ8evvU1981R0DqnNRL3QqPAn3lT2yXPP6tAn1DW4nB8XUjF9bNgpHK0p/y9MOv2Q6zy03mxOssMBpQ9H+Rz0fMQsxok/AZSF4KqvPHZmHWm7oAq7GRFywwml2p9y0HYi+JLY+y/1a0Z1IQeOXbAHS3D331hwNS5BO2nmFeH/JeH4h9+yKSzKB7nhzv2K9ykdBOrzJrJ3NIJQ0+7+vlzQMrBgH4xK3vDPd+ij+8q89m/uo+57c7j46jyEcdVieNlEo0C2k7TanwWVNPCy5VO08z1OiixspdQ5hu9dsl0J78RxEd4+RkDtkQFvaBQGHoM3lqYcsurCRq3PlUw=="
我想在代码中调用,并传值给函数,怎么使用?

2楼
有点蓝 发表于:2025/1/5 20:30:00
参考这种用法:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=160819&skin=0
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02148 s, 2 queries.