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