AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

hagen reddman dec

Ein Thema von darknes · begonnen am 15. Feb 2011 · letzter Beitrag vom 16. Feb 2011
 
darknes

Registriert seit: 11. Apr 2009
15 Beiträge
 
#3

AW: hagen reddman dec

  Alt 15. Feb 2011, 14:29
Es soll md5 sein die function heisst nur md4(testzwecke).

Selbst wenn ich es freigebe:

Delphi-Quellcode:
t:THash_MD5;
begin
t:=THash_MD5.Create;
t.init;
Result:=t.DigestStr(TFormat_MIME64);
t.done;
end;
Der md5 string soll ja für diese functionen sein;
Delphi-Quellcode:
function GetUser: string; // Function to get UserName
var // Declaring our variables
StrUserName: PChar; // PointerChar
Size: DWord; // DWORD integer Begin //
Begin
Size:=250; // Set size to 250 (max UN length)
GetMem(StrUserName, Size); // Allocate some memory
GetUserName(StrUserName, Size); // API to get UN
result := StrPas(StrUserName); // Return the UN
FreeMem(StrUserName); // Free up the allocated memory
end;

 Procedure RSADecrypt(CT : String; D : String; N : String; var PT : String);
 Var
 c,d1,n1,p : TFGInt;
Begin
ConvertHexStringToBase256String(CT,CT);
Base256StringToFGInt(CT,c);
ConvertHexStringToBase256String(D,D);
Base256StringToFGInt(D,d1);
ConvertHexStringToBase256String(N,N);
Base256StringToFGInt(N,n1);
FGIntModExp(c,d1,n1,p); // C ^ D mod N
FGIntToBase256String(P,PT);
ConvertBase256StringToHexString(PT,PT);
FGIntDestroy(c); // Destroy FGInt (important!)
FGIntDestroy(d1); // Destroy FGInt (important!)
FGIntDestroy(n1); // Destroy FGInt (important!)
FGIntDestroy(p); // Destroy FGInt (important!) End;

end;

function HexToInt(s : string) : Int64; // Convert HEX to Int64 integers
begin // Begin
if (s <> '') and (s[1] <> '$') then // If s != ‘’ and s[1] is not $ then
result := strToInt64('$' + s ) // Convert ‘$’+s to Int64 ($ = HEX)
else // Else
result := strToInt64(s); // Convert s to Int64 end;

end;


function Part1(s: string): string; // Part 1
var // Declaring variables
i, x : integer; // Counter and Holder as integers
begin // Begin
x := 0; // Initialize x as 0
for i := 1 to length(s) do // For 1 to 32 do
begin // Begin
x := x + HexToInt(s[i]); // hier knallt es wenn ich oben den code verwende
end; // End
result := new_md5(IntToHex(x,0)); // Get the MD5 of x
end;

function Part2(s: string): string; // Part 2
var // Declaring Variables
i, j, x : integer; // 2 Counters and a holder as integers begin //
Begin
i := 1; // Initialize i as 1
j := 2; // Initialize j as 2
x := 0; // Initialize x as 0
while i <= length(s) do // If i <= 32, then execute loop begin //
Begin
x := x + HexToInt(s[i] + s[j]); // Pair
inc(i,2); // Increment counter
inc(j,2); // Increment counter
end; // End
result := new_md5(IntToHex(x,0)); // Get the MD5 of x oder hier
end;


function Part3(s: string): string; // Part 3
var // Declaring variables
arr : array [1..8] of string; // Array [1..8] of strings
i, x : integer; // Counter and Holder as integers begin //
Begin
arr[1] := s[01] + s[02] + s[03] + s[04]; // I got a little lazy here...
arr[2] := s[05] + s[06] + s[07] + s[08]; // Manually splitting the MD5 into
arr[3] := s[09] + s[10] + s[11] + s[12]; // Groups of 4... made possible by
arr[4] := s[13] + s[14] + s[15] + s[16]; // The creators of Copy/Paste ļ
arr[5] := s[17] + s[18] + s[19] + s[20]; // Still going...
arr[6] := s[21] + s[22] + s[23] + s[24]; // And going...
arr[7] := s[25] + s[26] + s[27] + s[28]; // Almost...
arr[8] := s[29] + s[30] + s[31] + s[32]; // Finally!
x := 0; // Initialize x as 0
for i := 1 to 8 do // 1 to length of the array do loop begin //
Begin
x := x + HexToInt(arr[i]); // Groups of 4
end; // End
result := new_md5(IntToHex(x,0)); // Get the MD5 of x
end;

function Part4(s: string): string; // Part 4
var // Refer to Part 3 for more info...
arr : array [1..4] of string;
i, x : integer;
begin
arr[1] := s[01] + s[02] + s[03] + s[04] + s[05] + s[06] + S[07] + s[08];
arr[2] := s[09] + s[10] + s[11] + s[12] + s[13] + s[14] + s[15] + s[16];
arr[3] := s[17] + s[18] + s[19] + s[20] + s[21] + s[22] + s[23] + s[24];
arr[4] := s[25] + s[26] + s[27] + s[28] + s[29] + s[30] + s[31] + s[32];
x := 0;
for i := 1 to 4 do
begin
x := x + HexToInt(arr[i]);
end;
result := new_md5(IntToHex(x,0));
end;

function Part5(s: string): string; // Part 5
var // Refer to Part 3 for more info...
arr : array [1..4] of string;
x : int64;
i : integer;
begin
x := 0;
arr[1] := s[01] + s[02] + s[03] + s[04] + s[05] + s[06] + s[07] + s[08] +
          s[09] + s[10] + s[11] + s[12] + s[13] + s[14] + s[15] + s[16];

arr[2] := s[17] + s[18] + s[19] + s[20] + s[21] + s[22] + s[23] + s[24] +
          s[25] + s[26] + s[27] + s[28] + s[29] + s[30] + s[31] + s[32];
for i := 1 to 2 do
begin
x := x + HexToInt(arr[i]);
end;
result := new_md5(IntToHex(x,0));
end;


procedure TForm1.btn1Click(Sender: TObject);
Var // Declaring variables
A,b: string; // Strings ‘a’ and ‘b’ (b = serial)
begin // Begin
a := Part1(new_md5(GetUser)); //Part 1
a := Part2(a); // Part 2
a := Part3(a); // Part 3
a := Part4(a); // Part 4
a := Part5(a); // Part 5 { RSA Decrypt the final MD5 hash (result goes in ‘b’): }
RSADecrypt(a,'3E6CBE18ABF0172741C8A583CA54402D',
'D679E4D420CF78D335DC9AD165F9D819',b);
edt1.text := b; // Print out serial end; // End
end;
Wie gesagt das hier geht bei dec ja nicht.
//function GetMD5(s: string): string; // Gets MD5 hash for what’s sent begin //
//Begin
//result := MD5DigestToStr(MD5String(s)); // Calculate MD5 hash hier wird s genutzt
//end;

Geändert von darknes (15. Feb 2011 um 14:32 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:57 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz