Programming 9

Put your programming skills to the test in these challenges.

Re: Programming 9

Post by Defience on Fri Mar 27, 2009 10:08 am
([msg=20691]see Re: Programming 9[/msg])

Here's an example of a properly decrypted answer: SCXmdR

It looks like there's a problem with your decryption code.
User avatar
Defience
Addict
Addict
 
Posts: 1281
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 9

Post by BeTheDuck on Mon Jun 22, 2009 12:40 pm
([msg=25745]see Re: Programming 9[/msg])

I am incredibly frustrated right now. And I'm sure I'm just missing something silly.

I have a PHP script that runs the exact (like, copied and pasted) encryption scheme given in the challenge. I ALSO have a decryption function that works beautifully. When I test them, I run the encryption function on the text "Hello" with whatever key I feel like using. When I decrypt using the same key, I always get "Hello".

I have a program that solves sudoku puzzles quickly, and tells me if there's more than one solution (and if there is, I just refresh the challenge until I get a puzzle with only one solution... ah laziness). I've double-checked these solved puzzles on three online sudoku solvers, and it always matches.

When I convert the sudoku into a key, I separate each number with a comma, left to right, top to bottom, just like the format given to me. 81 digits, 80 commas.

So why is it that, whenever I use the sudoku and encrypted string from the challenge, I get a bunch of illegal unicode characters as my answer? I've even tried SHA1 hashing the solved puzzle before using it as a key (once before even calling keys(), once inside keys() [which as I said is copied and pasted directly from the challenge]). I'm not even changing the code from my control test; I'm commenting out the encryption part. And even if I run my code with the encryption commented out and using an encrypted result and the correct key from a PREVIOUS test, I still get my "Hello". So it's not even the code that runs my encrypt/decrypt that's wrong.

As far as I can tell, either my key is wrong, or my encrypted answer is wrong (which I'm directly copying and pasting from the challenge, all 24 chars, every time). What am I missing?

If you know what I'm doing wrong, and it's spoileriffic, PM me. I'm tearing my hair out.
BeTheDuck
New User
New User
 
Posts: 2
Joined: Mon Jun 22, 2009 12:22 pm
Blog: View Blog (0)


Re: Programming 9

Post by haha01haha01 on Mon Jun 22, 2009 2:13 pm
([msg=25749]see Re: Programming 9[/msg])

BeTheDuck wrote:I am incredibly frustrated right now. And I'm sure I'm just missing something silly.

I have a PHP script that runs the exact (like, copied and pasted) encryption scheme given in the challenge. I ALSO have a decryption function that works beautifully. When I test them, I run the encryption function on the text "Hello" with whatever key I feel like using. When I decrypt using the same key, I always get "Hello".

I have a program that solves sudoku puzzles quickly, and tells me if there's more than one solution (and if there is, I just refresh the challenge until I get a puzzle with only one solution... ah laziness). I've double-checked these solved puzzles on three online sudoku solvers, and it always matches.

When I convert the sudoku into a key, I separate each number with a comma, left to right, top to bottom, just like the format given to me. 81 digits, 80 commas.

So why is it that, whenever I use the sudoku and encrypted string from the challenge, I get a bunch of illegal unicode characters as my answer? I've even tried SHA1 hashing the solved puzzle before using it as a key (once before even calling keys(), once inside keys() [which as I said is copied and pasted directly from the challenge]). I'm not even changing the code from my control test; I'm commenting out the encryption part. And even if I run my code with the encryption commented out and using an encrypted result and the correct key from a PREVIOUS test, I still get my "Hello". So it's not even the code that runs my encrypt/decrypt that's wrong.

As far as I can tell, either my key is wrong, or my encrypted answer is wrong (which I'm directly copying and pasting from the challenge, all 24 chars, every time). What am I missing?

If you know what I'm doing wrong, and it's spoileriffic, PM me. I'm tearing my hair out.
If you want, you can PM me with all the steps you did on a specific sudoku\cipher and the result of each one, and ill tell you where is your mistake.
There are 11 types of people in the world - those who understand binary, those who don't and those who already heard this joke.
User avatar
haha01haha01
Poster
Poster
 
Posts: 133
Joined: Tue Jan 13, 2009 10:08 am
Location: HackThisSite.org
Blog: View Blog (0)


Re: Programming 9

Post by BeTheDuck on Mon Jun 22, 2009 3:50 pm
([msg=25762]see Re: Programming 9[/msg])

haha01haha01 wrote:If you want, you can PM me with all the steps you did on a specific sudoku\cipher and the result of each one, and ill tell you where is your mistake.


Huh. I can't send PMs.

That would have been good for me to check before asking. *facepalm*
BeTheDuck
New User
New User
 
Posts: 2
Joined: Mon Jun 22, 2009 12:22 pm
Blog: View Blog (0)


Re: Programming 9

Post by Auxis on Tue Jul 07, 2009 11:31 pm
([msg=26438]see Re: Programming 9[/msg])

I had the same problem BeTheDuck had. My first attempt used the C implementation of SHA1, which is when I got illegal unicode characters as the decrypted text. I then tried using the default implementation that PHP has for SHA1, and I got the correct password. I might do a little more research after I get off work tomorrow to see why there was a problem with the C implementation, but I bet it has something to do with the way I was using it.
Auxis
New User
New User
 
Posts: 7
Joined: Wed May 14, 2008 3:00 pm
Blog: View Blog (0)


Re: Programming 9

Post by Defience on Wed Jul 08, 2009 3:29 pm
([msg=26470]see Re: Programming 9[/msg])

I used Python for this and Python's SHA1 and didn't have a problem. Let us know if you find anything out.
User avatar
Defience
Addict
Addict
 
Posts: 1281
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 9

Post by Auxis on Wed Jul 08, 2009 6:31 pm
([msg=26481]see Re: Programming 9[/msg])

I thought about what could have been wrong at work and I was right. It was an error on my part on how I was using it. SHA1Update was being called more than once because it was inside of a loop that was being used from a previous project I had.
Auxis
New User
New User
 
Posts: 7
Joined: Wed May 14, 2008 3:00 pm
Blog: View Blog (0)


Re: Programming 9

Post by Defience on Wed Jul 08, 2009 7:03 pm
([msg=26483]see Re: Programming 9[/msg])

Auxis wrote:I thought about what could have been wrong at work and I was right. It was an error on my part on how I was using it. SHA1Update was being called more than once because it was inside of a loop that was being used from a previous project I had.


Ah, I see. Thanks for letting us know in case someone else runs into this. 8-)
User avatar
Defience
Addict
Addict
 
Posts: 1281
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Programming 9

Post by motley84 on Thu Apr 08, 2010 11:44 pm
([msg=37931]see Re: Programming 9[/msg])

Just because many ppl make false assumptions, within the PHP the function KEYS firstly computes the SHA1 of the password. This doesn't mean you must not follow the directions in the challenge. Additionally this was possibly the script that encrypted the text for you. Thus, use twice unless you want a bunch of unreadable characters
the devil still cheats and wins more souls, and as for the lord... he's just doing his bet..
User avatar
motley84
New User
New User
 
Posts: 8
Joined: Mon Mar 22, 2010 10:08 pm
Location: Nearby coffee shop[[
Blog: View Blog (0)


Re: Programming 9

Post by bnw33 on Sat Jun 05, 2010 3:03 pm
([msg=39561]see Re: Programming 9[/msg])

Just finished. Took me a while. I rewrote the encryption algorithm in Java, if anyone is interested. That seemed to be the hardest part of the challenge, I suppose it would have been easier if I had used the provided php script.
bnw33
New User
New User
 
Posts: 1
Joined: Sat Jun 05, 2010 3:01 pm
Blog: View Blog (0)


PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests