diff options
Diffstat (limited to 'django/srpproject/templates')
-rw-r--r-- | django/srpproject/templates/login.html | 34 | ||||
-rw-r--r-- | django/srpproject/templates/register.html | 42 |
2 files changed, 76 insertions, 0 deletions
diff --git a/django/srpproject/templates/login.html b/django/srpproject/templates/login.html new file mode 100644 index 0000000..f949663 --- /dev/null +++ b/django/srpproject/templates/login.html @@ -0,0 +1,34 @@ +<html> + <head> + <script src="{{ static_files }}/SHA256.js"></script> + <script src="{{ static_files }}/prng4.js"></script> + <script src="{{ static_files }}/rng.js"></script> + <script src="{{ static_files }}/jsbn.js"></script> + <script src="{{ static_files }}/jsbn2.js"></script> + <script src="{{ static_files }}/srp.js"></script> + <script type="text/javascript"> + function login() + { + var username = document.getElementById("srp_username").value; + var password = document.getElementById("srp_password").value; + var url = window.location.protocol+"//"+window.location.host+"/srp/"; + srp = new SRP(username, password, "django", url); + srp.success = function() + { + alert("We win"); + }; + srp.identify(); + return false; + } + </script> + </head> + <body> + <form action="." onsubmit="return login()"> + <table> + <tr><td>Username:</td><td><input type="text" id="srp_username" /></td></tr> + <tr><td>Password:</td><td><input type="password" id="srp_password" /></td></tr> + </table> + <input type="submit"/> + </form> + </body> +</html> diff --git a/django/srpproject/templates/register.html b/django/srpproject/templates/register.html new file mode 100644 index 0000000..82ce61e --- /dev/null +++ b/django/srpproject/templates/register.html @@ -0,0 +1,42 @@ +<html> + <head> + <script src="{{ static_files }}/SHA256.js"></script> + <script src="{{ static_files }}/prng4.js"></script> + <script src="{{ static_files }}/rng.js"></script> + <script src="{{ static_files }}/jsbn.js"></script> + <script src="{{ static_files }}/jsbn2.js"></script> + <script src="{{ static_files }}/srp.js"></script> + <script type="text/javascript"> + function register() + { + if(document.getElementById("confirm_password").value != document.getElementById("srp_password").value) + alert("Passwords do not match"); + else if(document.getElementById("srp_password").value == "") + alert("Password cannot be blank"); + else + { + var username = document.getElementById("srp_username").value; + var password = document.getElementById("srp_password").value; + var url = window.location.protocol+"//"+window.location.host+"/srp/"; + srp = new SRP(username, password, "django", url); + srp.success = function() + { + alert("We win"); + }; + srp.register(); + } + return false; + }; + </script> + </head> + <body> + <form action="." onsubmit="return register()"> + <table> + <tr><td>Username:</td><td><input type="text" id="srp_username" /></td></tr> + <tr><td>Password:</td><td><input type="password" id="srp_password" /></td></tr> + <tr><td>Confirm:</td><td><input type="password" id="confirm_password" /></td></tr> + </table> + <input type="submit"/> + </form> + </body> +</html> |