其实加密解密也就只有那么几种方法,可以一个字符一个字符地异域一个字符也可以,你可到网上找找,以下是我提供一个简单得不能再简单的加密和解密代码,如果朋友有新的方法,请给我来一份mengyun5005@sina.com
function encrypt(code:string):string; //简单的加密
var
texts:string;
tmpcode:string;
i:integer;
begin
tmpcode:=code;
texts:='';
for i:=1 to length(code) do
begin
tmpcode:=midstr(code,i,1);
texts:=texts+chr(ord(tmpcode[1])+i);
end;
encrypt:=texts;
end;
相对于以上的加密进行解密
Function decrypt(code:string):string; //简单的解密
var
texts:string;
tmpcode:string;
i:integer;
begin
code:=trim(code);
tmpcode:=code;
texts:='';
for i:=1 to length(code) do
begin
tmpcode:=midstr(code,i,1);
texts:=texts+chr(ord(tmpcode[1])-i);
end;
decrypt:=texts;
end;