Question: I am currently creating a game where if a player wants to play a certain level, the player has to provide the password to unlock it. I have the following code right now:

```
var password;
var psd= "abcdefg";
password=prompt('Enter the Passcode: ');
if (password==psd){functions}

```

However, I want to make it so that the input text for password is masked. I also want to make it just a tiny bit more secure so that the players won't be able to cheat themselves by inspecting the JavaScript code. Is there a simple way to do this?

Answer: 
You could use MD5, it is a hash algorithm.

Check this out: <http://pajhome.org.uk/crypt/md5/>
You can do it by giving `<input type='password' >`

But this doesn't make sense as you are explicitly storing the password in java script. Anyone who views the source can get the password. The only way is to store the password in a database and use AJAX to check whether the password is correct.