自己写一个不就行了,反正是加密算法嘛 附上一个仅做参考: unit crypt; //加密单元声明interfaceuses Classes;Const C1=52845; //常量说明 C2=22719; //此二常量用于生成随机数 function Encrypt(S:String;Key:Word):String; //加密函数声明 function Decrypt(S:String;Key:Word):String; //解密函数声明Implementationfunction Encrypt(S:String;Key:Word):String; //加密子程序 var I:Integer; //用于循环 J:Integer; begin Result:=S; //初始化结果字符串 for I:=1 to Length(S) do //依次对字符串中各字符进行操作 begin Result[I]:=char(byte(S[I])xor(Key shr 8)); //将密钥移位后与字符串异或 Key:=(byte(Result[I])+Key)*C1+C2; //产生下一个密钥 end; s:=Result; //保存结果 Result:=''; //清除结果 for i:=1 to length(s) do //对加密结果进行转换 begin j:=Integer(s[i]); //提取字符 Result:=Result+Char(65+(j div 26))+Char(65+(j mod 26)); //将字符转换为两个字母保存 end; end;function Decrypt(S:String;Key:Word):String; //解密子程序 var I:Integer; J:Integer; begin Result:=''; for i:=1 to (length(s) div 2) do begin j:=(Integer(s[2*i-1])-65)*26; j:=j+(Integer(s[2*i])-65); Result:=Result+Char(j); end; s:=Result; for I:=1 to Length(S) do begin Result[I]:=char(byte(S[I]) xor (Key shr 8)); Key:=(byte(S[I])+Key)*C1+C2; end; end;end.
附上一个仅做参考:
unit crypt; //加密单元声明interfaceuses
Classes;Const
C1=52845; //常量说明
C2=22719; //此二常量用于生成随机数
function Encrypt(S:String;Key:Word):String; //加密函数声明
function Decrypt(S:String;Key:Word):String; //解密函数声明Implementationfunction Encrypt(S:String;Key:Word):String; //加密子程序
var
I:Integer; //用于循环
J:Integer;
begin
Result:=S; //初始化结果字符串
for I:=1 to Length(S) do //依次对字符串中各字符进行操作
begin
Result[I]:=char(byte(S[I])xor(Key shr 8)); //将密钥移位后与字符串异或
Key:=(byte(Result[I])+Key)*C1+C2; //产生下一个密钥
end;
s:=Result; //保存结果
Result:=''; //清除结果
for i:=1 to length(s) do //对加密结果进行转换
begin
j:=Integer(s[i]); //提取字符
Result:=Result+Char(65+(j div 26))+Char(65+(j mod 26)); //将字符转换为两个字母保存
end;
end;function Decrypt(S:String;Key:Word):String; //解密子程序
var
I:Integer;
J:Integer;
begin
Result:='';
for i:=1 to (length(s) div 2) do
begin
j:=(Integer(s[2*i-1])-65)*26;
j:=j+(Integer(s[2*i])-65);
Result:=Result+Char(j);
end;
s:=Result; for I:=1 to Length(S) do
begin
Result[I]:=char(byte(S[I]) xor (Key shr 8));
Key:=(byte(S[I])+Key)*C1+C2;
end;
end;end.