TGC Codebase Backup



wep key generator by Nitro Methane

7th May 2004 17:42
Summary

A simple wep key generator for setting up wep on wireless networks.



Description

Also very useful for changing your wep key on a weekly basis.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem *****************************************************************************************
rem * 64 bit and 128 bit wep key generator                                                  *
rem * By Thomas L. Simpson                                                                  *
rem * 5 - 07 - 04   Friday                                                                  *
rem * For dlink broadband wireless routers                                                  *
rem *****************************************************************************************

cls 0
randomize timer()
sync on
sync rate 30
dim key$(26)

do
print "This is a 64 and 128 bit wep key generator."
print "File will be written out as a text file to"
print "where the .dba file is saved."
input "Please choose 1 for 64 bit or 2 for 128 bit key ",key
if key = 1 then gosub key1
if key = 2 then gosub key2
cls
sync
loop

key1:
CLS 0
  for k = 1 to 10
  key$(k) = str$(rnd(15))
  if key$(k) = "10" then key$(k) = "A"
  if key$(k) = "11"  then key$(k) = "B"
  if key$(k) = "12" then key$(k) = "C"
  if key$(k) = "13" then key$(k) = "D"
  if key$(k) = "14" then key$(k) = "E"
  if key$(k) = "15" then key$(k) = "F"
next k

print "Here is your 64 Bit wep key"
wepkey$ = key$(1)+key$(2)+key$(3)+key$(4)+key$(5)+key$(6)+key$(7)+key$(8)+key$(9)+key$(10)
print wepkey$
gosub store_wep_key
Print "Press any key to continue"
print "Press Escape to exit the program"
suspend for key
return

key2:
cls 0
for k = 1 to 26
  key$(k) = str$(rnd(15))
  if key$(k) = "10" then key$(k) = "A"
  if key$(k) = "11"  then key$(k) = "B"
  if key$(k) = "12" then key$(k) = "C"
  if key$(k) = "13" then key$(k) = "D"
  if key$(k) = "14" then key$(k) = "E"
  if key$(k) = "15" then key$(k) = "F"
next k
print "Here is your 128 bit wep key"
first$ = key$(1)+key$(2)+key$(3)+key$(4)+key$(5)+key$(6)+key$(7)+key$(8)+key$(9)+key$(10)+key$(11)+key$(12)+key$(13)
second$ = key$(14)+key$(15)+key$(16)+key$(17)+key$(18)+key$(19)+key$(20)+key$(21)+key$(22)+key$(23)+key$(24)+key$(25)+key$(26)
wepkey$ = first$+second$
print wepkey$
gosub store_wep_key
print "Press any key to continue"
print "Press Escape to exit the program"
suspend for key
return

store_wep_key:
   filename$ = "wep key.txt"
    if file exist(filename$) then delete file filename$
    open to write 1, filename$
      write string 1, "This is your wep key."
      write string 1, wepkey$
    close file 1
return