Bitcoin Forum
June 27, 2024, 12:49:08 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 [4]  All
  Print  
Author Topic: Another riddle - guess script win 10BTC [SOLVED]  (Read 8382 times)
ralree
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


Manateeeeeeees


View Profile
December 29, 2012, 07:57:04 PM
 #61

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!

1MANaTeEZoH4YkgMYz61E5y4s9BYhAuUjG
cozz (OP)
Member
**
Offline Offline

Activity: 61
Merit: 15


View Profile
December 29, 2012, 08:07:30 PM
 #62


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


1cozzwyCJvDiyBA8zXGJ1qxtrd5b4i1nB
cozz (OP)
Member
**
Offline Offline

Activity: 61
Merit: 15


View Profile
December 29, 2012, 08:09:52 PM
 #63

Oh I just noticed your script is still missing the phone number thing, but you will find that Im pretty sure.

1cozzwyCJvDiyBA8zXGJ1qxtrd5b4i1nB
ralree
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


Manateeeeeeees


View Profile
December 29, 2012, 08:12:00 PM
 #64

OMFG I'm so close..

Thanks for the tips!

1MANaTeEZoH4YkgMYz61E5y4s9BYhAuUjG
Scrat Acorns
Sr. Member
****
Offline Offline

Activity: 293
Merit: 250



View Profile
December 29, 2012, 08:16:32 PM
Last edit: December 29, 2012, 08:26:35 PM by Scrat Acorns
 #65

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
ralree
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


Manateeeeeeees


View Profile
December 29, 2012, 08:18:32 PM
 #66

Damn nice Job Scrat!  What ended up being the final script?

1MANaTeEZoH4YkgMYz61E5y4s9BYhAuUjG
Scrat Acorns
Sr. Member
****
Offline Offline

Activity: 293
Merit: 250



View Profile
December 29, 2012, 08:21:20 PM
 #67

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
ralree
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


Manateeeeeeees


View Profile
December 29, 2012, 08:26:57 PM
 #68

78427939?

29a253dbe3d494581e30dfae3fd363f78427939cf2e467369b0fea2fba0e6c667e37f888d14b2a3 cc1153f552b1cbf9d504436aa9221eb0c123b9f555733dd22 was the full whirlpool output?

And where did you use that?

1MANaTeEZoH4YkgMYz61E5y4s9BYhAuUjG
Scrat Acorns
Sr. Member
****
Offline Offline

Activity: 293
Merit: 250



View Profile
December 29, 2012, 08:28:14 PM
 #69

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.
cozz (OP)
Member
**
Offline Offline

Activity: 61
Merit: 15


View Profile
December 29, 2012, 08:33:00 PM
Last edit: December 29, 2012, 08:50:18 PM by cozz
 #70

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"

1cozzwyCJvDiyBA8zXGJ1qxtrd5b4i1nB
ralree
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


Manateeeeeeees


View Profile
December 29, 2012, 08:33:38 PM
 #71

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 <cozz00lovan@yahoo.com>"
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 <cozz00lovan@yahoo.com>"
5J1TxGPBqgJmpDqJPwkLE43nTsSyvDHjuCefgcfbKoqhc5Wfek7

1MANaTeEZoH4YkgMYz61E5y4s9BYhAuUjG
AwkwardSituation
Newbie
*
Offline Offline

Activity: 29
Merit: 0


View Profile
December 30, 2012, 04: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!
Pages: « 1 2 3 [4]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!