This is a password cracker application created using Excel VBA 365(can use older version). This app can generate possible passwords and check each of them with the actual password. If the generated password found to be equal to the actual password, login will be successful and a secret word will be revealed.
In this application, we use a Do loop and the DoEvents command to iterate through the proces of generating the passwords.
The password is a combination of three alphanumeric characters(you can use more characters), so we need to generate random alphanumeric characters using the chr() functions. The ASCII code for all alphanumeric characters are from 33 to 126. Therefore, we need to generate random alphanumeric characters using the formula:
Int(Rnd * 93) + 33
Private Sub Cmd_Generate_Click() Dim crackpass, password, secretword As String Dim num1, num2, num3 As Integer password = "#@9" secretword = "Happy Birthday" Do num1 = Int(Rnd * 93) + 33 num2 = Int(Rnd * 93) + 33 num3 = Int(Rnd * 93) + 33 crackpass = Chr(num1) & Chr(num2) & Chr(num3) TxtPW.Text = crackpass If crackpass = password Then Exit Do End If DoEvents Loop Lbl_Msg.Caption = "Password Cracked!Login Successful!" Cells(2, 2) = secretword End Sub