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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -