文件名称:经典delphi加密算法
文件大小:180KB
文件格式:RAR
更新时间:2012-10-05 03:43:30
Delphi 加密 DES
一个网上广为流传的Delphi加密算法, function EncryptString(Source, Key: string): string; var KeyLen: integer; KeyPos: integer; Offset: integer; Dest: string; SrcPos: integer; SrcAsc: integer; Range: integer; begin KeyLen := Length(Key); if KeyLen = 0 then Key := 'delphi'; KeyPos := 0; Range := 256; randomize; Offset := random(Range); Dest := format('%1.2x', [Offset]); for SrcPos := 1 to Length(Source) do begin SrcAsc := (Ord(Source[SrcPos]) + Offset) mod 255; if KeyPos < KeyLen then KeyPos := KeyPos + 1 else KeyPos := 1; SrcAsc := SrcAsc xor Ord(Key[KeyPos]); Dest := Dest + format('%1.2x', [SrcAsc]); Offset := SrcAsc; end; result := Dest; end;
【文件预览】:
加密
----明文.txt(649B)
----Project1.dof(2KB)
----Unit1.dcu(10KB)
----密文.TXT(1KB)
----Project1.exe(407KB)
----Unit1.dfm(3KB)
----Project1.cfg(434B)
----Project1.dpr(188B)
----Unit1.pas(6KB)
----Project1.res(876B)
----Unit1.ddp(51B)
----Project1.~dpr(191B)