Jump to content
Sign in to follow this  

Authentication Device

Recommended Posts


I was really bored, so that is why I made this it could be better but got bored of making it :o

I do not play World of Warcraft but was curious of this little device, I can not make a real working one because I do not have a server to mess around with this project and I could of made two Autoit scripts to have a proof example but that is when the boredom really sunk in :)


#include <String.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $Token , $Source = @ScriptDir & "\UniqueKey.txt"

FileWrite($Source , _UniqueKey()) 

$GUI = GUICreate("Security Token", 200, 20)
$Token = GUICtrlCreateInput("" , 0, 0, 100, 20)
$Gen = GUICtrlCreateButton("Gen" , 100 , 0 , 100 , 20)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
        Case $Gen

Function Name - Key

This Function receives the unqie key and converts 
it to a key that the server would be using.

Func _Key($UniqueKey)
    I am cheating by using _StringEncrypt you can
    use your own Encryption method.
    I am also cheating by using random for the 
    _StringEncrypt text part.
    $Encrypt = _StringEncrypt(1 , _Random() , $UniqueKey , 1)
    GUICtrlSetData($Token , StringTrimRight($Encrypt , StringLen($Encrypt) -6)) ; I cut the return string to 6 numbers/letters or less because I want a small return value.

Function Name - Unique Key

This Function is to generate random alphabetical letters,
the purpose of this is to act like the numbers/letters found
on the back of Blizzards authentication tokens.

Func _UniqueKey()
$Key = 0
$String = ""
    $Letter = Chr(Random(Asc("A"), Asc("Z"), 1))
    $String &= $Letter
    $Key = $Key +1
Until $Key = 6
Return StringTrimLeft($String , 3) & "-" & StringTrimRight($String , 3)

Function Name - Random

This is my Random Function.

1 - Numbers
2 - Lower case
3 - Capitals

Error, no idea why lower case isn't working.

Func _Random()
    $RanString = ""
    $Ran = Random(1 , 3 , 1)
    If $Ran = 1 Then
        $Num = Random(0 , 9 , 1)
        $RanString &= $Num
    ElseIf $Ran = 2 Then
        $Lower = Random(Asc("a") , Asc("z") , 1)
        $RanString &= $Lower
    ElseIf $Ran = 3 Then
        $Caps = Random(Asc("A") , Asc("Z") , 1)
        $RanString &= $Caps
    Return $RanString

Share this post

Link to post
Share on other sites

hm so it creates a "random" key not a bad idea this could be useful, maybe ill work on a script to verify if the keys came from this script that would be kinda fun.. but not now im still tryin to finish 1 project lol



A great place to start Autoit 1-2-3

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.