Proof of work - an unobtrusive alternative to captchas
bennolan.com
bennolan.com
A proof-of-work system requires a verifiable amount of computation time before you can do something. The idea is that "honest" computers are mostly idle, but that this should slow down spammers.
The problem is that it may not be possible to seriously inconvenience spammers without seriously inconveniencing honest clients, even if both run native code (e.g. hashcash). The article limits the honest guy to some crappy smartphone's interpreted Javascript running an algorithm that is very much optimized for 32-bit machine words (instead of Javascript's floats). If the smartphone can do the work in 10sec (which is annoying enough), the spammer should be able to do it in at most .01sec: enough to send ~8.6 million messages per day.
Client Puzzles have a couple nice properties: the difficulty can be adjusted & they can be implemented in a completely stateless manner. The last point is the most important because it what protects against a [D]DOS attack.
There could be a new HTTP request method called "SUBMIT" which works like a POST request except with an added step for proof of work. When making a SUBMIT request, the client opens a connection to the server, sends the initial request header with the SUBMIT method, and receives a proof of work challenge as an HTTP field in the server's response. The client then processes the challenge and sends its proof of work to the server which verifies it and sends an OK. Then the client sends its url-encoded data to the server, the server sends its response data, and the connection closes.
Then performance impact and behavior would be fairly uniform for all clients, especially if a standard library of problems and problem solving code were used by them, so you wouldn't have to worry about finding a problem that isn't too hard for poor Javascript implementations to solve while still being too easy for native code implementations in spamming tools to process. There could even be an added field for the server to inform the client what problem type is being used, allowing the addition of new problem types of different difficulty and performance requirements in the future without any more updates to the protocol.
Personally though, I don't like proof of work solutions. Sure, they add some computational cost to spamming, but the mass implementation and use of any proof of work solution would probably just create a new, lucrative market for botnet hackers to sell their services to. Besides that, it just feels like the wrong solution to me.
There is plenty of people with bloated windows machines that even using a modern browser struggle to perform properly, I dont think overloading them with extra work would help making their experience easy and smooth.
Just my 2 cents.
If that is correct, bitcoin validation isn't fast enough for instantaneous forum postings when the spammers can be assumed to be as dishonest as fits them.
(Note that, even if this were implemented, you probably wouldn't be doing the work in the browser, but rather just spending (fractions of) coins you had already generated and placed into your bitcoin wallet. Thus, this wouldn't slow down spammers—as they could just buy coins on the open market—it would just make the marginal cost of a single spam transaction more (and hopefully prohibitively) expensive. On the bright side, even if it happened that Bitcoins were too comparatively-devalued to prevent spam, spammers would then, by buying Bitcoins en masse, become the de-facto Bitcoin-to-USD exchange!)
So I can send back p as my answer for all values of n, without needing to do any client side calculation
Server:
uniq_id = long random string
salt = long random string
work_number = random integer
storage[uniq_id] = salt
send(uniq_id, salt, work_number)
Client:
new_number = work_number
while hash[:4] != "0000"
hash = hashfunc(salt | new_number++)
send(uniq_id, new_number)
Server:
salt = storage[uniq_id]
if no salt
deny
delete from storage[uniq_id]
if hashfunc(salt | new_number)[:4] != "0000"
deny
else
allow
May also add timestamps.As far as I'm concerned using up 8 seconds of user computation time (during which you cannot guarantee responsiveness) is just as bad as throwing a cryptic CAPTCHA field in her face.
Methods such as timestamping, honeypots and dynamically added fields yield very good results for bot recognition.
I'll try to look up some numbers on this.
http://news.ycombinator.com/item?id=2368486
(there are lots of comments, a couple of months ago, it would have been easy to see which ones are "interesting", now you must read them all).
It also penalises users who don't use Javascript.
Edit: This fails against a botnet where computers can be told to wait(10) [seconds] after filling form out.
Imposing a separate delay on each attempt (but with no global mutex) is actually done in practice; see "greylisting".
How so? Requests are piled in a queue, waiting for the mutex. If the request can't be completed for a given timeout (Say, 3 times the delay), you'll respond with an error message and the client will retry his request. You could automate the retry, so the user will only experience that it takes time - not a failure.
The biggest problem I see here is that it's a clear DoS attack vector.
Why does the client need to be processing during the waiting time? Would spambots wait around for the submit button to work?
The random number would have to be sent from the server, else the same hash could be used every time.
Also MD5 can be easily done on an FPGA at hundreds of millions of tests a second. Other algorithms might be more effective, particularly those which attempt to use large amounts of memory.
Nice idea though.
It would be better if the server sent a request saying send me an integer which has a hash beginning with npqr where n, p q and r are all random characters.
But maybe browsers could implement something natively.
I'm serious - spammers already use packs of porn-hungry humans to process CAPTCHAs; this will only make their lives easier as they already have the botnets available, and botnets don't need porn!
This sounds like it could just (handwaving here) be given to a bottnet for solving.