delphi
function EnDecriptar(const Valor : String) : String; var CharIndex : integer; begin Result := Valor; for CharIndex := 1 to Length(Valor) do Result[CharIndex] := chr(not(ord(Valor[CharIndex]))); end;
Modo de uso:
delphi
procedure TForm1.Button1Click(Sender: TObject); begin Edit2.Text := EnDecriptar(Edit1.Text); //Codificamos end; procedure TForm1.Button2Click(Sender: TObject); begin Edit3.Text := EnDecriptar(Edit2.Text); //Decodificamos end;
Saludos.