Wednesday, February 27, 2013

How to crack a password with the use of a dictionary.

How to crack a password with the use of a dictionary.


Use brute force to enter a protected program might work after a period XYZ. Even with the most powerful computer, brute force is the final solution to be used to break a password. What are cracks computer to successfully pass through security without passwords? One answer is to use a dictionary.
In practice, people use passwords relatively easy to remember. People use words that make them remember their childhoods, associate numbers or meet some sort of syntax to invent their password.



Do you know the percentage of people who use the password 1234 to secure their documents? How many people do you employ that names of persons or animals for their passwords? How do you think people reuse the same password for different email accounts, Facebook, Twitter, Flirk, Gmail, Alleluia! Imagine for a moment that the bad people accumulating databases of passwords and use them to enter an email account. Imagine that the world's computers attempting to access your Facebook account periodically passwords most likely surveyed around the world!

I developed a code very fictitious and foolish to create a collection of words from a text file. I sort of elementary form and I organized so that the most popular terms can be found at the top of list. Obviously with a smarter algorithm, it is possible to generate a high-quality dictionary to break a real program. Here is the program that creates a collection of words and then organize them as you go. The performance of this code is slow, but easy to understand.
Note that the program is available for download at the end of this article. Feel free to modify it and have fun with this unoptimized code.
The operation is relatively simple. Start the application and craft a text file. In the project download, there is a sample text file to test. Obviously, the value assigned to the key words found can be considered mediocre, but better to have 10 million words to try that 10 million passwords insignificant.


    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        If OpenFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
            TextBox1.Text = OpenFileDialog.FileName
            Dim oReader As New System.IO.StreamReader(TextBox1.Text)
            TextBox2.Text = ""
            Do
                TextBox2.Text = TextBox2.Text & oReader.ReadLine & vbCrLf
                mHash.UnionWith(TextBox2.Text.Trim.Split(" "))
                Dim aString() As String
                Dim index1 As Integer
                Dim index2 As Integer
                Dim indexA As Integer
                Dim indexB As Integer
                aString = TextBox2.Text.Trim.Split(" ")

                For index1 = 0 To aString.Length - 1 Step 1
                    indexA = -1
                    indexB = -1
                    For index2 = 0 To mCollection.Count - 1 Step 1
                        If mCollection.Item(index2) = aString(index1) Then
                            'mCollection.Item(aString(index1)
                            indexA = index2
                            indexB = index1
                            index2 = mCollection.Count
                            'index1 = aString.Length
                        End If

                    Next
                    If indexA > 0 Then 'ça veut dire que c'est trouvé
                        mCollection.RemoveAt(indexA)
                        mCollection.Insert(1, aString(index1))
                    Else
                        If indexB <> -1 Then
                            mCollection.Add(aString(indexB))
                        Else
                            mCollection.Add(aString(index1))
                        End If
                    End If
                Next
              

            Loop Until oReader.EndOfStream = True
            'Me.Text = Me.Text & mHash.Count
            oReader.Close() 'important to close the open file
        End If
    End Sub



Download the sample project: ReadTextFileSample.zip


No comments:

Post a Comment