Live data from Hacker News

mCaptcha – Proof of work based, privacy respecting CAPTCHA system

github.com

91–100 of 100 posts

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#91

I looked into doing something like this once and decided it wasn't going to be very effective, for a few different reasons. JS engines (or even WASM) aren't going to be as fast at this kind of work as native machine code would be. Especially when you consider that libraries like OpenSSL have heavily tuned implementations of the SHA algorithms. Any bot solving a SHA-based challenge would be able to extract the challen…

Thank you for your detailed response, you raise some very interesting and valid points! > JS engines (or even WASM) aren't going to be as fast at this kind of work as native machine code would be You are right. mCaptcha has a WASM and a JS polyfill implementations. Native code will definitely be faster than WASM but in an experiment I ran for fun[0], I discovered that the WASM was roughly 2s slower than native implem…

Can you elaborate on why you chose SHA256 as the hash function?

Attackers aren't exactly limited to web apis, and SHA265 is known to be trivially parallelizable on a GPU. RandomX is one such example[0], which reminds me of a similar initiative called RPC-Pay.

[0]: https://github.com/tevador/RandomX [1]: https://www.monerooutreach.org/stories/RPC-Pay.html

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#92
post #53

From what I understand, this would allow somebody with reasonable resources to easily crack captchas with a high-end GPU. You could increase the complexity of the PoW, but ultimately you then just end up in a resource race. Ideally you want an attacker to spend as long as possible using up computation resources, whilst your normal clients spend on average little. I believe you would want a multi-stage approach that i…

The term for describing is memory hard functions. RandomX[0] is one such example where GPU parallelism does not net them a large advantage over CPUs. [0]: https://github.com/tevador/RandomX

Thinking about it, this could be the way forwards. Memory offers several natural bottlenecks:

1. Memory size - Memory is somewhat costly (even now), with most entry laptops being stuck in the range of 8GB.

2. Access bandwidth - Getting a CPU to communicate with the RAM takes some time, improvements are incremental and are fundamentally limited.

3. Thread access - Threads compete for bandwidth, as long as cache hits are low.

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#93
post #78

This isn’t a CAPTCHA. A CAPTCHA should be something that can tell a human user apart from a non-human user with a high degree of accuracy, such that it should be hard for a bot to pass even a single instance. As noted elsewhere in the thread, this is a rate-limiting system. It cannot protect low-rate critical resources like registrations, but would be useful in mitigating large-scale spam attacks.

According to Wikipedia, CAPTCHA stands for Completely Automated Public Turing test to tell Computers and Humans Apart. This code shouldn't be called CAPTCHA as it makes no attempt to tell humans from machines. (If anything, SHA256 proof-of-work is a problem that's easy for a computer but hard for a human, the opposite of a Turing test.) I'd call it "Proof-Of-Work Client-side RAte Protection" -- it's a POWCRAP, not a…

CRAP is sufficient

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#94
post #60

As a spammer I wouldn't care much about this, they run thousands of requests in parallel and don't care if they take 1 second or 10 seconds to finish. After all, their machines run all day long. Much of the more professional spammers are running on hacked botnet machines anyways so they don't really care about maxing the CPUs. Compute is cheap and the only loser here is the end user with a low end device.

> the only loser here is the end user with a low end device

And our environment as we are burning more an more CO2

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#95

Earlier quoted context omitted.

But it doesn’t though! A typical laptop can easily hold tens of thousands of I/O connections open at once in your favorite async I/O environment - that number can be in the millions with careful optimizations applied. Each connection just needs a sleep(3) applied between the initial form request and the submission. A 3 second form delay just means the difference between a spammer launching 1000000 requests and postin…

Who are we kidding here --- most likely, your server can't handle 1000000 simultaneous requests. My servers don't have enough bandwidth for that. Most of the connections are going to get dropped one way or the other. In my case, they will be intentionally dropped as being a likely denial of service attack.

You don't need to keep a connection open assuming this is HTTP. Just send another request.

You're sending two requests either way, it doesn't matter that you're waiting 3s because you can just do it in parallel.

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#96
post #5

The goal of CAPTCHA is to tell computers and humans apart. I appreciate the effort towards better UX, but there are already "invisible" CAPTCHAs like Botpoison that discriminate better than this. PoW solutions are just more energy-intensive rate limits.

> The goal of CAPTCHA is to tell computers and humans apart.

This is definitely not true today, and i'm not sure it was ever true. I remember the first (or what i remember to be the first) -submitted CAPTCHAs asking me to copy some text, answer a riddle or perform some simple math... all of which could be bypassed by a script. The goal was to avoid a random web-scanning bot to fill your DB with garbage, not protect against targeted attacks.

Nowadays there's large portions of the web i can't browse because of bad IP reputation (i browse through tor) and because the most widely deployed CAPTCHA systems insist that i'm not human.

Google RECAPTCHA in particular has an obsession with fire hydrants (that's not even a thing here in France), traffic lights, bicycles and buses. However, it's never clear if i should click the square where just a tiny bit of the object appears, and some images are so unobvious that what i know to be a bicycle part i'm not sure the algorithm will pick up as such. So i'm trapped in endless CAPTCHA loops in which the robot claims i'm not human.

I realize a GPT3-powered bot would probably say this, but i'm 100% human. Meanwhile, malicious bot authors buy CAPTCHAs for a few cents a dozen from sketchy online marketplaces. CAPTCHAs only prevents legitimate use, as malicious actors have way more considerable means and resources at their disposal than we ordinary users do.

PS: It's not just Google though. As much as they claim to be the good guys, CloudFlare claims an enormous part of their malicious traffic comes from the tor network. However, given that they block 80-90% of my `GET /` requests as if they were malicious, i wouldn't be surprised if these stats were complete bullshit that did not stand scrutiny. But well, if the algorithm says so... (post PS: even HN a few months back started blocking many GET requests from Tor except on the homepage).

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#97
post #95

Earlier quoted context omitted.

Who are we kidding here --- most likely, your server can't handle 1000000 simultaneous requests. My servers don't have enough bandwidth for that. Most of the connections are going to get dropped one way or the other. In my case, they will be intentionally dropped as being a likely denial of service attack.

You don't need to keep a connection open assuming this is HTTP. Just send another request. You're sending two requests either way, it doesn't matter that you're waiting 3s because you can just do it in parallel.

it doesn't matter that you're waiting 3s because you can just do it in parallel.

A little math for you:

An 8 char password using only letters and numbers has roughly 1 x 10^14 permutations. Just for the sake of argument, let's assume that your server and your service provider can actually handle 1000000 simultaneous, parallel requests from 1000000 different IPs.

It can't unless you're Google or Facebook running your own data centers but for the sake of argument let's just ignore that reality and push on.

To check every possible 8 character password by making 1 million parallel attempts at guessing the password every 3 seconds would take roughly 10 years. Luck being what it is, you'd probably only need to check half of them ... but that would still take 5 years.

Back in reality land, you'll be out of business before 5 years because you can't serve your paying customers. 1000000 parallel requests hitting a run of the mill server is effectively a "denial of service" attack.

In reality land using servers that I run, your 1000000 different IPs would all be banned after about 30 seconds.

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#98

Consider using RandomX instead. https://github.com/tevador/RandomX This would tie the algo to CPU based compute and thus knock out ASIC and GPU solutions.

From your link:

> Web mining is infeasible due to the large memory requirement and the lack of directed rounding support for floating point operations in both Javascript and WebAssembly.

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#99

AGPL seems problematic here. If a company uses this as their captcha system does it force them to open source their entire code base?

No, the GNU AGPL does not force that. Maybe you are thinking of MongoDB's SSPL[0]?

[0] https://en.wikipedia.org/wiki/Server_Side_Public_License

Re: mCaptcha – Proof of work based, privacy respecting CAPTCHA system

#100
post #98

Consider using RandomX instead. https://github.com/tevador/RandomX This would tie the algo to CPU based compute and thus knock out ASIC and GPU solutions.

From your link: > Web mining is infeasible due to the large memory requirement and the lack of directed rounding support for floating point operations in both Javascript and WebAssembly.

I guess the best solution would be to look for a hash that is tied to those two technologies instead.
Post reply on HN