Skip to content

Commit

Permalink
Strength bar
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeSteinbach authored and nbaars committed Mar 26, 2019
1 parent 44a9a77 commit 06a8bd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class CrossSiteScriptingLesson3 extends AssignmentEndpoint {
public AttackResult completed(@RequestParam String editor) {
//https://github.com/OWASP/owasp-java-encoder
//maybe better idea for assignment
//<e:forHtml value="${param.title}" />

String line1 ="";
String line2 ="";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ public AttackResult completed(@RequestParam String password) {
output.append("<b>Your Password: </b>" + password + "</br>");
output.append("<b>Length: </b>" + password.length()+ "</br>");
output.append("<b>Estimated guesses needed to crack your password: </b>" + df.format(strength.getGuesses())+ "</br>");
output.append("<b>Score: </b>" + strength.getScore()+ "/5 </br>");
output.append("<b>Score: </b>" + strength.getScore()+ "/5");
if(strength.getScore()<=1){
output.append("<div style=\"background-color:red;width: 200px;\">&nbsp;</div></br>");
} else if(strength.getScore()<=3){
output.append("<div style=\"background-color:orange;width: 200px;\">&nbsp;</div></br>");
} else{
output.append("<div style=\"background-color:green;width: 200px;\">&nbsp;</div></br>");
}
output.append("<b>Estimated cracking time in seconds: </b>" + calculateTime((long) strength.getCrackTimeSeconds().getOnlineNoThrottling10perSecond()));

if(strength.getScore() >= 4)
Expand Down

0 comments on commit 06a8bd8

Please sign in to comment.