converspace / webmention

A modern alternative to Pingback.
webmention.org
173 stars 18 forks source link

Add Hashcash? #31

Open sandeepshetty opened 10 years ago

sandeepshetty commented 10 years ago

wp-http-ddos-by-abusing-pingback

Pingback DDOS references:

Hashcash references:

sandeepshetty commented 10 years ago

Looks like @oshepherd though of this as well: http://owenshepherd.net/content/posts

sandeepshetty commented 9 years ago

Some example code I wrote to mint a hashcash. $counter could be sent as an additional Webmention POST var hashcash_counter.

$source="http://bob.host/post-by-bob";
$target="http://alice.host/post-by-alice";
$zeros = 5;
$counter = 0;
do { $counter++; } while (substr(hash('sha1', "$source|$target|$counter"), 0, $zeros) !== str_repeat('0', $zeros));
echo "$source|$target|$counter: ".substr(hash('sha1', "$source|$target|$counter"), 0, $zeros)."\n";
$ echo -n "http://bob.host/post-by-bob|http://alice.host/post-by-alice|618275" | sha1sum | awk '{print $1}'
00000b8d455a229e04caf57175415e6e3846fd2e  -