const
SeedString = 'qoslasgnvkhqweqweqwsadqweq'
//[red]种子字符串可以自己设定[/red]
function Encrypt3(S: String): String;
var
i,j:Integer;
Asc:Byte;
begin
Result:='';
for i:=1 to Length(S) do
begin
if (i mod Length(SeedString)) = 0 then
j:=Length(SeedString)
else
j:=(i mod Length(SeedString));
Asc:=Byte(S) xor Byte(SeedString[j]);
Result:=Result+IntToHex(Asc,3);
end;
end;
function Decrypt3(S: String): String;
var
i,j:Integer;
ss:String;
Asc:Byte;
begin
Result:='';
for i:=1 to (Length(S) div 3) do
begin
if (i mod Length(SeedString)) = 0 then
j:=Length(SeedString)
else
j:=(i mod Length(SeedString));
ss:=Copy(S,(i-1)*3+1,3);
Asc:=StrToInt('$'+ss);
Asc:=Asc xor Byte(SeedString[j]);
Result:=Result+Chr(Asc);
end;
end;