USE OF PROGRAM
The program 'hashcash' will calculate an X-Hashcash: header line to
allow your message to pass through a hashcash mail2news gateway. You
will need some information (from the gateway's webpage) first.
1) Find how many 'collision bits' the gateway requires (this controls how
long the program will take). For testing, the default is 17 bits. Variable
bits% will set the required value.
2) Find the 'challenge string' used by the gateway (you will see this appear
also in the output). For testing, the current string is 'fluffybunny'.
Variable challenge$ will set this value.
3) If you do not run the program in a taskwindow, output will be printed to
screen but also to a file. The default is to a file on RAMdisc. To change
this, variable output$ will set the filename.
Edit the program to set these variables. When you run the program, it will
check the speed for your computer and then tell you how long to calculate
the number of bits you have asked. Then it will print up to six 'tokens',
with actual time taken for each one. To stop the program (not during speed
test) press ESCAPE. Use taskwindow to run it as a background task.
A token is a line starting "X-Hashcash:". To use a hashcash token, add it to
the header lines in the email message you send to the mail2news gateway.
--------------------------------------------------------------------------------
SAMPLE OUTPUT
3.69 seconds to complete 51200 hashes
13875 hashes per second
Checking for 17-bit match
131072 estimated tries at 0 hours 0 min 9 sec
X-Hashcash: 020424:fluffybunny:2b0b1eda6939b3be
251470 tries Actual time 0 hours 0 min 23 sec
X-Hashcash: 020424:fluffybunny:18beb9156cfe0538
20189 tries Actual time 0 hours 0 min 1 sec
X-Hashcash: 020424:fluffybunny:2bfe4fe2a4f4cf15
36816 tries Actual time 0 hours 0 min 3 sec
X-Hashcash: 020424:fluffybunny:4ed2f3554bb3e975
149360 tries Actual time 0 hours 0 min 14 sec
X-Hashcash: 020424:fluffybunny:dc367aecb902aea8
311466 tries Actual time 0 hours 0 min 29 sec
X-Hashcash: 020424:fluffybunny:02a9a2f02978dd76
49654 tries Actual time 0 hours 0 min 4 sec
--------------------------------------------------------------------------------
SAMPLE HEADERS
From: Someone
To: mail2news-hashcash@dizum.com
Date: Mon, 11 Mar 2002 00:32:59 +0000
Message-ID: <20020311003259.A1080297@exeter.ac.uk>
Subject: hashcash test
X-Hashcash: 020424:fluffybunny:2bfe4fe2a4f4cf15
Newsgroups: alt.test
--------------------------------------------------------------------------------
To test the 'value' of a given token (how many bits match) the program
'bitmatch' can be used. This program does not use the fast machine code
routine which cannot return a full result but instead uses a simple BASIC
procedure which is 1000 times slower. However to test the number of bits
only one hash is needed (this is how the gateway can check quickly) so the
speed does not matter.
--------------------------------------------------------------------------------
Also Theo Markettos has written SHA-1 module for RISC OS which will
calculate a full hash by a SWI call "SHA1_Digest". This is too slow for
hashcash but has many other uses. Visit
http://www.chiark.greenend.org.uk/~theom/riscos/crypto/index.html