I need a code that encrypts the password, please if anyone knows it please post.

Here, instead of encrypting a password, make the password a super-hard math problem.

Like this

<html>
<head>
<script language='javascript'>
var foo = 5 + 5 * 5;
var moo = foo * 2 * 4;
var goo = moo + foo % 7;
var too = goo * foo + moo;
var hoo = 6 / 2 + too * foo - moo + goo; 
var poo = hoo / 50 * 0.04 - 80 % 9.9; 
var doo = poo / 5 * 0.3 + 2 / 8;
var koo = doo * poo + hoo - foo % 7 / 8 * 3 / 500 % 29 / 5000 / 5 / 3 - 200000;
var yoo = doo + koo * 500000 / 6.1543 % 8.2543 / 4.4151 + 3135;
var voo = yoo * koo * 44252.45245 * poo * hoo * too * goo * moo * foo / 13.1345 % 170.908;
var joo = voo * 154213451.5245245 % 151.114354 / 4154.5454 + 27527272572.75272;
var noo = joo * 252542.245245 * 25254245.4524245 % 15.5135 / 2542.4524525;
var pass = noo * 52424532543245245 * 5245252425435 * 453435435 / 13 * 2152175621375.1534348343483;
</script>
</head>
<body>
<script language='javascript'>
function check(x)
{
if(x==pass){
alert('Correct Password');
window.location='';
}else{
alert('Incorrect Password');
   }
}
</script>
<center><p>Please enter the password:</p><br /><input type="password" id="pass" value="" size='50' /><br />
<input type='button' onclick="check(document.getElementById('pass').value)" value='Check Password'>
</body>
</html>

Oh, and by the way, the password is:

7.114267799844692e+46

But the problem about this, is that the viewer( user ) can simply view the souce-code on their browser and thats it. Everything is wasted...

commented: For sure... +36

It's still can be caculated by the user and the fact that the actual process inside if( password === password ) { /*Here's my answer... */} , i get the whole answer even w/o doing any of those math calculations.
-no matter how hard we try to hide it, its still there...

True, that's why you shouldn't try to hide something important...

The user can easily take all the variables, and create a .js file that would show the answer

var foo = 5 + 5 * 5;
var moo = foo * 2 * 4;
var goo = moo + foo % 7;
var too = goo * foo + moo;
var hoo = 6 / 2 + too * foo - moo + goo; 
var poo = hoo / 50 * 0.04 - 80 % 9.9; 
var doo = poo / 5 * 0.3 + 2 / 8;
var koo = doo * poo + hoo - foo % 7 / 8 * 3 / 500 % 29 / 5000 / 5 / 3 - 200000;
var yoo = doo + koo * 500000 / 6.1543 % 8.2543 / 4.4151 + 3135;
var voo = yoo * koo * 44252.45245 * poo * hoo * too * goo * moo * foo / 13.1345 % 170.908;
var joo = voo * 154213451.5245245 % 151.114354 / 4154.5454 + 27527272572.75272;
var noo = joo * 252542.245245 * 25254245.4524245 % 15.5135 / 2542.4524525;
var pass = noo * 52424532543245245 * 5245252425435 * 453435435 / 13 * 2152175621375.1534348343483;
document.write(pass);

Anyways, its just my opinion and the whole thing still up to you, if you prefer to claim it using this method, .

Good luck...

essential

I'm still looking for an encrypter, that's why this isn't marked as solved yet :P

Do you still need some code? Ok i'll post back later...

I think I got it

The browser will turn the encrypted password to the original password so that it is unreadable by the human eye.

<html>
<head>
<script language=JavaScript>m='%3Cscript%20language%3D%27javascript%27%3E%0D%0Avar%20foo%20%3D%205%20+%205%20*%205%3B%0D%0Avar%20moo%20%3D%20foo%20*%202%20*%204%3B%0D%0Avar%20goo%20%3D%20moo%20+%20foo%20%25%207%3B%0D%0Avar%20too%20%3D%20goo%20*%20foo%20+%20moo%3B%0D%0Avar%20Dioo%20%3D%205%20+%205%20*%2010%3B%0D%0Avar%20hoo%20%3D%206%20/%202%20+%20too%20*%20foo%20-%20moo%20+%20goo%3B%20%0D%0Avar%20poo%20%3D%20hoo%20/%2050%20*%200.04%20-%2080%20%25%209.9%3B%20%0D%0Avar%20doo%20%3D%20poo%20/%205%20*%200.3%20+%202%20/%208%3B%0D%0Avar%20koo%20%3D%20doo%20*%20poo%20+%20hoo%20-%20foo%20%25%207%20/%208%20*%203%20/%20500%20%25%2029%20/%205000%20/%205%20/%203%20-%20200000%3B%0D%0Avar%20yoo%20%3D%20doo%20+%20koo%20*%20500000%20/%206.1543%20%25%208.2543%20/%204.4151%20+%203135%3B%0D%0Avar%20voo%20%3D%20yoo%20*%20koo%20*%2044252.45245%20*%20poo%20*%20hoo%20*%20too%20*%20goo%20*%20moo%20*%20foo%20/%2013.1345%20%25%20170.908%3B%0D%0Avar%20joo%20%3D%20voo%20*%20154213451.5245245%20%25%20151.114354%20/%204154.5454%20+%2027527272572.75272%3B%0D%0Avar%20noo%20%3D%20joo%20*%20252542.245245%20*%2025254245.4524245%20%25%2015.5135%20/%202542.4524525%3B%0D%0Avar%20ioo%20%3D%20noo%20*%2052424532543245245%20*%205245252425435%20*%20453435435%20/%2013%20*%202152175621375.1534348343483%3B%0D%0A%3C/script%3E';d=unescape(m);document.write(d);</script>
</head>
<body>
<script language=JavaScript>m='%3Cscript%20language%3D%27javascript%27%3E%0D%0Afunction%20check%28x%29%0D%0A%7B%0D%0Aif%28x%3D%3Dioo%29%7B%0D%0Aalert%28%27Correct%20Password%27%29%3B%0D%0Awindow.location%3D%27%27%3B%0D%0A%7Delse%7B%0D%0Aalert%28%27Incorrect%20Password%27%29%3B%0D%0A%20%20%20%7D%0D%0A%7D%0D%0A%3C/script%3E';d=unescape(m);document.write(d);</script>
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<center><table border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align'center'>
<fieldset>
<legend>Please Enter The Password</legend><br />
<input type="password" id="pass" value="" size='50' /><br />
<input type='button' onclick="check(document.getElementById('pass').value)" value='Check Password'>
</td>
</tr>
</fieldset>
</table>
</center>
</body>
</html>

It also shows a fake password, incase the user 'thinks' they found the real one.

Again, the password is:

7.114267799844692e+46

If you want to see how to encrypt and decrypt sources, go Here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.