html - Securing Javascript Code -
html - Securing Javascript Code -
i have javascript file within website how can store code in separate file on same server still activates password function code is
<script> function password() { var testv = 1; var pass1 = prompt('please come in school code',' '); while (testv < 3) { if (!pass1) history.go(-1); if (pass1.tolowercase() == "0000") { window.open('discussion.html','_self') break; } testv+=1; var pass1 = prompt('access denied - password incorrect, please seek again.','password'); } if (pass1.tolowercase()!="password" & testv ==3) history.go(-1); homecoming " "; } it runs with
<input type="button" value="enter page" onclick="password()">
no matter how store password, accessible client if send client.
that is, cannot have secure password verification done in javascript, short of using one-way hash function. if did utilize one-way hash function, bypass javascript password verification. password verification server-side.
javascript html
Comments
Post a Comment