Skip to content

Commit

Permalink
Dead beef.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradfitz committed Apr 6, 2014
0 parents commit deadbee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
What do you get when you kill a cow?

(Note the commit hash.)

13 comments on commit deadbee

@dmitshur
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol.

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

@karan
Copy link

@karan karan commented on deadbee Apr 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How'd you do that?

@coffeecodecouch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link

@karan karan commented on deadbee Apr 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's smart dude.

@jketcham
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great.

@chalkers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delight!

@mathiasbynens
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@coldhawaiian
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link

@garyvdm garyvdm commented on deadbee Apr 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@arthurnn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

@peterdietz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@stuartpb
Copy link

@stuartpb stuartpb commented on deadbee Jul 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cute! This is the same approach I used to generate the feefee commit on my Large Hashsum Collider project in February 2013, except mine was written in JavaScript, and generated the collision by jiggling words in the commit message instead of the timestamps.

Please sign in to comment.