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?

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?

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.

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 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.

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..

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.