<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/testing-hashcash-based-anti-spam-measures.html comments</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Sun, 12 Apr 2026 02:18:00 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>anyone - 2021-08-10 18:56:17</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Thank you!</description><guid isPermaLink="true">498cd895eb5a102c5aeb977e2b928dee</guid><pubDate>Tue, 10 Aug 2021 18:56:17 GMT</pubDate></item><item><title>Jewls - 2018-06-19 20:24:07</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Hi Mike, i couldn't find this on your github repo. I was curious of how you implemented. This was about 30 secs.</description><guid isPermaLink="true">05dc961ff8bdf97c8f898ee10b9a56e0</guid><pubDate>Tue, 19 Jun 2018 20:24:07 GMT</pubDate></item><item><title>My1 - 2017-04-19 11:27:47</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>at least for me it takes literally half an eternity to calculate the thing, and I am on an i5 CPU.</description><guid isPermaLink="true">e794ca539a9a20d84a4f14b11fedb286</guid><pubDate>Wed, 19 Apr 2017 11:27:47 GMT</pubDate></item><item><title>Jonathan McCormack - 2016-02-24 20:04:54</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Just testing on an iPhone 6 Plus, button appeared straight away.</description><guid isPermaLink="true">9730cc23525f8f2e5f3ab1a859d7e7ee</guid><pubDate>Wed, 24 Feb 2016 20:04:54 GMT</pubDate></item><item><title>Test - 2014-04-28 10:31:25</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Just testing this to see how it works! ;)</description><guid isPermaLink="true">6dbe649c2a31dc165c9b86ff678eccb9</guid><pubDate>Mon, 28 Apr 2014 10:31:25 GMT</pubDate></item><item><title>hascashe - 2014-04-17 00:24:55</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>pretty cool isnt it</description><guid isPermaLink="true">95f3adcfd0e97e3b2395a92080a2dc42</guid><pubDate>Thu, 17 Apr 2014 00:24:55 GMT</pubDate></item><item><title>Aaron Toponce - 2013-09-24 02:44:46</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>testing from a Samsung Galaxy S3. still waiting for the post button to become visible...</description><guid isPermaLink="true">322f1bf1686da7cbea1f969781d6326b</guid><pubDate>Tue, 24 Sep 2013 02:44:46 GMT</pubDate></item><item><title>Aaron Toponce - 2013-05-18 17:11:36</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>I have written a number of web applications with public/anonymous commenting systems. If I implement a native Hashcash support for JavaScript, then spam is non-existent. Just for fun, I log all spam comments thrown out, due to not passing the Hashcash test, and I've seen upwards of 600 spam comments PER DAY thrown out due to not presenting a valid Hashcash token.
&lt;br /&gt;
&lt;br /&gt;Hashcash is only one valid client puzzle, among many though. For Wordpress, there is a "hashcash plugin", but when you look at the source, it's actually not Hashcash. Instead, it's just a random client puzzle. But, proof-of-work client puzzles work all the same.
&lt;br /&gt;
&lt;br /&gt;Well done on implementing Hashcash though. If more people would do this for their web applications, we wouldn't need those ridiculous CAPTCHAs.</description><guid isPermaLink="true">1699e80c910014577acbfeda472e5204</guid><pubDate>Sat, 18 May 2013 17:11:36 GMT</pubDate></item><item><title>HASH CA$H - 2013-05-01 20:16:01</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>This should be everywhere</description><guid isPermaLink="true">f21e66807198f353e42e0ac63ee0e0fc</guid><pubDate>Wed, 01 May 2013 20:16:01 GMT</pubDate></item><item><title>steve smith - 2013-04-06 01:24:34</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Just testing here.</description><guid isPermaLink="true">6de854cedf69d222a779a07b822f5f54</guid><pubDate>Sat, 06 Apr 2013 01:24:34 GMT</pubDate></item><item><title>Ugur - 2013-02-24 16:10:36</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Just for trying live demo</description><guid isPermaLink="true">56c3355fb50f1b5b811a88a2ef390a4e</guid><pubDate>Sun, 24 Feb 2013 16:10:36 GMT</pubDate></item><item><title>my wonderful self again - 2013-02-08 04:29:29</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Took less than a second for me as well.</description><guid isPermaLink="true">679c75493f8a2300a14090229d7c57d0</guid><pubDate>Fri, 08 Feb 2013 04:29:29 GMT</pubDate></item><item><title>my wonderful self - 2013-02-08 04:27:56</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Just wants to see how this works</description><guid isPermaLink="true">0d8cc94e8c1c6c03e3fa4515ae00d0d1</guid><pubDate>Fri, 08 Feb 2013 04:27:56 GMT</pubDate></item><item><title>mikeash - 2013-02-07 14:48:37</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>I did some quickie benchmarking when I wrote the implementation, and as I recall, my result was that a native hashcash solution was about 100x faster than doing it in JavaScript in a modern browser. This is probably enough to render the whole exercise pointless on a large scale. If the hashcash is tuned to take 30 seconds in the browser, then a native implementation would take about a third of a second per post. It's possible that this would still be enough to discourage spam to an extent, but it's not a huge obstacle.
&lt;br /&gt;
&lt;br /&gt;On a small blog like this, &lt;i&gt;any&lt;/i&gt; custom solution is enough to cut down on spam substantially, at least for a long time, because it's just not worth it to write any custom code for it, no matter how easy.
&lt;br /&gt;
&lt;br /&gt;As JavaScript engines improve (and I assume that crypto will be a particularly important target for optimization), that will allow the hashcash difficulty to be turned up, lessening the advantage of a native implementation. So it could become a truly useful, scalable solution eventually.</description><guid isPermaLink="true">49964cb5ca0188f3da94c99b696a7d95</guid><pubDate>Thu, 07 Feb 2013 14:48:37 GMT</pubDate></item><item><title>George Hafiz - 2013-02-07 08:11:37</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>It's a good point about the efficiency of the hash implementation being a remaining issue. How long before botnet operators implement C SHA-1 into their zombie programs in order to render these counter-measures ineffective? Assuming the efficiency of C SHA-1 is really that much greater than JavaScript - anyone got any benchmark results?</description><guid isPermaLink="true">30711ce0253254cb9ca8df01532500a9</guid><pubDate>Thu, 07 Feb 2013 08:11:37 GMT</pubDate></item><item><title>rewrw - 2013-01-24 16:22:40</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>rwerwerwerw</description><guid isPermaLink="true">c4f4c37852804f6f0056b143a2033b60</guid><pubDate>Thu, 24 Jan 2013 16:22:40 GMT</pubDate></item><item><title>mikeash - 2012-09-13 13:48:30</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>It hasn't stopped spam completely, but the spam that remains appears to be posted by actual humans using the form just like the rest of us. I can't fathom how it could be worth their time, but that's what the logs tell me.</description><guid isPermaLink="true">39ac5227b99b6851b61f774fcaaf758f</guid><pubDate>Thu, 13 Sep 2012 13:48:30 GMT</pubDate></item><item><title>tester - 2012-09-13 04:30:56</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>So does this system actually work? As others have noted, JavaScript is much faster these days and so you probably need more zeros.</description><guid isPermaLink="true">bb46ffc7bbe8b22298673ab8cc9a90c5</guid><pubDate>Thu, 13 Sep 2012 04:30:56 GMT</pubDate></item><item><title>test - 2012-08-27 13:37:56</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>test.</description><guid isPermaLink="true">8cff6a87456225afc3b0bd8fecb8c515</guid><pubDate>Mon, 27 Aug 2012 13:37:56 GMT</pubDate></item><item><title>Alice - 2012-07-20 15:36:08</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Took less than a second for me.  :|</description><guid isPermaLink="true">1fc5aa3d5c6e48debf7a71bfbb8fdcb4</guid><pubDate>Fri, 20 Jul 2012 15:36:08 GMT</pubDate></item><item><title>mikeash - 2012-02-15 14:45:43</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Mine tends to drop to zero for a couple of months, then rise back to a handful of spam comments a week. I'm not sure how to explain that, as it doesn't seem worth anybody's while to automate this particular site's anti-spam measures, but human-driven spam shouldn't be deterred at all by small changes.
&lt;br /&gt;
&lt;br /&gt;I really should check my logs for the IP address that spam comments come from and see if the requests show anything about the nature of what's posting them. I'll have to remember to do that next time one shows up.</description><guid isPermaLink="true">97c9290b4b0e19727176c85a7a435174</guid><pubDate>Wed, 15 Feb 2012 14:45:43 GMT</pubDate></item><item><title>me - 2012-02-14 21:15:35</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Typically, if you implement any custom anti-spam measures at all, the spam rate will drop to almost zero because the automated tools no longer work.</description><guid isPermaLink="true">df4c072f774b6dbf362bdc7a65dfb1d0</guid><pubDate>Tue, 14 Feb 2012 21:15:35 GMT</pubDate></item><item><title>mikeash - 2012-01-11 14:40:06</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>A nuisance to spammers is all I need. 30 minutes of programmer time plus the resources that Safari would take up is worth far more than spamming my site is. I haven't had to delete any spam since I set the thing up, so clearly it's working. Whether it works better than the previous scheme (which prevented spam for a while every time I changed the magic word) remains to be seen.
&lt;br /&gt;
&lt;br /&gt;How could it be a nuisance to my readers? If you mean because it prevents people from being able to write and submit a post in under 10 seconds, well, that's just the sort of nuisance I want to give to my readers.</description><guid isPermaLink="true">a5fb4a52836d9361756e32c823ce8e28</guid><pubDate>Wed, 11 Jan 2012 14:40:06 GMT</pubDate></item><item><title>Jared Kipe - 2012-01-11 02:30:53</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>I have always assumed "spammers" employ various types of automation, and I wouldn't say it is out of the realm of possibility that someone would script the above (I could do it trivially in less than 30 minutes by making a Safari Extension, opening the posts I wanted to target in separate background tabs and let the custom JS do their own thing forever).
&lt;br /&gt;
&lt;br /&gt;Your idea is interesting, but at best is a nuisance for spammers.  At worst, a nuisance to spammers AND nuisance to your readers.</description><guid isPermaLink="true">06c68a22efb2cdaf7a4b9127a6765f2d</guid><pubDate>Wed, 11 Jan 2012 02:30:53 GMT</pubDate></item><item><title>mikeash - 2012-01-10 18:27:41</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Forgot to mention: yes, a specialized tool could defeat this easily by computing the hashcash in C in 0.01 seconds instead of in JavaScript in 10 seconds. But the goal isn't to defeat all potential adversaries, just all that I expect to come across. Nobody will implement a C hashcasher just to defeat my site.</description><guid isPermaLink="true">d2c5eb4ede8c3d1997ee7c469d6ddc3a</guid><pubDate>Tue, 10 Jan 2012 18:27:41 GMT</pubDate></item><item><title>mikeash - 2012-01-10 18:26:35</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>My assumption is that waiting ~10 seconds for the button to become available imposes an impractical time drain on a spammer. They need to work in incredible bulk and that means they need to work fast.
&lt;br /&gt;
&lt;br /&gt;This also hits human spammers, who have similar time constraints. They'll want to open the page, paste paste paste submit, all really quickly. This forces them to wait.
&lt;br /&gt;
&lt;br /&gt;As a bonus, it also discourages legitimate commenters with nothing important to say.</description><guid isPermaLink="true">c5b660d438c489ebab4934cbc48504c0</guid><pubDate>Tue, 10 Jan 2012 18:26:35 GMT</pubDate></item><item><title>Jared Kipe - 2012-01-10 18:19:12</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>The thing is, that if you decided to write your spamming client in javascript, this is trivial to get around. 
&lt;br /&gt;
&lt;br /&gt;document.forms[0][0].onfocus();
&lt;br /&gt;document.forms[0][0].value = "spam"; 
&lt;br /&gt;And then just wait for the "Post Comment" button to become available.  Since you've already implemented the JS to actually do the computation, there isn't any added complexity to the "spam" client.
&lt;br /&gt;
&lt;br /&gt;I would think this is about as good as just having a hidden field you expect to be a certain value, that JS fills in that value onfocus()</description><guid isPermaLink="true">392a78c318f9bcae8c5e25065824fbc9</guid><pubDate>Tue, 10 Jan 2012 18:19:12 GMT</pubDate></item><item><title>sneak - 2011-12-24 22:59:27</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>The problem with this is that JavaScript implementations of hashcash are 10000x slower than native implementations.  Any acceptable comment-posting delays mean that I can write a native blog spamming tool with more than acceptable performance. :)</description><guid isPermaLink="true">b2149834343318577fca9b752c32c6dd</guid><pubDate>Sat, 24 Dec 2011 22:59:27 GMT</pubDate></item><item><title>Aron - 2011-12-21 22:02:12</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Do I get a Bitcoin upon successful comment submission?</description><guid isPermaLink="true">37452659fc0e2fa18953ff9aff7697ec</guid><pubDate>Wed, 21 Dec 2011 22:02:12 GMT</pubDate></item><item><title>mikeash - 2011-11-30 15:48:29</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Since it's a probabilistic computation, it can sometimes go really fast (or slow). It's just trying different pieces of data until a match is found, which could be the first item it tries or the millionth. On average, it'll be around 2^18 attempts, but it'll vary.</description><guid isPermaLink="true">429baec92b609ff43796dd07ac6c5262</guid><pubDate>Wed, 30 Nov 2011 15:48:29 GMT</pubDate></item><item><title>dennis - 2011-11-30 15:19:39</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>It definitely didn't take anywhere near 10 seconds on my machine (late 2010 11" MBA, 1.6GHz).  It was a small blip on my Activity Monitor and then went away just as quickly.</description><guid isPermaLink="true">34ef9bb95cb2c3f03e8e57e951e6ac13</guid><pubDate>Wed, 30 Nov 2011 15:19:39 GMT</pubDate></item><item><title>mikeash - 2011-11-28 15:29:24</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Interestingly, you actually want the hashcash implementation to be as fast as possible. If you make it artificially slow, then an adversary could come along and implement their own that's much faster and defeat your inherent rate limiting. For example, if I calibrate the hashcash to take 10 seconds of CPU time and then somebody comes along and writes an implementation that's 1000x faster, they only have to dedicate 1/100th of a second of CPU time for each post.
&lt;br /&gt;
&lt;br /&gt;As it happens, doing it in JavaScript is about 100x slower than doing it in C using CommonCrypto, so that certainly could be done here. But you'd have to dedicate quite a bit of development time developing a special client just for my blog comments, and at that point I'm not really going to worry about it too hard.</description><guid isPermaLink="true">eb094c47b581878aaabab3829586d27a</guid><pubDate>Mon, 28 Nov 2011 15:29:24 GMT</pubDate></item><item><title>Steve Nicholson - 2011-11-28 02:49:41</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>I'm trying to come up with some funny way to say that you should have implemented the routine in Flash to use even more CPU time but I got nothin'.</description><guid isPermaLink="true">e4a82da861a77f05cd46676eb455d3cf</guid><pubDate>Mon, 28 Nov 2011 02:49:41 GMT</pubDate></item><item><title>Allan - 2011-11-28 01:18:10</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Yup, much better.</description><guid isPermaLink="true">a9f7540200052b55955aaaf9b7a6cdae</guid><pubDate>Mon, 28 Nov 2011 01:18:10 GMT</pubDate></item><item><title>mikeash - 2011-11-27 03:23:32</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Silly me, I never thought to actually test UI responsiveness. I've tuned how the computation runs and it should be much better now. I'm posting this from my iPad as proof.</description><guid isPermaLink="true">c33257c5cf57d01a8017cd56c4a4ca7f</guid><pubDate>Sun, 27 Nov 2011 03:23:32 GMT</pubDate></item><item><title>Allan - 2011-11-26 21:13:42</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>The computation took quite a while on my iPad 2 (I didn't time it but it was at least 30 seconds), and while it was churning it was just about impossible to type.</description><guid isPermaLink="true">87dfcf449b236da3bcce949d27b625b5</guid><pubDate>Sat, 26 Nov 2011 21:13:42 GMT</pubDate></item><item><title>Jose Vazquez - 2011-11-26 20:51:45</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Oh noes! My CPUs! they burn unnecessarily! :-) (/me pulls out stopwatch to measure performance)</description><guid isPermaLink="true">3a470f8f805419128f86fdeb4410c04e</guid><pubDate>Sat, 26 Nov 2011 20:51:45 GMT</pubDate></item><item><title>jcburns - 2011-11-26 18:54:01</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Hello, I am commenting for the sake of commenting. Also for the sake of understanding what's happening as I click in these fields and invisible javascript numbers are tossed back and forth. Happy day after day after US Thanksgiving to all.</description><guid isPermaLink="true">f10fa4a1640cf653f6e02df48c0f5482</guid><pubDate>Sat, 26 Nov 2011 18:54:01 GMT</pubDate></item><item><title>mikeash - 2011-11-26 18:44:43</title><link>http://www.mikeash.com/?page=pyblog/testing-hashcash-based-anti-spam-measures.html#comments</link><description>Greetings from this new hashcash-enabled world!</description><guid isPermaLink="true">9aedf7794c170835d82cce56b2dea44b</guid><pubDate>Sat, 26 Nov 2011 18:44:43 GMT</pubDate></item></channel></rss>
