Delphi DES算法实现

时间:2013-11-29 03:18:00
【文件属性】:

文件名称:Delphi DES算法实现

文件大小:168KB

文件格式:RAR

更新时间:2013-11-29 03:18:00

DES,DES算法

DES算法实现 function EncryStr(Str, Key: String): String; var StrByte, OutByte, KeyByte: array[0..7] of Byte; StrResult: String; I, J: Integer; begin if (Length(Str) > 0) and (Ord(Str[Length(Str)]) = 0) then raise Exception.Create('Error: the last char is NULL char.'); if Length(Key) < 8 then while Length(Key) < 8 do Key := Key + Chr(0); while Length(Str) mod 8 <> 0 do Str := Str + Chr(0); for J := 0 to 7 do KeyByte[J] := Ord(Key[J + 1]); makeKey(keyByte, subKey); StrResult := ''; for I := 0 to Length(Str) div 8 - 1 do begin for J := 0 to 7 do StrByte[J] := Ord(Str[I * 8 + J + 1]); desData(dmEncry, StrByte, OutByte); for J := 0 to 7 do StrResult := StrResult + Chr(OutByte[J]); end; Result := StrResult; end;


【文件预览】:
DES算法实现
----Project1.dof(2KB)
----Project1.exe(381KB)
----Unit1.dfm(1KB)
----Project1.cfg(434B)
----des.pas(14KB)
----Project1.dpr(209B)
----Unit1.pas(875B)
----DelTemp.bat(68B)
----Project1.res(876B)

网友评论