Thema: Delphi Zahlencode bruten

Einzelnen Beitrag anzeigen

cydo

Registriert seit: 6. Sep 2006
28 Beiträge
 
#12

Re: Zahlencode bruten

  Alt 15. Apr 2008, 16:29
gleich nochmal: also hab alle durchprobiert im ASCII-Bereich 10-250, kein Erfolg. Der Verschlüsselungsalgo ist auch selten dämlich. Als Beispiel verschlüsselt man mal das Wort "delphi" (=1334092032000) ergibt das 1440 andere Worte, die auf das selbe Ergebnis passen (z.B. "dblhex").
Ich glaub Du hast Dich mit dem Algo vertan....

Delphi-Quellcode:
program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  BigInt in 'BigInt.pas';

var
 loesungs: integer;
 bigint: TBigInt;


function Verschl(input: string): TBigint;
var
  i: integer;
  test: TBigint;
begin
  result := TBigInt.Create(ord(input[1]));
  for I := 2 to length(input) do
  begin
    test := TBigint.Create(ord(input[i]));
    result.mul(test);
    test.free;
  end;
end;


procedure Back(zahl: TBigint;pass: string);
var
  i: integer;
  test: TBigint;
  Divi: TBigint;
begin

  test := TBigInt.Create(1);
  if test.IsEqual(zahl) then
  begin
    writeln('Loesung: '+pass);
    inc(loesungs);
    test.Free;
    exit;
  end;
  test.Free;

  //for I := 10 to 250 do
  for I := 97 to 122 do
  begin
    divi := TBigInt.Create(i);
    test := TBigInt.Create(zahl);
    test.div_(divi);
    test.mul(divi);
    if test.IsEqual(zahl) then
    begin
      test.div_(divi);
      Back(test,pass+chr(i));
    end;
    test.free;
    divi.free;
  end;
end;

begin
  loesungs :=0;
  BigInt := Verschl('delphi');
  //BigInt := TBigInt.Create('219235317047744800000');
  Writeln('Suche Loesung zu ',BigInt.ToString);
  readln;
  Back(Bigint,'');
  writelN('ende');
  writeln(loesungs,' Loesungen');
  readln;
end.
  Mit Zitat antworten Zitat