VB2017 VB2015 VB2013 VB2012 VB2010 VB2008 VB6 VB Sample Codes 中文VB About Us

A Passwords Cracking Program

This passwords cracker created using VB6 can generate possible passwords and compare each of them with the actual password. If the generated password found to be equal to the actual password, the login will be successful. In this program, a timer is inserted into the form and it is used to do a repetitive job of generating the passwords.

The passwords generating procedure is placed under the timer1_Timer () event so that the procedure is repeated after every interval. The interval of the timer can be set in its properties window where a value of 1 is equivalent to 1 millisecond. Therefore a value of 1000 is equivalent to 1 second; the smaller the value, the shorter the interval. The Timer1.Enabled property is set to false so that the program will only start generating the passwords after you click on the command button. Rnd is a VB function that generates a random number between 0 and 1. Multiplying Rnd by 100 will obtain a number between 0 and 100. Int is a VB function that returns an integer by ignoring the decimal part of that number.

Therefore, Int(Rnd*100) will produce a number between 0 and 99, and the value of Int(Rnd*100)+100 will produce a number between 100 and 199. Finally, we use If...Then...Else to check whether the generated password is equal to the actual password; if they are equal, the passwords generating process will be terminated by setting the Timer1.Enabled property to false.

The Video Demo

The Code

Dim password As Integer

Dim crackpass As Integer

Private Sub Command1_Click()

Timer1.Enabled = True

End Sub

Private Sub Form_Load()

password = 123

End Sub

Private Sub Timer1_Timer()

crackpass = Int(Rnd * 100) + 100

If crackpass = password Then

Timer1.Enabled = False

Text1.Text = crackpass

Label1.Visible = True

Label1.Caption = "Password Cracked!Login Successful!"


Text1.Text = crackpass

Label1.Visible = True

Label1.Caption = "Please wait..."

End If

End Sub


Copyright©2008 Dr.Liew Voon Kiong. All rights reserved |Contact|Privacy Policy