473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Difficult javascript challenge

Hello,

i try to break this code, since many days (and nights), without any
success :

<script type="text/javascript">
function p(a,i,c) {
var x=a.charCodeAt(i)+c;
return String.fromCharCode(x);
}

m="Wrong, wrong, totally wrong :-)";
phrase=prompt("Starting easy (maybe). Enter a passphrase");
if (phrase.length<5 || phrase.length>50) phrase="abrakadabra";
bcl=bcI=bc1=p(phrase,3,-2)+p(phrase,1,-4)+p(phrase,4,15)+p(phrase,2,-17);
bcd=phrase.substr(2);
bcI+=p(phrase,0,-74);
xx=p(phrase,5%phrase.length,-65)+p(phrase,6%phrase.length,-58);
yy=p(phrase,7%phrase.length,-22)+p(phrase,8%phrase.length,-5);
t=parseInt(p(phrase,5%phrase.length,-66),10);
bd='<script t'+bcd+'="text/javascript" \
function che'+yy+'() { \
var name,pass,abc=new Array(14,29,26,15,'+xx+'),ok; \
name=document.getElementById(\'idname\').value; \
pass=document.getElementById(\'idpass\').value; \
++t; \
ok=0; \
for (i=0; i<name.le'+bcl+'; ++i) if
(name.charCodeAt(i)^pass.charCodeAt(i)==abc[i%abc.length]) ++ok; \
if (ok!=5) return; \
if (name.charAt(name.le'+bc1+'-1)!="g") return; \
if (pass.charAt(pass.length-1)!="e") return; \
if (((name.le'+bcI+'^pass.le'+bcl+')!=3) return; \
if
(name.charAt(1)+pass.charAt(0)+name.charAt(3)+pass .charAt(2)!="rynu")
return; \
if (name.le'+bcl+'*(pass.le'+bcI+'>34) return; \
m="Very well. You\'ve got it. Add \'?name="+name+"&pass="+pass+"\'
(without quotes) to the url"; \
if (t>1) { // you don\'t have many attempts...\n \
m="Wrong, wrong, totally wrong :-)";\n \
} \
}\n</script'+'>';
document.write(bd);
</script>
<center>
<form action="" method="get"
onsubmit="window.setTimeout('alert(m);',500);
window.setTimeout('check();',10); return false;">
Name: <input type="text" name="name" value="" id="idpass"/><br/>
Pass: &nbsp<input type="text" name="pass" value="" id="idname"/><br/>
<input type="submit" value="Login"/>

<input type="reset" value="Reset"/>
</form>


I'm totally lost, the author has given some clues :

- The passphrase has a length 5
- After entering correct username&password you'll be redirected to
'succeeded' page automatically
- The passphrase contain a space at least

Very hard, some rarely persons have solved this.
If somebody has a idea.

Thank you

Nov 12 '06 #1
8 1993
ok, let me see ...
I offered 5$ on paypal account for the first who solve this challenge,
really, not a joke.

I try some possibilities for "passphrase", for exemple with value
"skype", the code is executed without errors.

The most important point is this hint from the creator :
- you are redirected automatically to verification page if
passphrase&pass&username were correct

How this code can be permit a redirection ? i'm lost.

Nov 12 '06 #2
Senderos wrote on 13 nov 2006 in comp.lang.javascript:
How this code can be permit a redirection ? i'm lost.
You certenly are.

We are too, because without quoting you lost us.

This is not email but usenet.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 12 '06 #3
This challenge is not as difficult as i thought.... lol

But it's true that there isn't an automatic redirection in fact if you
find the correct login and pass an alert appear and tell you to add "
&name=the correct name&pass=the correct pass "

So it's a manually redirection adding with copy/paste the end of the
url

the passphrase is easy to break and you've already found it : " SKYPE "

the login and pass is much more difficult to break but not impossible
and need " inteligence " (lol) no... with 1 hour and a some
calculation and equation you should find :

login : YOUARE
pass : WRONG

that's all

so i'm waiting for many congratulations.... and money !!!!!!!!!!
Seriously, if you find out other javascript challenge over the net
don't forget to write the url next to these messages. thanks

Bye all @+

Nov 17 '06 #4
Sorry i've made some errors

all string found are in lowercase...

And in fact without modify the code it's impossible because the
variable bcd must be "ype" because " <script t YPE='...." and bcd is
created with passphrase.substr(2)
so passphrase length must be 5 and passphrase must ended with 'YPE' to
create correct script tag declaration.
and we know that the first two char must be "sk" ( see the cryptography
mode ), so the author is a liar and passphrase don't contain a space
and has a length of 5.
Besides there is a problem because the variable t = 1 at the begining
and after the ++t statement increase the variable and so the last
condition ( if t 1 ... ) is false.

To resolve this problem change :
t=parseInt(p(phrase,5%phrase.length,-66),10); to
t=parseInt(p(phrase,5%phrase.length,-66),10)-1;

and with this it's ok with passphrase = 'skype' // login = 'youare'
// pass = 'wrong'

In fact i think that the author know that it don't exist a correct
combinaison with the original code and it's the goal... never find
out... and think about it all the time and be haunted by this code lol.

So if you don't believe me... try again but you will see that i'm
right.

++ all

Nov 17 '06 #5
wrote on 17 nov 2006 in comp.lang.javascript:
This challenge is not as difficult as i thought.... lol
What are you talking about.

This is a usenet NG, not email, so please quote relevant parts of the
posting you are reacting on!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 17 '06 #6
i talked about the post : Difficult javascript challenge...

My messages isn't at the next of the post??
when i'm opening this post i see all the messages and my messages too..
so i don't understand what you mean.

Evertjan. a écrit :
wrote on 17 nov 2006 in comp.lang.javascript:
This challenge is not as difficult as i thought.... lol

What are you talking about.

This is a usenet NG, not email, so please quote relevant parts of the
posting you are reacting on!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 17 '06 #7
wrote on 17 nov 2006 in comp.lang.javascript:
i talked about the post : Difficult javascript challenge...

My messages isn't at the next of the post??
when i'm opening this post i see all the messages and my messages too..
so i don't understand what you mean.
[Please do not toppost on usenet]

Perhaps you are using a special interface, like groups.google.com,
but most people use dedicated news clients and work on local news servers,
that are not even always synchronous.

Since the start of usenet, and that is way older than the web, it is
considered polite to adhere to "usenet netiquette" and the charter of each
NG.

So please do quote, do not toppost, but use sparse interposting, and use
normal capitalisation.

If you are not fluent in these, read up about it in wikipedia or elsewhere.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 17 '06 #8
No you are wrong,

the passphrase is : "skype=text/javascript src="

And next the code call another script : "text/javascript"

And the result is :

-----------------------------------------------------------------------
a="HmmmmSoYouLookedIntoTheCodeReallyCarefullyButIt WillNotBeSoEasyEitherYouWillNeedToFindCorrectNameA ndPassTooItWillNotBeGivenToYouWithoutEffortAndIWil lGiveYouASmallAdviceAndThatIsThatYouShouldBeAsCare fulAsTillNowOrEvenMoreCarefulItMaySpareYouSomeTime SoNowContinueWithThisChallengeAndTryToSucceedAndIf YouSucceedThenYouShouldWriteYourOwnChallengeToImpr oveYourSkillsCauseCodingIsNotAsEasyAsCodeReadingGo odLuck";

ok=0;
tomatch=new Array(3,18,2,2,4,6,1,10,7,14,0);
mess=new Array(16, 37, 22, 83, 44, 55, 67, 66, 78, 119, 93, 110, 126,
116, 175, 158, 138, 151, 157, 172, 169, 190, 207, 197, 214, 237, 234,
241, 270, 271, 378, 274, 275, 318, 322, 359, 308, 330, 326, 346, 367,
359, 375, 21, 387, 393, 32, 6, 9, 119, 26, 275, 52, 53, 72, 91, 87,
109, 275, 130, 129);
messO=' \' !!!';
messI=new Array(2, 10, 17, 21, 26, 29, 36, 44, 50, 55, 59, 62, 66, 69,
75, 76, 77,0);

function reassure(n,p) {
var i,h1=0,h2=1,h3=1,h4=1,h5=1,v;
var H1=16, H2=-1288481342, H3=-2031681083, H4=933919781,
H5=-1934107010;
for (i=0; i<n.length; ++i) {
h1^=n.charCodeAt(i);
h2=((h2*(i+1)*n.charCodeAt(i))/7)&0xffffffff;
h4=((h4*(n.charCodeAt(i)+n.charCodeAt(n.length-i-1)))/7)&0xffffffff;
}
for (i=0; i<p.length; ++i) {
h1^=p.charCodeAt(i);
h3=((h3*(i+1)*p.charCodeAt(i))/7)&0xffffffff;
h5=((h5*(p.charCodeAt(i)+p.charCodeAt(p.length-i-1)))/7)&0xffffffff;
}
v=(h1==H1 && h2==H2 && h3==H3 && h4==H4 && h5==H5)?"yes":"no";
return v;
}

function check() {
var c=new
Array(224,222,211,194,198,202,214,221,225,222,221, 220,209,215,213,219);
var d=new Array(4,2,2,3,2,0,1,3,2,0,6,0,0,0,0);
var i,j,p,n,nname,cc,was,mm,psor;
name=document.getElementById('idpass').value;
p=pass=document.getElementById('idname').value;
if (pass=="" || name=="") pass=name="abrakadabra";
while (pass.length<name.length) pass+=p;
was=new Array();
for (i=0; i<pass.length; ++i) was.push(0);
p=pass;
nname="";
psor="";
n=name;
for (i=0; i<name.length; ++i) {
mm=0; cc=256;
for (j=0; j<p.length; ++j) if (!was[j] && p.charCodeAt(j)<cc) {
cc=p.charCodeAt(j);
mm=j;
}
nname+=name.charAt(mm%name.length);
psor+=p.charAt(mm);
was[mm]=1;
}
for (i=0; i<name.length; ++i) if
(nname.charCodeAt(i)+nname.charCodeAt((i+1)%nname. length)==c[i%c.length])
++ok;
if (ok!=16) pass=pass.substr(0,pass.length-1)+".";
ok=1;
for (i=1; i<psor.length; ++i) if
(psor.charCodeAt(i)-psor.charCodeAt(i-1)!=d[i-1]) {
ok=0;
break;
}

if (ok && pass.charAt(pass.length-1)!="." &&
reassure(name,pass)=="yes" && pass.length*name.length<130) {
m="";
for (i=j=0; i<mess.length+messO.length; ++i) {
if (i==messI[j]) {
m+=messO.charAt(j);
++j;
continue;
}
m+=a.charAt(mess[i-j]);
}
window.setTimeout("document.location=document.loca tion.pathname+'?name="+name+"&pass="+pass+"';",500 );
}
}
ok=5;

tomatch=new Array(9,2,1,11,6,8,19,9,11,11,7);
nm=document.getElementById('name');
ps=document.getElementById('pass');
message='Very well!!! You\'ve got it right. Another challenge done
:-)\' '
-----------------------------------------------------------------------

And next, we must find login/pass, the length in first, and next with
the length and the function reassure the couple : login/pass

So it's a difficult challenge !
my offer is always present

If you have any ideas

Dec 1 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: Spammay Blockay | last post by:
I've been tasked with doing technical interviews at my company, and I have generally ask a range of OO, Java, and "good programming technique" concepts. However, one of my favorite exercises I...
9
by: Sarah | last post by:
Hi! I have perhaps a strange question... I have a javascript that activates on a right click and shows the user a little menu of links. However, by doing so, it disables the users ability to...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
5
by: glegipon | last post by:
As Tom Cahill would require, my challenge is (according to the "three R's") Reproducible: if run on OS 9.x, the monthly payment does not show up in the text box: Recognizable: I believe the...
34
by: electrician | last post by:
Perl has it, Basic has it, Fortran has it. What is so difficult about creating a goto command for JavaScript. Just set up a label and say go to it.
18
by: Chris Ianson | last post by:
Hi geniuses (or is that genii, or genies) The challenge is as above really. I have a page with an iframe in it, and need to call a JS function in the *parent* page, *from* inside the iframe. ...
7
by: phal | last post by:
Hi I think there are many different browsers to browse to the Internet, how can I write the javascript to identify different browser and display according to the users. Some browser disable the...
41
by: Rene Nyffenegger | last post by:
Hello everyone. I am not fluent in JavaScript, so I might overlook the obvious. But in all other programming languages that I know and that have associative arrays, or hashes, the elements in...
9
by: steve | last post by:
hi, Has anyone come across a "hack" to do a dns look up via JS I want to evaluate an email address against a server to see if it is valid , I'm 50 % of the way there but i need a way to look...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.