FASTEST way to try all strings (a until ZZZZZZZZZZZZZZZZZZZZZZZZ)

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: DraguVaso (pietercoucke_at_hotmail.com)
Date: 09/28/04


Date: Tue, 28 Sep 2004 10:04:34 +0200

Hi,

I need to find the FASTEST way to get a string in a Loop, that goes from "a"
to "ZZZZZZZZZZZZZZZZZ".
So it has to go like this:

a
b
...
z
A
...
Z
aa
ab
...
az
aA
...
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

So it has to try every combination with all the 26 letters, making a
difference between upper case and lower case, and the space (" ") has to be
included too.

Does anybody knows a way to do this?

I do not need this to hack any password or stuff liek this: I'm working with
the SDK of the Belgian governemnet for the electronic identity card. For
some @%£&§*$!! reason these guys made some big mistakes in there
documentation, and used the parameters with the info on a stupid way. Half
of them aren't working.... So the only ways to find out the missing
paramters is:
1. ask them for info, but they seem to be to stupid to knwo anything about
the stuff they made themselves...
2. Try avery combination of letters... So that's what I want to do :-)

I came up with this: but it doesn't work as fast as I want to...

            dblBegin = 0
            dblEnd = 52 ^ 30
            For dblTeller = dblBegin To dblEnd
                strT = GiveWord()
                TestValue(strT)
                txtWord.Text = strT
                Application.DoEvents()
            Next

    Private Function GiveWord() As String
        Dim strA As String = ""
        Dim dblRest As Double
        Dim dblQuotient As Double
        dblQuotient = dblTeller
        Do
            dblRest = dblQuotient Mod 53
            '1-26 = a-z
            '27-52 = A-Z
            If dblRest = 0 Then
                dblRest = 32 'space
            ElseIf dblRest < 27 Then
                dblRest = dblRest + 96
            Else
                dblRest = dblRest + 38
            End If
            strA = Chr(dblRest) & strA
            dblQuotient = dblQuotient \ 53
        Loop Until dblQuotient = 0
        GiveWord = strA
    End Function



Relevant Pages

  • FASTEST way to try all strings (a until ZZZZZZZZZZZZZZZZZZZZZZZZ)
    ... I need to find the FASTEST way to get a string in a Loop, ... and used the parameters with the info on a stupid way. ... Try avery combination of letters... ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Help, its my first ASM homework
    ... > letters in the string you input. ... The main problem is that you are using LOOP to count off the ...
    (comp.lang.asm.x86)
  • Re: Stripping letters from filename
    ... I need to do a loop that starts stripping the letters from the front of this file name until it reaches the "Cat" part. ... one more thing you might be able to help with: I've got a string of text in a label. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: validates characters
    ... > the only thing that should be valid is letters and spaces ... the way to do this is to loop through all the characters of the string ... As soon as you find an invalid character then you know ...
    (comp.lang.cpp)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... put them in stupid places. ... Programming is difficult (as you must surely appreciate, ... > strings will be in the range 1...1000 characters. ... impose an artificially small limit on string length." ...
    (comp.programming)