reCAPTCHA
是卡内基梅隆大学的一帮人搞出来的,它的技术并没有什么先进之处,但是创意有点意思。世界上面有很多将图书电子化的计划,基本是把书籍扫描了以后用
OCR 软件识别。有些情况下面 OCR 软件自己觉得某些词的识别结果并不是非常有把握。通常情况下面是通过雇佣劳力来肉眼校对。reCAPTCHA
项目认为这个工作不妨交给全世界大量填写认证码的人来完成。
一般图形认证码系统都是只生成一个单词的,reCAPTCHA
生成的图片里面有两个单词,其中一个是机器生成的,有正确结果的单词,另一个则是扫描出来的有问题的单词,这个词没有正确结果。如果用户提交上来的结果里
面机器生成的那个是对的,那么系统就认为另外一个也很有可能是对的。一幅扫描图片展示给多个用户如果结果都是一样的,他就将这个结果作为最终校对结果。这
样就实现了利用人力来分布式校对文稿的目的。更具体的细节可以看 http://recaptcha.net/learnmore.html
There are three ways to use reCAPTCHA: using an application plugin, using a library
for your programming language, and using the web-based API.
How to reCAPTCHA Your Java Application:http://wheelersoftware.com/articles/recaptcha-java.html
在你的pom.xml文件加入:
<dependency>
<groupId>net.tanesha.recaptcha4j</groupId>
<artifactId>recaptcha4j</artifactId>
<version>${version}</version>
</dependency>
...
<repositories>
...
<repository>
<id>taneshanet</id>
<url>http://tanesha.net/maven2</url>
</repository>
...
</repositories>
在你的jsp页面这样:
<%
// create recaptcha without <noscript> tags
ReCaptcha captcha = ReCaptchaFactory.newReCaptcha("my-public-key", "my-private-key", false);
String captchaScript = captcha.createRecaptchaHtml(request.getParameter("error"), null);
out.print(captchaScript);
%>
Checking the captcha goes like this:
<%
// create recaptcha without <noscript> tags
ReCaptcha captcha = ReCaptchaFactory.newReCaptcha("my-public-key", "my-private-key", false);
ReCaptchaResponse response = captcha.checkAnswer(request.getRemoteAddr(), request.getParameter("recaptcha_challenge_field"), request.getParameter("recaptcha_response_field"));
if (response.isValid()) {
out.print("Success");
}
else {
out.print(response.getErrorMessage());
}
%>
https://svn.tanesha.net/svn/sandbox/recaptcha4j-example/trunk/
.
当然你也可以在spring里面配置:
<bean id="reCaptcha" class="net.tanesha.recaptcha4j.ReCaptchaImpl">
<property name="privateKey" value="my private key" />
<property name="publicKey" value="my public key" />
<property name="recaptchaServer" value="http://api.recaptcha.net" />
<!-- Or, if you want to use SSL, then use this:
<property name="recaptchaServer" value="http://secure-api.recaptcha.net" />
-->
<property name="includeNoscript" value="false" />
</bean>
http://tanesha.net/projects/recaptcha4j/
分享到:
相关推荐
很多国外网站采用了Google的reCaptcha验证,但在国内上网是无法显示该验证的,即使用梯子也无法解决,可以采用谷歌浏览器插件来解决此问题 使用谷歌浏览器,打开 设置--->扩展程序,勾选开发者模式,把Header ...
下载文件 https://www.google.com/recaptcha/api.js 和这个文件中包含的另外一个文件 https://www.gstatic.com/recaptcha/api2/r20160531110558/recaptcha__zh_cn.js
很多国外网站采用了Google的reCaptcha验证,但在国内上网是无法显示该验证的,即使用梯子也无法解决,可以采用谷歌浏览器插件来解决此问题 使用谷歌浏览器,打开 设置--->扩展程序,勾选开发者模式,把Header ...
java对接google验证码完整示例,函前端引入google api.js与后端校验g-recaptcha-response是否合法的业务逻辑,可正常运行。
以91%的准确率击败最新版本的ReCaptcha
Laravel开发-recaptcha reCAPTCHA 验证码的支持 Recaptcha验证码的支持
ng-recaptcha, Google reCAPTCHA的Angular 组件 Google reCAPTCHA的 Angular 组件 一个简单,可以配置的easy-to-start组件,用于处理 reCAPTCHA 。目录安装工具基本用法:游乐场使用 @angular/form
Laravel开发-recaptcha Laravel 5的Recaptcha验证程序
recaptcha, 用于 ruby 应用的ReCaptcha帮助程序 reCAPTCHA作者:Jason L 佩里( http://ambethia.com )版权所有:版权所有( c ) 2007 -2013 Jason L 佩里许可证:信息:https://github.com/ambethia
CodeIgniter-reCAPTCHA, 用于CodeIgniter的reCAPTCHA库 recaptcha免费防恶意服务。易于添加,安全,可以广泛使用的用户和平台。 这里软件包与 PSR-1 和 PSR-2 兼容。什么是 reCAPTCHA?reCAPTCHA是一个免费的服务,...
使用谷歌浏览器,打开 设置--->扩展程序,勾选开发者模式,把Header Editor....很多国外网站采用了Google的reCaptcha验证,但在国内上网是无法显示该验证的,即使用梯子也无法解决,可以采用谷歌浏览器插件来解决此问题
Laravel开发-laravel-recaptcha Google Recaptcha为Laravel 5
Laravel开发-recaptcha-laravel 在Laravel中添加和验证Recaptcha字段的简单包
前端项目-angular-recaptcha,An AngularJS module to ease usage of reCaptcha inside a form
Laravel开发-invisible-recaptcha 为拉雷维尔看不见的重演。
前端开源库-recaptchaRecaptcha,显示并验证Recaptcha验证码
Android-Lib-reCAPTCHA This project is no longer maintained reCAPTCHA v1 is official unsupported since May of 2016 (Link): > reCAPTCHA V1 has been deprecated since May of 2016 and will not work for ...