Skip to content

Instantly share code, notes, and snippets.

@vanhoefm
Created March 22, 2015 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanhoefm/eb833025c60fec808042 to your computer and use it in GitHub Desktop.
Save vanhoefm/eb833025c60fec808042 to your computer and use it in GitHub Desktop.
Codegate 2015
function validate() {
var x = document.forms["formxx"]["pwz"].value;
alert(x);
if (x == null || x == "") {
alert("Password must be filled out");
return false;
}
if (!x.match(/^[A-Za-z]+$/)) {
alert("Bad charset");
return false;
}
if (!sha1(x).match(/^ff7b948953ac/))
{
return false;
}
alert("Flag: " + x);
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment