🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #174915

Re: benchmark win32 1.x hashcash.exe (Re: hashcash 1.04 released)

#174915
From: Adam Back
Date: Sat, 11 Sep 2004 21:52
58 lines
4163 bytes
I think the correct solution would be to use the win32 crypto api 
interface to call windows cryptographic random number generator.

Unfortunately I'm not really a windows programmer (unix hacker) so I 
don't know how to do this directly.  But if someone could give me 
pointers or sample code I'm happy to try and do this inside 
#ifdef(_WIN32) in random.c.  Maybe openssl even has some code calling it 
(will take a look).

Note also it should not happen all that often accidentally because two 
users would have to send to the same end-recipient at the same 1/100th 
second interval on the same day.  Not that this is intended as an excuse 
-- I fully agree it should be fixed.

Anyone have tips or sample code I can copy to use the crypto RNG on windows?

I could use openssl, but it's not small, and adds a big dependency which 
would probably make compiling with wingw harder.  But if really can't 
make CAPI rng work under wingw, I can try that.

There is one other important use of random numbers in hashcash -- the -a 
option which is for use with mixmaster and other remailers to hide the 
send time.  From the docs:

   -a period

      Add (or subtract if number is negative) a random value from the
      current time before minting the stamp.  This hides the time the
      stamp was created, which may be useful for anonymous users.  Note
      adding (rather than subtracting) a random time may be risky if the
      stamp takes less than the added time to arrive as the recipient
      will reject stamps with time stamps in the future.

So if you do -a -3d this mimicks what mixmaster does.  (mixmaster also 
includes timestamps to allow it to expire the replay control entries; to 
avoid this leaking the precise send time, it subtracts 0-3 day period 
from the timestamp).  -a -3d does the same to the hashcash stamp 
visibile in the header in UTC YYMMDD[hhmm[ss]] format.

Really people who are using hashcash with remailers ought to use this 
feature.  That's what it was designed for.  (Of course improving the 
randomness would increase the protection offered for your send time when 
using -a).

Adam

Thomas J. Boschloo wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> I understand from the source code for 1.06 that the random functions
> under windows only rely on things like the getpid() (ProcessID?) and the
> clock()/time()? Wouldn't that cause a lot of problems (double spends)
> when multiple people are minting at the same time? If only you would use
> a random.bin file things would be a lot better (assuming people would
> run the hashcash minter at different time intervals). Maybe you could
> also use OpenSSL as I see some #defines for that in the source code?
> 
> And maybe there should be an entropy warning when running under windows?
Technical Details
Message-ID: <414373E8.4050407@cypherspace.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.music.nirvana.20141024.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!newspeer1-win.ntli.net!newsfe4-gui.ntli.net.POSTED!53ab2750!not-for-mail
References: <413E57CC.8020508@cypherspace.org> <4142219A.9020605@cypherspace.org> <4142fc55$0$153$3a628fcd@reader2.nntp.hccnet.nl>

Show Full Headers
Complete Article Headers
Message-ID: <414373E8.4050407@cypherspace.org>
Subject: Re: benchmark win32 1.x hashcash.exe (Re: hashcash 1.04 released)
Date: Sat, 11 Sep 2004 21:52:46 GMT
From: Adam Back <adam@cypherspace.org>
References: <413E57CC.8020508@cypherspace.org> <4142219A.9020605@cypherspace.org> <4142fc55$0$153$3a628fcd@reader2.nntp.hccnet.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.music.nirvana.20141024.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!newspeer1-win.ntli.net!newsfe4-gui.ntli.net.POSTED!53ab2750!not-for-mail
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: alt.privacy.anon-server
In-Reply-To: <4142fc55$0$153$3a628fcd@reader2.nntp.hccnet.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 58
NNTP-Posting-Host: 82.3.243.71
X-Complaints-To: abuse@virgin.net
X-Trace: newsfe4-gui.ntli.net 1094939566 82.3.243.71 (Sat,
NNTP-Posting-Date: Sat, 11 Sep 2004 22:52:46 BST
Organization: Virgin Net Usenet Service