CryptatorZ

« Older   Newer »
  Share  
Kira95
CAT_IMG Posted on 1/6/2010, 19:07     +1   -1




Ecco a voi 2 criptatori, un per file e l'altro per testi, giudicate voi....

CryptatorZ Per File
CryptatorZ Per TEsti

Source del criptatore per testi
SPOILER (click to view)
#include <guiconstantsex.au3>
#include <windowsconstants.au3>
#Include <string.au3>

$Gui = GuiCreate("CryptatorZ",400,400)
$Edit = GUICtrlCreateEdit("",25,25,350,250)
$Enc = GuiCtrlCreateButton("Crypta",220,350,70,30)
$Dec = GUICtrlCreateButton("Decrypta",300,350,70,30)
$Pass = GuiCtrlCreateInput("",25,350,175,30)
$Lab = GUICtrlCreateLabel("Scegli la Password:",25,330,100,20)
$Liv = GUICtrlCreateCombo("Livello",25,280,60,30)
GUICtrlSetData($Liv,"1|2|3|4|5|6|7|8|9|10")
GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $Enc
$Read = GUICtrlRead($Edit)
GUICtrlSetData($Edit, 'Attendere prego, sto criptando il testo.')
GUICtrlSetData($Edit,_StringEncrypt(1,$Read,GUICtrlRead($Pass),GUICtrlRead($Liv)))
Case $Dec
$read = GUICtrlRead($Edit)
GUICtrlSetData($Edit, 'Attendere prego, sto decriptando il testo.')
GUICtrlSetData($Edit,_StringEncrypt(0,$Read,GUICtrlRead($Pass),GUICtrlRead($Liv)))



EndSwitch
WEnd


Source Criptatore per file
SPOILER (click to view)
#include <guiconstantsex.au3>
#include <windowsconstants.au3>
#Include <string.au3>
#Include <crypt.au3>

$Gui = GuiCreate("CryptatorZ",400,200)
$Enc = GuiCtrlCreateButton("Crypta",25,150,175,30)
$Dec = GUICtrlCreateButton("Decrypta",200,150,175,30)
$Pass = GuiCtrlCreateInput("",25,100,250,30)
$Lab = GUICtrlCreateLabel("Livello",300,80,100,15)
$Liv = GUICtrlCreateCombo("RC4",300,100,80,30)
GUICtrlSetData($Liv,"3DES|AES 128|AES 192|AES 256|DES|RC2")
$Lab = GUICtrlCreateLabel("Scegli la Password:",25,80,100,20)
$Input = GUICtrlCreateLabel("Scegli File",25,10,100,15)
$InFile = GUICtrlCreateInput("",25,25,125,25)
$Pre = GUICtrlCreateButton("...",160,25,30,25)
$Output = GUICtrlCreateLabel("Destinazione",200,10,100,15)
$UnFile = GUICtrlCreateInput("",200,25,125,25)
$UnPre = GUICtrlCreateButton("...",335,25,30,25)

GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $Pre
$File = FileOpenDialog("Scegli File", "", "Tutti i file (*.*;)")
If $File <> "" Then GUICtrlSetData($InFile, $File)
Case $UnPre
$File = FileSaveDialog("Destinazione", "", "Tutti i file (*.*;)")
If $File <> "" Then GUICtrlSetData($UnFile, $File)
;Criptazione
Case $Enc
$Inp = GUICtrlRead($InFile)
If Not FileExists($Inp) Then
MsgBox(16, "Errore", "il file che hai scelto non esiste!")
ContinueLoop
EndIf
$Out = GUICtrlRead($UnFile)
If $Out="" Then
MsgBox(16,"Errore","Devi scegliere prima la destinazione!")
ContinueLoop
EndIf
$algo = 0
Switch GUICtrlRead($Liv)
Case "3DES"
$algo = $CALG_3DES
Case "DES"
$algo = $CALG_DES
Case "RC2"
$algo = $CALG_RC2
Case "RC4"
$algo = $CALG_RC4
Case "AES 128"
If @OSVersion = "WIN_2000" Then
MsgBox(16, "Errore", "Questo algoritmo non è disponibile per questo sistema operativo!")
ContinueLoop
EndIf
$algo = $CALG_AES_128
Case "AES 192"
If @OSVersion = "WIN_2000" Then
MsgBox(16, "Errore", "Questo algoritmo non è disponibile per questo sistema operativo!")
ContinueLoop
EndIf
$algo = $CALG_AES_192
Case "AES 256"
If @OSVersion = "WIN_2000" Then
MsgBox(16, "Errore", "Questo algoritmo non è disponibile per questo sistema operativo!")
ContinueLoop
EndIf
$algo = $CALG_AES_256
EndSwitch
$Password = GUICtrlRead($Pass)
If $Password="" Then
MsgBox(16,"Errore","Inserisci la password!")
ContinueLoop
EndIf

AdlibRegister("Update",333)
$success=_Crypt_EncryptFile($Inp,$Out,$Password,$algo)
If $success Then
MsgBox(0,"Crypt","Cryptazione effettuata con successo!")
Else
Switch @error
Case 1
MsgBox(16,"Fail","Failed to create key")
Case 2
MsgBox(16,"Fail","Impossibile aprire il file")
Case 3
MsgBox(16,"Fail","Impossibile salvare il file in quella destinazione")
Case 4 or 5
MsgBox(16,"Fail","Errore di criptazione")
EndSwitch
EndIf
;Decriptazione
Case $Dec
$InFile2 = GUICtrlRead($InFile)
If Not FileExists($InFIle2) Then
MsgBox(16, "Errore", "Il file da criptare non esiste!")
ContinueLoop
EndIf

$OutFile2 = GUICtrlRead($UnFIle)
If $OutFile2="" Then
MsgBox(16,"Errore","La destinazione è errata!")
ContinueLoop
EndIf

$algo = 0
Switch GUICtrlRead($Liv)
Case "3DES"
$algo = $CALG_3DES
Case "DES"
$algo = $CALG_DES
Case "RC2"
$algo = $CALG_RC2
Case "RC4"
$algo = $CALG_RC4
Case "AES 128"
If @OSVersion = "WIN_2000" Then
MsgBox(16, "Errore", "Questo algoritmo non è disponibile per questo sistema operativo!")
ContinueLoop
EndIf
$algo = $CALG_AES_128
Case "AES_192"
If @OSVersion = "WIN_2000" Then
MsgBox(16, "Errore", "Questo algoritmo non è disponibile per questo sistema operativo!")
ContinueLoop
EndIf
$algo = $CALG_AES_192
Case "AES_256"
If @OSVersion = "WIN_2000" Then
MsgBox(16, "Errore", "Questo algoritmo non è disponibile per questo sistema operativo!")
ContinueLoop
EndIf
$algo = $CALG_AES_256
EndSwitch
$password2 = GUICtrlRead($Pass)
If $password2="" Then
MsgBox(16,"Errore","Inserisci una password")
ContinueLoop
EndIf

AdlibRegister("Update",333)
$success=_Crypt_DecryptFile($InFile2,$OutFile2,$password2,$algo)
If $success Then
MsgBox(0,"Success","Decriptazione effettuata con successo!")
Else
Switch @error
Case 1
MsgBox(16,"Fail","Failed to create key")
Case 2
MsgBox(16,"Fail","Couldn't open source file")
Case 3
MsgBox(16,"Fail","Couldn't open destination file")
Case 4 or 5
MsgBox(16,"Fail","Encryption error")
EndSwitch
EndIf


AdlibUnRegister("Update")
WinSetTitle($Gui,"","File Encrypter")
EndSwitch
WEnd
 
Top
ACIDBURN16
CAT_IMG Posted on 1/6/2010, 19:55     +1   -1




Bravo buon lavoro ;)
 
Top
` K u r t ·
CAT_IMG Posted on 1/6/2010, 20:00     +1   -1




Uniscili, no? Come ho fatto io con PEncrypter :)
 
Top
Kira95
CAT_IMG Posted on 2/6/2010, 08:08     +1   -1




Ok, mi metto al lavoro...
 
Top
3 replies since 1/6/2010, 19:06   148 views
  Share