Aktuelle Zeit: 05.06.2020 18:55

Alle Zeiten sind UTC + 1 Stunde [ Sommerzeit ]




Ein neues Thema erstellen Auf das Thema antworten  [ 9 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Oberfläche für Blowfish-Algo
BeitragVerfasst: 07.05.2008 15:08 
Offline

Registriert: 28.12.2006 17:44
Wohnort: Senden
Hi Leute,

ich habe ein Programm geschrieben, wo verschiedene Passwörter für MySQL, FTP und dergleichen innerhalb des Programmes mit untergebracht werden musste. Dämlich fand ich es, das wenn man sich im HEX-Editor die compilierte Datei angesehen hat, die Passwörter in Textformat auslesen konnte.

Da hat der HeX0R mal ein Blowfish-Algo geschrieben, den ich nun mit einer Oberfläche versehen habe (s. http://www.purebasic.fr/german/viewtopic.php?t=7896).
Vielen Dank an dieser Stelle an HeXOR für den Code!

Wenn man(n) nun das Passwort verschlüsselt hinterlegt und in der Laufzeit entschlüsselt, kann man mit dem Hex-Editor lange nach dem Passwort suchen :mrgreen:

Das Masterpasswort kann so lang sein, wie man will. Ich habe es schon mit 40 Zeichen probiert, inkl. Sonderzeichen. Kein Problem damit gehabt.
Auch das zu verschlüsselnde Passwort habe ich mit 40 Zeichen ausprobiert, hat jedesmal einwandfrei geklappt.

Einzige Einschränkung: Es funktioniert nicht mit UTF-8 (s. Original-Thread).

Funktionsweise:
1. Masterpasswort und zu verschlüsselndes Passwort eingeben.
2. Verschlüsselungstext (Dein Passwort für z.B. MySQL) eingeben.
3. Auf verschlüsseln klicken, Ausgabe des verschlüsselten Passwortes und andere Angaben erfolgen.
4. Masterpasswort wird in Reintext in eine Pref-Datei geschrieben (ja, ich weiss.... Aber der Programmierer hat das "Tool" ja nur auf seinem Rechner).
5. Gadget "Quelltext" anklicken, der Entschlüsselungsquelltext wird angezeigt.
6. Beim klicken auf dem Gadget "Einstellungen löschen" wird in der Pref-Datei das Masterpasswort gelöscht!

Vieleicht kann der eine oder andere was damit anfangen <)
Zumindest habe ich versucht, das Programm ausführich zu dokumentieren.

Gruß Micro

Code:
; Author: Micro
; Greetings to HeXOR
; Date: 07. May 2008
; OS: Windows
; Demo: No

;------ Fensterkonstanten festlegen
Enumeration
  #Window_0
  #Window_1
EndEnumeration

;------ Gadget-Konstanten festlegen
Enumeration
  #Button_0
  #Button_1
  #Button_2
  #Button_3
  #Button_4
  #String_0
  #String_1
  #String_2
  #String_3
  #String_4
  #String_5
  #Frame3D_0
  #Frame3D_1
EndEnumeration

;------ Zeilenumbruch in der Ausgabe definieren
Global EOL.s = Chr(13) + Chr(10)

;------ Programmname definieren
Global Programmname$ = "Crypter V0.1"

;------ Includefile defninieren
IncludeFile "BlowFish.pbi"

;------ Fonts für das Programm festlegen
LoadFont(0, "Arial", 8)
LoadFont(1, "Arial", 8, #PB_Font_Bold)

;------ Systemverzeichnisse auslesen
Procedure.s spec_folder(clsi_const.l)
 
  path.s = Space(2048)
  SHGetSpecialFolderLocation_(0,clsi_const,@pidl.l)
  SHGetPathFromIDList_(pidl,@path)
  CoTaskMemFree_(pidl)
  ProcedureReturn path+"\"

EndProcedure

;------ Preference-Verzeichnis prüfen ob vorhanden, ansonsten erstellen
Global VerzeichnisName$ = spec_folder($2b) + "Crypter\"
Verzeichnisda = FileSize(VerzeichnisName$)
If Verzeichnisda = -1
  Ergebnis = CreateDirectory(VerzeichnisName$)
  If Ergebnis = 0
    MessageRequester("Fehler","Konnte Programmverzeichnis" + Chr(13) + VerzeichnisName$ + Chr(13) + "nicht erstellen!",#MB_ICONERROR)
    End
  EndIf
EndIf

; ------ Semaphore einrichten
Procedure OnlyOne(EinmaligerName.s)
  hTargetSem.l = CreateSemaphore_(0, 0, 1, @EinmaligerName); semaphore erstellen
  If hTargetSem <> 0 ; prüfen ob semaphor schon im system vorhanden
    If GetLastError_() = #ERROR_ALREADY_EXISTS ; semaphore is schon im system vorhanden
      MessageRequester("Fehler!","Das Programm läuft schon im Hintergrund!",0)
      End
    EndIf
  EndIf
EndProcedure

;------ Programm beenden
Procedure ProgrammBeenden()
  meldung = MessageRequester(" " + Programmname$, "Programm wirklich beenden ?", #MB_YESNO | #MB_ICONQUESTION)
  If meldung = #PB_MessageRequester_Yes
    End
  EndIf

EndProcedure

;------ Quelltest für das Programmieren anzeigen
Procedure Quelltextfenster(password_for_encryption$,verschluesseltespasswort$)

  HideWindow(#Window_0,1)
  If OpenWindow(#Window_1, #PB_Ignore, #PB_Ignore, 800, 545, " Quelltext - " + Programmname$, #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_MinimizeGadget)
    If CreateGadgetList(WindowID(#Window_1))
      ButtonGadget(#Button_4, 670, 510, 120, 25, "Schliessen")

      Frame3DGadget(#Frame3D_1, 10, 10, 780, 490, " Programmierteil: ")
        StringGadget(#String_5, 20, 30, 760, 460, "", #ES_MULTILINE)
       
        b$ = "IncludeFile " + Chr(34) + "BlowFish.pbi" + Chr(34) + "" + EOL
        b$ + "password_for_encryption$ = " + Chr(34) + password_for_encryption$ + Chr(34) + "" + EOL
        b$ + "Flags.l = #BlowFish_UseCBC | #BlowFish_UseBase64" + EOL
        b$ + "Result$ = " + Chr(34) + verschluesseltespasswort$ + Chr(34) + EOL
        b$ + "Length = Len(Result$)" + EOL
        b$ + "text_to_decrypt$ = Result$" + EOL
        b$ + "Result$ = Space(1024)" + EOL
        b$ + "Blowfish_Decrypt(@text_to_decrypt$, Length, @password_for_encryption$, Len(password_for_encryption$), @Result$, Len(Result$), Flags)" + EOL
        b$ + "Password.s = LTrim(RTrim(Result$))" + EOL
        b$ + "Debug Password.s" + EOL
        SetGadgetText(#String_5, b$)

    EndIf
  EndIf

EndProcedure

;------ Masterpasswort in Prefs speichern
Procedure PreferencesSpeichern()

  If CreatePreferences(VerzeichnisName$ + "Preferences.prefs")
      WritePreferenceString("Masterpasswort", GetGadgetText(#String_1))
     ClosePreferences()
  EndIf
  ; Löschgadget freigeben
  DisableGadget(#Button_2, 0)

EndProcedure

;------ Programm prüfen, ob nur einmal gestartet
OnlyOne("Blowfish_Crypter")

;------ Hauptfenster Start
If OpenWindow(#Window_0, #PB_Ignore, #PB_Ignore, 600, 245, " " + Programmname$, #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_MinimizeGadget)

  ; Prüfen, ob Einstellungen vorhanden sind
  If OpenPreferences(VerzeichnisName$ + "Preferences.prefs")
      Masterpasswort$ = ReadPreferenceString("Masterpasswort", "")
    ClosePreferences()
  EndIf

  If CreateGadgetList(WindowID(#Window_0))
    TextGadget(#String_0, 10, 13, 190, 20, "Masterpasswort eingeben:")
    StringGadget(#String_1, 210, 10, 380, 20, Masterpasswort$)

    TextGadget(#String_2, 10, 43, 190, 20, "Verschlüsselungstext eingeben:")
    StringGadget(#String_3, 210, 40, 380, 20, "")
   
    Frame3DGadget(#Frame3D_0, 10, 70, 580, 130, " Ausgabe: ")
      StringGadget(#String_4, 20, 90, 560, 100, "Hier erfolgt die Ausgabe des verschlüsselten Passwortes", #ES_MULTILINE)
   
    ButtonGadget(#Button_0, 010, 210, 120, 25, "Beenden")
    ButtonGadget(#Button_1, 165, 210, 120, 25, "Quelltext anzeigen")
    ButtonGadget(#Button_2, 320, 210, 120, 25, "Einstellungen löschen")
    ButtonGadget(#Button_3, 470, 210, 120, 25, "Verschlüsseln")
   
    SetGadgetFont(#String_0, FontID(1))
    SetGadgetFont(#String_1, FontID(0))
    SetGadgetFont(#String_2, FontID(1))
    SetGadgetFont(#String_3, FontID(0))
   
    SetGadgetFont(#Frame3D_0, FontID(1))
    SetGadgetFont(#String_4, FontID(0))

    SetGadgetFont(#Button_0, FontID(0))
    SetGadgetFont(#Button_1, FontID(0))
    SetGadgetFont(#Button_2, FontID(0))
    SetGadgetFont(#Button_3, FontID(0))
   
    DisableGadget(#Button_1, 1)

    ; Voreinstellung: Wenn kein Masterpasswort vorhanden ist, Löschgadget sperren
    If Masterpasswort$ = ""
      DisableGadget(#Button_2, 1)
    EndIf

   
  EndIf

EndIf
;------ Hauptfenster Ende

;------ Schleifenanfang
Repeat
  EventID.l = WaitWindowEvent()

  Select EventID

    Case #PB_Event_Gadget   ; Hier das Buttonmenü
        Select EventGadget()
       
          Case #Button_0 ; Beenden
            ProgrammBeenden()

          Case #Button_1 ; Quelltext anzeigen
            Quelltextfenster(password_for_encryption$,verschluesseltespasswort$)

          Case #Button_2 ; Einstellungen löschen
          If OpenPreferences(VerzeichnisName$ + "Preferences.prefs")
               RemovePreferenceKey("Masterpasswort")
            ClosePreferences()
          EndIf
          SetGadgetText(#String_1, "")
          SetGadgetText(#String_3, "")
          SetGadgetText(#String_4, "")
          DisableGadget(#Button_1, 1)
          DisableGadget(#Button_2, 1)
         

          Case #Button_3 ; Verschlüsseln
            If GetGadgetText(#String_1) = "" Or GetGadgetText(#String_3) = ""
              MessageRequester(" " + Programmname$, "Sie haben ein Passwortfeld nicht ausgefüllt!", #MB_ICONERROR)
            Else
              Lenght0 = Len(GetGadgetText(#String_1))
              Lenght1 = Len(GetGadgetText(#String_3))

              password_for_encryption$ = GetGadgetText(#String_1) ; Masterpasswort
              text_to_encrypt$         = GetGadgetText(#String_3) ; Eingabe des zu verschlüsselndes Passwortes
            Flags.l                  = #BlowFish_UseCBC | #BlowFish_UseBase64
            Result1$                  = Space(1024)
            Length2 = Blowfish_Crypt(@text_to_encrypt$, Len(text_to_encrypt$), @password_for_encryption$, Len(password_for_encryption$), @Result1$, Len(Result1$), Flags)
            If Length2
               SetGadgetText(#String_4, "")
               verschluesseltespasswort$ = Result1$
                a$ = "Länge des Masterpasswortes: " + Str(Lenght0) + EOL
                a$ + "Länge des Verschlüsselungstextes: " + Str(Lenght1) + EOL
                a$ + "Länge des verschlüsselten Passwortes: " + Str(Length2) + EOL
                a$ + "Das Masterpasswort lautet: " + GetGadgetText(#String_1) + EOL
                a$ + "Das unverschlüsselte Passwort lautet: " + GetGadgetText(#String_3) + EOL
                a$ + "Das verschlüsselte Passwort lautet: " + verschluesseltespasswort$
                SetGadgetText(#String_4, a$)
                PreferencesSpeichern()
                DisableGadget(#Button_1, 0)
            Else
              MessageRequester(" " + Programmname$, "Es ist ein Fehler aufgetreten!" + Chr(13) + "Bitte versuche es noch einmal!", #MB_ICONERROR)
            EndIf
         
            EndIf

        Case #Button_4 ; Quelltextfenster schliessen
          HideWindow(#Window_0,0)
          CloseWindow(#Window_1)


      EndSelect

      Case #PB_Event_CloseWindow
            If EventWindow() = #Window_1
          HideWindow(#Window_0,0)
              CloseWindow(#Window_1)
            Else
              ProgrammBeenden()
            EndIf
            
  EndSelect

Until Quit = 1
;------ Schleifenende

; IDE Options = PureBasic 4.10 (Windows - x86)
; Folding = -
; Executable = Crypter.exe





Code:
;/------------------------------
;|
;| BlowFish.pbi
;| (c)HeX0R 2006
;|
;| Include File for
;| some BlowFish-Action.
;|
;| Needs PureBasic >= 4.0,
;| no Userlibrarys,
;| no Api
;| Should work with Demo also.
;|
;/-------------------------------

Structure BLOWFISH
  S0.q[256]
  S1.q[256]
  S2.q[256]
  S3.q[256]
  K.q[18]
EndStructure

Structure BLOWFISHKEY
   b.b[16]
EndStructure

#FL                 = $FFFFFFFF
#BlowFish_UseBase64 = $01
#BlowFish_UseCBC    = $02

Procedure.q BF_Internal_Sbox_Round(*Q.QUAD, *B.BLOWFISH)

    Protected Result.q, b0.l, b1.l, b2.l, b3.l
   
    b0 = (*Q\q >> 24) & $FF
    b1 = (*Q\q >> 16) & $FF
    b2 = (*Q\q >> 8) & $FF
    b3 = *Q\q & $FF

    Result = *B\S0[b0] + *B\S1[b1]
    Result ! *B\S2[b2]
    Result & #FL
    Result + *B\S3[b3]

    ProcedureReturn Result & #FL
   
EndProcedure

Procedure BF_Internal_Block_Encrypt(*vl.QUAD, *vr.QUAD, *B.BLOWFISH)

   Protected i.l

   For i = 0 To 15

      *vl\q ! *B\K[i]
    *vr\q ! BF_Internal_Sbox_Round(*vl, *B)
      Swap *vl\q, *vr\q
     
  Next i

  Swap *vl\q, *vr\q
  *vr\q ! *B\K[16]
  *vl\q ! *B\K[17]

EndProcedure

Procedure BF_Internal_Block_Decrypt(*vl.QUAD, *vr.QUAD, *B.BLOWFISH)

   Protected i.l
 
   For i = 17 To 2 Step -1

      *vl\q ! *B\K[i]
      *vr\q ! BF_Internal_Sbox_Round(*vl, *B)
      Swap *vl\q, *vr\q

   Next i
 
   Swap *vl\q, *vr\q
   *vr\q ! *B\K[1]
   *vl\q ! *B\K[0]

EndProcedure

Procedure BF_Internal_Cipher_Key(*key, keylen.l, *B.BLOWFISH)

   Protected key_md5.s, i.l, v0.q, v1.q, nkey.BLOWFISHKEY
   
   For i = 0 To 17
      *B\K[i] = PeekL(?BLOWFISH_K + i*4) & #FL
   Next i
   
   For i = 0 To 255
      *B\S0[i] = PeekL(?BLOWFISH_S0 + i*4) & #FL
   Next i
   
   For i = 0 To 255
      *B\S1[i] = PeekL(?BLOWFISH_S1 + i*4) & #FL
   Next i
   
   For i = 0 To 255
      *B\S2[i] = PeekL(?BLOWFISH_S2 + i*4) & #FL
   Next i
   
   For i = 0 To 255
      *B\S3[i] = PeekL(?BLOWFISH_S3 + i*4) & #FL
   Next i

   key_md5 = MD5Fingerprint(*key, keylen)

  If keylen < 16
      CopyMemory(*key, @nkey\b[0], keylen)
      CopyMemory(@key_md5, @nkey\b[keylen], 16 - keylen)
   Else
      CopyMemory(*key, @nkey\b[0], 16)
   EndIf
 
  Dim MyKey.q(4)
  For i = 0 To 3
     MyKey(i) = PeekL(@nkey\b[i*4]) & #FL
  Next i

   For i = 0 To 17
     
     *B\K[i] ! MyKey(i % 4)
     *B\K[i] & #FL
   
  Next i

  For i = 0 To 16 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
     *B\K[i]   = v0
     *B\K[i+1] = v1
  Next i

  For i = 0 To 254 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
    *B\S0[i]   = v0
    *B\S0[i+1] = v1
   Next i

  For i = 0 To 254 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
    *B\S1[i]   = v0
    *B\S1[i+1] = v1
   Next i

  For i = 0 To 254 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
    *B\S2[i]   = v0
    *B\S2[i+1] = v1
   Next i

  For i = 0 To 254 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
    *B\S3[i]   = v0
    *B\S3[i+1] = v1
   Next i

EndProcedure

Procedure.l Blowfish_Crypt(*text, textlen.l, *Password, passlen.l, *Result, Resultlen.l, Mode.l = #BlowFish_UseBase64)

   Protected BF.BLOWFISH, *Buffer, n.l, i.l, a.l, K.q, P.l, b.l

   BF_Internal_Cipher_Key(*Password, passlen, @BF)
   
   *Buffer = AllocateMemory(textlen * 2)
   If *Buffer
      n = textlen
     If n % 8 <> 0
        n = 8 - (n % 8)
        For i = 0 To n - 1
           PokeB(*text + textlen + i, 32)
        Next i
        textlen + n
     EndIf

      n = textlen / 4
       
     Dim L.QUAD(n)
     Dim Cipher.QUAD(n+2)
     
     If Mode & #BlowFish_UseCBC
         Cipher(0)\q = Date();
      Cipher(1)\q = ElapsedMilliseconds()*1000000
      P = 2
    EndIf
   
     For i = 0 To n - 1
        L(i)\q = PeekL(*text + i*4) & #FL
     Next i

     b = 1
     If n*8 <= ResultLen
        For i = 0 To n - 1 Step 2
         
           If Mode & #BlowFish_UseCBC
              L(i)\q   ! Cipher(b-1)\q
          L(i+1)\q ! Cipher(b)\q
           EndIf
           
           Cipher(i+P)\q   = L(i)\q
           Cipher(i+P+1)\q = L(i+1)\q
            BF_Internal_Block_Encrypt(@Cipher(i + P), @Cipher(i + P+ 1), @BF)
            b + 2
         Next i
         
         a = 0
         For i = 0 To n - 1 + P Step 2
            K = Cipher(i)\q & #FL
            PokeL(*Buffer + a, PeekL(@K))
            K = Cipher(i + 1)\q & #FL
            PokeL(*Buffer + a + 4, PeekL(@K))
            a + 8
        Next i
     
         If Mode & #BlowFish_UseBase64
            Base64Encoder(*Buffer, a, *Result, Resultlen)
            a = MemoryStringLength(*Result)
         Else
            CopyMemory(*Buffer, *Result, a)
         EndIf
      EndIf
      FreeMemory(*Buffer)
   EndIf
   
   ProcedureReturn a

EndProcedure

Procedure.l Blowfish_Decrypt(*text, textlen.l, *Password, Passlen.l, *Result, Resultlen.l, Mode.l = #BlowFish_UseBase64)

   Protected BF.BLOWFISH, *Buffer, n.l, i.l, a.l, j.l, K1.q, K2.q

   BF_Internal_Cipher_Key(*Password, passlen, @BF)
   
   *Buffer = AllocateMemory(textlen * 2 + 64)
   If *Buffer
      If Mode & #BlowFish_UseBase64
         textlen = Base64Decoder(*text, textlen, *Buffer, textlen * 2 + 64)
         n = textlen / 4
      Else
         CopyMemory(*text, *Buffer, textlen)
         n = textlen / 4
      EndIf
       
      Dim Cipher.QUAD(n+2)
      Dim L.QUAD(n)
       
      For i = 0 To n - 1
         Cipher(i)\q = PeekL(*Buffer + i*4) & #FL
      Next i
       
      If Mode & #BlowFish_UseCBC
         j = 2
      Else
         j = 0
      EndIf

      a = 0
      If n*8 <= ResultLen
         For i = j To n - 1 Step 2
            K1 = Cipher(i)\q
            K2 = Cipher(i+1)\q
            BF_Internal_Block_Decrypt(@K1, @K2, @BF)
            If Mode & #BlowFish_UseCBC
          L(i-j)\q   = K1 ! Cipher(i-2)\q
          L(i+1-j)\q = K2 ! Cipher(i-1)\q
        Else
          L(i-j)\q   = K1
          L(i+1-j)\q = K2
        EndIf
      Next i
      For i = 0 To n - 1 - j Step 2
            K1 = L(i)\q & #FL
            K2 = L(i + 1)\q & #FL
            PokeL(*Result + a, PeekL(@K1))
            PokeL(*Result + a + 4, PeekL(@K2))
            a + 8
        Next i
     EndIf
     
     FreeMemory(*Buffer)
  EndIf
   ProcedureReturn a

EndProcedure

DataSection
  BLOWFISH_K:
  Data.l $243F6A88, $85A308D3, $13198A2E, $03707344
  Data.l $A4093822, $299F31D0, $082EFA98, $EC4E6C89
  Data.l $452821E6, $38D01377, $BE5466CF, $34E90C6C
  Data.l $C0AC29B7, $C97C50DD, $3F84D5B5, $B5470917
  Data.l $9216D5D9, $8979FB1B, 0, 0
 
  BLOWFISH_S0:
  Data.l $D1310BA6, $98DFB5AC, $2FFD72DB, $D01ADFB7
  Data.l $B8E1AFED, $6A267E96, $BA7C9045, $F12C7F99
  Data.l $24A19947, $B3916CF7, $0801F2E2, $858EFC16
  Data.l $636920D8, $71574E69, $A458FEA3, $F4933D7E
  Data.l $0D95748F, $728EB658, $718BCD58, $82154AEE
  Data.l $7B54A41D, $C25A59B5, $9C30D539, $2AF26013
  Data.l $C5D1B023, $286085F0, $CA417918, $B8DB38EF
  Data.l $8E79DCB0, $603A180E, $6C9E0E8B, $B01E8A3E
  Data.l $D71577C1, $BD314B27, $78AF2FDA, $55605C60
  Data.l $E65525F3, $AA55AB94, $57489862, $63E81440
  Data.l $55CA396A, $2AAB10B6, $B4CC5C34, $1141E8CE
  Data.l $A15486AF, $7C72E993, $B3EE1411, $636FBC2A
  Data.l $2BA9C55D, $741831F6, $CE5C3E16, $9B87931E
  Data.l $AFD6BA33, $6C24CF5C, $7A325381, $28958677
  Data.l $3B8F4898, $6B4BB9AF, $C4BFE81B, $66282193
  Data.l $61D809CC, $FB21A991, $487CAC60, $5DEC8032
  Data.l $EF845D5D, $E98575B1, $DC262302, $EB651B88
  Data.l $23893E81, $D396ACC5, $0F6D6FF3, $83F44239
  Data.l $2E0B4482, $A4842004, $69C8F04A, $9E1F9B5E
  Data.l $21C66842, $F6E96C9A, $670C9C61, $ABD388F0
  Data.l $6A51A0D2, $D8542F68, $960FA728, $AB5133A3
  Data.l $6EEF0B6C, $137A3BE4, $BA3BF050, $7EFB2A98
  Data.l $A1F1651D, $39AF0176, $66CA593E, $82430E88
  Data.l $8CEE8619, $456F9FB4, $7D84A5C3, $3B8B5EBE
  Data.l $E06F75D8, $85C12073, $401A449F, $56C16AA6
  Data.l $4ED3AA62, $363F7706, $1BFEDF72, $429B023D
  Data.l $37D0D724, $D00A1248, $DB0FEAD3, $49F1C09B
  Data.l $075372C9, $80991B7B, $25D479D8, $F6E8DEF7
  Data.l $E3FE501A, $B6794C3B, $976CE0BD, $04C006BA
  Data.l $C1A94FB6, $409F60C4, $5E5C9EC2, $196A2463
  Data.l $68FB6FAF, $3E6C53B5, $1339B2EB, $3B52EC6F
  Data.l $6DFC511F, $9B30952C, $CC814544, $AF5EBD09
  Data.l $BEE3D004, $DE334AFD, $660F2807, $192E4BB3
  Data.l $C0CBA857, $45C8740F, $D20B5F39, $B9D3FBDB
  Data.l $5579C0BD, $1A60320A, $D6A100C6, $402C7279
  Data.l $679F25FE, $FB1FA3CC, $8EA5E9F8, $DB3222F8
  Data.l $3C7516DF, $FD616B15, $2F501EC8, $AD0552AB
  Data.l $323DB5FA, $FD238760, $53317B48, $3E00DF82
  Data.l $9E5C57BB, $CA6F8CA0, $1A87562E, $DF1769DB
  Data.l $D542A8F6, $287EFFC3, $AC6732C6, $8C4F5573
  Data.l $695B27B0, $BBCA58C8, $E1FFA35D, $B8F011A0
  Data.l $10FA3D98, $FD2183B8, $4AFCB56C, $2DD1D35B
  Data.l $9A53E479, $B6F84565, $D28E49BC, $4BFB9790
  Data.l $E1DDF2DA, $A4CB7E33, $62FB1341, $CEE4C6E8
  Data.l $EF20CADA, $36774C01, $D07E9EFE, $2BF11FB4
  Data.l $95DBDA4D, $AE909198, $EAAD8E71, $6B93D5A0
  Data.l $D08ED1D0, $AFC725E0, $8E3C5B2F, $8E7594B7
  Data.l $8FF6E2FB, $F2122B64, $8888B812, $900DF01C
  Data.l $4FAD5EA0, $688FC31C, $D1CFF191, $B3A8C1AD
  Data.l $2F2F2218, $BE0E1777, $EA752DFE, $8B021FA1
  Data.l $E5A0CC0F, $B56F74E8, $18ACF3D6, $CE89E299
  Data.l $B4A84FE0, $FD13E0B7, $7CC43B81, $D2ADA8D9
  Data.l $165FA266, $80957705, $93CC7314, $211A1477
  Data.l $E6AD2065, $77B5FA86, $C75442F5, $FB9D35CF
  Data.l $EBCDAF0C, $7B3E89A0, $D6411BD3, $AE1E7E49
  Data.l $00250E2D, $2071B35E, $226800BB, $57B8E0AF
  Data.l $2464369B, $F009B91E, $5563911D, $59DFA6AA
  Data.l $78C14389, $D95A537F, $207D5BA2, $02E5B9C5
  Data.l $83260376, $6295CFA9, $11C81968, $4E734A41
  Data.l $B3472DCA, $7B14A94A, $1B510052, $9A532915
  Data.l $D60F573F, $BC9BC6E4, $2B60A476, $81E67400
  Data.l $08BA6FB5, $571BE91F, $F296EC6B, $2A0DD915
  Data.l $B6636521, $E7B9F9B6, $FF34052E, $C5855664
  Data.l $53B02D5D, $A99F8FA1, $08BA4799, $6E85076A
 
  BLOWFISH_S1:
  Data.l $4B7A70E9, $B5B32944, $DB75092E, $C4192623
  Data.l $AD6EA6B0, $49A7DF7D, $9CEE60B8, $8FEDB266
  Data.l $ECAA8C71, $699A17FF, $5664526C, $C2B19EE1
  Data.l $193602A5, $75094C29, $A0591340, $E4183A3E
  Data.l $3F54989A, $5B429D65, $6B8FE4D6, $99F73FD6
  Data.l $A1D29C07, $EFE830F5, $4D2D38E6, $F0255DC1
  Data.l $4CDD2086, $8470EB26, $6382E9C6, $021ECC5E
  Data.l $09686B3F, $3EBAEFC9, $3C971814, $6B6A70A1
  Data.l $687F3584, $52A0E286, $B79C5305, $AA500737
  Data.l $3E07841C, $7FDEAE5C, $8E7D44EC, $5716F2B8
  Data.l $B03ADA37, $F0500C0D, $F01C1F04, $0200B3FF
  Data.l $AE0CF51A, $3CB574B2, $25837A58, $DC0921BD
  Data.l $D19113F9, $7CA92FF6, $94324773, $22F54701
  Data.l $3AE5E581, $37C2DADC, $C8B57634, $9AF3DDA7
  Data.l $A9446146, $0FD0030E, $ECC8C73E, $A4751E41
  Data.l $E238CD99, $3BEA0E2F, $3280BBA1, $183EB331
  Data.l $4E548B38, $4F6DB908, $6F420D03, $F60A04BF
  Data.l $2CB81290, $24977C79, $5679B072, $BCAF89AF
  Data.l $DE9A771F, $D9930810, $B38BAE12, $DCCF3F2E
  Data.l $5512721F, $2E6B7124, $501ADDE6, $9F84CD87
  Data.l $7A584718, $7408DA17, $BC9F9ABC, $E94B7D8C
  Data.l $EC7AEC3A, $DB851DFA, $63094366, $C464C3D2
  Data.l $EF1C1847, $3215D908, $DD433B37, $24C2BA16
  Data.l $12A14D43, $2A65C451, $50940002, $133AE4DD
  Data.l $71DFF89E, $10314E55, $81AC77D6, $5F11199B
  Data.l $043556F1, $D7A3C76B, $3C11183B, $5924A509
  Data.l $F28FE6ED, $97F1FBFA, $9EBABF2C, $1E153C6E
  Data.l $86E34570, $EAE96FB1, $860E5E0A, $5A3E2AB3
  Data.l $771FE71C, $4E3D06FA, $2965DCB9, $99E71D0F
  Data.l $803E89D6, $5266C825, $2E4CC978, $9C10B36A
  Data.l $C6150EBA, $94E2EA78, $A5FC3C53, $1E0A2DF4
  Data.l $F2F74EA7, $361D2B3D, $1939260F, $19C27960
  Data.l $5223A708, $F71312B6, $EBADFE6E, $EAC31F66
  Data.l $E3BC4595, $A67BC883, $B17F37D1, $018CFF28
  Data.l $C332DDEF, $BE6C5AA5, $65582185, $68AB9802
  Data.l $EECEA50F, $DB2F953B, $2AEF7DAD, $5B6E2F84
  Data.l $1521B628, $29076170, $ECDD4775, $619F1510
  Data.l $13CCA830, $EB61BD96, $0334FE1E, $AA0363CF
  Data.l $B5735C90, $4C70A239, $D59E9E0B, $CBAADE14
  Data.l $EECC86BC, $60622CA7, $9CAB5CAB, $B2F3846E
  Data.l $648B1EAF, $19BDF0CA, $A02369B9, $655ABB50
  Data.l $40685A32, $3C2AB4B3, $319EE9D5, $C021B8F7
  Data.l $9B540B19, $875FA099, $95F7997E, $623D7DA8
  Data.l $F837889A, $97E32D77, $11ED935F, $16681281
  Data.l $0E358829, $C7E61FD6, $96DEDFA1, $7858BA99
  Data.l $57F584A5, $1B227263, $9B83C3FF, $1AC24696
  Data.l $CDB30AEB, $532E3054, $8FD948E4, $6DBC3128
  Data.l $58EBF2EF, $34C6FFEA, $FE28ED61, $EE7C3C73
  Data.l $5D4A14D9, $E864B7E3, $42105D14, $203E13E0
  Data.l $45EEE2B6, $A3AAABEA, $DB6C4F15, $FACB4FD0
  Data.l $C742F442, $EF6ABBB5, $654F3B1D, $41CD2105
  Data.l $D81E799E, $86854DC7, $E44B476A, $3D816250
  Data.l $CF62A1F2, $5B8D2646, $FC8883A0, $C1C7B6A3
  Data.l $7F1524C3, $69CB7492, $47848A0B, $5692B285
  Data.l $095BBF00, $AD19489D, $1462B174, $23820E00
  Data.l $58428D2A, $0C55F5EA, $1DADF43E, $233F7061
  Data.l $3372F092, $8D937E41, $D65FECF1, $6C223BDB
  Data.l $7CDE3759, $CBEE7460, $4085F2A7, $CE77326E
  Data.l $A6078084, $19F8509E, $E8EFD855, $61D99735
  Data.l $A969A7AA, $C50C06C2, $5A04ABFC, $800BCADC
  Data.l $9E447A2E, $C3453484, $FDD56705, $0E1E9EC9
  Data.l $DB73DBD3, $105588CD, $675FDA79, $E3674340
  Data.l $C5C43465, $713E38D8, $3D28F89E, $F16DFF20
  Data.l $153E21E7, $8FB03D4A, $E6E39F2B, $DB83ADF7
 
  BLOWFISH_S2:
  Data.l $E93D5A68, $948140F7, $F64C261C, $94692934
  Data.l $411520F7, $7602D4F7, $BCF46B2E, $D4A20068
  Data.l $D4082471, $3320F46A, $43B7D4B7, $500061AF
  Data.l $1E39F62E, $97244546, $14214F74, $BF8B8840
  Data.l $4D95FC1D, $96B591AF, $70F4DDD3, $66A02F45
  Data.l $BFBC09EC, $03BD9785, $7FAC6DD0, $31CB8504
  Data.l $96EB27B3, $55FD3941, $DA2547E6, $ABCA0A9A
  Data.l $28507825, $530429F4, $0A2C86DA, $E9B66DFB
  Data.l $68DC1462, $D7486900, $680EC0A4, $27A18DEE
  Data.l $4F3FFEA2, $E887AD8C, $B58CE006, $7AF4D6B6
  Data.l $AACE1E7C, $D3375FEC, $CE78A399, $406B2A42
  Data.l $20FE9E35, $D9F385B9, $EE39D7AB, $3B124E8B
  Data.l $1DC9FAF7, $4B6D1856, $26A36631, $EAE397B2
  Data.l $3A6EFA74, $DD5B4332, $6841E7F7, $CA7820FB
  Data.l $FB0AF54E, $D8FEB397, $454056AC, $BA489527
  Data.l $55533A3A, $20838D87, $FE6BA9B7, $D096954B
  Data.l $55A867BC, $A1159A58, $CCA92963, $99E1DB33
  Data.l $A62A4A56, $3F3125F9, $5EF47E1C, $9029317C
  Data.l $FDF8E802, $04272F70, $80BB155C, $05282CE3
  Data.l $95C11548, $E4C66D22, $48C1133F, $C70F86DC
  Data.l $07F9C9EE, $41041F0F, $404779A4, $5D886E17
  Data.l $325F51EB, $D59BC0D1, $F2BCC18F, $41113564
  Data.l $257B7834, $602A9C60, $DFF8E8A3, $1F636C1B
  Data.l $0E12B4C2, $02E1329E, $AF664FD1, $CAD18115
  Data.l $6B2395E0, $333E92E1, $3B240B62, $EEBEB922
  Data.l $85B2A20E, $E6BA0D99, $DE720C8C, $2DA2F728
  Data.l $D0127845, $95B794FD, $647D0862, $E7CCF5F0
  Data.l $5449A36F, $877D48FA, $C39DFD27, $F33E8D1E
  Data.l $0A476341, $992EFF74, $3A6F6EAB, $F4F8FD37
  Data.l $A812DC60, $A1EBDDF8, $991BE14C, $DB6E6B0D
  Data.l $C67B5510, $6D672C37, $2765D43B, $DCD0E804
  Data.l $F1290DC7, $CC00FFA3, $B5390F92, $690FED0B
  Data.l $667B9FFB, $CEDB7D9C, $A091CF0B, $D9155EA3
  Data.l $BB132F88, $515BAD24, $7B9479BF, $763BD6EB
  Data.l $37392EB3, $CC115979, $8026E297, $F42E312D
  Data.l $6842ADA7, $C66A2B3B, $12754CCC, $782EF11C
  Data.l $6A124237, $B79251E7, $06A1BBE6, $4BFB6350
  Data.l $1A6B1018, $11CAEDFA, $3D25BDD8, $E2E1C3C9
  Data.l $44421659, $0A121386, $D90CEC6E, $D5ABEA2A
  Data.l $64AF674E, $DA86A85F, $BEBFE988, $64E4C3FE
  Data.l $9DBC8057, $F0F7C086, $60787BF8, $6003604D
  Data.l $D1FD8346, $F6381FB0, $7745AE04, $D736FCCC
  Data.l $83426B33, $F01EAB71, $B0804187, $3C005E5F
  Data.l $77A057BE, $BDE8AE24, $55464299, $BF582E61
  Data.l $4E58F48F, $F2DDFDA2, $F474EF38, $8789BDC2
  Data.l $5366F9C3, $C8B38E74, $B475F255, $46FCD9B9
  Data.l $7AEB2661, $8B1DDF84, $846A0E79, $915F95E2
  Data.l $466E598E, $20B45770, $8CD55591, $C902DE4C
  Data.l $B90BACE1, $BB8205D0, $11A86248, $7574A99E
  Data.l $B77F19B6, $E0A9DC09, $662D09A1, $C4324633
  Data.l $E85A1F02, $09F0BE8C, $4A99A025, $1D6EFE10
  Data.l $1AB93D1D, $0BA5A4DF, $A186F20F, $2868F169
  Data.l $DCB7DA83, $573906FE, $A1E2CE9B, $4FCD7F52
  Data.l $50115E01, $A70683FA, $A002B5C4, $0DE6D027
  Data.l $9AF88C27, $773F8641, $C3604C06, $61A806B5
  Data.l $F0177A28, $C0F586E0, $006058AA, $30DC7D62
  Data.l $11E69ED7, $2338EA63, $53C2DD94, $C2C21634
  Data.l $BBCBEE56, $90BCB6DE, $EBFC7DA1, $CE591D76
  Data.l $6F05E409, $4B7C0188, $39720A3D, $7C927C24
  Data.l $86E3725F, $724D9DB9, $1AC15BB4, $D39EB8FC
  Data.l $ED545578, $08FCA5B5, $D83D7CD3, $4DAD0FC4
  Data.l $1E50EF5E, $B161E6F8, $A28514D9, $6C51133C
  Data.l $6FD5C7E7, $56E14EC4, $362ABFCE, $DDC6C837
  Data.l $D79A3234, $92638212, $670EFA8E, $406000E0
 
  BLOWFISH_S3:
  Data.l $3A39CE37, $D3FAF5CF, $ABC27737, $5AC52D1B
  Data.l $5CB0679E, $4FA33742, $D3822740, $99BC9BBE
  Data.l $D5118E9D, $BF0F7315, $D62D1C7E, $C700C47B
  Data.l $B78C1B6B, $21A19045, $B26EB1BE, $6A366EB4
  Data.l $5748AB2F, $BC946E79, $C6A376D2, $6549C2C8
  Data.l $530FF8EE, $468DDE7D, $D5730A1D, $4CD04DC6
  Data.l $2939BBDB, $A9BA4650, $AC9526E8, $BE5EE304
  Data.l $A1FAD5F0, $6A2D519A, $63EF8CE2, $9A86EE22
  Data.l $C089C2B8, $43242EF6, $A51E03AA, $9CF2D0A4
  Data.l $83C061BA, $9BE96A4D, $8FE51550, $BA645BD6
  Data.l $2826A2F9, $A73A3AE1, $4BA99586, $EF5562E9
  Data.l $C72FEFD3, $F752F7DA, $3F046F69, $77FA0A59
  Data.l $80E4A915, $87B08601, $9B09E6AD, $3B3EE593
  Data.l $E990FD5A, $9E34D797, $2CF0B7D9, $022B8B51
  Data.l $96D5AC3A, $017DA67D, $D1CF3ED6, $7C7D2D28
  Data.l $1F9F25CF, $ADF2B89B, $5AD6B472, $5A88F54C
  Data.l $E029AC71, $E019A5E6, $47B0ACFD, $ED93FA9B
  Data.l $E8D3C48D, $283B57CC, $F8D56629, $79132E28
  Data.l $785F0191, $ED756055, $F7960E44, $E3D35E8C
  Data.l $15056DD4, $88F46DBA, $03A16125, $0564F0BD
  Data.l $C3EB9E15, $3C9057A2, $97271AEC, $A93A072A
  Data.l $1B3F6D9B, $1E6321F5, $F59C66FB, $26DCF319
  Data.l $7533D928, $B155FDF5, $03563482, $8ABA3CBB
  Data.l $28517711, $C20AD9F8, $ABCC5167, $CCAD925F
  Data.l $4DE81751, $3830DC8E, $379D5862, $9320F991
  Data.l $EA7A90C2, $FB3E7BCE, $5121CE64, $774FBE32
  Data.l $A8B6E37E, $C3293D46, $48DE5369, $6413E680
  Data.l $A2AE0810, $DD6DB224, $69852DFD, $09072166
  Data.l $B39A460A, $6445C0DD, $586CDECF, $1C20C8AE
  Data.l $5BBEF7DD, $1B588D40, $CCD2017F, $6BB4E3BB
  Data.l $DDA26A7E, $3A59FF45, $3E350A44, $BCB4CDD5
  Data.l $72EACEA8, $FA6484BB, $8D6612AE, $BF3C6F47
  Data.l $D29BE463, $542F5D9E, $AEC2771B, $F64E6370
  Data.l $740E0D8D, $E75B1357, $F8721671, $AF537D5D
  Data.l $4040CB08, $4EB4E2CC, $34D2466A, $0115AF84
  Data.l $E1B00428, $95983A1D, $06B89FB4, $CE6EA048
  Data.l $6F3F3B82, $3520AB82, $011A1D4B, $277227F8
  Data.l $611560B1, $E7933FDC, $BB3A792B, $344525BD
  Data.l $A08839E1, $51CE794B, $2F32C9B7, $A01FBAC9
  Data.l $E01CC87E, $BCC7D1F6, $CF0111C3, $A1E8AAC7
  Data.l $1A908749, $D44FBD9A, $D0DADECB, $D50ADA38
  Data.l $0339C32A, $C6913667, $8DF9317C, $E0B12B4F
  Data.l $F79E59B7, $43F5BB3A, $F2D519FF, $27D9459C
  Data.l $BF97222C, $15E6FC2A, $0F91FC71, $9B941525
  Data.l $FAE59361, $CEB69CEB, $C2A86459, $12BAA8D1
  Data.l $B6C1075E, $E3056A0C, $10D25065, $CB03A442
  Data.l $E0EC6E0E, $1698DB3B, $4C98A0BE, $3278E964
  Data.l $9F1F9532, $E0D392DF, $D3A0342B, $8971F21E
  Data.l $1B0A7441, $4BA3348C, $C5BE7120, $C37632D8
  Data.l $DF359F8D, $9B992F2E, $E60B6F47, $0FE3F11D
  Data.l $E54CDA54, $1EDAD891, $CE6279CF, $CD3E7E6F
  Data.l $1618B166, $FD2C1D05, $848FD2C5, $F6FB2299
  Data.l $F523F357, $A6327623, $93A83531, $56CCCD02
  Data.l $ACF08162, $5A75EBB5, $6E163697, $88D273CC
  Data.l $DE966292, $81B949D0, $4C50901B, $71C65614
  Data.l $E6C6C7BD, $327A140A, $45E1D006, $C3F27B9A
  Data.l $C9AA53FD, $62A80F00, $BB25BFE2, $35BDD2F6
  Data.l $71126905, $B2040222, $B6CBCF7C, $CD769C2B
  Data.l $53113EC0, $1640E3D3, $38ABBD60, $2547ADF0
  Data.l $BA38209C, $F746CE76, $77AFA1C5, $20756060
  Data.l $85CBFE4E, $8AE88DD8, $7AAAF9B0, $4CF9AA7E
  Data.l $1948C25C, $02FB8A8C, $01C36AE4, $D6EBE1F9
  Data.l $90D4F869, $A65CDEA0, $3F09252D, $C208E69F
  Data.l $B74E6132, $CE77E25B, $578FDFE3, $3AC372E6
EndDataSection

; IDE Options = PureBasic 4.10 (Windows - x86)
; Folding = --


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: 07.05.2008 15:19 
Offline
Benutzeravatar

Registriert: 28.07.2005 12:39
Tja, nett gemeint, aber sicherer wird es dadurch auch nicht.

Zitat:
Wenn man(n) nun das Passwort verschlüsselt hinterlegt und in der Laufzeit entschlüsselt, kann man mit dem Hex-Editor lange nach dem Passwort suchen


Das haellt vielleicht Otto ab, aber jeder der auch nur ein bisschen Ahnung
von einem Disassembler hat, wird in ein paar Sekunden an das Passwort
gelangen.

Packt also keine Web Passwoerter, und schon gar keine von einem FTP
Account, in eine Exe.

_________________
Suche


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: 07.05.2008 15:27 
Offline

Registriert: 28.12.2006 17:44
Wohnort: Senden
Tach auch...

edel hat geschrieben:
Tja, nett gemeint, aber sicherer wird es dadurch auch nicht.


Ein bissl schon, in der ausführbaren Datei ist zumindest kein PW mehr sichtbar...

edel hat geschrieben:
Zitat:
Wenn man(n) nun das Passwort verschlüsselt hinterlegt und in der Laufzeit entschlüsselt, kann man mit dem Hex-Editor lange nach dem Passwort suchen


Das haellt vielleicht Otto ab, aber jeder der auch nur ein bisschen Ahnung
von einem Disassembler hat, wird in ein paar Sekunden an das Passwort
gelangen.


Da die wenigsten mit einem Diasselbler umgehen können....

edel hat geschrieben:
Packt also keine Web Passwoerter, und schon gar keine von einem FTP
Account, in eine Exe.


Hmmm, haste denn eine andere Lösung? PHP könnte die hochzuladenen Dateien entgegennehmen, das wäre nicht das Problem. Aber wie sieht das denn mit MySQL aus? Leserechte sind dann nur auf bestimmte Tabellen, schreibrechte nur an einer. Und da kann man ja prüfen, was da so rein kommt.

Gruß Micro


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: 07.05.2008 15:34 
Offline
Benutzeravatar

Registriert: 29.08.2004 20:46
Wohnort: Luxemburg
Insbesondere bei FTP- und HTTP-Passwörtern braucht man gar keinen Disassembler, egal wie du das Passwort in der EXE verschlüsselt hast. Wireshark reicht vollkommen aus.

_________________
„Warum siehst du den Splitter im Auge deines Bruders, aber den dicken fetten schwarzen Zensurbalken vor deinem Auge bemerkst du nicht?“


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: 07.05.2008 15:56 
Offline
Benutzeravatar

Registriert: 28.07.2005 12:39
Zitat:
Da die wenigsten mit einem Diasselbler umgehen können....


Das spielt leider keine Rolle wieviele damit nicht umgehen koennen,
einer wird es immer schaffen.

Zitat:
Hmmm, haste denn eine andere Lösung? PHP könnte die hochzuladenen Dateien entgegennehmen, das wäre nicht das Problem. Aber wie sieht das denn mit MySQL aus? Leserechte sind dann nur auf bestimmte Tabellen, schreibrechte nur an einer. Und da kann man ja prüfen, was da so rein kommt.


Es wird dir nichts anderes uebrig bleiben, als ein Script\Server zu nutzen.
Zumindest dann nicht, wenn dir die Daten wichtig sind ;)

_________________
Suche


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: 07.05.2008 17:16 
Offline

Registriert: 28.12.2006 17:44
Wohnort: Senden
edel hat geschrieben:
Zitat:
Da die wenigsten mit einem Diasselbler umgehen können....


Das spielt leider keine Rolle wieviele damit nicht umgehen koennen,
einer wird es immer schaffen.

Zitat:
Hmmm, haste denn eine andere Lösung? PHP könnte die hochzuladenen Dateien entgegennehmen, das wäre nicht das Problem. Aber wie sieht das denn mit MySQL aus? Leserechte sind dann nur auf bestimmte Tabellen, schreibrechte nur an einer. Und da kann man ja prüfen, was da so rein kommt.


Es wird dir nichts anderes uebrig bleiben, als ein Script\Server zu nutzen.
Zumindest dann nicht, wenn dir die Daten wichtig sind ;)


Haste da eine Idee? Bin für Ideen immer zu haben...


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: 07.05.2008 17:53 
Offline
Benutzeravatar

Registriert: 08.09.2004 00:57
Wohnort: Berlin
Besorg Dir nen Webspace mit PHP, falls nicht schon vorhanden und dann
lernste erstmal PHP: http://www.selfphp.info/
FTP, SMTP, POP3 usw., dort werden die Passwörter im Endeffekt immer in
Klarschrift übermittelt und können mit div. Tools ausgelesen werden, von
jedem Laien. Teilweise verstößt man dabei sogar gegen die AGB des
Providers seines E-Mail-Faches

Für den Rest gilt das was edel sagte, es ist niemals sicher, das Entschlüsseln
im Speicher ist schon unsicher !

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: 07.05.2008 18:17 
Offline

Registriert: 05.05.2005 19:06
Jupp. Und auch wenn man sich auf teure VM's verlässt (z.B. mal Themida) muss der Code trotzdem noch anständig sein... Weil ansonsten einfach starten, debuggen (Step for Step) und irgendwann das eine Register auslesen. Und es gibt keine 100% sichere Methode. Ne Möglichkeit wär vielleicht das aktuelle Datum mit nem EIGENEM Algo zu verschlüsseln, an nen PHP senden (verschlüsselt) dort entschlüssel und falls das Datum älter als 10sek is eine "gefakte" Error 404 Seite anzeigen... Aber auch das is knackbar, man muss nur schnell genug sein. Wie schon jemand gesagt hat, Wireshark. Ich habe bisher alles per PHP gelöst. (z.B. bei nem eigefrorenem Chat, wegen User-DB's und so) Aber FTP würde ich vorallem nie verwenden. Ist zu heikel. Und die PHPs habe ich mit so ner Art wie oben abgeschottet und noch UserAgent Check und so Zeugs reingemacht. Nicht schlecht das Prog, aber wie gesagt unsicher.

Gruss
PMTheQuick ;)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: Oberfläche für Blowfish-Algo
BeitragVerfasst: 11.03.2020 13:44 
Offline

Registriert: 11.03.2020 13:39
Hab ein paar Sachen gelöscht für
1) Plattformunabhängikeit
2) Update auf PB 5.61

Code:
;/------------------------------
;|
;| BlowFish.pbi
;| (c)HeX0R 2006
;|
;| Include File for
;| some BlowFish-Action.
;|
;| Needs PureBasic >= 4.0,
;| no Userlibrarys,
;| no Api
;| Should work with Demo also.
;|
;/-------------------------------
UseMD5Fingerprint()
Structure BLOWFISH
  S0.q[256]
  S1.q[256]
  S2.q[256]
  S3.q[256]
  K.q[18]
EndStructure

Structure BLOWFISHKEY
   b.b[16]
EndStructure

#FL                 = $FFFFFFFF
#BlowFish_UseBase64 = $01
#BlowFish_UseCBC    = $02

Procedure.q BF_Internal_Sbox_Round(*Q.QUAD, *B.BLOWFISH)

    Protected Result.q, b0.l, b1.l, b2.l, b3.l
   
    b0 = (*Q\q >> 24) & $FF
    b1 = (*Q\q >> 16) & $FF
    b2 = (*Q\q >> 8) & $FF
    b3 = *Q\q & $FF

    Result = *B\S0[b0] + *B\S1[b1]
    Result ! *B\S2[b2]
    Result & #FL
    Result + *B\S3[b3]

    ProcedureReturn Result & #FL
   
EndProcedure

Procedure BF_Internal_Block_Encrypt(*vl.QUAD, *vr.QUAD, *B.BLOWFISH)

   Protected i.l

   For i = 0 To 15

      *vl\q ! *B\K[i]
    *vr\q ! BF_Internal_Sbox_Round(*vl, *B)
      Swap *vl\q, *vr\q
     
  Next i

  Swap *vl\q, *vr\q
  *vr\q ! *B\K[16]
  *vl\q ! *B\K[17]

EndProcedure

Procedure BF_Internal_Block_Decrypt(*vl.QUAD, *vr.QUAD, *B.BLOWFISH)

   Protected i.l
 
   For i = 17 To 2 Step -1

      *vl\q ! *B\K[i]
      *vr\q ! BF_Internal_Sbox_Round(*vl, *B)
      Swap *vl\q, *vr\q

   Next i
 
   Swap *vl\q, *vr\q
   *vr\q ! *B\K[1]
   *vl\q ! *B\K[0]

EndProcedure

Procedure BF_Internal_Cipher_Key(*key, keylen.l, *B.BLOWFISH)

   Protected key_md5.s, i.l, v0.q, v1.q, nkey.BLOWFISHKEY
   
   For i = 0 To 17
      *B\K[i] = PeekL(?BLOWFISH_K + i*4) & #FL
   Next i
   
   For i = 0 To 255
      *B\S0[i] = PeekL(?BLOWFISH_S0 + i*4) & #FL
   Next i
   
   For i = 0 To 255
      *B\S1[i] = PeekL(?BLOWFISH_S1 + i*4) & #FL
   Next i
   
   For i = 0 To 255
      *B\S2[i] = PeekL(?BLOWFISH_S2 + i*4) & #FL
   Next i
   
   For i = 0 To 255
      *B\S3[i] = PeekL(?BLOWFISH_S3 + i*4) & #FL
   Next i

   key_md5 = Fingerprint(*key, keylen,#PB_Cipher_MD5)

  If keylen < 16
      CopyMemory(*key, @nkey\b[0], keylen)
      CopyMemory(@key_md5, @nkey\b[keylen], 16 - keylen)
   Else
      CopyMemory(*key, @nkey\b[0], 16)
   EndIf
 
  Dim MyKey.q(4)
  For i = 0 To 3
     MyKey(i) = PeekL(@nkey\b[i*4]) & #FL
  Next i

   For i = 0 To 17
     
     *B\K[i] ! MyKey(i % 4)
     *B\K[i] & #FL
   
  Next i

  For i = 0 To 16 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
     *B\K[i]   = v0
     *B\K[i+1] = v1
  Next i

  For i = 0 To 254 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
    *B\S0[i]   = v0
    *B\S0[i+1] = v1
   Next i

  For i = 0 To 254 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
    *B\S1[i]   = v0
    *B\S1[i+1] = v1
   Next i

  For i = 0 To 254 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
    *B\S2[i]   = v0
    *B\S2[i+1] = v1
   Next i

  For i = 0 To 254 Step 2
      BF_Internal_Block_Encrypt(@v0, @v1, *B)
    *B\S3[i]   = v0
    *B\S3[i+1] = v1
   Next i

EndProcedure

Procedure.l Blowfish_Crypt(*text, textlen.l, *Password, passlen.l, *Result, Resultlen.l, Mode.l = #BlowFish_UseBase64)

   Protected BF.BLOWFISH, *Buffer, n.l, i.l, a.l, K.q, P.l, b.l

   BF_Internal_Cipher_Key(*Password, passlen, @BF)
   
   *Buffer = AllocateMemory(textlen * 2)
   If *Buffer
      n = textlen
     If n % 8 <> 0
        n = 8 - (n % 8)
        For i = 0 To n - 1
           PokeB(*text + textlen + i, 32)
        Next i
        textlen + n
     EndIf

      n = textlen / 4
       
     Dim L.QUAD(n)
     Dim Cipher.QUAD(n+2)
     
     If Mode & #BlowFish_UseCBC
         Cipher(0)\q = Date();
      Cipher(1)\q = ElapsedMilliseconds()*1000000
      P = 2
    EndIf
   
     For i = 0 To n - 1
        L(i)\q = PeekL(*text + i*4) & #FL
     Next i

     b = 1
     If n*8 <= ResultLen
        For i = 0 To n - 1 Step 2
         
           If Mode & #BlowFish_UseCBC
              L(i)\q   ! Cipher(b-1)\q
          L(i+1)\q ! Cipher(b)\q
           EndIf
           
           Cipher(i+P)\q   = L(i)\q
           Cipher(i+P+1)\q = L(i+1)\q
            BF_Internal_Block_Encrypt(@Cipher(i + P), @Cipher(i + P+ 1), @BF)
            b + 2
         Next i
         
         a = 0
         For i = 0 To n - 1 + P Step 2
            K = Cipher(i)\q & #FL
            PokeL(*Buffer + a, PeekL(@K))
            K = Cipher(i + 1)\q & #FL
            PokeL(*Buffer + a + 4, PeekL(@K))
            a + 8
        Next i
     
         If Mode & #BlowFish_UseBase64
            Base64DecoderBuffer(*Buffer, a, *Result, Resultlen)
            a = MemoryStringLength(*Result)
         Else
            CopyMemory(*Buffer, *Result, a)
         EndIf
      EndIf
      FreeMemory(*Buffer)
   EndIf
   
   ProcedureReturn a

EndProcedure

Procedure.l Blowfish_Decrypt(*text, textlen.l, *Password, Passlen.l, *Result, Resultlen.l, Mode.l = #BlowFish_UseBase64)

   Protected BF.BLOWFISH, *Buffer, n.l, i.l, a.l, j.l, K1.q, K2.q

   BF_Internal_Cipher_Key(*Password, passlen, @BF)
   
   *Buffer = AllocateMemory(textlen * 2 + 64)
   If *Buffer
      If Mode & #BlowFish_UseBase64
         textlen = Base64DecoderBuffer(*text, textlen, *Buffer, textlen * 2 + 64)
         n = textlen / 4
      Else
         CopyMemory(*text, *Buffer, textlen)
         n = textlen / 4
      EndIf
       
      Dim Cipher.QUAD(n+2)
      Dim L.QUAD(n)
       
      For i = 0 To n - 1
         Cipher(i)\q = PeekL(*Buffer + i*4) & #FL
      Next i
       
      If Mode & #BlowFish_UseCBC
         j = 2
      Else
         j = 0
      EndIf

      a = 0
      If n*8 <= ResultLen
         For i = j To n - 1 Step 2
            K1 = Cipher(i)\q
            K2 = Cipher(i+1)\q
            BF_Internal_Block_Decrypt(@K1, @K2, @BF)
            If Mode & #BlowFish_UseCBC
          L(i-j)\q   = K1 ! Cipher(i-2)\q
          L(i+1-j)\q = K2 ! Cipher(i-1)\q
        Else
          L(i-j)\q   = K1
          L(i+1-j)\q = K2
        EndIf
      Next i
      For i = 0 To n - 1 - j Step 2
            K1 = L(i)\q & #FL
            K2 = L(i + 1)\q & #FL
            PokeL(*Result + a, PeekL(@K1))
            PokeL(*Result + a + 4, PeekL(@K2))
            a + 8
        Next i
     EndIf
     
     FreeMemory(*Buffer)
  EndIf
   ProcedureReturn a

EndProcedure

DataSection
  BLOWFISH_K:
  Data.l $243F6A88, $85A308D3, $13198A2E, $03707344
  Data.l $A4093822, $299F31D0, $082EFA98, $EC4E6C89
  Data.l $452821E6, $38D01377, $BE5466CF, $34E90C6C
  Data.l $C0AC29B7, $C97C50DD, $3F84D5B5, $B5470917
  Data.l $9216D5D9, $8979FB1B, 0, 0
 
  BLOWFISH_S0:
  Data.l $D1310BA6, $98DFB5AC, $2FFD72DB, $D01ADFB7
  Data.l $B8E1AFED, $6A267E96, $BA7C9045, $F12C7F99
  Data.l $24A19947, $B3916CF7, $0801F2E2, $858EFC16
  Data.l $636920D8, $71574E69, $A458FEA3, $F4933D7E
  Data.l $0D95748F, $728EB658, $718BCD58, $82154AEE
  Data.l $7B54A41D, $C25A59B5, $9C30D539, $2AF26013
  Data.l $C5D1B023, $286085F0, $CA417918, $B8DB38EF
  Data.l $8E79DCB0, $603A180E, $6C9E0E8B, $B01E8A3E
  Data.l $D71577C1, $BD314B27, $78AF2FDA, $55605C60
  Data.l $E65525F3, $AA55AB94, $57489862, $63E81440
  Data.l $55CA396A, $2AAB10B6, $B4CC5C34, $1141E8CE
  Data.l $A15486AF, $7C72E993, $B3EE1411, $636FBC2A
  Data.l $2BA9C55D, $741831F6, $CE5C3E16, $9B87931E
  Data.l $AFD6BA33, $6C24CF5C, $7A325381, $28958677
  Data.l $3B8F4898, $6B4BB9AF, $C4BFE81B, $66282193
  Data.l $61D809CC, $FB21A991, $487CAC60, $5DEC8032
  Data.l $EF845D5D, $E98575B1, $DC262302, $EB651B88
  Data.l $23893E81, $D396ACC5, $0F6D6FF3, $83F44239
  Data.l $2E0B4482, $A4842004, $69C8F04A, $9E1F9B5E
  Data.l $21C66842, $F6E96C9A, $670C9C61, $ABD388F0
  Data.l $6A51A0D2, $D8542F68, $960FA728, $AB5133A3
  Data.l $6EEF0B6C, $137A3BE4, $BA3BF050, $7EFB2A98
  Data.l $A1F1651D, $39AF0176, $66CA593E, $82430E88
  Data.l $8CEE8619, $456F9FB4, $7D84A5C3, $3B8B5EBE
  Data.l $E06F75D8, $85C12073, $401A449F, $56C16AA6
  Data.l $4ED3AA62, $363F7706, $1BFEDF72, $429B023D
  Data.l $37D0D724, $D00A1248, $DB0FEAD3, $49F1C09B
  Data.l $075372C9, $80991B7B, $25D479D8, $F6E8DEF7
  Data.l $E3FE501A, $B6794C3B, $976CE0BD, $04C006BA
  Data.l $C1A94FB6, $409F60C4, $5E5C9EC2, $196A2463
  Data.l $68FB6FAF, $3E6C53B5, $1339B2EB, $3B52EC6F
  Data.l $6DFC511F, $9B30952C, $CC814544, $AF5EBD09
  Data.l $BEE3D004, $DE334AFD, $660F2807, $192E4BB3
  Data.l $C0CBA857, $45C8740F, $D20B5F39, $B9D3FBDB
  Data.l $5579C0BD, $1A60320A, $D6A100C6, $402C7279
  Data.l $679F25FE, $FB1FA3CC, $8EA5E9F8, $DB3222F8
  Data.l $3C7516DF, $FD616B15, $2F501EC8, $AD0552AB
  Data.l $323DB5FA, $FD238760, $53317B48, $3E00DF82
  Data.l $9E5C57BB, $CA6F8CA0, $1A87562E, $DF1769DB
  Data.l $D542A8F6, $287EFFC3, $AC6732C6, $8C4F5573
  Data.l $695B27B0, $BBCA58C8, $E1FFA35D, $B8F011A0
  Data.l $10FA3D98, $FD2183B8, $4AFCB56C, $2DD1D35B
  Data.l $9A53E479, $B6F84565, $D28E49BC, $4BFB9790
  Data.l $E1DDF2DA, $A4CB7E33, $62FB1341, $CEE4C6E8
  Data.l $EF20CADA, $36774C01, $D07E9EFE, $2BF11FB4
  Data.l $95DBDA4D, $AE909198, $EAAD8E71, $6B93D5A0
  Data.l $D08ED1D0, $AFC725E0, $8E3C5B2F, $8E7594B7
  Data.l $8FF6E2FB, $F2122B64, $8888B812, $900DF01C
  Data.l $4FAD5EA0, $688FC31C, $D1CFF191, $B3A8C1AD
  Data.l $2F2F2218, $BE0E1777, $EA752DFE, $8B021FA1
  Data.l $E5A0CC0F, $B56F74E8, $18ACF3D6, $CE89E299
  Data.l $B4A84FE0, $FD13E0B7, $7CC43B81, $D2ADA8D9
  Data.l $165FA266, $80957705, $93CC7314, $211A1477
  Data.l $E6AD2065, $77B5FA86, $C75442F5, $FB9D35CF
  Data.l $EBCDAF0C, $7B3E89A0, $D6411BD3, $AE1E7E49
  Data.l $00250E2D, $2071B35E, $226800BB, $57B8E0AF
  Data.l $2464369B, $F009B91E, $5563911D, $59DFA6AA
  Data.l $78C14389, $D95A537F, $207D5BA2, $02E5B9C5
  Data.l $83260376, $6295CFA9, $11C81968, $4E734A41
  Data.l $B3472DCA, $7B14A94A, $1B510052, $9A532915
  Data.l $D60F573F, $BC9BC6E4, $2B60A476, $81E67400
  Data.l $08BA6FB5, $571BE91F, $F296EC6B, $2A0DD915
  Data.l $B6636521, $E7B9F9B6, $FF34052E, $C5855664
  Data.l $53B02D5D, $A99F8FA1, $08BA4799, $6E85076A
 
  BLOWFISH_S1:
  Data.l $4B7A70E9, $B5B32944, $DB75092E, $C4192623
  Data.l $AD6EA6B0, $49A7DF7D, $9CEE60B8, $8FEDB266
  Data.l $ECAA8C71, $699A17FF, $5664526C, $C2B19EE1
  Data.l $193602A5, $75094C29, $A0591340, $E4183A3E
  Data.l $3F54989A, $5B429D65, $6B8FE4D6, $99F73FD6
  Data.l $A1D29C07, $EFE830F5, $4D2D38E6, $F0255DC1
  Data.l $4CDD2086, $8470EB26, $6382E9C6, $021ECC5E
  Data.l $09686B3F, $3EBAEFC9, $3C971814, $6B6A70A1
  Data.l $687F3584, $52A0E286, $B79C5305, $AA500737
  Data.l $3E07841C, $7FDEAE5C, $8E7D44EC, $5716F2B8
  Data.l $B03ADA37, $F0500C0D, $F01C1F04, $0200B3FF
  Data.l $AE0CF51A, $3CB574B2, $25837A58, $DC0921BD
  Data.l $D19113F9, $7CA92FF6, $94324773, $22F54701
  Data.l $3AE5E581, $37C2DADC, $C8B57634, $9AF3DDA7
  Data.l $A9446146, $0FD0030E, $ECC8C73E, $A4751E41
  Data.l $E238CD99, $3BEA0E2F, $3280BBA1, $183EB331
  Data.l $4E548B38, $4F6DB908, $6F420D03, $F60A04BF
  Data.l $2CB81290, $24977C79, $5679B072, $BCAF89AF
  Data.l $DE9A771F, $D9930810, $B38BAE12, $DCCF3F2E
  Data.l $5512721F, $2E6B7124, $501ADDE6, $9F84CD87
  Data.l $7A584718, $7408DA17, $BC9F9ABC, $E94B7D8C
  Data.l $EC7AEC3A, $DB851DFA, $63094366, $C464C3D2
  Data.l $EF1C1847, $3215D908, $DD433B37, $24C2BA16
  Data.l $12A14D43, $2A65C451, $50940002, $133AE4DD
  Data.l $71DFF89E, $10314E55, $81AC77D6, $5F11199B
  Data.l $043556F1, $D7A3C76B, $3C11183B, $5924A509
  Data.l $F28FE6ED, $97F1FBFA, $9EBABF2C, $1E153C6E
  Data.l $86E34570, $EAE96FB1, $860E5E0A, $5A3E2AB3
  Data.l $771FE71C, $4E3D06FA, $2965DCB9, $99E71D0F
  Data.l $803E89D6, $5266C825, $2E4CC978, $9C10B36A
  Data.l $C6150EBA, $94E2EA78, $A5FC3C53, $1E0A2DF4
  Data.l $F2F74EA7, $361D2B3D, $1939260F, $19C27960
  Data.l $5223A708, $F71312B6, $EBADFE6E, $EAC31F66
  Data.l $E3BC4595, $A67BC883, $B17F37D1, $018CFF28
  Data.l $C332DDEF, $BE6C5AA5, $65582185, $68AB9802
  Data.l $EECEA50F, $DB2F953B, $2AEF7DAD, $5B6E2F84
  Data.l $1521B628, $29076170, $ECDD4775, $619F1510
  Data.l $13CCA830, $EB61BD96, $0334FE1E, $AA0363CF
  Data.l $B5735C90, $4C70A239, $D59E9E0B, $CBAADE14
  Data.l $EECC86BC, $60622CA7, $9CAB5CAB, $B2F3846E
  Data.l $648B1EAF, $19BDF0CA, $A02369B9, $655ABB50
  Data.l $40685A32, $3C2AB4B3, $319EE9D5, $C021B8F7
  Data.l $9B540B19, $875FA099, $95F7997E, $623D7DA8
  Data.l $F837889A, $97E32D77, $11ED935F, $16681281
  Data.l $0E358829, $C7E61FD6, $96DEDFA1, $7858BA99
  Data.l $57F584A5, $1B227263, $9B83C3FF, $1AC24696
  Data.l $CDB30AEB, $532E3054, $8FD948E4, $6DBC3128
  Data.l $58EBF2EF, $34C6FFEA, $FE28ED61, $EE7C3C73
  Data.l $5D4A14D9, $E864B7E3, $42105D14, $203E13E0
  Data.l $45EEE2B6, $A3AAABEA, $DB6C4F15, $FACB4FD0
  Data.l $C742F442, $EF6ABBB5, $654F3B1D, $41CD2105
  Data.l $D81E799E, $86854DC7, $E44B476A, $3D816250
  Data.l $CF62A1F2, $5B8D2646, $FC8883A0, $C1C7B6A3
  Data.l $7F1524C3, $69CB7492, $47848A0B, $5692B285
  Data.l $095BBF00, $AD19489D, $1462B174, $23820E00
  Data.l $58428D2A, $0C55F5EA, $1DADF43E, $233F7061
  Data.l $3372F092, $8D937E41, $D65FECF1, $6C223BDB
  Data.l $7CDE3759, $CBEE7460, $4085F2A7, $CE77326E
  Data.l $A6078084, $19F8509E, $E8EFD855, $61D99735
  Data.l $A969A7AA, $C50C06C2, $5A04ABFC, $800BCADC
  Data.l $9E447A2E, $C3453484, $FDD56705, $0E1E9EC9
  Data.l $DB73DBD3, $105588CD, $675FDA79, $E3674340
  Data.l $C5C43465, $713E38D8, $3D28F89E, $F16DFF20
  Data.l $153E21E7, $8FB03D4A, $E6E39F2B, $DB83ADF7
 
  BLOWFISH_S2:
  Data.l $E93D5A68, $948140F7, $F64C261C, $94692934
  Data.l $411520F7, $7602D4F7, $BCF46B2E, $D4A20068
  Data.l $D4082471, $3320F46A, $43B7D4B7, $500061AF
  Data.l $1E39F62E, $97244546, $14214F74, $BF8B8840
  Data.l $4D95FC1D, $96B591AF, $70F4DDD3, $66A02F45
  Data.l $BFBC09EC, $03BD9785, $7FAC6DD0, $31CB8504
  Data.l $96EB27B3, $55FD3941, $DA2547E6, $ABCA0A9A
  Data.l $28507825, $530429F4, $0A2C86DA, $E9B66DFB
  Data.l $68DC1462, $D7486900, $680EC0A4, $27A18DEE
  Data.l $4F3FFEA2, $E887AD8C, $B58CE006, $7AF4D6B6
  Data.l $AACE1E7C, $D3375FEC, $CE78A399, $406B2A42
  Data.l $20FE9E35, $D9F385B9, $EE39D7AB, $3B124E8B
  Data.l $1DC9FAF7, $4B6D1856, $26A36631, $EAE397B2
  Data.l $3A6EFA74, $DD5B4332, $6841E7F7, $CA7820FB
  Data.l $FB0AF54E, $D8FEB397, $454056AC, $BA489527
  Data.l $55533A3A, $20838D87, $FE6BA9B7, $D096954B
  Data.l $55A867BC, $A1159A58, $CCA92963, $99E1DB33
  Data.l $A62A4A56, $3F3125F9, $5EF47E1C, $9029317C
  Data.l $FDF8E802, $04272F70, $80BB155C, $05282CE3
  Data.l $95C11548, $E4C66D22, $48C1133F, $C70F86DC
  Data.l $07F9C9EE, $41041F0F, $404779A4, $5D886E17
  Data.l $325F51EB, $D59BC0D1, $F2BCC18F, $41113564
  Data.l $257B7834, $602A9C60, $DFF8E8A3, $1F636C1B
  Data.l $0E12B4C2, $02E1329E, $AF664FD1, $CAD18115
  Data.l $6B2395E0, $333E92E1, $3B240B62, $EEBEB922
  Data.l $85B2A20E, $E6BA0D99, $DE720C8C, $2DA2F728
  Data.l $D0127845, $95B794FD, $647D0862, $E7CCF5F0
  Data.l $5449A36F, $877D48FA, $C39DFD27, $F33E8D1E
  Data.l $0A476341, $992EFF74, $3A6F6EAB, $F4F8FD37
  Data.l $A812DC60, $A1EBDDF8, $991BE14C, $DB6E6B0D
  Data.l $C67B5510, $6D672C37, $2765D43B, $DCD0E804
  Data.l $F1290DC7, $CC00FFA3, $B5390F92, $690FED0B
  Data.l $667B9FFB, $CEDB7D9C, $A091CF0B, $D9155EA3
  Data.l $BB132F88, $515BAD24, $7B9479BF, $763BD6EB
  Data.l $37392EB3, $CC115979, $8026E297, $F42E312D
  Data.l $6842ADA7, $C66A2B3B, $12754CCC, $782EF11C
  Data.l $6A124237, $B79251E7, $06A1BBE6, $4BFB6350
  Data.l $1A6B1018, $11CAEDFA, $3D25BDD8, $E2E1C3C9
  Data.l $44421659, $0A121386, $D90CEC6E, $D5ABEA2A
  Data.l $64AF674E, $DA86A85F, $BEBFE988, $64E4C3FE
  Data.l $9DBC8057, $F0F7C086, $60787BF8, $6003604D
  Data.l $D1FD8346, $F6381FB0, $7745AE04, $D736FCCC
  Data.l $83426B33, $F01EAB71, $B0804187, $3C005E5F
  Data.l $77A057BE, $BDE8AE24, $55464299, $BF582E61
  Data.l $4E58F48F, $F2DDFDA2, $F474EF38, $8789BDC2
  Data.l $5366F9C3, $C8B38E74, $B475F255, $46FCD9B9
  Data.l $7AEB2661, $8B1DDF84, $846A0E79, $915F95E2
  Data.l $466E598E, $20B45770, $8CD55591, $C902DE4C
  Data.l $B90BACE1, $BB8205D0, $11A86248, $7574A99E
  Data.l $B77F19B6, $E0A9DC09, $662D09A1, $C4324633
  Data.l $E85A1F02, $09F0BE8C, $4A99A025, $1D6EFE10
  Data.l $1AB93D1D, $0BA5A4DF, $A186F20F, $2868F169
  Data.l $DCB7DA83, $573906FE, $A1E2CE9B, $4FCD7F52
  Data.l $50115E01, $A70683FA, $A002B5C4, $0DE6D027
  Data.l $9AF88C27, $773F8641, $C3604C06, $61A806B5
  Data.l $F0177A28, $C0F586E0, $006058AA, $30DC7D62
  Data.l $11E69ED7, $2338EA63, $53C2DD94, $C2C21634
  Data.l $BBCBEE56, $90BCB6DE, $EBFC7DA1, $CE591D76
  Data.l $6F05E409, $4B7C0188, $39720A3D, $7C927C24
  Data.l $86E3725F, $724D9DB9, $1AC15BB4, $D39EB8FC
  Data.l $ED545578, $08FCA5B5, $D83D7CD3, $4DAD0FC4
  Data.l $1E50EF5E, $B161E6F8, $A28514D9, $6C51133C
  Data.l $6FD5C7E7, $56E14EC4, $362ABFCE, $DDC6C837
  Data.l $D79A3234, $92638212, $670EFA8E, $406000E0
 
  BLOWFISH_S3:
  Data.l $3A39CE37, $D3FAF5CF, $ABC27737, $5AC52D1B
  Data.l $5CB0679E, $4FA33742, $D3822740, $99BC9BBE
  Data.l $D5118E9D, $BF0F7315, $D62D1C7E, $C700C47B
  Data.l $B78C1B6B, $21A19045, $B26EB1BE, $6A366EB4
  Data.l $5748AB2F, $BC946E79, $C6A376D2, $6549C2C8
  Data.l $530FF8EE, $468DDE7D, $D5730A1D, $4CD04DC6
  Data.l $2939BBDB, $A9BA4650, $AC9526E8, $BE5EE304
  Data.l $A1FAD5F0, $6A2D519A, $63EF8CE2, $9A86EE22
  Data.l $C089C2B8, $43242EF6, $A51E03AA, $9CF2D0A4
  Data.l $83C061BA, $9BE96A4D, $8FE51550, $BA645BD6
  Data.l $2826A2F9, $A73A3AE1, $4BA99586, $EF5562E9
  Data.l $C72FEFD3, $F752F7DA, $3F046F69, $77FA0A59
  Data.l $80E4A915, $87B08601, $9B09E6AD, $3B3EE593
  Data.l $E990FD5A, $9E34D797, $2CF0B7D9, $022B8B51
  Data.l $96D5AC3A, $017DA67D, $D1CF3ED6, $7C7D2D28
  Data.l $1F9F25CF, $ADF2B89B, $5AD6B472, $5A88F54C
  Data.l $E029AC71, $E019A5E6, $47B0ACFD, $ED93FA9B
  Data.l $E8D3C48D, $283B57CC, $F8D56629, $79132E28
  Data.l $785F0191, $ED756055, $F7960E44, $E3D35E8C
  Data.l $15056DD4, $88F46DBA, $03A16125, $0564F0BD
  Data.l $C3EB9E15, $3C9057A2, $97271AEC, $A93A072A
  Data.l $1B3F6D9B, $1E6321F5, $F59C66FB, $26DCF319
  Data.l $7533D928, $B155FDF5, $03563482, $8ABA3CBB
  Data.l $28517711, $C20AD9F8, $ABCC5167, $CCAD925F
  Data.l $4DE81751, $3830DC8E, $379D5862, $9320F991
  Data.l $EA7A90C2, $FB3E7BCE, $5121CE64, $774FBE32
  Data.l $A8B6E37E, $C3293D46, $48DE5369, $6413E680
  Data.l $A2AE0810, $DD6DB224, $69852DFD, $09072166
  Data.l $B39A460A, $6445C0DD, $586CDECF, $1C20C8AE
  Data.l $5BBEF7DD, $1B588D40, $CCD2017F, $6BB4E3BB
  Data.l $DDA26A7E, $3A59FF45, $3E350A44, $BCB4CDD5
  Data.l $72EACEA8, $FA6484BB, $8D6612AE, $BF3C6F47
  Data.l $D29BE463, $542F5D9E, $AEC2771B, $F64E6370
  Data.l $740E0D8D, $E75B1357, $F8721671, $AF537D5D
  Data.l $4040CB08, $4EB4E2CC, $34D2466A, $0115AF84
  Data.l $E1B00428, $95983A1D, $06B89FB4, $CE6EA048
  Data.l $6F3F3B82, $3520AB82, $011A1D4B, $277227F8
  Data.l $611560B1, $E7933FDC, $BB3A792B, $344525BD
  Data.l $A08839E1, $51CE794B, $2F32C9B7, $A01FBAC9
  Data.l $E01CC87E, $BCC7D1F6, $CF0111C3, $A1E8AAC7
  Data.l $1A908749, $D44FBD9A, $D0DADECB, $D50ADA38
  Data.l $0339C32A, $C6913667, $8DF9317C, $E0B12B4F
  Data.l $F79E59B7, $43F5BB3A, $F2D519FF, $27D9459C
  Data.l $BF97222C, $15E6FC2A, $0F91FC71, $9B941525
  Data.l $FAE59361, $CEB69CEB, $C2A86459, $12BAA8D1
  Data.l $B6C1075E, $E3056A0C, $10D25065, $CB03A442
  Data.l $E0EC6E0E, $1698DB3B, $4C98A0BE, $3278E964
  Data.l $9F1F9532, $E0D392DF, $D3A0342B, $8971F21E
  Data.l $1B0A7441, $4BA3348C, $C5BE7120, $C37632D8
  Data.l $DF359F8D, $9B992F2E, $E60B6F47, $0FE3F11D
  Data.l $E54CDA54, $1EDAD891, $CE6279CF, $CD3E7E6F
  Data.l $1618B166, $FD2C1D05, $848FD2C5, $F6FB2299
  Data.l $F523F357, $A6327623, $93A83531, $56CCCD02
  Data.l $ACF08162, $5A75EBB5, $6E163697, $88D273CC
  Data.l $DE966292, $81B949D0, $4C50901B, $71C65614
  Data.l $E6C6C7BD, $327A140A, $45E1D006, $C3F27B9A
  Data.l $C9AA53FD, $62A80F00, $BB25BFE2, $35BDD2F6
  Data.l $71126905, $B2040222, $B6CBCF7C, $CD769C2B
  Data.l $53113EC0, $1640E3D3, $38ABBD60, $2547ADF0
  Data.l $BA38209C, $F746CE76, $77AFA1C5, $20756060
  Data.l $85CBFE4E, $8AE88DD8, $7AAAF9B0, $4CF9AA7E
  Data.l $1948C25C, $02FB8A8C, $01C36AE4, $D6EBE1F9
  Data.l $90D4F869, $A65CDEA0, $3F09252D, $C208E69F
  Data.l $B74E6132, $CE77E25B, $578FDFE3, $3AC372E6
EndDataSection

; IDE Options = PureBasic 4.10 (Windows - x86)
; Folding = --


Code:
; Greetings to HeXOR
; Date: 07. May 2008
; OS: Windows
; Demo: No

;------ Fensterkonstanten festlegen
Enumeration
  #Window_0
  #Window_1
EndEnumeration

;------ Gadget-Konstanten festlegen
Enumeration
  #Button_0
  #Button_1
  #Button_2
  #Button_3
  #Button_4
  #String_0
  #String_1
  #String_2
  #String_3
  #String_4
  #String_5
  #Frame3D_0
  #Frame3D_1
EndEnumeration

;------ Zeilenumbruch in der Ausgabe definieren
Global EOL.s = Chr(13) + Chr(10)

;------ Programmname definieren
Global Programmname$ = "Crypter V0.1"

;------ Includefile defninieren
IncludeFile "Blowfish.pbi"

;------ Fonts für das Programm festlegen
LoadFont(0, "Arial", 8)
LoadFont(1, "Arial", 8, #PB_Font_Bold)

;------ Preference-Verzeichnis prüfen ob vorhanden, ansonsten erstellen
Global VerzeichnisName$ = GetCurrentDirectory() + "Crypter\"
Verzeichnisda = FileSize(VerzeichnisName$)
If Verzeichnisda = -1
  Ergebnis = CreateDirectory(VerzeichnisName$)
  If Ergebnis = 0
    MessageRequester("Fehler","Konnte Programmverzeichnis" + Chr(13) + VerzeichnisName$ + Chr(13) + "nicht erstellen!")
    End
  EndIf
EndIf

;------ Programm beenden
Procedure ProgrammBeenden()
  meldung = MessageRequester(" " + Programmname$, "Programm wirklich beenden ?", #PB_MessageRequester_YesNo)
  If meldung = #PB_MessageRequester_Yes
    End
  EndIf

EndProcedure

;------ Quelltest für das Programmieren anzeigen
Procedure Quelltextfenster(password_for_encryption$,verschluesseltespasswort$)

  HideWindow(#Window_0,1)
  If OpenWindow(#Window_1, #PB_Ignore, #PB_Ignore, 800, 545, " Quelltext - " + Programmname$, #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_MinimizeGadget)
    If CreateGadgetList(WindowID(#Window_1))
      ButtonGadget(#Button_4, 670, 510, 120, 25, "Schliessen")

      Frame3DGadget(#Frame3D_1, 10, 10, 780, 490, " Programmierteil: ")
        StringGadget(#String_5, 20, 30, 760, 460, "")
       
        b$ = "IncludeFile " + Chr(34) + "BlowFish.pbi" + Chr(34) + "" + EOL
        b$ + "password_for_encryption$ = " + Chr(34) + password_for_encryption$ + Chr(34) + "" + EOL
        b$ + "Flags.l = #BlowFish_UseCBC | #BlowFish_UseBase64" + EOL
        b$ + "Result$ = " + Chr(34) + verschluesseltespasswort$ + Chr(34) + EOL
        b$ + "Length = Len(Result$)" + EOL
        b$ + "text_to_decrypt$ = Result$" + EOL
        b$ + "Result$ = Space(1024)" + EOL
        b$ + "Blowfish_Decrypt(@text_to_decrypt$, Length, @password_for_encryption$, Len(password_for_encryption$), @Result$, Len(Result$), Flags)" + EOL
        b$ + "Password.s = LTrim(RTrim(Result$))" + EOL
        b$ + "Debug Password.s" + EOL
        SetGadgetText(#String_5, b$)

    EndIf
  EndIf

EndProcedure

;------ Masterpasswort in Prefs speichern
Procedure PreferencesSpeichern()

  If CreatePreferences(VerzeichnisName$ + "Preferences.prefs")
      WritePreferenceString("Masterpasswort", GetGadgetText(#String_1))
     ClosePreferences()
  EndIf
  ; Löschgadget freigeben
  DisableGadget(#Button_2, 0)

EndProcedure

;------ Hauptfenster Start
If OpenWindow(#Window_0, #PB_Ignore, #PB_Ignore, 600, 245, " " + Programmname$, #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_MinimizeGadget)

  ; Prüfen, ob Einstellungen vorhanden sind
  If OpenPreferences(VerzeichnisName$ + "Preferences.prefs")
      Masterpasswort$ = ReadPreferenceString("Masterpasswort", "")
    ClosePreferences()
  EndIf

  If CreateGadgetList(WindowID(#Window_0))
    TextGadget(#String_0, 10, 13, 190, 20, "Masterpasswort eingeben:")
    StringGadget(#String_1, 210, 10, 380, 20, Masterpasswort$)

    TextGadget(#String_2, 10, 43, 190, 20, "Verschlüsselungstext eingeben:")
    StringGadget(#String_3, 210, 40, 380, 20, "")
   
    Frame3DGadget(#Frame3D_0, 10, 70, 580, 130, " Ausgabe: ")
      StringGadget(#String_4, 20, 90, 560, 100, "Hier erfolgt die Ausgabe des verschlüsselten Passwortes")
   
    ButtonGadget(#Button_0, 010, 210, 120, 25, "Beenden")
    ButtonGadget(#Button_1, 165, 210, 120, 25, "Quelltext anzeigen")
    ButtonGadget(#Button_2, 320, 210, 120, 25, "Einstellungen löschen")
    ButtonGadget(#Button_3, 470, 210, 120, 25, "Verschlüsseln")
   
    SetGadgetFont(#String_0, FontID(1))
    SetGadgetFont(#String_1, FontID(0))
    SetGadgetFont(#String_2, FontID(1))
    SetGadgetFont(#String_3, FontID(0))
   
    SetGadgetFont(#Frame3D_0, FontID(1))
    SetGadgetFont(#String_4, FontID(0))

    SetGadgetFont(#Button_0, FontID(0))
    SetGadgetFont(#Button_1, FontID(0))
    SetGadgetFont(#Button_2, FontID(0))
    SetGadgetFont(#Button_3, FontID(0))
   
    DisableGadget(#Button_1, 1)

    ; Voreinstellung: Wenn kein Masterpasswort vorhanden ist, Löschgadget sperren
    If Masterpasswort$ = ""
      DisableGadget(#Button_2, 1)
    EndIf

   
  EndIf

EndIf
;------ Hauptfenster Ende

;------ Schleifenanfang
Repeat
  EventID.l = WaitWindowEvent()

  Select EventID

    Case #PB_Event_Gadget   ; Hier das Buttonmenü
        Select EventGadget()
       
          Case #Button_0 ; Beenden
            ProgrammBeenden()

          Case #Button_1 ; Quelltext anzeigen
            Quelltextfenster(password_for_encryption$,verschluesseltespasswort$)

          Case #Button_2 ; Einstellungen löschen
          If OpenPreferences(VerzeichnisName$ + "Preferences.prefs")
               RemovePreferenceKey("Masterpasswort")
            ClosePreferences()
          EndIf
          SetGadgetText(#String_1, "")
          SetGadgetText(#String_3, "")
          SetGadgetText(#String_4, "")
          DisableGadget(#Button_1, 1)
          DisableGadget(#Button_2, 1)
         

          Case #Button_3 ; Verschlüsseln
            If GetGadgetText(#String_1) = "" Or GetGadgetText(#String_3) = ""
              MessageRequester(" " + Programmname$, "Sie haben ein Passwortfeld nicht ausgefüllt!")
            Else
              Lenght0 = Len(GetGadgetText(#String_1))
              Lenght1 = Len(GetGadgetText(#String_3))

              password_for_encryption$ = GetGadgetText(#String_1) ; Masterpasswort
              text_to_encrypt$         = GetGadgetText(#String_3) ; Eingabe des zu verschlüsselndes Passwortes
            Flags.l                  = #BlowFish_UseCBC | #BlowFish_UseBase64
            Result1$                  = Space(1024)
            Length2 = Blowfish_Crypt(@text_to_encrypt$, Len(text_to_encrypt$), @password_for_encryption$, Len(password_for_encryption$), @Result1$, Len(Result1$), Flags)
            If Length2
               SetGadgetText(#String_4, "")
               verschluesseltespasswort$ = Result1$
                a$ = "Länge des Masterpasswortes: " + Str(Lenght0) + #CRLF$
                a$ + "Länge des Verschlüsselungstextes: " + Str(Lenght1) + #CRLF$
                a$ + "Länge des verschlüsselten Passwortes: " + Str(Length2) + #CRLF$
                a$ + "Das Masterpasswort lautet: " + GetGadgetText(#String_1) + #CRLF$
                a$ + "Das unverschlüsselte Passwort lautet: " + GetGadgetText(#String_3) + #CRLF$
                a$ + "Das verschlüsselte Passwort lautet: " + verschluesseltespasswort$
                SetGadgetText(#String_4, a$)
                PreferencesSpeichern()
                DisableGadget(#Button_1, 0)
            Else
              MessageRequester(" " + Programmname$, "Es ist ein Fehler aufgetreten!" + Chr(13) + "Bitte versuche es noch einmal!")
            EndIf
         
            EndIf

        Case #Button_4 ; Quelltextfenster schliessen
          HideWindow(#Window_0,0)
          CloseWindow(#Window_1)


      EndSelect

      Case #PB_Event_CloseWindow
            If EventWindow() = #Window_1
          HideWindow(#Window_0,0)
              CloseWindow(#Window_1)
            Else
              ProgrammBeenden()
            EndIf
           
  EndSelect

Until Quit = 1
;------ Schleifenende

; IDE Options = PureBasic 4.10 (Windows - x86)
; Folding = -
; Executable = Crypter.exe


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 9 Beiträge ] 

Alle Zeiten sind UTC + 1 Stunde [ Sommerzeit ]


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 8 Gäste


Sie dürfen keine neuen Themen in diesem Forum erstellen.
Sie dürfen keine Antworten zu Themen in diesem Forum erstellen.
Sie dürfen Ihre Beiträge in diesem Forum nicht ändern.
Sie dürfen Ihre Beiträge in diesem Forum nicht löschen.

Suche nach:
Gehe zu:  

 


Powered by phpBB © 2008 phpBB Group | Deutsche Übersetzung durch phpBB.de
subSilver+ theme by Canver Software, sponsor Sanal Modifiye