mini-contest: try to crack this snippet ("Happy 2007!" Ruby challenge)

Discussion in 'Ruby' started by Mauricio Fernandez, Jan 6, 2007.

  1. http://eigenclass.org/rubychallenge2007

    Your mission, should you choose to accept it, is to find the secret message
    hidden in a Ruby script, follow the instructions to generate the code that
    will prove you've found the message, and report it via eigenclass.org (more
    details at the above address).

    This script works with Ruby 1.8.5 (also tested with -p12); alternative
    versions for Ruby 1.8.2, 1.8.3 and 1.8.4 are also available.
    If you want to try to crack the script, it's safer to download it from
    http://eigenclass.org/rubychallenge2007 (cut&paste fails too often...)

    One request: please don't publish your hints/solutions --- let's try to keep
    the challenge interesting for future readers. Thank you.

    The script must be saved as happy2007-eigenclass.org-1.8.5.rb (exactly) and
    run with Ruby 1.8.5, without RubyGems:
    $ RUBYOPT="" ruby happy2007-eigenclass.org-1.8.5.rb

    I hope you have fun.

    #OrNYAMv67ABbqnK01lSLaHsKlmOBIwcFqzuEXezq5cAYnu6IFvAF8IBXMDCp8R7NheeL13UiFV39S
    "02312ZqeVxtl3gw6NVawApA9bwn9LLGBfE/66UCuABlSFVRSr00stZa7YkchPYzsaMdQcLWp5xKCd
    0BUpoXvq5vnxVMgz29HvqTrnZVpDfDpWKB3m0uCcBY4rKSFoQ3rWDi8lArMyig2/nPObKuucdhlQjt
    OkQMgNXiH9l+bOmeMpiNTN8PIZoEcFFl0YwtcSXGOo4Tam21XPf7N9izo/7LAemLSG3mZ55cAgLegq
    +XJoRGtDMLrDj Ho7b9Q I/IeCa60CPfzR2rTh2Ng9aNLsxYLxBUS+ZnRJHQmmjGo6v4FfBnIVZx
    h0XTyv0X4+jcA wmWsmS 4cpRZ1ev7zmwvbWMFG5KZlDPoBLlgWoqe2FoDKx3q3n/UDmi6beIMdO
    nz4VAxdGERKv3 cki9FT O8aHKbLlx/BlP4hcD+63B+eRpAgK58DnV4sUKvo9BCuwQqM8k6WcDqS
    WP7ZNGiW8eA4y UIfsyd kX1v mUI Z FCsr A EUS ao47J GMlefa8WAd0b0UN
    YsfAiDTOmWugK 9MDpTe gqE cz/7 cy l1 86M kf P6n TLf bxh5zibUMKyMmmGx
    8OK5/1KjPRq1X aFUZkijk Qo Lx/Y 8R 7P38 WV ZL0 6Spf3M+okFpRQg2G
    UpfuWbtyB06BH 2Eu/vZ tbS AW 8kGx It 8VEl JP UZ2 8zosYQvGPPiDJmwU
    BpD+lkFRe/Piu 3kydXF Ij oHL5 ud mbSy Ti 6bwe daK a HYPybXbENNQlJoSGr
    CMCxXR3KlonNk NOCefm +4 fq6H 9o Yi0S vk +a1W AWx S AT5p/7w4YkUrFIxo/
    TESZLgRi1KIkw Nz4c8t NV yVB E5 eU E/h Av hev6v vd5lgvX4xykKm2PzV
    EvGksbbXFjezU Ennwvv FtT K 2y J c8h+ / 8NaJwN VbFruIzmZ6A9GomBIV
    1nN0eUMI5vdwTBD/034y6pP3gO9+tgY/Z+u D5oBVQlu jNK/74Mua6i RAmHBnc7jSxvMB9os7
    OE0v5q0/qNXYL7jfOZJ0Pgbnvih4ViB6ZWW LGu13Bdl fV3pNN49KZ Ra1rjx0Vtd6bbnVVFyO
    uzaad8w90GXhl52Q4hIkcKYeiT6TJ1O05ir eODiQFTS JRdOZ70m PhyljHwB/FPzjJvSseqW
    tJab3eZ+6uRFmEwsYCc37P2/24slUQ1f7d9eDpZ4NS4rVlaeIx5qH1fvZis8SUTGi3qT4BuK/wwGJb
    Dfw3dLu2uzIF4LbRzEl59Ni7EC0q/Pj0FUlY25CESpCiX7Tn8VhzJP7ObzONwpB1IptdshseudGY2F
    jeivpdahI26bvOWlPzb h1f+9T IK6oAn TerM 3DRb4S3gk+PjoejtttW6Ee
    PcnmtNVDNCAcOB9NV5 FWRh 38FS tp 7KCq 1k 6M4yO6ILq xVRpWPwqzICh9sav/u2Pnp
    MHxn4RF3UPxPtMnRc6XxvZHX it ld1g c/u l8v5 1j7p6vM4 ltqOtjAetny2g14uvLGKYC
    fAKn38RogjLz50xMtrw4aPl3 Gt 1J6e tr of90 0j35GGQ vv+TvjX4SeKRn1HPfGS8mjV
    utf/Mh4BFfMdnT8xsCqPMdy IW vb0L pm KgON w0clVkY PlyjUZVqIN2spadEG40Zib7
    geEI0WDd12Wfv45sont9TAE L5m BpSO 6w NfW5 Js9hP8 +UTtyV7vM75mIpxomFHjHWFT
    yNDKGiMk3lJmW3RbGBmTyk c8bJ /kEZ /J cvad O3JCFi TvOhTHvMkcEkG7Rto/vzg1TD
    ThuG4tBCTsMrV4enitht+ ITOE4 2Fr5 sa v9ag 7lIZw EYHMdZFbRlO8blKy1q1tOQtxZ
    2hQwARL2xBVaMQayxKry FzHVyZ xCS5 go DAcn jKXp/ tkWXIhFV3uDGDgXBfPGJZ69qS
    hfGaODSze+D/ixRRfeL yRMMFlkE mt t0Ig Mm fWqbV gXMbbZ7UN3GelWTpEbAsKa12W
    bqDUMPbQLy16Da85we jnb/ qayEBP Jt5kDC foIihFX3rGmjv8H35nLt4bwKg7
    SV2t9d9QPLEGEBIexr69FqX3fLii4UUouUUfs8RLJAHgWEoztt1tloZ8I7TsBpGtfTJntGyZdwcKEW
    NW7BTaYhVj70niCV4Ws407gIjZN5gIW1XeplrvpKEOGzuN9vmynojJOdgVfVV2hgJISHMCZHYehge0
    jzGCFECNwaUmxJiP80PRWWwjBY7hKnjhQjvyvhtGcNMEZAQPKYPYJcYQFIrCVjzDQmZUnZXNBu7SIy
    qneV+2/f4rOxDgu56FqYA39CAgtCVQTwmrWkpFt1M1ACFnacRf9ypJgS1kEURs3xx2/dngv0YGiSZG
    tiLXL3PyxR8mv21RsVCD2wA00400eNo1kFtLAzEQhd/zK8YiVKENVRBFEKEIPpWK1Ic+Zjezu6O5LJ
    mEdf+9k8U+5TLnO2dm9sfj4QqUOscClmxYZ7DYFUbIA0ITfQNtTAnb7Gat3sjCLEofLXXzIhlT7JPx
    EBMkDMYjUH6F0wWeyDnA39FFK5VuoW2UGOVNoLE4kysBrUkS69wMN/IyjuOFYpgGDP/gBkyGTB55Ay
    L5LpwhlaAq0xsKUEImVw15iBMvHUqON5liuNXqYH4QuCSsfms5BA4U+kpMlAf4LM0Md/pJPwhnQbqq
    KylcNbX2jp43SjQlMOa8fH/tz8eP07OC68v9ZbUSZ1ENZhzn+93ucYvUY2idYdYx9dslQqdGqboqxj
    ZhBhmLTS/7kJkNLead7LWOToHJotZa/QG9gJR7nNQde2XvHS8rqELruQqnMCQYPOvJepTOCl79AioL
    ".instance_eval{|$x|def h(q)q.unpack("m*")[0]end;def k(z);Zlib::Inflate.inflate(
    z)end;require'zlib';rr=eval k(h(File.read($0)[-605..-2]));ps=false;puts rr if ps
    begin;class<<$<;class<<self;class<<self;def f;end;f;end end end;rescue NameError
    p=lambda{rr=(rr.to_i*214013+2531011)&(2**32-1);(rr.to_i>>16)&0xff};begin v=$x.
    gsub(/\s+/,"");v2="";h(v[5,k=v[0,5].to_i]).each_byte{|b|v2<<(b^p[])};eval(k(v2)
    )[$x];rescue Interrupt;rescue Exception;puts k(h(v[10+k,v[5+k,5].to_i]));exit(
    42);end;else$W||=SCRIPT_LINES__={};class<<$<;class<<self;class<<self;def self.x;
    end end end end; load($0) end};exit
    # Copyright (C) 2005-2007 Mauricio Fernandez <>
    # http://eigenclass.org
    # Get the hidden message and claim your prize at eigenclass.org!
    __END__
    eNpVUVtr2zAUZo817D+IYBOp2RSnS9ouqh/cxQ2GxYEmbLAsCFk+zbw6tifJpeTy36c4g1G9SDrn8N1O
    3RjdnURf5pM4mVJKUTxN5o8RmkWLRTiNFug+ejj9wySehct4nnSZgj9NrgB1s3wD2vS32ajruN+ix/v5
    IkIoQGVeOCZ4yAugCkSGXZ8wPPB9v6dEmeGR7xNCTb4FvU9hk5dMfEgDPKD0itCtqPftlKE63wE5Ul0p
    w+BFFNisBKXp+tJinZGuLBCxerRsAEWvEmqTVyWDMjs6jstFsFozDYYbJSTwp6aUqFaV3B8uBT/Y/t0d
    FpxmUIABLgweEiY4OTLXBJNwGbITCXv/FgFbd4TJQmiN5ulvkIY1ZQZPfAvmV5WhcY3+CbKDyEphtol3
    QefTYDi6Ho461nrFc8YmbXrj8WwyoucksZV0auqeFEUB6vx2O3SjoMZ9qlK3T85Fz/vpac87XZnncf41
    TiLOe9g1tK50gL3/58zXe7MOqqUosacuVuHHH2tMyfLdBWkDt97bKQv1/XDYHwm1yTegV/66Zbaba8pa
    yGfcSTrEVpGHrm8G/u3tzefWLdo5fwFjGbgl1


    --
    Mauricio Fernandez - http://eigenclass.org - singular Ruby
    Mauricio Fernandez, Jan 6, 2007
    #1
    1. Advertising

  2. Mauricio Fernandez

    vasudevram Guest

    Mauricio Fernandez wrote:
    > http://eigenclass.org/rubychallenge2007
    >
    > Your mission, should you choose to accept it, is to find the secret message
    > hidden in a Ruby script, follow the instructions to generate the code that
    > will prove you've found the message, and report it via eigenclass.org (more
    > details at the above address).
    >
    > This script works with Ruby 1.8.5 (also tested with -p12); alternative
    > versions for Ruby 1.8.2, 1.8.3 and 1.8.4 are also available.
    > If you want to try to crack the script, it's safer to download it from
    > http://eigenclass.org/rubychallenge2007 (cut&paste fails too often...)
    >
    > One request: please don't publish your hints/solutions --- let's try to keep
    > the challenge interesting for future readers. Thank you.
    >
    > The script must be saved as happy2007-eigenclass.org-1.8.5.rb (exactly) and
    > run with Ruby 1.8.5, without RubyGems:
    > $ RUBYOPT="" ruby happy2007-eigenclass.org-1.8.5.rb
    >
    > I hope you have fun.
    >
    > #OrNYAMv67ABbqnK01lSLaHsKlmOBIwcFqzuEXezq5cAYnu6IFvAF8IBXMDCp8R7NheeL13UiFV39S
    > "02312ZqeVxtl3gw6NVawApA9bwn9LLGBfE/66UCuABlSFVRSr00stZa7YkchPYzsaMdQcLWp5xKCd
    > 0BUpoXvq5vnxVMgz29HvqTrnZVpDfDpWKB3m0uCcBY4rKSFoQ3rWDi8lArMyig2/nPObKuucdhlQjt
    > OkQMgNXiH9l+bOmeMpiNTN8PIZoEcFFl0YwtcSXGOo4Tam21XPf7N9izo/7LAemLSG3mZ55cAgLegq
    > +XJoRGtDMLrDj Ho7b9Q I/IeCa60CPfzR2rTh2Ng9aNLsxYLxBUS+ZnRJHQmmjGo6v4FfBnIVZx
    > h0XTyv0X4+jcA wmWsmS 4cpRZ1ev7zmwvbWMFG5KZlDPoBLlgWoqe2FoDKx3q3n/UDmi6beIMdO
    > nz4VAxdGERKv3 cki9FT O8aHKbLlx/BlP4hcD+63B+eRpAgK58DnV4sUKvo9BCuwQqM8k6WcDqS
    > WP7ZNGiW8eA4y UIfsyd kX1v mUI Z FCsr A EUS ao47J GMlefa8WAd0b0UN
    > YsfAiDTOmWugK 9MDpTe gqE cz/7 cy l1 86M kf P6n TLf bxh5zibUMKyMmmGx
    > 8OK5/1KjPRq1X aFUZkijk Qo Lx/Y 8R 7P38 WV ZL0 6Spf3M+okFpRQg2G
    > UpfuWbtyB06BH 2Eu/vZ tbS AW 8kGx It 8VEl JP UZ2 8zosYQvGPPiDJmwU
    > BpD+lkFRe/Piu 3kydXF Ij oHL5 ud mbSy Ti 6bwe daK a HYPybXbENNQlJoSGr
    > CMCxXR3KlonNk NOCefm +4 fq6H 9o Yi0S vk +a1W AWx S AT5p/7w4YkUrFIxo/
    > TESZLgRi1KIkw Nz4c8t NV yVB E5 eU E/h Av hev6v vd5lgvX4xykKm2PzV
    > EvGksbbXFjezU Ennwvv FtT K 2y J c8h+ / 8NaJwN VbFruIzmZ6A9GomBIV
    > 1nN0eUMI5vdwTBD/034y6pP3gO9+tgY/Z+u D5oBVQlu jNK/74Mua6i RAmHBnc7jSxvMB9os7
    > OE0v5q0/qNXYL7jfOZJ0Pgbnvih4ViB6ZWW LGu13Bdl fV3pNN49KZ Ra1rjx0Vtd6bbnVVFyO
    > uzaad8w90GXhl52Q4hIkcKYeiT6TJ1O05ir eODiQFTS JRdOZ70m PhyljHwB/FPzjJvSseqW
    > tJab3eZ+6uRFmEwsYCc37P2/24slUQ1f7d9eDpZ4NS4rVlaeIx5qH1fvZis8SUTGi3qT4BuK/wwGJb
    > Dfw3dLu2uzIF4LbRzEl59Ni7EC0q/Pj0FUlY25CESpCiX7Tn8VhzJP7ObzONwpB1IptdshseudGY2F
    > jeivpdahI26bvOWlPzb h1f+9T IK6oAn TerM 3DRb4S3gk+PjoejtttW6Ee
    > PcnmtNVDNCAcOB9NV5 FWRh 38FS tp 7KCq 1k 6M4yO6ILq xVRpWPwqzICh9sav/u2Pnp
    > MHxn4RF3UPxPtMnRc6XxvZHX it ld1g c/u l8v5 1j7p6vM4 ltqOtjAetny2g14uvLGKYC
    > fAKn38RogjLz50xMtrw4aPl3 Gt 1J6e tr of90 0j35GGQ vv+TvjX4SeKRn1HPfGS8mjV
    > utf/Mh4BFfMdnT8xsCqPMdy IW vb0L pm KgON w0clVkY PlyjUZVqIN2spadEG40Zib7
    > geEI0WDd12Wfv45sont9TAE L5m BpSO 6w NfW5 Js9hP8 +UTtyV7vM75mIpxomFHjHWFT
    > yNDKGiMk3lJmW3RbGBmTyk c8bJ /kEZ /J cvad O3JCFi TvOhTHvMkcEkG7Rto/vzg1TD
    > ThuG4tBCTsMrV4enitht+ ITOE4 2Fr5 sa v9ag 7lIZw EYHMdZFbRlO8blKy1q1tOQtxZ
    > 2hQwARL2xBVaMQayxKry FzHVyZ xCS5 go DAcn jKXp/ tkWXIhFV3uDGDgXBfPGJZ69qS
    > hfGaODSze+D/ixRRfeL yRMMFlkE mt t0Ig Mm fWqbV gXMbbZ7UN3GelWTpEbAsKa12W
    > bqDUMPbQLy16Da85we jnb/ qayEBP Jt5kDC foIihFX3rGmjv8H35nLt4bwKg7
    > SV2t9d9QPLEGEBIexr69FqX3fLii4UUouUUfs8RLJAHgWEoztt1tloZ8I7TsBpGtfTJntGyZdwcKEW
    > NW7BTaYhVj70niCV4Ws407gIjZN5gIW1XeplrvpKEOGzuN9vmynojJOdgVfVV2hgJISHMCZHYehge0
    > jzGCFECNwaUmxJiP80PRWWwjBY7hKnjhQjvyvhtGcNMEZAQPKYPYJcYQFIrCVjzDQmZUnZXNBu7SIy
    > qneV+2/f4rOxDgu56FqYA39CAgtCVQTwmrWkpFt1M1ACFnacRf9ypJgS1kEURs3xx2/dngv0YGiSZG
    > tiLXL3PyxR8mv21RsVCD2wA00400eNo1kFtLAzEQhd/zK8YiVKENVRBFEKEIPpWK1Ic+Zjezu6O5LJ
    > mEdf+9k8U+5TLnO2dm9sfj4QqUOscClmxYZ7DYFUbIA0ITfQNtTAnb7Gat3sjCLEofLXXzIhlT7JPx
    > EBMkDMYjUH6F0wWeyDnA39FFK5VuoW2UGOVNoLE4kysBrUkS69wMN/IyjuOFYpgGDP/gBkyGTB55Ay
    > L5LpwhlaAq0xsKUEImVw15iBMvHUqON5liuNXqYH4QuCSsfms5BA4U+kpMlAf4LM0Md/pJPwhnQbqq
    > KylcNbX2jp43SjQlMOa8fH/tz8eP07OC68v9ZbUSZ1ENZhzn+93ucYvUY2idYdYx9dslQqdGqboqxj
    > ZhBhmLTS/7kJkNLead7LWOToHJotZa/QG9gJR7nNQde2XvHS8rqELruQqnMCQYPOvJepTOCl79AioL
    > ".instance_eval{|$x|def h(q)q.unpack("m*")[0]end;def k(z);Zlib::Inflate.inflate(
    > z)end;require'zlib';rr=eval k(h(File.read($0)[-605..-2]));ps=false;puts rr if ps
    > begin;class<<$<;class<<self;class<<self;def f;end;f;end end end;rescue NameError
    > p=lambda{rr=(rr.to_i*214013+2531011)&(2**32-1);(rr.to_i>>16)&0xff};begin v=$x.
    > gsub(/\s+/,"");v2="";h(v[5,k=v[0,5].to_i]).each_byte{|b|v2<<(b^p[])};eval(k(v2)
    > )[$x];rescue Interrupt;rescue Exception;puts k(h(v[10+k,v[5+k,5].to_i]));exit(
    > 42);end;else$W||=SCRIPT_LINES__={};class<<$<;class<<self;class<<self;def self.x;
    > end end end end; load($0) end};exit
    > # Copyright (C) 2005-2007 Mauricio Fernandez <>
    > # http://eigenclass.org
    > # Get the hidden message and claim your prize at eigenclass.org!
    > __END__
    > eNpVUVtr2zAUZo817D+IYBOp2RSnS9ouqh/cxQ2GxYEmbLAsCFk+zbw6tifJpeTy36c4g1G9SDrn8N1O
    > 3RjdnURf5pM4mVJKUTxN5o8RmkWLRTiNFug+ejj9wySehct4nnSZgj9NrgB1s3wD2vS32ajruN+ix/v5
    > IkIoQGVeOCZ4yAugCkSGXZ8wPPB9v6dEmeGR7xNCTb4FvU9hk5dMfEgDPKD0itCtqPftlKE63wE5Ul0p
    > w+BFFNisBKXp+tJinZGuLBCxerRsAEWvEmqTVyWDMjs6jstFsFozDYYbJSTwp6aUqFaV3B8uBT/Y/t0d
    > FpxmUIABLgweEiY4OTLXBJNwGbITCXv/FgFbd4TJQmiN5ulvkIY1ZQZPfAvmV5WhcY3+CbKDyEphtol3
    > QefTYDi6Ho461nrFc8YmbXrj8WwyoucksZV0auqeFEUB6vx2O3SjoMZ9qlK3T85Fz/vpac87XZnncf41
    > TiLOe9g1tK50gL3/58zXe7MOqqUosacuVuHHH2tMyfLdBWkDt97bKQv1/XDYHwm1yTegV/66Zbaba8pa
    > yGfcSTrEVpGHrm8G/u3tzefWLdo5fwFjGbgl1
    >
    >
    > --
    > Mauricio Fernandez - http://eigenclass.org - singular Ruby


    > Mauricio Fernandez - http://eigenclass.org - singular Ruby



    Nice one :)

    I guess I must have a built-in Ruby interpreter in my brain. I didn't
    even need to read the code, let alone write any, to get the solution
    :)

    Vasudev Ram
    http://www.dancingbison.com
    vasudevram, Jan 7, 2007
    #2
    1. Advertising

  3. On Sun, Jan 07, 2007 at 11:00:21PM +0900, vasudevram wrote:
    > Mauricio Fernandez wrote:
    > > http://eigenclass.org/rubychallenge2007
    > >
    > > Your mission, should you choose to accept it, is to find the secret message
    > > hidden in a Ruby script, follow the instructions to generate the code that
    > > will prove you've found the message, and report it via eigenclass.org (more
    > > details at the above address).

    >
    > Nice one :)
    >
    > I guess I must have a built-in Ruby interpreter in my brain. I didn't
    > even need to read the code, let alone write any, to get the solution
    > :)


    Impressive! I myself can hardly decode base64 in my mind, let alone
    zlib-decompress it or ... :)

    I can see lots of "GET /rubychallenge2007/Happy2007 HTTP/1.1" and similar in
    the logs, but AFAICT only 9 people have cracked the code out of 206 so far.
    10 including you ;)

    --
    Mauricio Fernandez - http://eigenclass.org - singular Ruby
    Mauricio Fernandez, Jan 8, 2007
    #3
  4. Mauricio Fernandez

    _why Guest

    On Sun, Jan 07, 2007 at 11:00:21PM +0900, vasudevram wrote:
    > I guess I must have a built-in Ruby interpreter in my brain. I didn't
    > even need to read the code, let alone write any, to get the solution
    > :)


    Zed Shaw did it blindfolded, hands tied, with a cigar in his mouth. He didn't
    even have to say anything. A bit of that white-and-green tractor-fed paper
    spilled out of a crease in his forehead.

    _why
    _why, Jan 8, 2007
    #4
  5. Mauricio Fernandez

    Evan Weaver Guest

    Re: mini-contest: try to crack this snippet ("Happy 2007!" R

    Pfff. I fail to see Zed on the list.

    Evan Weaver

    --
    Posted via http://www.ruby-forum.com/.
    Evan Weaver, Jan 8, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Coen
    Replies:
    0
    Views:
    421
  2. mielikuvitusjuustokirja

    who can crack this?

    mielikuvitusjuustokirja, Feb 21, 2006, in forum: Java
    Replies:
    18
    Views:
    7,430
    Roedy Green
    Feb 23, 2006
  3. Replies:
    15
    Views:
    575
    James Kanze
    Apr 2, 2007
  4. Mauricio Fernandez
    Replies:
    0
    Views:
    170
    Mauricio Fernandez
    Jan 5, 2007
  5. Antonio Cangiano

    [ANN] Ruby on Crack

    Antonio Cangiano, Apr 1, 2008, in forum: Ruby
    Replies:
    5
    Views:
    97
    Brian Adkins
    Apr 2, 2008
Loading...

Share This Page