Algebraic captcha
Stumbled on the Internet for interesting technology from captcha - user is asked to solve a linear equation with one root and enter the solution as the test code.
When I was on your blog searching for the captcha, have tried many different, but with a curious approach does not come across. I decided to look at it closer, opened your page and was disappointed - the task for CAPTCHAs displayed text, but no picture.
So out of curiosity decided to break her ![]()
In general, this captcha is a linear algebraic equation (ax + b = 0). For solutions used . (Oh, why did I not know about it at 1-3 degree? It even can work on your PDA!).
The line with zadchey for CAPTCHAs can be obtained from html-code of the page about this form:
A | <b> (<i> x </ i> +9) ∙ 5 +4 = 64 </ b> |
.
The tags
A | <b> |
can be eliminated at the stage of obtaining the correct line, but great harm them not, so for clarity left.
Next line is a bit processed to bring to a form suitable for solution in the Maxima, followed by the actual decision to continue - processing of the output for the isolation of a desired verification code (the output from Maxima sufficiently detailed, even if you use the option-quiet):
#! / Usr / bin / perl use warnings; use strict; use encoding 'utf8'; my $ input = '<b> (<i> x </ i> +9) ∙ 5 +4 = 64 </ b>'; $ Input = ~ s |</?[ b, i]> | | ig; $ Input = ~ s / ∙ / * / ig; $ Input = ~ s /-/-/ ig; print $ input, "\ n"; my $ out = qx / maxima - quiet - batch-string = solve "($ input );"/; my $ x = $ 1 if $ out = ~ m # \ [x = (-? \ s? \ d +) \] # gi; print $ x, "\ n"; exit 0;
That's how I was lucky in one evening to get acquainted with an interesting idea for the mechanism of captcha and learn about the wonderful computer algebra system Maxima.
I wish you a lot of new and pleasant discoveries!
More on similar topics:
Filed under: Linux , Gadgets , Technocracy |
Tags: captcha , linux , Maxima , Security , algebra , programming |
No Comments 


Recent comments