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: 
for the security bit, you could hash the correct password an then create the hast of the input and check if those are equal (for example md5 or sha1) (as posted in the answer before md5 (and i think sha1 too) are not "secure" but i doubt anyone would put so much effort in unlocking this level
Regardless of what you do, the password will be view able especially if everything is on client side.

But If it's just obfuscating the password it could be done in so many ways.

For example :

```
var psd = "\u0041\u0042\u0043\u0044\u0045\u0046\u0047".toLowerCase();  // abcdefg

```

Or use the functions in JS itself: 

```
btoa("abcdefg");      // "YWJjZGVmZw=="

atob("YWJjZGVmZw=="); // "abcdefg"

```