Documents

Submitted by: Submitted by

Views: 152

Words: 348

Pages: 2

Category: Other Topics

Date Submitted: 02/18/2013 12:59 AM

Report This Essay

A Passwords Cracking Program

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.

The passwords generating procedure is put 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 1 millisecond, so a value of 1000 is 1 second; the smaller the value, the shorter the interval. However, do not set the timer to zero because if you do that, the timer will not start. 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. 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 CodeDim password As IntegerDim crackpass As Integer Private Sub Command1_Click()Timer1.Enabled = TrueEnd Sub Private Sub Form_Load()password = 123End Sub Private Sub Timer1_Timer()Randomize Timercrackpass = Int(Rnd * 100) + 100If crackpass = password ThenTimer1.Enabled = FalseText1.Text = crackpassLabel1.Visible = TrueLabel1.Caption =...