function crypt(text:string):string;
var
pos : integer;
text1 : string;
a : integer;
begin
a:= 69;
text1 := text;
for pos := 1 to length(text1) do
text1[pos] := chr(ord(text1[pos]) + a);
crypt := text1;
end;
function decrypt(text:string):string;
var
pos : integer;
text1 : string;
a : integer;
begin
a:= 69;
text1 := text;
for pos := 1 to length(text1) do
text1[pos] := chr(ord(text1[pos]) - a);
result := text1;
end;
Crypt :
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Text := crypt(Memo1.Text)
end;
Decrypt :
procedure TForm1.Button2Click(Sender: TObject);
begin
Memo1.Text := Decrypt(Memo1.Text)
end;
Keine Kommentare:
Kommentar veröffentlichen