darktimesrpg Posted February 19, 2007 Share Posted February 19, 2007 Um, this is really weird I didn't touch a file and this happened: Parse error: syntax error, unexpected ',' This is the line it's talking about: a=>"?",b=>"?",c=>"?,d=>"?",e=>"?,f=>"?",g=>"?",h=>"%",i=>"?",j=>"?",k=>"?",l=>"?,m=>"?",n=>"?,o=>"!",p=>"?", What I don't understand is why even after a restore it still gives that error. Any advice or help? Quote Link to comment Share on other sites More sharing options...
tom100 Posted February 19, 2007 Share Posted February 19, 2007 Please copy the lines above and below that line so we can further review it. Otherwise it looks like its ending with a , that it shouldn't be. Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 Acually it has nothing to do with those lines they haven't been changed, but here they are: q=>"?,r=>"?",s=>"@",t=>"?,u=>"?",v=>"?,w=>"?",x=>"?,y=>"?",z=>"?, A=>"#",B=>"$",C=>"^",D=>"&",E=>"*",F=>"(",G=>")",H=>"-",I=>"_",J=>"?", K=>"+",L=>"=",M=>"~",N=>"`",O=>"[",P=>"]",Q=>"{",R=>"}",S=>";",T=>":",U=>"'",V=>"\"",W=>"<",X=>">",Y=>".",Z=>",", 0=>"?,1=>"?",2=>"?,3=>"?",4=>"?",5=>"?",6=>"?",7=>"?,8=>"?,9=>"?); Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 You have a bunch of open strings with no ending and literal strings for tags Examplke: t=>"? should be 't'=>'?' or 't'=>"?" Also, that's not even a complete statement. It's starting with the assignment of keys in an array, but no creation of the array or assignment. Please post the lines surrounding this. Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 Nope, that's not the problem. It worked like that before, and it's not the problem Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 You want to quit telling us what's not the problem? obviously you can't figure it out as you're asking for help, and I can assure you the code you have posted is far from valid code. So if you want our help, quit arguing and post the code. Quote Link to comment Share on other sites More sharing options...
tom100 Posted February 19, 2007 Share Posted February 19, 2007 Sounds like denial, cause jesirose is correct. Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 Ok, explain to me why if I didn't touch the code and restored a backup I would get the error? It doesn't sound like a coding error, and I would rather not post a 450 line code, it's a security risk Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 Don't post all 450 lines, post SOME of the lines BEFORE and AFTER the STATEMENT causing the ERROR. Or, you can simply choose to believe you're infalliable, and it was a gremlin who went in and changed it, and maybe if you post the fing code you might be able to fix it. I don't believe you that it "worked" before as the code you've posted IS NOT VALID CODE. Quote Link to comment Share on other sites More sharing options...
tom100 Posted February 19, 2007 Share Posted February 19, 2007 If it's such a huge security risk, then you shouldn't be posting it at all, eh? Guess your stuck to figure it out then... Hmm... Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 You could just ask the 350+ members of my site, couldn't you? I would post it but it's part of a password encrypter Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 I agree Tom, heck, for all we know it's top secret CIA code - if we change one line we might bomb Russia or something right? Best to leave it as it's always been with that error there Here's a little clue for you dude. If we can't see the code, we can't fix the problem. You seem to refuse to admit that there even IS a problem, and think the error in the code is "not a coding error". We're not psychics, we're programmers. If you're not going to post code, you're going to have to fix it yourself. Have fun kiddo. Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 Fine I'll post the "invalid code" Code: ### Encryption ### function encrypt($str,$salt=2) { $chr = array( a=>"?",b=>"?",c=>"?,d=>"?",e=>"?,f=>"?",g=>"?",h=>"%",i=>"?",j=>"?",k=>"?",l=>"?,m=>"?",n=>"?,o=>"!",p=>"?", q=>"?,r=>"?",s=>"@",t=>"?,u=>"?",v=>"?,w=>"?",x=>"?,y=>"?",z=>"?, A=>"#",B=>"$",C=>"^",D=>"&",E=>"*",F=>"(",G=>")",H=>"-",I=>"_",J=>"?", K=>"+",L=>"=",M=>"~",N=>"`",O=>"[",P=>"]",Q=>"{",R=>"}",S=>";",T=>":",U=>"'",V=>"\"",W=>"<",X=>">",Y=>".",Z=>",", 0=>"?,1=>"?",2=>"?,3=>"?",4=>"?",5=>"?",6=>"?",7=>"?,8=>"?,9=>"?); for ($i=0;$i<=strlen($str)-1;$i++) { $c = substr($str,$i,1); for ($t=0;$t<=$i+$salt;$t++) { if ($chr[$c] != "") { $c = $chr[$c]; } } $encrypt .= $c; } return $encrypt; } ### Decryption ### function decrypt($str,$salt=2) { $chr = array( "?"=>a,"?"=>b,"?=>c,"?"=>d,"?=>e,"?"=>f,"?"=>g,"%"=>h,"?"=>i,"?"=>j,"?"=>k,"?=>l,"?"=>m,"?=>n,"!"=>o,"?"=>p, "?=>q,"?"=>r,"@"=>s,"?=>t,"?"=>u,"?=>v,"?"=>w,"?=>x,"?"=>y,"?=>z, "#"=>A,"$"=>B,"^"=>C,"&"=>D,"*"=>E,"("=>F,")"=>G,"-"=>H,"_"=>I,"?"=>J, "+"=>K,"="=>L,"~"=>M,"`"=>N,"["=>O,"]"=>P,"{"=>Q,"}"=>R,";"=>S,":"=>T,"'"=>U,"\""=>V,"<"=>W,">"=>X,"."=>Y,","=>Z, "?=>"0","?"=>1,"?=>2,"?"=>3,"?"=>4,"?"=>5,"?"=>6,"?=>7,"?=>8,"?=>9); for ($i=0;$i<=strlen($str)-1;$i++) { $c = substr($str,$i,1); for ($t=0;$t<=$i+$salt;$t++) { if ($chr[$c] != "") { $c = $chr[$c]; } } $decrypt .= $c; } return $decrypt; } Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 You never fixed the first error I pointed out - that you have unclosed strings. Fix that and that will likely fix it. After the t=>"? you need ANOTHER " to CLOSE the string. If you don't believe me, you've got bigger problems. That missing " means that PHP thinks the string ends at the next ", and the next char after that is ? which doesn't make sense to PHP. It's on t, 8, 9 and probably others. Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 That doesn't fix it I get an unxpected double arrow error. I still don't understand why it worked for two months and then quit working? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 You'll need to fix all of them. It's also on 0, 2, 7. and still others. Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 Now I get unexpected t-string and here's the code: ### Encryption ### function encrypt($str,$salt=2) { $chr = array( a=>"?",b=>"?",c=>"?",d=>"?",e=>"?",f=>"?",g=>"?",h=>"%",i=>"?",j=>"?",k=>"?",l=>"?",m=>"?",n=>"?",o=>"!",p=>"?", q=>"?",r=>"?",s=>"@",t=>"?",u=>"?",v=>"?,w=>"?",x=>"?",y=>"?",z=>"?", A=>"#",B=>"$",C=>"^",D=>"&",E=>"*",F=>"(",G=>")",H=>"-",I=>"_",J=>"?", K=>"+",L=>"=",M=>"~",N=>"`",O=>"[",P=>"]",Q=>"{",R=>"}",S=>";",T=>":",U=>"'",V=>"\"",W=>"<",X=>">",Y=>".",Z=>",", 0=>"?",1=>"?",2=>"?",3=>"?",4=>"?",5=>"?",6=>"?",7=>"?",8=>"?",9=>"?"); for ($i=0;$i<=strlen($str)-1;$i++) { $c = substr($str,$i,1); for ($t=0;$t<=$i+$salt;$t++) { if ($chr[$c] != "") { $c = $chr[$c]; } } $encrypt .= $c; } return $encrypt; } ### Decryption ### function decrypt($str,$salt=2) { $chr = array( "?"=>a,"?"=>b,"?"=>c,"?"=>d,"?"=>e,"?"=>f,"?"=>g,"%"=>h,"?"=>i,"?"=>j,"?"=>k,"?"=>l,"?"=>m,"?"=>n,"!"=>o,"?"=>p, "?=>q,"?"=>r,"@"=>s,"?"=>t,"?"=>u,"?"=>v,"?"=>w,"?"=>x,"?"=>y,"?"=>z, "#"=>A,"$"=>B,"^"=>C,"&"=>D,"*"=>E,"("=>F,")"=>G,"-"=>H,"_"=>I,"?"=>J, "+"=>K,"="=>L,"~"=>M,"`"=>N,"["=>O,"]"=>P,"{"=>Q,"}"=>R,";"=>S,":"=>T,"'"=>U,"\""=>V,"<"=>W,">"=>X,"."=>Y,","=>Z, "?"=>"0","?"=>1,"?"=>2,"?"=>3,"?"=>4,"?"=>5,"?"=>6,"?"=>7,"?"=>8,"?"=>9); for ($i=0;$i<=strlen($str)-1;$i++) { $c = substr($str,$i,1); for ($t=0;$t<=$i+$salt;$t++) { if ($chr[$c] != "") { $c = $chr[$c]; } } $decrypt .= $c; } return $decrypt; } Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 No, It messed up the encrytion, my password doesn't work Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 You need to get yourself a editor with syntax highlighting. "?=>q SAME PROBLEM. You're still not doing your strings correctly. This should be '?'=>'q' " " strings are for strings that have variables in them, ' ' are for literal strings. Download textpad and use the syntax highlighting. Also, md5() dude. Reinventing the wheel, shoddily, is never a good idea. Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 Md5 is easily breakable, Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 And apparently your method is bullet proof. I'm done here. Fix the syntax errors then worry about whether or not it works. Quote Link to comment Share on other sites More sharing options...
darktimesrpg Posted February 19, 2007 Author Share Posted February 19, 2007 What's wrong with you? It worked yesterday and I didn't touch the script Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 19, 2007 Share Posted February 19, 2007 Did your host upgrade PHP without telling you? That may be what's causing your problems. What version of PHP, what webserver, what OS? Ken Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted February 19, 2007 Share Posted February 19, 2007 Md5 is easily breakable, Md5 is not easily breakable...to my knowledge it hasn't been broken...if someone claims to be decrypting it they most likely are comparing an md5 string against a database of known values. Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted February 19, 2007 Share Posted February 19, 2007 Md5 is easily breakable, Forceable, not breakable. md5 is a hash, so it's one way, and cannot be broken. However, it can be forced. Then again, name me one encryption or hash that isn't forceable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.