AGB  ·  Datenschutz  ·  Impressum  







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

Verschüsselungs-DLL mit Fehlern

Ein Thema von RebellX · begonnen am 21. Feb 2009 · letzter Beitrag vom 21. Feb 2009
Antwort Antwort
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#1

Re: Verschüsselungs-DLL mit Fehlern

  Alt 21. Feb 2009, 11:40

was ist denn an einem formatierten Code unübersichtlich? das man sieht wie die Blöcke zusammenhängen?
Nun ja, jeder hat da ja eine andere Wahrnehmung ...
Delphi-Quellcode:
library PCrypt;

uses
  FastShareMem,
  SysUtils,
  Classes;

const
  list: array [1..62] of string =
    ( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
      'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
      'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7',
      '8', '9', '0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
      'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
      't', 'u', 'v', 'w', 'x', 'y', 'z' );
  list2: array [1..62] of string =
    ( '1', '2', '3', '4', '5', '6', '7',
      '8', '9', '0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
      'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
      't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D',
      'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
      'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' );

function crypt1(s: string): string; stdcall;
var
  wert: array of byte;
  i, j: integer;
  ende: string;
begin
  s := s + 'A';
  randseed := 4546464;
  SetLength( wert, Length( s ) );
  ende := '';
  for i := 0 to Length( s ) - 1 do
    begin
      for j := 1 to 62 do
        if
          ( Copy( s, i, 1 ) = list[ j ] )
        then
          wert[ i ] := j;
      ende := ende + IntToStr( wert[ i ] ) + IntToStr( Random( wert[ i ] ) );
    end;
  for i := 0 to Length( s ) - 1 do
    begin
      for j := 1 to 62 do
        if
          ( Copy( s, i, 1 ) = list2[ j ] )
        then
          wert[ i ] := j;
      ende := ende + IntToStr( wert[ i ] ) + IntToStr( Random( wert[ i ] ) );
  end;
  result := ende;
end;

function crypt(s: string): string; stdcall; export;
var
  s1, s2: string;
begin
  s1 := crypt1( s );
  s2 := crypt1( s1 );
  result := s2;
end;

{$R *.res}

exports
  Crypt;
begin
end.
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
Antwort Antwort


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 02:25 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