please prefer base 64 over base 32 (was: Re: [p2p-hackers] Bitzi (was Various identifier choices))

Oskar Sandberg oskar at freenetproject.org
Wed Sep 19 14:57:02 UTC 2001


On Wed, Sep 19, 2001 at 11:10:07AM -0700, hal at finney.org wrote:
> Zooko writes:
> > Since mojoids include 160-bit SHA1 hashes, they are collision free *even* if
> > you base64 encode them and then merge all the upper/lowercase!  (That isn't
> > obvious, but once upon a time I convinced myself of it.  I can find the message
> > in old mojonation-devel archives if you like.)
> 
> Base64 encoding a 160 bit hash would take 26-27 characters.  Compressing
> case throws away 1 bit per character that happens to be alphabetic, and
> 52/64 of the characters will be alphabetic.  So you'll end up discarding
> around 21 bits, giving the hash an effective strength of 139 bits.
> That should be amply strong for these purposes.

It makes a lot more sense to generate a shorter key to begin with and
base32 encode it, then to generate a full length key and then downgrade
it based on the base64 encoding...

> 
> Hal
> _______________________________________________
> p2p-hackers mailing list
> p2p-hackers at zgp.org
> http://zgp.org/mailman/listinfo/p2p-hackers

-- 
Though here at journey's end I lie 
  In darkness buried deep,          above all shadows rides the Sun
beyond all towers strong and high,    and the Stars forever dwell:
  beyond all mountains steep,       I will not say the Day is done,
                                      nor bid the Stars farewell.
(JRRT)

Oskar Sandberg
oskar at freenetproject.org



More information about the P2p-hackers mailing list