-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, Apr 28, 2004 at 04:34:55PM -0400, Adam Back wrote: >Well I coded a little bit, and can now create and verify v1 stamps. > >Here's a real example: > >1:20:040428:foo::0298b26853c8ebb3:beca0 > >which is broken down by : separated field: So, I don't remember the verdict from before. Is ':' always a separator? How do we put a ':' in a field (some kind of escape)? I guess I'm asking what's the right way to pull this thing into its component parts. I made a pretty simple change in hashcash-sendmail to deal with the new format. I haven't published the change yet, since I haven't tested it at all. diff -r1.14 hashcash-sendmail 773c773,777 < $expiry = $1 if ( $tok =~ /X-Hashcash: 0:(\d+):/ ); - - --- > # v0 = 0:date > # v1 = 1:bits:date > if ( $tok =~ /X-Hashcash: (?:0|1:\d+):(\d+):/ ) { > $expiry = $1; > } I think it's simple enough I don't need a test, but I've been wrong before. 8-) >the random field is to avoid collisions; the counter starts at 0 and >increases. For small numbers of bits you expect a short counter (on >average) and for larger numbers of bits you expect a larger counter. > >This arrangement with separate randomness part counter field makes the >probability of collision collision independent of size in bits. I'm missing something. I don't understand what you gain from separating the random part and the count. You have <random>:<count> (e.g., 123:456). Is that very different from <random><count> (e.g., 123456) or <random+count> (e.g., 579)? I guess I'm thinking that they all collide the same way, with the same frequency. You seem to be saying this has something to do with the size in bits, but I don't get it. We expect a low bit stamp to have a smaller counter, I guess, but I'm not sure what that has to do with anything. >You can also see directly in the stamp btw how unlucky the generator >got. So for a 20 bit stamp you expect 2^20 tries which is 1 >mega-tries, or 100000 in hex. You can see it took only BECA0 tries or >about BE/100 = 74% of expected time. I'm going to rewrite my generator to start the counter at 2^(bits+2). It'll be the unluckiest generator on the net. 8-) - -- Kyle Hasselbacher TV is chewing gum for the eyes. kyle@xxxxxxxxxxx -- Frank Lloyd Wright -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAkBzc10sofiqUxIQRAhviAJkBoqyUlM+UxjVgfobcf3HA2ucZEwCfW+3j f5CH7nCzo5Dv29WTNLl1aac= =gBRd -----END PGP SIGNATURE-----