|
|
This Visual Basic program is a passwords cracker where it can generate possible passwords and compare each of them with the actual password; and if the generated password found to be equal to the actual password, 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.
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. Randomize timer is an essential statement which ensures that the generated numbers are truly random. Finally, the program uses If…Then…Else to check whether the generated password is equal the actual password or not; and if they are equal, the passwords generating process will be terminated by setting the Timer1.Enabled property to false. The Program 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() Randomize 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!"
Else Text1.Text = crackpass Label1.Visible = True Label1.Caption = "Please wait..." End If End Sub
|