voilà l'autre jours je m'ennuyais donc je me suis codé un petit générateur de clef wep / wpa qui enregistre dans le presse papier.
je ne sais pas si il est vraiment au norme, cependant pour les clef wep j'ai respecter la taille des caractère.
ex: 64bits = 10 caractères
128bits = 26 caractères
et wpa je ne pense pas qui ai de limites.
voici la source non compiler car sous linux et windows sa n'est pas la même chose.
si sa peut donnée des idées a quel qu'un:
Code : Tout sélectionner
;################################
;################################
;##### venom 10/09/2009 purebasic V 4.30 #####
;################################
;################################
;- Window Constants
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
Enumeration
#Text_0
#ComboBox
#ComboBox_0
#ButtonGadget_0
#EditorGadget_0
EndEnumeration
;------ fenetre -------
If OpenWindow(#Window_0, 0, 0, 350, 140, "Key Wifi Générator", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
TextGadget(#Text_0, 10, 5, 330, 25, "générateure de clé wep 64/128 Bits ", #PB_Text_Center)
ComboBoxGadget(#ComboBox, 10, 5, 330, 25, 0)
AddGadgetItem(#ComboBox, 0, "Protection wep")
AddGadgetItem(#ComboBox, 1, "Protection wpa")
SetGadgetState(#ComboBox, 0)
ComboBoxGadget(#ComboBox_0, 10, 35, 330, 25, 0)
AddGadgetItem(#ComboBox_0, 0, "64 Bits")
AddGadgetItem(#ComboBox_0, 1, "128 Bits")
SetGadgetState(#ComboBox_0, 0)
ButtonGadget(#ButtonGadget_0, 10, 70, 330, 25, "Générer une clé et copier dans le presse-papier", 0)
EditorGadget(#EditorGadget_0, 10, 105, 330, 25, #PB_Editor_ReadOnly)
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadget()
;------ wep 64 -------
Case #ButtonGadget_0
wep = GetGadgetState(#ComboBox)
bits = GetGadgetState(#ComboBox_0)
If bits + wep = 0
ClearGadgetItems(#EditorGadget_0)
cle1$ = Mid("ABCDEF0123456789", Random(16), 1)
cle2$ = Mid("ABCDEF0123456789", Random(16), 1)
cle3$ = Mid("ABCDEF0123456789", Random(16), 1)
cle4$ = Mid("ABCDEF0123456789", Random(16), 1)
cle5$ = Mid("ABCDEF0123456789", Random(16), 1)
cle6$ = Mid("ABCDEF0123456789", Random(16), 1)
cle7$ = Mid("ABCDEF0123456789", Random(16), 1)
cle8$ = Mid("ABCDEF0123456789", Random(16), 1)
cle9$ = Mid("ABCDEF0123456789", Random(16), 1)
cle10$ = Mid("ABCDEF0123456789", Random(16), 1)
AddGadgetItem(#EditorGadget_0, 0, cle1$+cle6$+" "+cle8$+cle3$+" "+cle5$+cle4$+" "+cle7$+cle2$+" "+cle9$+cle10$, 0)
SetClipboardText(GetGadgetItemText(#EditorGadget_0, 0))
EndIf
;------ wep 128 -------
wep = GetGadgetState(#ComboBox)
bits = GetGadgetState(#ComboBox_0)
If bits = 1 And wep = 0
ClearGadgetItems(#EditorGadget_0)
cle1$ = Mid("ABCDEF0123456789", Random(16), 1)
cle2$ = Mid("ABCDEF0123456789", Random(16), 1)
cle3$ = Mid("ABCDEF0123456789", Random(16), 1)
cle4$ = Mid("ABCDEF0123456789", Random(16), 1)
cle5$ = Mid("ABCDEF0123456789", Random(16), 1)
cle6$ = Mid("ABCDEF0123456789", Random(16), 1)
cle7$ = Mid("ABCDEF0123456789", Random(16), 1)
cle8$ = Mid("ABCDEF0123456789", Random(16), 1)
cle9$ = Mid("ABCDEF0123456789", Random(16), 1)
cle10$ = Mid("ABCDEF0123456789", Random(16), 1)
cle11$ = Mid("ABCDEF0123456789", Random(16), 1)
cle12$ = Mid("ABCDEF0123456789", Random(16), 1)
cle13$ = Mid("ABCDEF0123456789", Random(16), 1)
cle14$ = Mid("ABCDEF0123456789", Random(16), 1)
cle15$ = Mid("ABCDEF0123456789", Random(16), 1)
cle16$ = Mid("ABCDEF0123456789", Random(16), 1)
cle17$ = Mid("ABCDEF0123456789", Random(16), 1)
cle18$ = Mid("ABCDEF0123456789", Random(16), 1)
cle19$ = Mid("ABCDEF0123456789", Random(16), 1)
cle20$ = Mid("ABCDEF0123456789", Random(16), 1)
cle21$ = Mid("ABCDEF0123456789", Random(16), 1)
cle22$ = Mid("ABCDEF0123456789", Random(16), 1)
cle23$ = Mid("ABCDEF0123456789", Random(16), 1)
cle24$ = Mid("ABCDEF0123456789", Random(16), 1)
cle25$ = Mid("ABCDEF0123456789", Random(16), 1)
cle26$ = Mid("ABCDEF0123456789", Random(16), 1)
AddGadgetItem(#EditorGadget_0, 0, cle1$+cle6$+" "+cle8$+cle3$+" "+cle5$+cle4$+" "+cle7$+cle2$+" "+cle9$+cle10$ +" "+cle11$+cle12$+" "+cle13$+cle14$+" "+cle15$+cle26$+" "+cle25$+cle23$+" "+cle24$+cle22$+" "+cle20$+cle21$+" "+cle18$+cle19$+" "+cle16$+cle17$, 0)
SetClipboardText(GetGadgetItemText(#EditorGadget_0, 0))
EndIf
;------ end wep-------
;------ wpa 64 -------
wpa = GetGadgetState(#ComboBox)
bits = GetGadgetState(#ComboBox_0)
If wpa = 1 And bits = 0
ClearGadgetItems(#EditorGadget_0)
cle1$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle2$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle3$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle4$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle5$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle6$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle7$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle8$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle9$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle10$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle11$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle12$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle13$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle14$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle15$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
AddGadgetItem(#EditorGadget_0, 0, cle1$+cle2$+cle3$+cle4$+cle5$+cle6$+cle7$+cle8$+cle9$+cle10$ +cle11$+cle12$+cle13$+cle14$+cle15$, 0)
SetClipboardText(GetGadgetItemText(#EditorGadget_0, 0))
EndIf
;------ wpa 128 -------
wpa = GetGadgetState(#ComboBox)
bits = GetGadgetState(#ComboBox_0)
If wpa And bits = 1
ClearGadgetItems(#EditorGadget_0)
cle1$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle2$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle3$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle4$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle5$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle6$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle7$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle8$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle9$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle10$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle11$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle12$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle13$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle14$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle15$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle16$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle17$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle18$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle19$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle20$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle21$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle22$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle23$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle24$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle25$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle26$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle27$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle28$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle29$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle30$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle31$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle32$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle33$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle34$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
cle35$ = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>()+-éèç[]#&@", Random(50), 1)
AddGadgetItem(#EditorGadget_0, 0, cle1$+cle6$+cle8$+cle3$+cle5$+cle4$+cle7$+cle2$+cle9$+cle10$ +cle11$+cle12$+cle13$+cle14$+cle15$+cle26$+cle25$+cle23$+cle24$+cle22$+cle20$+cle21$+cle18$+cle19$+cle16$+cle17$ +cle27$+cle28$+cle29$+cle30$+cle31$+cle32$+cle33$+cle34$+cle35$, 0)
SetClipboardText(GetGadgetItemText(#EditorGadget_0, 0))
EndIf
;------ end wpa -------
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
;------ end fenetre -------

@++