scallion icon indicating copy to clipboard operation
scallion copied to clipboard

Time estimate off by factor of 2?

Open jwilk opened this issue 6 years ago • 2 comments

README says the average time to get a partial collision for GPG is:

2^(4*length-1) / hashspeed

Where does -1 come from? I believe it should be:

2^(4*length) / hashspeed

jwilk avatar Aug 21 '18 21:08 jwilk

It is the average time to find a collision. On average you will find a collision after trying 50% of the total possible combinations.

lukechilds avatar Aug 21 '18 23:08 lukechilds

Checking one hash is a Bernoulli trial with success probability p = 16−length. The number of trails needed to get one success has geometric distribution. The expected value of a geometrically distributed random variable is 1/p, not 1/(2p).

jwilk avatar Aug 22 '18 14:08 jwilk