Live data from Hacker News

Breaking the MintEye image CAPTCHA in 23 lines of Python

jwandrews.co.uk

31–40 of 60 posts

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#31
This is nitpicking. Well, maybe not.

This code does not take a swirled image and solve it. It takes a set of images with various swirl levels and finds the one with shortest sum of edge lengths.

The code does not do any un-swirling of the image. It also uses external libraries to convert to grayscale, apply the Sobel filter and the sum of edges.

I other words, it is far from breaking the swirled CAPTCHA in 23 lines of Python. If you had to write the un-swirling, gray-scaling, Sobel filtering and summation code in Python you'd be looking at a much larger pile-o-code.

The demo and the intent is good. I just wish the title didn't say "23 lines of". I don't think the article would have suffered at all if the title was "Breaking the MintEye image CAPTCHA with Python".

Again, the intent and what is being demonstrated are excellent. The title, in my not-so-humble opinion, is hugely misleading.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#32

This is nitpicking. Well, maybe not. This code does not take a swirled image and solve it. It takes a set of images with various swirl levels and finds the one with shortest sum of edge lengths. The code does not do any un-swirling of the image. It also uses external libraries to convert to grayscale, apply the Sobel filter and the sum of edges. I other words, it is far from breaking the swirled CAPTCHA in 23 lines o…

>it is far from breaking the swirled CAPTCHA in 23 lines of Python

Except it does break the captcha in 23 lines. I don't get your point.

Why would he need to do any 'un-swirling' in the first place? That's not the point of the captcha. The captcha provides you with multiple images and you have to pick the least swirled one - which is exactly what his code does.

And you argue that because he did use external libraries it's not 23 lines of python. Of course it is. He had to write only 23 lines that make up the logic to break the captcha. If you'd argue that one would have to add any previous work (or lines) done by other people to the linecount of your own project, I could also argue that 'print("Hello")' is not one line of python, because it uses some standard python library, which in turn calls native code, that native code would make a few syscalls and at some point resulting in multiple hundred lines of compiled kernel C code being executed.

So the linecount of his 23 lines python script would actually be: 23 lines of python + various libraries + the entire Linux kernel = roughly 20 million lines of code. Good job.

And yes, that was nitpicking. And I'm angry for some reason.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#33

This is nitpicking. Well, maybe not. This code does not take a swirled image and solve it. It takes a set of images with various swirl levels and finds the one with shortest sum of edge lengths. The code does not do any un-swirling of the image. It also uses external libraries to convert to grayscale, apply the Sobel filter and the sum of edges. I other words, it is far from breaking the swirled CAPTCHA in 23 lines o…

>it is far from breaking the swirled CAPTCHA in 23 lines of Python Except it does break the captcha in 23 lines. I don't get your point. Why would he need to do any 'un-swirling' in the first place? That's not the point of the captcha. The captcha provides you with multiple images and you have to pick the least swirled one - which is exactly what his code does. And you argue that because he did use external libraries…

Well put. The title is indeed completely factual! Including '23 lines' was just to let people know at first glance that the solution is simple.

> If you had to write the un-swirling, gray-scaling, Sobel filtering and summation code in Python you'd be looking at a much larger pile-o-code

I would also like to point out these are also all very simple operations, which would only take a few lines of Python/C/whatever to do. Python just happens to have a pre-written libraries to save reinventing the wheel.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#34

This is nitpicking. Well, maybe not. This code does not take a swirled image and solve it. It takes a set of images with various swirl levels and finds the one with shortest sum of edge lengths. The code does not do any un-swirling of the image. It also uses external libraries to convert to grayscale, apply the Sobel filter and the sum of edges. I other words, it is far from breaking the swirled CAPTCHA in 23 lines o…

>it is far from breaking the swirled CAPTCHA in 23 lines of Python Except it does break the captcha in 23 lines. I don't get your point. Why would he need to do any 'un-swirling' in the first place? That's not the point of the captcha. The captcha provides you with multiple images and you have to pick the least swirled one - which is exactly what his code does. And you argue that because he did use external libraries…

If you aren't going to have a cut off point for what is considered solving the problem and what is considered ancillary, then you can define new languages where a zero byte input stands for whatever solution you want, simultaneously one-upping everyone and contributing nothing to the conversation.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#35

This is nitpicking. Well, maybe not. This code does not take a swirled image and solve it. It takes a set of images with various swirl levels and finds the one with shortest sum of edge lengths. The code does not do any un-swirling of the image. It also uses external libraries to convert to grayscale, apply the Sobel filter and the sum of edges. I other words, it is far from breaking the swirled CAPTCHA in 23 lines o…

>it is far from breaking the swirled CAPTCHA in 23 lines of Python Except it does break the captcha in 23 lines. I don't get your point. Why would he need to do any 'un-swirling' in the first place? That's not the point of the captcha. The captcha provides you with multiple images and you have to pick the least swirled one - which is exactly what his code does. And you argue that because he did use external libraries…

No need to be angry. None of this is going to remove food from your table or affect your life in any way whatsoever. Take it easy. I am just opening the topic for conversation. We can discuss things without pulling out semi-automatic weapons, right?

When someone publishes code and says something like "solved in of " there generally is an implied "my language is better than yours" subliminal message that, for some strange reason, is based on line count.

Let's not debate the merit of line count as a measure of how good a language may or may not be. If we are going to go there I'll write the same solution in APL and we'll start counting characters instead. Again, line or character count, in my opinion, is not a measure of the "superiority" of a language.

The 28 line solution is not pure Python. How do we define pure Python. Let's just say that "solved in of Python" to me means that you download and install Python:

http://www.python.org/download/releases/2.7.3/

Install nothing else whatsoever and write code that solves .

OpenCV, which is what the author used for a couple of aspects of this code, is an extensive (and really cool) C++ library that is being accessed from Python. Here's the source:

https://github.com/Itseez/opencv

I'll leave it up to the reader to find the source for the Sobel method.

A much more honest title could have included something like "solving with lines of Python using OpenCV".

As I said before, the intent of the article and what is being demonstrated are good, no, great. I just wish the title was a little more reflective of reality. That's all. No need to get worked-up. This is not that serious of an issue. Just a comment.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#36

Earlier quoted context omitted.

>it is far from breaking the swirled CAPTCHA in 23 lines of Python Except it does break the captcha in 23 lines. I don't get your point. Why would he need to do any 'un-swirling' in the first place? That's not the point of the captcha. The captcha provides you with multiple images and you have to pick the least swirled one - which is exactly what his code does. And you argue that because he did use external libraries…

If you aren't going to have a cut off point for what is considered solving the problem and what is considered ancillary, then you can define new languages where a zero byte input stands for whatever solution you want, simultaneously one-upping everyone and contributing nothing to the conversation.

Unless the test of "human-ness" is the ability to drag a slider, or whoever it is that you interact with the captcha, picking the least swirled of a set of images is solving the captcha because that is the test of human-ness. This seems fairly cut and dry to me.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#37

Earlier quoted context omitted.

>it is far from breaking the swirled CAPTCHA in 23 lines of Python Except it does break the captcha in 23 lines. I don't get your point. Why would he need to do any 'un-swirling' in the first place? That's not the point of the captcha. The captcha provides you with multiple images and you have to pick the least swirled one - which is exactly what his code does. And you argue that because he did use external libraries…

Well put. The title is indeed completely factual! Including '23 lines' was just to let people know at first glance that the solution is simple. > If you had to write the un-swirling, gray-scaling, Sobel filtering and summation code in Python you'd be looking at a much larger pile-o-code I would also like to point out these are also all very simple operations, which would only take a few lines of Python/C/whatever to…

> I would also like to point out these are also all very simple operations, which would only take a few lines of Python/C/whatever to do.

Yikes! They are not. That's a lot of code. I've done a ton of image processing work in both hardware (FPGA) and software (various languages). Swirling, gray-scaling, Sobel filtering and summation collectively are far from "a few lines of Python/C/whatever to do"

> Python just happens to have a pre-written libraries to save reinventing the wheel

That's not true. OpenCV is NOT a Python library, it's nearly 100% C++ as far as I can tell:

https://github.com/Itseez/opencv

That was, in many ways, my point. This is not a solution in 23 lines of Python. Go install Python from Python.org --and NOTHING ELSE-- and solve the problem. Let's see how many lines of Python it takes.

There's nothing wrong with the intent of the author in terms of showing how one can break these CAPTCHA's using edge-length evaluation. I never put any thought into this myself so, yes, I learned something of value from his post. I just wish the title was more genuine, that's all.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#38

Earlier quoted context omitted.

>it is far from breaking the swirled CAPTCHA in 23 lines of Python Except it does break the captcha in 23 lines. I don't get your point. Why would he need to do any 'un-swirling' in the first place? That's not the point of the captcha. The captcha provides you with multiple images and you have to pick the least swirled one - which is exactly what his code does. And you argue that because he did use external libraries…

No need to be angry. None of this is going to remove food from your table or affect your life in any way whatsoever. Take it easy. I am just opening the topic for conversation. We can discuss things without pulling out semi-automatic weapons, right? When someone publishes code and says something like "solved in of " there generally is an implied "my language is better than yours" subliminal message that, for some str…

Actually, that's not entirely reflective of reality. You would have to access www.python.org in order to download python, so you'd have to write some sort of TCP/IP handler to connect to that interface...actually let me back up, you first would have to solder together a few million transistors to create a CPU before you could do that. You're making it seem way easier than it actually is, please don't go exaggerating the truth so blatantly.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#39

Earlier quoted context omitted.

The thing is, CAPTCHAs are used to validate it's a human operating the interface, not a robot. That's a stupid idea, based on some weird assumption that it's somehow safe to give access to your system for a user, but not for a robot. If the only thing stopping people from messing your system is automation, you should rethink it from the get go.

> weird assumption that it's somehow safe to give access to your system for a user, but not for a robot. Nice point. > If the only thing stopping people from messing your system is automation, you should rethink it from the get go. Are there systems that can't be abused through automation, or where that's much less of a concern? (Serious question, not intended as snark.) Maybe throttling activity is a better approach…

> Are there systems that can't be abused through automation, or where that's much less of a concern?

Let's analyze. One place CAPTCHA has been used a lot is in comment forms. It increases the opportunity cost of posting a comment via automation by introducing a complicated challenge.

Fair enough. But that doesn't solve the underlying problem (abusive comments). You'll still have abuse and spam, it will just come from humans instead of robots. If I'm a blackhat SEO with a budget, I pay people to solve CAPTCHAs all day and spam the internet (that's what happens).

If you design the comment system to fight abuse from the ground up (e.g., markov chain spam filters, user flagging), you don't need to care anymore wether it's a human or a robot behind the POST, because all the spam actually improves your training set. You defeat spammers with their own data.

Re: Breaking the MintEye image CAPTCHA in 23 lines of Python

#40

This is nitpicking. Well, maybe not. This code does not take a swirled image and solve it. It takes a set of images with various swirl levels and finds the one with shortest sum of edge lengths. The code does not do any un-swirling of the image. It also uses external libraries to convert to grayscale, apply the Sobel filter and the sum of edges. I other words, it is far from breaking the swirled CAPTCHA in 23 lines o…

And if you had to write the OS it runs on you'd have a really huge "pile-o-code". What's your point?
Post reply on HN