Hľadaj symetrické alebo asymetrické šifrovanie...
Na čo Ti to ale bude? Na to, aby si ukryl nejaký text v *.ini súbore ??? Predsa ten text bude dekódovať iba Tvoja aplikácia nie?
Použi na zakódovanie a dekódovanie stringu funkciu XOR.
function XorStr(Stri, Strk: String): String;
var
Longkey: string;
I: Integer;
Next: char;
begin
for I := 0 to (Length(Stri) div Length(Strk)) do
Longkey := Longkey + Strk;
for I := 1 to length(Stri) do
begin
Next := chr((ord(Stri[i]) xor ord(Longkey[i])));
Result := Result + Next;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
{ Encode The String }
Edit1.Text := XorStr('The String', '1234567890');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
{ Decode The String }
Edit2.Text := XorStr(Edit1.Text, '1234567890');
end;
Bez znalosti hodnoti kľúča "Strk" bude obtiažne pre nejakú LAMU dekódovať ten text.