Permalink
Browse files

Dead beef.

  • Loading branch information...
bradfitz committed Apr 6, 2014
0 parents commit deadbeefa1a98280231197b184c6d7ea4d2a7055
Showing with 3 additions and 0 deletions.
  1. +3 −0 README
3 README
@@ -0,0 +1,3 @@
What do you get when you kill a cow?
(Note the commit hash.)

12 comments on commit deadbee

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Apr 6, 2014

Lol.

gitbrute could've been handy during the last Stripe CTF, for the 2nd task.

dmitshur replied Apr 6, 2014

Lol.

gitbrute could've been handy during the last Stripe CTF, for the 2nd task.

@karan

This comment has been minimized.

Show comment
Hide comment
@karan

karan Apr 6, 2014

How'd you do that?

karan replied Apr 6, 2014

How'd you do that?

@coffeecodecouch

This comment has been minimized.

Show comment
Hide comment
@coffeecodecouch

coffeecodecouch Apr 6, 2014

@karan commit hashes are just sha1 hashes. Since there are no limitations on how many times you can alter the commit, you can repeatedly alter it (though you would have to automate this for it to be at all effective) until the hash begins with the text you desire. It's the same idea behind Bitcoin vanity addresses.

coffeecodecouch replied Apr 6, 2014

@karan commit hashes are just sha1 hashes. Since there are no limitations on how many times you can alter the commit, you can repeatedly alter it (though you would have to automate this for it to be at all effective) until the hash begins with the text you desire. It's the same idea behind Bitcoin vanity addresses.

@karan

This comment has been minimized.

Show comment
Hide comment
@karan

karan Apr 6, 2014

That's smart dude.

karan replied Apr 6, 2014

That's smart dude.

@jketcham

This comment has been minimized.

Show comment
Hide comment
@jketcham

jketcham Apr 6, 2014

This is great.

jketcham replied Apr 6, 2014

This is great.

@chalkers

This comment has been minimized.

Show comment
Hide comment
@chalkers

chalkers replied Apr 7, 2014

Delight!

@mathiasbynens

This comment has been minimized.

Show comment
Hide comment
@mathiasbynens

mathiasbynens replied Apr 7, 2014

Yeah, level1 in Stripe CTF3 was pretty much this. https://github.com/ctfs/write-ups/tree/master/stripe-ctf3/level1#readme

@coldhawaiian

This comment has been minimized.

Show comment
Hide comment
@coldhawaiian

coldhawaiian Apr 8, 2014

I don't know enough about how the sha sums are generated (I assume it's based on commit contents + time of commit + commit message + "voodoo magic"), but assuming that each [a-f][0-9] is distributed uniformly and has an equal chance of appearing at any position, then the odds of generating deadbeef in the first 8 characters is

1 / 16^8 = 1 / 4,294,967,296 = 0.00000000023283064365386962890625

Right? So you end up having to generate a lot of hashes in order to get deadbeef.

coldhawaiian replied Apr 8, 2014

I don't know enough about how the sha sums are generated (I assume it's based on commit contents + time of commit + commit message + "voodoo magic"), but assuming that each [a-f][0-9] is distributed uniformly and has an equal chance of appearing at any position, then the odds of generating deadbeef in the first 8 characters is

1 / 16^8 = 1 / 4,294,967,296 = 0.00000000023283064365386962890625

Right? So you end up having to generate a lot of hashes in order to get deadbeef.

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Apr 8, 2014

@coldhawaiian That's per attempt.

If you go through 1 million attempts per second, the expected time to get a match would be 72 minutes.

dmitshur replied Apr 8, 2014

@coldhawaiian That's per attempt.

If you go through 1 million attempts per second, the expected time to get a match would be 72 minutes.

@garyvdm

This comment has been minimized.

Show comment
Hide comment
@garyvdm

garyvdm Apr 8, 2014

I just knew there would be other uses for bitcoin mining hardware....

garyvdm replied Apr 8, 2014

I just knew there would be other uses for bitcoin mining hardware....

@arthurnn

This comment has been minimized.

Show comment
Hide comment
@arthurnn

arthurnn replied Apr 8, 2014

👍

@peterdietz

This comment has been minimized.

Show comment
Hide comment
@peterdietz

peterdietz Oct 17, 2014

In case anyone cared how long it takes to get deadbeef, it took me about 30 minutes on MBP.

peterdietz:gitbrute peterdietz$ time go run gitbrute.go --prefix deadbeef
[master deadbeef] Merge pull request #3 from Jubobs/master
 Author: Brad Fitzpatrick <brad@danga.com>

real    30m9.491s
user    177m7.754s
sys 6m20.912s

Then, it's a pretty normal looking git hash:

peterdietz:gitbrute peterdietz$ git log
commit deadbeef384da2b4b9c7701a93f1c85977027b30
Merge: 12179d7 37350ac
Author: Brad Fitzpatrick <brad@...>
Date:   Fri Oct 17 07:14:08 2014 -0700

    Merge pull request #3 from Jubobs/master

    correct typo in README

One of the doomsday ideas of full-collision deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, yeah, that would take a looong time, but yeah, theoretical.

peterdietz replied Oct 17, 2014

In case anyone cared how long it takes to get deadbeef, it took me about 30 minutes on MBP.

peterdietz:gitbrute peterdietz$ time go run gitbrute.go --prefix deadbeef
[master deadbeef] Merge pull request #3 from Jubobs/master
 Author: Brad Fitzpatrick <brad@danga.com>

real    30m9.491s
user    177m7.754s
sys 6m20.912s

Then, it's a pretty normal looking git hash:

peterdietz:gitbrute peterdietz$ git log
commit deadbeef384da2b4b9c7701a93f1c85977027b30
Merge: 12179d7 37350ac
Author: Brad Fitzpatrick <brad@...>
Date:   Fri Oct 17 07:14:08 2014 -0700

    Merge pull request #3 from Jubobs/master

    correct typo in README

One of the doomsday ideas of full-collision deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, yeah, that would take a looong time, but yeah, theoretical.

Please sign in to comment.