谁能帮忙将这个函数翻译成asp代码(300分)

  • 主题发起人 主题发起人 Cloud0
  • 开始时间 开始时间
C

Cloud0

Unregistered / Unconfirmed
GUEST, unregistred user!
function TForm1.EncryptionEngine(Src:pchar; Key:pchar; AEdition: Integer):pchar;<br>var<br>&nbsp; KeyLen &nbsp; &nbsp; &nbsp;:Integer;<br>&nbsp; KeyPos &nbsp; &nbsp; &nbsp;:Integer;<br>&nbsp; offset &nbsp; &nbsp; &nbsp;:Integer;<br>&nbsp; dest &nbsp; &nbsp; &nbsp; &nbsp;:string; <br>&nbsp; SrcPos &nbsp; &nbsp; &nbsp;:Integer; <br>&nbsp; SrcAsc &nbsp; &nbsp; &nbsp;:Integer;<br>&nbsp; TmpSrcAsc &nbsp; :Integer; <br>&nbsp; Range &nbsp; &nbsp; &nbsp; :Integer;<br>&nbsp; keybak &nbsp; &nbsp; &nbsp;:string;<br>&nbsp; Srcbak &nbsp; &nbsp; &nbsp;:string; <br>begin<br>&nbsp; keybak:=key;<br>&nbsp; keybak := UpperCase(keybak);<br>&nbsp; Srcbak:=Src;<br>&nbsp; KeyLen:=Length(Keybak);<br>&nbsp; if KeyLen = 0 then keybak:='juezhan918';<br>&nbsp; KeyPos:=0;<br>&nbsp; Range:=256;<br>&nbsp; Randomize;<br>&nbsp; offset:=Random(Range);<br>&nbsp; dest:=format('%1.2x',[offset]);<br>&nbsp; for SrcPos := 1 to Length(Srcbak) do<br>&nbsp; begin<br>&nbsp; &nbsp; SrcAsc:=(Ord(Srcbak[SrcPos]) + offset) MOD 255;<br>&nbsp; &nbsp; if KeyPos &lt; KeyLen then KeyPos:= KeyPos + 1 else KeyPos:=1;<br>&nbsp; &nbsp; SrcAsc:= SrcAsc xor Ord(Keybak[KeyPos]);<br>&nbsp; &nbsp; dest:=dest + format('%1.2x',[SrcAsc]);<br>&nbsp; &nbsp; offset:=SrcAsc;<br>&nbsp; end;<br>&nbsp; Result:=pchar(Dest);<br>end;
 
帮你顶,接个分
 
ASP写的加密方法网上也很多的啊,<br>LZ可以找找。
 
后退
顶部