I got this from dynamicdrive and I'm going to use it for my site I'm going put up soon..
The question I'm wondering is, what is the reverse encryption code for:
I already know a=97, therefore if the next letter is a, it'll be 97 * 97 = 9409..
So if my username will be pcboy (p=112 c=99 _=95 b=98 o=111 y=121), the encryption key will be 1386472459680, p*c*_*b*o*y.
Now my question is, how can I do the reverse? For instance, if I put 112, it'll give me p and etc.
btw: the source is here.
<script>
//Encrypted Password script- By Rob Heslop
//Script featured on Dynamic Drive
//Visit http://www.dynamicdrive.com
function submitentry(){
password = document.password1.password2.value.toLowerCase()
username = document.password1.username2.value.toLowerCase()
passcode = 1
usercode = 1
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}
for(x = 0; x < username.length; x++) {
usercode *= username.charCodeAt(x);
}
//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(usercode==134603040&&passcode==126906300)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location=password+".htm"}
else{
alert("password/username combination wrong")}
}
</script>
<form name="password1">
<strong>Enter username: </strong>
<input type="text" name="username2" size="15">
<strong>Enter password: </strong>
<input type="password" name="password2" size="15">
<input type="button" value="Submit" onClick="submitentry()">
</form>
The question I'm wondering is, what is the reverse encryption code for:
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}
for(x = 0; x < username.length; x++) {
usercode *= username.charCodeAt(x);
I already know a=97, therefore if the next letter is a, it'll be 97 * 97 = 9409..
So if my username will be pcboy (p=112 c=99 _=95 b=98 o=111 y=121), the encryption key will be 1386472459680, p*c*_*b*o*y.
Now my question is, how can I do the reverse? For instance, if I put 112, it'll give me p and etc.
btw: the source is here.