const
a: array[0..9] of char = ('3','5','2','8','1','4','9','0','7','6');
b: array[0..9] of char = ('7','4','2','0','5','1','9','8','3','6');
function Encrypt(str: string): string;
var
s: string;
i: integer;
begin
s:='';
for I := 1 to length(str) do
s:=s+a[strtoint(str)];
result:=s;
end;
function Decrypt(str: string): string;
var
s: string;
i: integer;
begin
s:='';
for I := 1 to length(str) do
s:=s+b[strtoint(str)];
result:=s;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit2.Text:=Encrypt(Edit1.Text);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit3.Text:=decrypt(Edit2.Text);
end;