首页 新闻 会员 周边 捐助

vb加密算法改成C#

0
悬赏园豆:100 [已关闭问题]

谁能帮我这个vb写的加密方法转换成C#?要测试通过的哦.

Function EnPas(CodeStr)

Dim CodeLen
Dim CodeSpace
Dim NewCode,cecr,cecb,cec

CodeLen = 30
CodeSpace = CodeLen - Len(CodeStr)

If Not CodeSpace < 1 Then
For cecr = 1 To CodeSpace
CodeStr = CodeStr & Chr(21)
Next
End If

NewCode = 1

Dim Been
For cecb = 1 To CodeLen
Been = CodeLen + Asc(Mid(CodeStr,cecb,1)) * cecb
NewCode = NewCode * Been
Next

CodeStr = NewCode
NewCode = Empty

For cec = 1 To Len(CodeStr)
NewCode = NewCode & CfsCode(Mid(CodeStr,cec,3))
Next

For cec = 20 To Len(NewCode) - 18 Step 2
EnPas = EnPas & Mid(NewCode,cec,1)
Next
 Response.Write("Enpas加密后的值 ="+EnPas+" ")
End Function


Function CfsCode(Word)
dim cc
For cc = 1 To Len(Word)
CfsCode = CfsCode & Asc(Mid(Word,cc,1))
Next
CfsCode = Hex(CfsCode)
End Function

渲起浪花的主页 渲起浪花 | 初学一级 | 园豆:118
提问于:2009-12-14 09:13
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册