https://github.com/hank/life/blob/master/code/python/cozzriddle/cozz.py
i have sent you 1BTC for this b80460a1924b2f232ab4e938b9eccd2a498702583b26b720f1ffd4a9a953ab2c (transactionid)
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
cdceddbefbedbcdeccecdfea500euro
php
$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';
echo "exchange: $password\n";
bash
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"
echo "exchange: ""$password"
python
import binascii
# My ...
name = "cozz"
# Once I made a journey and visited some of my old friends.
# The first one is a doctor and he has 5 children (MD5)
# He lives in a very beautiful house.
# The house always impresses me so much that I drive 5 rounds around it before
# actually ringing the bell (while eating his meals)
# The only problem with this friend is that he uses pepper instead of salt
# to all his meals
import hashlib
m = binascii.b2a_hex(hashlib.md5(name+"pepper").digest())
m = binascii.b2a_hex(hashlib.md5(m+"pepper").digest())
m = binascii.b2a_hex(hashlib.md5(m+"pepper").digest())
m = binascii.b2a_hex(hashlib.md5(m+"pepper").digest())
m = binascii.b2a_hex(hashlib.md5(m+"pepper").digest())
print "After 5xmd5 = ", m
# The funny thing is after eating there you feel like your stomach has grown
# about 137% of the original size.
import base64
m = base64.b64encode(m)
print "After base64 = ", m
# The trip went on to Maryland. Sadly, the friend I was going to visit there
# wasn't at home. But accidentally I met a friend of this friend who also
# wanted to visit him. After all the only thing I can say about this friend of
# the friend is that he literally is a stupid or unpleasant person (git).
# git -> sha1
m = binascii.b2a_hex(hashlib.sha1(m).digest())
print "After sha1 = ", m
# As the trip was more expensive than I thought, I decided to step by at one of
# my richer friends and ask for some money. I dont even know which country he
# is really from, but his name sounds like japanese.
# Satoshi -> 2xsha256
m = hashlib.sha256(binascii.b2a_hex(hashlib.sha256(m).digest())).digest()
print "After 2xsha256 = ", binascii.b2a_hex(m)
# Having filled up my wallet I could no afford a flight to europe.
# Of course for that I had to make some money exchange.
# I simply exchanged all my numbered coins I had and became on 500euro note
# Which fit very well at the end of my wallet.
# (remove all numbers from hash, put "500euro" at the end
import re
m = binascii.b2a_hex(m)
m = re.sub(r'[0-9]', '', m) + "500euro"
print "After 'cashing in' numbers = ", m