CN110166250A - 一种防暴力破解的验证码交互方法 - Google Patents

一种防暴力破解的验证码交互方法 Download PDF

Info

Publication number
CN110166250A
CN110166250A CN201910410635.1A CN201910410635A CN110166250A CN 110166250 A CN110166250 A CN 110166250A CN 201910410635 A CN201910410635 A CN 201910410635A CN 110166250 A CN110166250 A CN 110166250A
Authority
CN
China
Prior art keywords
identifying code
fragment
code
picture
hash value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910410635.1A
Other languages
English (en)
Inventor
李成东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201910410635.1A priority Critical patent/CN110166250A/zh
Publication of CN110166250A publication Critical patent/CN110166250A/zh
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Abstract

本发明公开了一种防暴力破解的验证码交互方法,包括步骤1:客户端请求验证码,服务器在接收到请求后生成验证码图片碎片;步骤2:判断步骤1中验证码图片碎片是否生成成功,若生成成功则加密验证码信息,存储未加密的验证码碎片hash值,拼接后再次取hash值,并存储验证码数据,然后将验证码数据响应给客户端;若生成失败则响应客户端验证码系统繁忙;步骤3:客户端判断验证码数据是否获取成功,若成功则解密部分或全部验证码信息,解密成功则展示碎片图片并进入步骤4,解密失败则结束本次验证流程;若获取失败则结束本次验证码验证流程;步骤4:获取用户输入数据,判断当前用户输入数据长度是否符合已解密的图片碎片,不符合则等待用户继续输入。

Description

一种防暴力破解的验证码交互方法
技术领域
本发明涉及信息安全技术领域,具体的说,是一种防暴力破解的验证码交互方法。
背景技术
随着互联网应用的发展,WEB应用和移动应用越来越多,对于用户数据至关重要的企业来说,如何保证用户数据不被泄露是一项任重道远的义务与责任,对于网络攻击者而言,通常第一步则是通过对管理系统或平台系统尝试暴力破解的方式来获取管理员或用户的登陆信息,从而登陆到管理系统获取数据,针对这一问题,有的企业采用图片验证码来防护账户被暴力破解,但是新型的攻击手段逐渐变得更加智能化,攻击者会通过页面抓取图片和OCR识别软件的方式获得验证码,从而通过机器学习的方式很快识别出来结果,同样可以实施暴力破解。
现有的静态验证码安全性较差非常容易破解;gif验证码生成困难,同时又存在被穷举的风险,安全性也不高;滑动验证码容易被识别,短信验证码有条数限制并且容易被拦截,因此我们需要一种安全性更高的验证码来保证用户的信息安全。
发明内容
本发明的目的在于提供一种防暴力破解的验证码交互方法,用于解决现有技术中由于科技发展破解手段越来越厉害,导致现有的验证码交互方式都容易被破解的问题。
本发明通过下述技术方案解决上述问题:
一种防暴力破解的验证码交互方法,所述交互方法包括如下步骤:
步骤1:客户端请求验证码,服务器在接收到请求后生成验证码图片碎片;
步骤2:判断步骤1中验证码图片碎片是否生成成功,若生成成功则加密验证码信息,存储未加密的验证码碎片hash值,拼接后再次取hash值,并存储验证码数据,然后将验证码数据响应给客户端;若生成失败则响应客户端验证码系统繁忙;
步骤3:客户端判断验证码数据是否获取成功,若成功则解密部分或全部验证码信息,解密成功则展示碎片图片并进入步骤4,解密失败则结束本次验证流程;若获取失败则结束本次验证码验证流程;
步骤4:获取用户输入数据,并判断当前用户输入数据长度是否符合已解密的图片碎片,若不符合则等待用户继续输入,若符合则进入步骤5;
步骤5:判断碎片图片是否完全显示,若未完全显示则跳转步骤3;若已完全显示则处理碎片验证码的hash值,拼接结果后再次取hash值并发起接口调用验证,根据接口调用验证结果判断是否验证通过,不通过则展示提示信息并结束本次验证码流程,通过则根据hash值查询验证码数据,若验证码数据不存在或验证码结果不匹配,则响应验证失败,反之则响应验证成功并结束验证码流程。
本方法通过对普通验证码生成多个验证码组成验证码序,验证码序通过加密方式传给前端,前端再解密出第一个验证码序,当用户输入验证码序对应的长度个数后,后台解密下个验证码序,即通过输入交互的方式逐步展现整个验证码,直到整个验证码图片被完全展示出来。最后根据验证码序的hash值及对应的验证码结果返回给后台进行验证。这个方式能有效防止图片被OCR软件获取,同时避免短信验证码的短板被重放攻击,很好的解决了现有验证码方式存在的易被破解的问题。
优选地,所述步骤2中验证码数据存储在Redis验证码缓存中。
优选地,所述步骤2中的加密方法为对称加密或非对称加密,可根据实际程序的设计进行选择。
本发明与现有技术相比,具有以下优点及有益效果:
本发明通过对普通验证码生成多个验证码组成验证码序,验证码序通过加密方式传给前端,前端再解密出第一个验证码序,当用户输入验证码序对应的长度个数后,后台解密下个验证码序,即通过输入交互的方式逐步展现整个验证码,直到整个验证码图片被完全展示出来。最后根据验证码序的hash值及对应的验证码结果返回给后台进行验证。这个方式能有效防止图片被OCR软件获取,同时避免短信验证码的短板被重放攻击。
附图说明
图1为本发明的防暴力破解的验证码交互方法流程示意图。
具体实施方式
下面结合实施例对本发明作进一步地详细说明,但本发明的实施方式不限于此。
实施例1:
结合附图1所示,一种防暴力破解的验证码交互方法,包括如下步骤:
步骤1:客户端请求验证码,服务器在接收到请求后生成验证码图片碎片;
步骤2:判断步骤1中验证码图片碎片是否生成成功,若生成成功则采用对称加密验证码信息,存储未加密的验证码碎片hash值,拼接后再次取hash值,并存储验证码数据于Redis验证码缓存中,然后将验证码数据响应给客户端;若生成失败则响应客户端验证码系统繁忙;
步骤3:客户端判断验证码数据是否获取成功,若成功则解密部分或全部验证码信息,解密成功则展示碎片图片并进入步骤4,解密失败则结束本次验证流程;若获取失败则结束本次验证码验证流程;
步骤4:获取用户输入数据,并判断当前用户输入数据长度是否符合已解密的图片碎片,若不符合则等待用户继续输入,若符合则进入步骤5;
步骤5:判断碎片图片是否完全显示,若未完全显示则跳转步骤3;若已完全显示则处理碎片验证码的hash值,拼接结果后再次取hash值并发起接口调用验证,根据接口调用验证结果判断是否验证通过,不通过则展示提示信息并结束本次验证码流程,通过则根据hash值查询验证码数据,若验证码数据不存在或验证码结果不匹配,则响应验证失败,反之则响应验证成功并结束验证码流程。
通过对普通验证码生成多个验证码组成验证码序,验证码序通过加密方式传给前端,前端再解密出第一个验证码序,当用户输入验证码序对应的长度个数后,后台解密下个验证码序,即通过输入交互的方式逐步展现整个验证码,直到整个验证码图片被完全展示出来。最后根据验证码序的hash值及对应的验证码结果返回给后台进行验证。这个方式能有效防止图片被OCR软件获取,同时避免短信验证码的短板被重放攻击,很好的解决了现有验证码方式存在的易被破解的问题。
尽管这里参照本发明的解释性实施例对本发明进行了描述,上述实施例仅为本发明较佳的实施方式,本发明的实施方式并不受上述实施例的限制,应该理解,本领域技术人员可以设计出很多其他的修改和实施方式,这些修改和实施方式将落在本申请公开的原则范围和精神之内。

Claims (3)

1.一种防暴力破解的验证码交互方法,其特征在于,所述交互方法包括如下步骤:
步骤1:客户端请求验证码,服务器在接收到请求后生成验证码图片碎片;
步骤2:判断步骤1中验证码图片碎片是否生成成功,若生成成功则加密验证码信息,存储未加密的验证码碎片hash值,拼接后再次取hash值,并存储验证码数据,然后将验证码数据响应给客户端;若生成失败则响应客户端验证码系统繁忙;
步骤3:客户端判断验证码数据是否获取成功,若成功则解密部分或全部验证码信息,解密成功则展示碎片图片并进入步骤4,解密失败则结束本次验证流程;若获取失败则结束本次验证码验证流程;
步骤4:获取用户输入数据,并判断当前用户输入数据长度是否符合已解密的图片碎片,若不符合则等待用户继续输入,若符合则进入步骤5;
步骤5:判断碎片图片是否完全显示,若未完全显示则跳转步骤3;若已完全显示则处理碎片验证码的hash值,拼接结果后再次取hash值并发起接口调用验证,根据接口调用验证结果判断是否验证通过,不通过则展示提示信息并结束本次验证码流程,通过则根据hash值查询验证码数据,若验证码数据不存在或验证码结果不匹配,则响应验证失败,反之则响应验证成功并结束验证码流程。
2.根据权利要求1所述的防暴力破解的验证码交互方法,其特征在于:所述步骤2中验证码数据存储在Redis验证码缓存中。
3.根据权利要求1所述的防暴力破解的验证码交互方法,其特征在于:所述步骤2中的加密方法为对称加密或非对称加密。
CN201910410635.1A 2019-05-16 2019-05-16 一种防暴力破解的验证码交互方法 Pending CN110166250A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910410635.1A CN110166250A (zh) 2019-05-16 2019-05-16 一种防暴力破解的验证码交互方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910410635.1A CN110166250A (zh) 2019-05-16 2019-05-16 一种防暴力破解的验证码交互方法

Publications (1)

Publication Number Publication Date
CN110166250A true CN110166250A (zh) 2019-08-23

Family

ID=67631330

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910410635.1A Pending CN110166250A (zh) 2019-05-16 2019-05-16 一种防暴力破解的验证码交互方法

Country Status (1)

Country Link
CN (1) CN110166250A (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021048686A1 (en) * 2019-09-09 2021-03-18 International Business Machines Corporation Security credentials management for client applications
CN112883359A (zh) * 2021-03-12 2021-06-01 河北亚迎科技有限公司 一种动态验证方法和系统

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8209743B1 (en) * 2010-03-09 2012-06-26 Facebook, Inc. CAPTCHA image scramble
CN102957688A (zh) * 2012-08-16 2013-03-06 中国商用飞机有限责任公司 密码输入以及验证方法和装置
CN103841130A (zh) * 2012-11-21 2014-06-04 深圳市腾讯计算机系统有限公司 验证信息推送方法及装置、身份认证方法及系统
CN104346557A (zh) * 2013-08-06 2015-02-11 深圳市腾讯计算机系统有限公司 验证码的生成方法及装置、验证码的显示控制方法及装置
CN104955050A (zh) * 2006-10-27 2015-09-30 高通股份有限公司 合成消息验证码
CN105450402A (zh) * 2014-06-26 2016-03-30 优视科技有限公司 用于组合型图片验证码输入的方法、装置及系统
CN106778223A (zh) * 2016-12-29 2017-05-31 维沃移动通信有限公司 一种密码校验方法及移动终端
CN107645381A (zh) * 2016-07-21 2018-01-30 阿里巴巴集团控股有限公司 安全验证实现方法及装置

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104955050A (zh) * 2006-10-27 2015-09-30 高通股份有限公司 合成消息验证码
US8209743B1 (en) * 2010-03-09 2012-06-26 Facebook, Inc. CAPTCHA image scramble
CN102957688A (zh) * 2012-08-16 2013-03-06 中国商用飞机有限责任公司 密码输入以及验证方法和装置
CN103841130A (zh) * 2012-11-21 2014-06-04 深圳市腾讯计算机系统有限公司 验证信息推送方法及装置、身份认证方法及系统
CN104346557A (zh) * 2013-08-06 2015-02-11 深圳市腾讯计算机系统有限公司 验证码的生成方法及装置、验证码的显示控制方法及装置
CN105450402A (zh) * 2014-06-26 2016-03-30 优视科技有限公司 用于组合型图片验证码输入的方法、装置及系统
CN107645381A (zh) * 2016-07-21 2018-01-30 阿里巴巴集团控股有限公司 安全验证实现方法及装置
CN106778223A (zh) * 2016-12-29 2017-05-31 维沃移动通信有限公司 一种密码校验方法及移动终端

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021048686A1 (en) * 2019-09-09 2021-03-18 International Business Machines Corporation Security credentials management for client applications
US11269987B2 (en) 2019-09-09 2022-03-08 International Business Machines Corporation Security credentials management for client applications
GB2601098A (en) * 2019-09-09 2022-05-18 Ibm Security credentials management for client applications
GB2601098B (en) * 2019-09-09 2022-09-07 Ibm Security credentials management for client applications
CN112883359A (zh) * 2021-03-12 2021-06-01 河北亚迎科技有限公司 一种动态验证方法和系统

Similar Documents

Publication Publication Date Title
CN110162936B (zh) 一种软件内容的使用授权方法
KR102493744B1 (ko) 생체 특징에 기초한 보안 검증 방법, 클라이언트 단말, 및 서버
CN108834144B (zh) 运营商码号与账号的关联管理方法与系统
CN101350723B (zh) 一种USB Key设备及其实现验证的方法
WO2007104243A1 (en) The managing system of accounts security based on the instant message and its method
CN106027501B (zh) 一种在移动设备中进行交易安全认证的系统和方法
CN106453361B (zh) 一种网络信息的安全保护方法及系统
US20100310077A1 (en) Method for generating a key pair and transmitting a public key or request file of a certificate in security
CN1937498A (zh) 一种动态密码认证方法、系统及装置
CN102281138B (zh) 一种提高验证码安全性的方法和系统
CN101577917A (zh) 一种安全的基于手机的动态密码验证方法
KR20140035775A (ko) 결제 방법, 이를 실행하는 결제 서버, 이를 저장한 기록 매체 및 이를 실행하는 시스템
CN111130798B (zh) 一种请求鉴权方法及相关设备
US20090119505A1 (en) Transaction method and verification method
CN111080299B (zh) 一种交易信息的防抵赖方法及客户端、服务器
CN101325483B (zh) 对称密钥更新方法和对称密钥更新装置
CN108183798A (zh) 应用的实名认证方法、服务器、移动终端及可读存储介质
CN111193743A (zh) 一种存储系统的身份认证方法、系统及相关装置
CN110166250A (zh) 一种防暴力破解的验证码交互方法
JP2010231404A (ja) 秘密情報管理システム、秘密情報管理方法、および秘密情報管理プログラム
CN109862009B (zh) 一种客户端身份校验方法及装置
CN112600667B (zh) 一种密钥协商方法、装置、设备及存储介质
CN109474431A (zh) 客户端认证方法及计算机可读存储介质
CN111625815A (zh) 一种基于可信执行环境的数据交易方法及装置
KR100866608B1 (ko) 모바일 기기를 이용한 사용자와 서버간의 상호 인증시스템, 그 방법 및 기록매체

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190823