16,748
社区成员
发帖
与我相关
我的任务
分享
const StartKey as Integer = 956 '{Start default key}
const MultKey as Integer = -6891 '58645 '{Mult default key}
const AddKey as Integer = 28564 ' {Add default key}
function cl_decrypt(s as String) as String
dim cl_StartKey as Integer, cl_Multkey as Integer, cl_AddKey as integer
cl_StartKey = decrypt(cl_bytetocharstr(mid(s, 1, 9)),StartKey,MultKey,AddKey)
cl_MultKey = decrypt(cl_bytetocharstr(mid(s, 10, 15)),StartKey,MultKey,AddKey)
cl_AddKey = decrypt(cl_bytetocharstr(mid(s, 25, 15)),StartKey,MultKey,AddKey)
cl_decrypt = decrypt(cl_bytetocharstr(mid(s, 40, len(s)-39)),cl_StartKey,cl_MultKey,cl_AddKey)
end function
function Decrypt(byval InString As String, StartKey as Integer,MultKey as Integer,AddKey As Integer) As String
dim I as Integer
Decrypt = ""
for I = 0 to Len(InString)-1
Decrypt = Decrypt & CHR(asc(Mid(InString,I,1)) xor (StartKey \ 256))
StartKey = (asc(Mid(InString,I,1)) + StartKey) * MultKey + AddKey;
Next I
end function