Question: For no particular reason, other than I am interesting in cryptography and computing, I would like to make my own brute force program in Java or Visual Basic or C# to see if it can crack a password. I am not interested in performance and I am aware that it is a totally impractical method - it's just a bit of a fun project to be honest. However, I've only got a rough idea in my head and I can't even put it into psuedocode. I'm most proficient in Java but even if somebody could provide me with the psuedocode that'd be great!

I don't want to provide the program with a length, but I'll provide a maximum length. I know that the program will have to do a lot of work, but I do also think I am overthinking it a little.

Answer: 
Ok, so I just found an example what I wanted to do in C++ and I've managed to convert it to the following Visual Basic .NET code, which works perfectly. However the output seems a bit slow and I'd have thought the program would have used near 100% processing power, but it isn't. Could somebody tell me why this is and how I could change it please?

```
Public Class Form1
    Dim chars() As Char = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYX".ToCharArray
    Dim csize As Integer = chars.Length - 1
    Dim upto As String
    Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
        upto = "                                                  "

        Dim max_length As Integer = 50

        For i = 1 To max_length
            bf_recursion(0, i)
            Update()
        Next

    End Sub

    Private Sub bf_recursion(ByVal index As Integer, ByVal depth As Integer)
        Dim current() As Char = upto.ToCharArray()

        For i = 0 To csize
            current(index) = chars(i)
            upto = CStr(current)

            Console.WriteLine(CStr(current))
            '\\lblOutput.Text = CStr(current)

            If index <> (depth - 1) Then
                bf_recursion(index + 1, depth)
            End If
        Next
    End Sub
End Class

```
```
while (true) 
{

 string[] mystring = new string[27];
                    mystring[0] = "";
                    mystring[1] = "a";
                    mystring[2] = "b";
                    mystring[3] = "c";
                    mystring[4] = "d";
                    mystring[5] = "e";
                    mystring[6] = "f";
                    mystring[7] = "g";
                    mystring[8] = "h";
                    mystring[9] = "i";
                    mystring[10] = "j";
                    mystring[11] = "k";
                    mystring[12] = "l";
                    mystring[13] = "m";
                    mystring[14] = "n";
                    mystring[15] = "o";
                    mystring[16] = "p";
                    mystring[17] = "q";
                    mystring[18] = "r";
                    mystring[19] = "s";
                    mystring[20] = "t";
                    mystring[21] = "u";
                    mystring[22] = "v";
                    mystring[23] = "w";
                    mystring[24] = "x";
                    mystring[25] = "y";
                    mystring[26] = "z";

                    if (counter == 27)
                    {
                        counter = 0;
                        counter2++;
                    }

                    if (counter2 == 27)
                    {
                        counter2 = 0;
                        counter3++;
                    }

                    if (counter3 == 27)
                    {
                        counter3 = 0;
                        counter4++;
                    }

                    if (counter4 == 27)
                    {
                        counter4 = 0;
                        counter5++;
                    }

                    if (counter5 == 27)
                    {
                        counter5 = 0;
                        counter6++;
                    }

                    if (counter6 == 27)
                    {
                        throw new Exception();
                    }

                    guessedpassword =  mystring[counter6] + mystring[counter5] + mystring[counter4] + mystring[counter3] + mystring[counter2] + mystring[counter];

                    counter++;
    }

```

Here is some code i have written. It is very inefficient at cracking, but is simple.