Crypter/Decrypter [NO _StringEncrypt ]

« Older   Newer »
  Share  
Ezi_
CAT_IMG Posted on 14/2/2010, 18:43     +1   -1




Ciao a tutti ecco un programma in grado di cryptare/decryptare stringhe utilizzando
un "algoritmo" creato da me...

CODICE
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include<string.au3>

$Form1 = GUICreate("Crypter/Decrypter", 561, 236, 192, 124)
$Label1 = GUICtrlCreateLabel("Crypter e Decrypter", 160, 8, 249, 31)
GUICtrlSetFont(-1, 14, 800, 2, "Arial Black")
GUICtrlSetColor(-1, 0x000080)
$Label2 = GUICtrlCreateLabel("Inserisci frase da criptare", 8, 40, 159, 19)
GUICtrlSetFont(-1, 8, 800, 0, "Arial Black")
$Edit1 = GUICtrlCreateEdit("", 8, 64, 257, 121)

$Label3 = GUICtrlCreateLabel("Inserisci frase da decriptare", 288, 40, 173, 19)
GUICtrlSetFont(-1, 8, 800, 0, "Arial Black")
$Edit2 = GUICtrlCreateEdit("", 288, 64, 257, 121)

$Button1 = GUICtrlCreateButton("Crypta ->", 8, 192, 257, 33, $WS_GROUP)
GUICtrlSetFont(-1, 8, 800, 0, "Arial Black")
$Button2 = GUICtrlCreateButton("<- Decrypta", 288, 192, 257, 33, $WS_GROUP)
GUICtrlSetFont(-1, 8, 800, 0, "Arial Black")
GUISetState(@SW_SHOW)

While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
               Case $GUI_EVENT_CLOSE
                       Exit
               case $button1
                       $crypt = Crypt(guictrlread($edit1))
                       guictrlsetdata($edit2,$crypt)
                       
               case $button2
                       $decrypt = DeCrypt(guictrlread($edit2))
                       guictrlsetdata($edit1,$decrypt)
EndSwitch
WEnd
func DeCrypt($ins)
$stringa =  $ins
$frase = 0
$leng = stringlen($stringa)
dim $arlet[26] = ['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']
dim $arsimb[15] = ['!','"','#','$','%','&','(',')','*',',','-','.','/']
dim $ascii[9000]
$c = 0
dim $num1[4000000]
Do
       $c=$c+1
       $read = stringleft($stringa,1)
       $stringa = stringreplace($stringa,$read,"",1)
       $arry = stringtoasciiarray($read)
       if $arry[0] > 32 and $arry[0] < 48 Then
               $frase = $frase+1
       Else
               
               $num1[$frase] = $num1[$frase]&$read
       EndIf
       
until $c = $leng
$frase = $frase - 1
$bvc = 0
Do
$lase = 0
$c = 0
$long = stringlen($num1[$bvc])
$primo = ""
$secondo = ""
Do
       $c=$c+1
       $read = stringleft($num1[$bvc],1)
       $num1[$bvc] = stringreplace($num1[$bvc],$read,"",1)
       $arry = stringtoasciiarray($read)
       if $arry[0] > 96 and $arry[0] < 123 Then
               $lase = $lase+1
       Else
               if $lase = 0 Then
               $primo = $primo&$read
       Else
               $secondo = $secondo&$read
       EndIf
       
       EndIf
       
until $c = $long

$ascii[$bvc] = $primo/$secondo
$bvc = $bvc+1
Until $bvc = $frase+1
$string = stringfromasciiarray($ascii)
return $string
endFunc
func Crypt($insert)
dim $arlet[26] = ['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']
dim $arsimb[15] = ['!','"','#','$','%','&','(',')','*',',','-','.','/']
dim $random[900000]
dim $letran[900000]
dim $simbran[900000]
dim $b[9000000]
dim $com[9000000]
dim $total
dim $a
isarray($a)
$stringa = $insert
if $stringa = "" Then
       msgbox(64,"Error!","Errore!")
       Exit
EndIf
Local $a = StringToASCIIArray($stringa)
$j = 0
$stri = $stringa&"ç*[#§ùmm;"
Do
       
       $XDXD = stringleft($stri,$j)
       $j = $j+1
Until stringinstr($XDXD,"ç*[#§ùmm;")
$numero = $j - 10
$cont = 0
dim $string
Do
$random[$cont] = int(random(1,76))
$l = $a[$cont]*$random[$cont]
$letran[$cont] = int(random(0,25))
$simbran[$cont] = int(random(0,14))
$com[$cont] = $l&$arlet[$letran[$cont]]&$random[$cont]&$arsimb[$simbran[$cont]]
$total = $total & $com[$cont]
$cont = $cont+1
until $cont = $numero
return $total
EndFunc


Edited by Ezi_ - 19/2/2010, 14:50
 
Top
Lahace
CAT_IMG Posted on 15/2/2010, 10:40     +1   -1




non male :D
 
Top
Gianlu-thebest
CAT_IMG Posted on 19/2/2010, 14:18     +1   -1




ma non decripta 0.o?
 
Top
Kurt_Black_hat 2.0
CAT_IMG Posted on 19/2/2010, 14:48     +1   -1




Errore nel decriptare.
 
Top
Ezi_
CAT_IMG Posted on 19/2/2010, 14:51     +1   -1




Avevo scritto $is al posto di $ins xD Adesso dovrebbe funzionare
 
Top
Kurt_Black_hat 2.0
CAT_IMG Posted on 19/2/2010, 14:56     +1   -1




CITAZIONE (Ezi_ @ 19/2/2010, 14:51)
Avevo scritto $is al posto di $ins xD Adesso dovrebbe funzionare

Sì xD
Thanks.

Edit:
Se mi applichi questo algoritmo in PHP, sono pronto a finanziarti una statua d'oro a grandezza naturale.
 
Top
Gianlu-thebest
CAT_IMG Posted on 19/2/2010, 15:00     +1   -1




Wow veramente ottimo!
 
Top
6 replies since 14/2/2010, 18:43   138 views
  Share