This example can also be used to achieve the same thing:
Note: Edit the Random(x) value for different randon encryption
Encrypt:
Code:
procedure Encrypt;
var S:String;
i:integer;
Begin
Randseed:= 12;
S:= '';
for i:=1 to length(txtMain.text) do
Begin
S:= S + chr(ord(txtMain.text[i]) + Random(10) + 1);
end;
txtMain.text:=S;
end;
Decrypt:
Code:
Procedure Decrypt;
Var S:string;
i:integer;
Begin
Randseed:= 12;
S:= '';
for i:=1 to length(txtMain.text) do
Begin
S:= S + chr(ord(txtMain.text[i]) - Random(10) - 1);
end;
txtMain.text:= S;
end;