Pages:
Author

Topic: Another riddle - guess script win 10BTC [SOLVED] (Read 8379 times)

newbie
Activity: 29
Merit: 0
December 30, 2012, 12:45:23 AM
#72
Damn, first, I wish I had enough BTC I could do contest like these.  And second, I missed this one today doing family stuff =D  Great riddles and games.  I had 3/4 of it figured out by the 3rd or 4th post but alas it is all been completed in my absence.

THanks Cozz!
hero member
Activity: 518
Merit: 500
Manateeeeeeees
78427939?

29a253dbe3d494581e30dfae3fd363f78427939cf2e467369b0fea2fba0e6c667e37f888d14b2a3 cc1153f552b1cbf9d504436aa9221eb0c123b9f555733dd22 was the full whirlpool output?

And where did you use that?
Correct, thats the phone and now you have to slice it out of the string since he loses it.

Ah got it now.  Final script is posted here: https://github.com/hank/life/blob/master/code/python/cozzriddle/cozz.py

I was very close.  I didn't make the leap to modifying the whirlpool by removing the phone number, but it all makes sense now.  Nicely done!

Quote
After 5xmd5 =  b13260daa9991b92ffc6f1bedbbc1c47
After base64 =  YjEzMjYwZGFhOTk5MWI5MmZmYzZmMWJlZGJiYzFjNDc=
After sha1 =  3731663362343732666234313833646461346433393861326662383464663864643964646463336 4
After 2xsha256 =  cd3487c5e6d255d798b0376e7338f32be4d13b73c9dec617c7e52c76d383f6ea
After 'cashing in' numbers =  cdceddbefbedbcdeccecdfea500euro
After Caesar =  fgfhggehiehgefghffhfgihd833hxur
29a253dbe3d494581e30dfae3fd363f78427939cf2e467369b0fea2fba0e6c667e37f888d14b2a3 cc1153f552b1cbf9d504436aa9221eb0c123b9f555733dd22
29a253dbe3d494581e30dfae3fd363fcf2e467369b0fea2fba0e6c667e37f888d14b2a3cc1153f5 52b1cbf9d504436aa9221eb0c123b9f555733dd22
Ripe result =  888ee31308b8c062ff643b790a22aa8acad3db64
gpg --decrypt --passphrase 888ee31308b8c062ff643b790a22aa8acad3db64 /tmp/foo

You need a passphrase to unlock the secret key for
user: "Cozz Lovan <[email protected]>"
2048-bit RSA key, ID A2C6AE1F, created 2012-12-29 (main key ID 160483CB)

gpg: encrypted with 2048-bit RSA key, ID A2C6AE1F, created 2012-12-29
      "Cozz Lovan <[email protected]>"
5J1TxGPBqgJmpDqJPwkLE43nTsSyvDHjuCefgcfbKoqhc5Wfek7
member
Activity: 61
Merit: 15
CONGRATULATIONS to the winner and everybody for participating.

I guess in the end it was about seconds between you 2 guys.

Anyway I post the solution scripts in php and bash.

The gpg password was:

Code:
888ee31308b8c062ff643b790a22aa8acad3db64

php
Code:
$password = 'cozz';
for ($i = 1; $i <= 5; $i++) $password = md5($password.'pepper');
$password = base64_encode($password);
$password = sha1($password); # git uses sha1
for ($i = 1; $i <= 2; $i++) $password = hash('sha256',$password); # bitcoin
$password = preg_replace('/[0-9]+/','', $password).'500euro';
for($i = 0; $i < strlen($password); $i++) $password[$i] = chr(ord($password[$i])+3); # caesar
$password = hash('whirlpool',$password.'+alice');
for ($i = 1; $i <= 50; $i++) $password = hash('whirlpool',$password);
$password = str_replace('78427939','',$password); # phone number
for ($i = 1; $i <= 6; $i++) $password = hash('ripemd160',$password);
echo "$password\n";

bash
Code:
function ord() {
  LC_CTYPE=C printf '%d' "'$1"
}

function chr() {
  printf \\$(printf '%03o' $1)
}

password="cozz"
for (( i=1; i<=5; i++ )); do
password=$(echo -n "$password""pepper" | md5sum | cut -d ' ' -f 1)
done
password=$(echo -n "$password" | base64)
password=$(echo -n "$password" | sha1sum | cut -d ' ' -f 1)
for (( i=1; i<=2; i++ )); do
password=$(echo -n "$password" | sha256sum | cut -d ' ' -f 1)
done
for (( i=0; i<=9; i++ )); do
password=${password//$i/}
done
password="$password""500euro"
for (( i=0; i<${#password}; i++ )); do
password="${password:0:$i}""$(chr $(($(ord ${password:$i:1})+3)))""${password:$(($i+1))}" # caesar
done
password=$(echo -n "$password""+alice" | whirlpoolsum | cut -d ' ' -f 1)
for (( i=1; i<=50; i++ )); do
   password=$(echo -n "$password" | whirlpoolsum | cut -d ' ' -f 1)
done
password=${password/78427939/}
for (( i=1; i<=6; i++ )); do
password=$(echo -n "$password" | openssl rmd160 | cut -d ' ' -f 2)
done
echo "$password"
sr. member
Activity: 293
Merit: 250
78427939?

29a253dbe3d494581e30dfae3fd363f78427939cf2e467369b0fea2fba0e6c667e37f888d14b2a3 cc1153f552b1cbf9d504436aa9221eb0c123b9f555733dd22 was the full whirlpool output?

And where did you use that?

Correct, thats the phone and now you have to slice it out of the string since he loses it.
hero member
Activity: 518
Merit: 500
Manateeeeeeees
78427939?

29a253dbe3d494581e30dfae3fd363f78427939cf2e467369b0fea2fba0e6c667e37f888d14b2a3 cc1153f552b1cbf9d504436aa9221eb0c123b9f555733dd22 was the full whirlpool output?

And where did you use that?
sr. member
Activity: 293
Merit: 250
This is how I did the whirlpool thingy:

Code:
$phonefound = false;

function whirlphone($stuff)
{
global $phonefound;

$out = hash('whirlpool', $stuff);
$offset = 0;

again:
$pos = strpos($out, '78', $offset);
if ($pos !== false && !$phonefound)
{
$phone = substr($out, $pos, 8);
if (ctype_digit($phone) && strlen($phone) == 8)
{
$phonefound = true;
echo 'Possible phone: ' . $phone . "\n";
echo 'preout: ' . $out . "\n";
$out = substr($out, 0, $pos) . substr($out, $pos + 8);
echo 'aftout: ' . $out . "\n";
return $out;
}
else
{
$offset = $pos + 2;
goto again;
}
}

return $out;
}

$start = whirlphone($start . '+alice');

for ($i = 1; $i <= 50; $i++)
{
$start = whirlphone($start);
}

Yeah sue me for using goto Cheesy I had to do it fast
hero member
Activity: 518
Merit: 500
Manateeeeeeees
Damn nice Job Scrat!  What ended up being the final script?
sr. member
Activity: 293
Merit: 250
Gotcha!

cozz: Thanks for the BTC and this awesome contest.

I could have gotten this 30 minutes ago but I was too stupid including the phone after the ripemd hash
hero member
Activity: 518
Merit: 500
Manateeeeeeees
OMFG I'm so close..

Thanks for the tips!
member
Activity: 61
Merit: 15
Oh I just noticed your script is still missing the phone number thing, but you will find that Im pretty sure.
member
Activity: 61
Merit: 15

I'm very close - I can almost taste it!


Yep. To bring this to an end:
- original caesar cipher was shift by 3
- I shifted numbers too
- in total there are 51 jumps into the pool
  first on was me +alice
  then another 50 together

now go get the coins

hero member
Activity: 518
Merit: 500
Manateeeeeeees
Updates at https://github.com/hank/life/blob/master/code/python/cozzriddle/cozz.py

I'm very close - I can almost taste it!

I think my problem is in the whirlpool.  Time to mess around with that a bit!
legendary
Activity: 1288
Merit: 1226
Away on an extended break

We jumped like another fifty times in that whirlpool : Whirlpool hash for 50 times?



correct. 1BTC f4c593b34f862d27f6ccc18415e5bdb9356635693c64a23d8ad1863ab1bb0853 (transactionid)

NO MORE BITCOINS NOW

its now only up to solving the riddle


Thanks!

caesar was kinda the last thing to guess.
Now to just find the right substitution...
[/quote]

Could be anything before 6, as Jesus was born on 6 BC if I'm not wrong...but 26 combinations ain't that hard to list down now thankfully.

I sure wish I'm with my laptop/desktop here - can't run any code in this tablet.  Cry
hero member
Activity: 518
Merit: 500
Manateeeeeeees
Very fun story.  I'm committing my progress here in python:

https://github.com/hank/life/blob/master/code/python/cozzriddle/cozz.py


i have sent you 1BTC for this b80460a1924b2f232ab4e938b9eccd2a498702583b26b720f1ffd4a9a953ab2c (transactionid)

Thanks!

I can confirm that the script is logocally correct up to the point after the money exchange. We get different results, because you used ascii instead of hex. So I post correct solutions here.
After the money exchange the hash must be
Code:
cdceddbefbedbcdeccecdfea500euro

Got it on my end - thanks.

Quote from: johnthedong
Alice must be at Croatia (country number 78)?
Ah nice one!  Oh, but it looks like it doesn't matter..

Quote from: cozz
imagine the hash being cozz.
Got it.

Quote
I lost the phone number. So you have to get rid of it. You need not to search that much to find the number, its not made too difficult.
Thanks - that makes more sense now.

Quote
caesar was kinda the last thing to guess.
Now to just find the right substitution...
member
Activity: 61
Merit: 15

We jumped like another fifty times in that whirlpool : Whirlpool hash for 50 times?



correct. 1BTC f4c593b34f862d27f6ccc18415e5bdb9356635693c64a23d8ad1863ab1bb0853 (transactionid)

NO MORE BITCOINS NOW

its now only up to solving the riddle

legendary
Activity: 1288
Merit: 1226
Away on an extended break
...
There is no more guessing like adding airport or something, caesar was kinda the last thing to guess.

Oops, missed this.
legendary
Activity: 1288
Merit: 1226
Away on an extended break
Quote
eight digit number starting with 78.
Well at least I know where I can find her:)

Alice must be at Croatia (country number 78)?
member
Activity: 61
Merit: 15

  • I can't tell whether I'm supposed to input my result from the previous hashes into the whirlpool.  Right now, I'm just assuming that and concatenating alice, and looping 50 times.  Maybe previous result goes in between cozz and alice, all three concatenated?

Just read the story. The script starts with name = "cozz" so imagine the hash being cozz.

  • Alice's phone number - sooo there's an 8 digit number used somewhere in the whirlpool rounds?  Not really sure where to put that..

I lost the phone number. So you have to get rid of it. You need not to search that much to find the number, its not made too difficult.

  • 888 and the airport.  I assume you mean prepend 888 to the airport code (such as BWI since we were talking Maryland earlier).  Or maybe you mean the origin code in Europe (such as a German airport).  Need a hint here I think.  Also, where does the previous result enter into this calculation?  Maybe we're supposed to ripemd160(888+airport+previous hash)?

As mentioned earlier the final gpg password starts with 888. The ripe-guy just guides me until I find my flight. There is no more guessing like adding airport or something, caesar was kinda the last thing to guess.
legendary
Activity: 1288
Merit: 1226
Away on an extended break
And cozz and alice are variables of a kind that could be concatenated/added together mathematically.

Not quite correct. Script uses concat operation, but the thing with the variables is just halfway correct.
Guess the concat should be here then: After jumping in the pool with her I felt like we have become one now

Hmm.. the 500euro bill is designed on 1996. ripemd160 again? (wild guess here) Or simply concatenate the text '500euro' ?

We jumped like another fifty times in that whirlpool : Whirlpool hash for 50 times?

member
Activity: 61
Merit: 15
Caesar

correct. 1BTC bee4464a735519ad7aac8eee58778b55c78a8849db93f368a853e0558d773a7f (transactionid)
Pages:
Jump to: