I am trying to simulate a brute force attack (to explain how it works). I want to display the process to crack a password of “abc”. This requires me to show what password is being attempted to crack the “abc” password at that moment (so starting at “a” then “b” then “c” until it gets to “abc”.
My question is how I can get the password being attempted at that moment, displayed on screen, whilst the code is running the code?
Would it be easier to make a video that shows this process?
Thanks
Jamie
edit Here is the code I have written with comments explaining each part. Hope this helps with me explaining the problem.
thanks for the answers so far
// the simulation
Button btnSim = (Button) findViewById(R.id.btnSim);
btnSim.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
TextView currentSimPword = (TextView) findViewById(R.id.currentSimPword);
int i = 0;//i would be replaced by the string it is trying e.g. a then b then c
//until it reaches abc
while (i < 100) {//this would loop until i reaches abc
//this would show what the brute force attack is attempting against the real password
currentSimPword.setText("comparing password " + i + " against the real password 'abc'");
//at this point i want it to be displayed on screen (and at every time it reaches here)
//here i would need a way to pause it long enough for the user to see what is being tried
//this increases the password tried by one each time in the loop
i = i + 1;
}
}
});