8

Is there a piece of Wolfram Language code out there that integrates reCAPTCHA (for human verification) into the Wolfram Cloud environment?

This is what the reCaptcha service looks like (in Swedish):

recaptcha

When you press the checkbox, metrics such as how long it took to mark the checkbox and how the mouse moved are sent to Google's server. This data is used to determine whether it was a human that marked the checkbox. It is not the same as the generic term "captcha".

C. E.
  • 70,533
  • 6
  • 140
  • 264
Frank Liu
  • 81
  • 1

1 Answers1

3

As a starter: enter image description here

WolframAlpha["CAPTCHA", IncludePods -> "Result", 
AppearanceElements -> {"Pods"}, 
TimeConstraint -> {30, Automatic, Automatic, Automatic}]

enter image description here

And you can copy/paste the Image easy

enter image description here

If you are looking to do your own challenge-response test, then you can create a key phrase using two random dictionary words,

With[{key = 
   StringJoin@
    Riffle[RandomChoice[WordList["CommonWords"], 2], " "]}, {key, 
  WolframAlpha["CAPTCHA " <> key, IncludePods -> "Result", 
   AppearanceElements -> {"Pods"}, 
   TimeConstraint -> {30, Automatic, Automatic, Automatic}]}]

enter image description here

The call to WolframAlpha is slow (takes about 2+ seconds on my machine), so this might not be the best way to generate captchas for a high-use app.

Jason B.
  • 68,381
  • 3
  • 139
  • 286
  • reCaptcha (a product from Google) is not the same as the generic term Captcha, also having the image is no good for validation unless you also know what it says. – C. E. Apr 26 '16 at 08:23
  • @Louis, you could have it do 2 dictionary words in the captcha style, and then you will have the key and the image: With[{key = StringJoin@Riffle[RandomChoice[WordList["CommonWords"], 2], " "]}, {key, WolframAlpha["CAPTCHA " <> key, IncludePods -> "Result", AppearanceElements -> {"Pods"}, TimeConstraint -> {30, Automatic, Automatic, Automatic}]} ] – Jason B. Apr 26 '16 at 08:59
  • As with the popular captchas out there, you get some humorous results: http://i.stack.imgur.com/1lBfT.png , – Jason B. Apr 26 '16 at 09:02
  • @JasonB, nice humor :)), make it an answer or edit mine. –  Apr 26 '16 at 09:04
  • @C.E. I still think it's entirely possible OP was talking about generic captcha. I come from the American south, where "Coke" is a generic term for a carbonated sugary nonalcoholic beverage :-) Basically OP didn't say very much in general, copy pasted word for word to wolfram community: http://community.wolfram.com/groups/-/m/t/845675 – Jason B. Apr 26 '16 at 10:11
  • @JasonB Let's wait and see what he has to say. In the meantime I didn't want this captcha thing to get out of hand, if that's not at all what he wants. I thought there was a risk that he'd come back after fifteen hours and have fifteen different answers for generating captchas, which may not help him. – C. E. Apr 26 '16 at 12:48
  • lol, but wouldn't that be more fun than the real answer, the one that J.M. posted as a comment, which is "No, there isn't anything built in, but there is a built-in method for working with external APIs and you can write this one yourself" – Jason B. Apr 26 '16 at 12:50
  • @JasonB But I don't think that's right either. I think the OP wants to deploy a website through Wolfram Cloud and he is wondering how to integrate reCaptcha into this website. When you use reCaptcha first you load a JavaScript file that creates the checkbox with your user ID etc., then when the user submits the form to your server you get a request ID. You have to send a post request to Google's server with this request ID, and more, and then process the returned value to find out if the user is human or not. The way I interpret the question is how do you set this up in the Wolfram Cloud. – C. E. Apr 26 '16 at 13:08
  • 2
    You are most certainly right, I sometimes talk about things I don't know anything about... – Jason B. Apr 26 '16 at 13:10