
function transcode(S,K:byte):byte;
var
i:integer;
begin
i:=s xor k;
if i>255 then
i:=i-255;
if i<0 then
i:=i+255;
result:=i;
end;
function EnCode(Source:String;Key:Byte):String;
var
i:integer;
begin
if length(source)=0 then exit;
Result:='';
for i:=1 to length(source) do
begin
Result:=Result+chr(transcode(ord(source[i]),key));
end;
end;
function Decode(Source:String;Key:Byte):String;
begin
Result:=Encode(source,key);
end;
Users browsing this forum: Google [Bot] and 1 guest