Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi xor funktioniert nicht (https://www.delphipraxis.net/133537-xor-funktioniert-nicht.html)

mlhk 4. Mai 2009 10:02


xor funktioniert nicht
 
hey,
mein problem besteht darin, dass ich bei meiner xor-verschlüsselung nur mist raus bekomme, ich denke mal das liegt daran ich mit einen ganzen wort als schlüssel arbeiten will, was ich als string speichern muss, nun nimmt die funktion ord aber nur char, also schaut es euch mal an, wäre dankbar für rückmeldungen
Delphi-Quellcode:
function xorfunktion (text: Char;key:string): char;
begin
  Result := Char(Ord(text) xor Ord(key));
end;

procedure TForm2.Button1Click(Sender: TObject);
var
  V, text: string;
  key: string;
  i,j: integer;
begin
    memo1.Clear;
    text := memo2.text;
    key := edit3.text;
    V := '';
  for i := 0 to Length(text) do
      begin
          for j := 0 to length(key) do
            begin
                  V := V+ xorfunktion (text[i], key[j]);
                  Application.ProcessMessages;
                  ProgressBar1.Position := i+j;
                  ProgressBar1.Update;
                memo1.Text := V;
                end;
      end;
  end;
diese progressbar füllt sich zum teil nicht ganz auf, soll das so sein?


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:00 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz