找回密码
 加入
搜索
查看: 2849|回复: 1

[求购] 很短的一个VB.NET函数 转AU3

[复制链接]
发表于 2012-7-18 09:58:11 | 显示全部楼层 |阅读模式
悬赏100金钱未解决
Function EncodePassword(ByVal pass As String, ByVal challange As String) As String
                Dim hash_byte(challange.Length / 2 - 1) As Byte
                For i = 0 To challange.Length - 2 Step 2
                        hash_byte(i / 2) = Byte.Parse(challange.Substring(i, 2), Globalization.NumberStyles.HexNumber)
                Next
                Dim response(pass.Length + hash_byte.Length) As Byte
                response(0) = 0
                Text.Encoding.ASCII.GetBytes(pass.ToCharArray()).CopyTo(response, 1)
                hash_byte.CopyTo(response, 1 + pass.Length)


                Dim md5 = New System.Security.Cryptography.MD5CryptoServiceProvider()

                Dim hash = md5.ComputeHash(response)

                Dim hashStr As New Text.StringBuilder()
                For Each h In hash
                        hashStr.Append(h.ToString("x2"))
                Next
                Return hashStr.ToString()
        End Function

发表于 2012-7-18 17:46:04 | 显示全部楼层
帮顶。。。。。路过
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-29 15:01 , Processed in 0.075108 second(s), 17 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表