I write lots of perl CGI. Why is this tiny little script so pants, and why did it take so long?
Need to start on the Java side PDQ. Never mind start, I need to think about what it should do. I'll think out loud, so you can help. (Very kind of you to list... oh, see ya later)
- HTML fires up the applet, either just because it can or (more likely, and the purpose) to calculate a partial hash collision on a bit of data.
- Well it should probably be threaded, so..
- ..one thread to sit there and churn numbers. It should probably update a variable and notify the other thread, when it finds a collision bigger than what it had a moment ago.
- ..the other thread to look at how fast things are going
and update the GUI to estimate how long it will take. I
suspect a progress bar would be depressing to watch. Also
misleading since it could go to 1000% if you're unlucky.
Maybe a Windows-style "5 seconds left!". "Oh, hang on .. no, it'll be about 2 minutes". Five minutes later...Abort button? Well you could send an inadequate hashcash token. I've been starting to think about this. I think it should be valid to say "I think that talking to you is only worth 10 seconds CPU time, so if you want to sit there and demand 2 hours then tough".
- ..network access will be pretty simple. The only important bit is sending the completed collision back to the webserver (POST request, I should think) so it can validate it and then email it to someone. (Webserver sends the email so I don't have to fart about with a "secure" applet.)
- There may be some merit in requesting some tiny bit of data of the webserver just to obtain a cookie saying how fast your processor is, so that the HTML can tell you how long things will take next time you visit.
Of course, I say "start". Lapo Luchini's GPL code will do all the hard work for me. Oh yeah, I should drop him a line if I'm going to start hacking about, shouldn't I? I'm so rude. 8-(
Am I scared that lots of stupid emails will be leaving my computer, destined for random people? Well all I have to do is up the minimum collision threshold to 25 bits and it will go very very quiet. 8-)