CN106899610A - 一种无需存储的验证码验证方法 - Google Patents

一种无需存储的验证码验证方法 Download PDF

Info

Publication number
CN106899610A
CN106899610A CN201710174614.5A CN201710174614A CN106899610A CN 106899610 A CN106899610 A CN 106899610A CN 201710174614 A CN201710174614 A CN 201710174614A CN 106899610 A CN106899610 A CN 106899610A
Authority
CN
China
Prior art keywords
code
identifying code
server
characters string
encrypted characters
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
CN201710174614.5A
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.)
Century Hengtong Polytron Technologies Inc
Original Assignee
Century Hengtong Polytron Technologies Inc
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 Century Hengtong Polytron Technologies Inc filed Critical Century Hengtong Polytron Technologies Inc
Priority to CN201710174614.5A priority Critical patent/CN106899610A/zh
Publication of CN106899610A publication Critical patent/CN106899610A/zh
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明公开了一种无需存储的验证码验证方法,包括以下步骤:一、服务器生成验证码,将验证码加密后生成加密字符串,将加密字符串和验证码一同发送给客户端:二、客户端接收到加密字符串和验证码后显示,然后将加密字符串和用户输入的验证码发送到服务器;三、服务器将加密字符串解密后得到验证码,与客户端发送过来的用户输入验证码进行对比,判断其是否一致。本发明的方法无须任何存储或缓存,无须在客户端与服务端之间保持会话,不论在单服务器还是分布式环境下都可以工作,校验前后两次请求不需要落在同一台服务器上,可以无任何附加条件地横向扩容。

Description

一种无需存储的验证码验证方法
技术领域
本发明涉及一种验证码验证方法。
背景技术
随着互联网的发展,内容越来越多的同时,也存在反抓取、反垃圾等问题,验证码是一种普遍用于拒绝机器人、脚本访问的方式,通过验证码可以区分出当前操作请求是真人还是机器脚本,可以有效拦截恶意抓取及攻击。
传统的验证码方案需要在服务端与客户端之间保持会话,将生成的验证码存储于会话之中,客户端提交验证码后进行比对。这种方法缺点明显:
1.需要在服务器中存储验证码原文直到验证码验证或者失效
2.需要客户端与服务端之间保持会话
3.对分布式环境不友好。
传统验证码方案为避免暴露验证码,需要将随机数生成器产生的验证码暂存在服务端,当访问量大时,会给服务端存储带来额外负担。在分布式环境下,需要实现分布式存储来提供多台服务器共同访问此部分数据。对于存储的有效期(定时删除过期验证码)需要额外开发程序功能实现。
发明内容
本发明要解决的技术问题:针对目前的验证码需要暂存在服务器中的问题,提供了一种无需存储验证码的验证方法。
本发明技术方案:
一种无需存储的验证码验证方法包括以下步骤:一、服务器生成验证码,将验证码加密后生成加密字符串,将加密字符串和验证码一同发送给客户端:
二、客户端接收到加密字符串和验证码后显示,然后将加密字符串和用户输入的验证码发送到服务器;
三、服务器将加密字符串解密后得到验证码,与客户端发送过来的用户输入验证码进行对比,判断其是否一致。
在步骤一中,服务器还生成时间戳,将验证码和时间戳拼合后加密,在步骤三中还要对比收到时间是否和时间戳在一个规定时间差内。
使用对称加密算法进行加密和解密。
本发明的有益效果:
该方法无须任何存储或缓存,无须在客户端与服务端之间保持会话,不论在单服务器还是分布式环境下都可以工作,校验前后两次请求不需要落在同一台服务器上,可以无任何附加条件地横向扩容。
附图说明:
图1为本发明方法的流程示意图。
具体实施方式:
实施例:在服务器中有随机数生成器和密匙管理单元,实现步骤如下:
1.使用随机数生成器生成验证码。
2.将验证码和当前时间戳拼合在一起,使用对称加密算法,得到密文,发送到客户端,同时也将验证码以图片、语音、短信等方式发送给用户,用以鉴别是真人还是机器脚本。
3.客户端如果是真人,则可以识别出验证码,填写验证码后,客户端将密文及用户输入的验证码一起提交回服务端。
4.服务端接受到密文后使用对称加密算法解密得到验证码原文及时间戳,通过原文可以比对用户输入的验证码是否正确,通过时间戳可以比对验证码是否过期。
如果加密串一经破解,则通过对密钥管理单元存储的密钥进行修改,即各服务器可快速经过共享密钥服务器快速对新的加密、解密算法及时更正密钥。
对称加密算法的选择可以采用AES(高级加密标准)算法或3DES(三重数据加密算法)等国际公开、经受过理论与实际双重验证的算法。由于密钥只存在于服务端,容易保护,即使遭受保利破解导致密钥泄露,也只需要重新生成一组密钥,几乎无任何成本。

Claims (3)

1.一种无需存储的验证码验证方法,其特征在于包括以下步骤:一、服务器生成验证码,将验证码加密后生成加密字符串,将加密字符串和验证码一同发送给客户端:
二、客户端接收到加密字符串和验证码后显示,然后将加密字符串和用户输入的验证码发送到服务器;
三、服务器将加密字符串解密后得到验证码,与客户端发送过来的用户输入验证码进行对比,判断其是否一致。
2.根据权利要求1所述无需存储的验证码验证方法,其特征在于:在步骤一中,服务器还生成时间戳,将验证码和时间戳拼合后加密,在步骤三中还要对比收到时间是否和时间戳在一个规定时间差内。
3.根据权利要求1或2所述无需存储的验证码验证方法,其特征在于:使用对称加密算法进行加密和解密。
CN201710174614.5A 2017-03-22 2017-03-22 一种无需存储的验证码验证方法 Pending CN106899610A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710174614.5A CN106899610A (zh) 2017-03-22 2017-03-22 一种无需存储的验证码验证方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710174614.5A CN106899610A (zh) 2017-03-22 2017-03-22 一种无需存储的验证码验证方法

Publications (1)

Publication Number Publication Date
CN106899610A true CN106899610A (zh) 2017-06-27

Family

ID=59192445

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710174614.5A Pending CN106899610A (zh) 2017-03-22 2017-03-22 一种无需存储的验证码验证方法

Country Status (1)

Country Link
CN (1) CN106899610A (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107241363A (zh) * 2017-08-10 2017-10-10 青岛宇硕云联信息科技有限公司 自动区分计算机程序输入和人类输入的方法和装置
CN109818925A (zh) * 2018-12-21 2019-05-28 航天信息股份有限公司 一种针对React框架的防止跨站请求伪造CSRF攻击的方法及系统
CN112039890A (zh) * 2020-08-31 2020-12-04 重庆可兰达科技有限公司 一种验证码校验方法、装置、终端及介质
CN112149100A (zh) * 2020-09-01 2020-12-29 长沙市到家悠享网络科技有限公司 一种验证方法、装置、电子设备及存储介质
CN114363034A (zh) * 2021-12-29 2022-04-15 上海众源网络有限公司 验证码生成及校验方法、装置、电子设备及存储介质
CN114584327A (zh) * 2022-05-09 2022-06-03 山东捷瑞数字科技股份有限公司 一种客户端生成的图形验证码的验证方法及系统
CN115037515A (zh) * 2022-04-29 2022-09-09 北京龙腾佳讯科技股份公司 开放数据网中无状态验证码验证方法、装置及电子设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101714205A (zh) * 2008-10-07 2010-05-26 优仕达资讯股份有限公司 验证方法及识别系统
CN102469091A (zh) * 2010-11-18 2012-05-23 金蝶软件(中国)有限公司 一种页面验证码处理的方法、装置及终端
CN103209158A (zh) * 2012-01-12 2013-07-17 深圳市宇初网络技术有限公司 一种第三方验证方法以及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101714205A (zh) * 2008-10-07 2010-05-26 优仕达资讯股份有限公司 验证方法及识别系统
CN102469091A (zh) * 2010-11-18 2012-05-23 金蝶软件(中国)有限公司 一种页面验证码处理的方法、装置及终端
CN103209158A (zh) * 2012-01-12 2013-07-17 深圳市宇初网络技术有限公司 一种第三方验证方法以及系统

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107241363A (zh) * 2017-08-10 2017-10-10 青岛宇硕云联信息科技有限公司 自动区分计算机程序输入和人类输入的方法和装置
CN109818925A (zh) * 2018-12-21 2019-05-28 航天信息股份有限公司 一种针对React框架的防止跨站请求伪造CSRF攻击的方法及系统
CN112039890A (zh) * 2020-08-31 2020-12-04 重庆可兰达科技有限公司 一种验证码校验方法、装置、终端及介质
CN112149100A (zh) * 2020-09-01 2020-12-29 长沙市到家悠享网络科技有限公司 一种验证方法、装置、电子设备及存储介质
CN114363034A (zh) * 2021-12-29 2022-04-15 上海众源网络有限公司 验证码生成及校验方法、装置、电子设备及存储介质
CN114363034B (zh) * 2021-12-29 2024-02-02 上海众源网络有限公司 验证码生成及校验方法、装置、电子设备及存储介质
CN115037515A (zh) * 2022-04-29 2022-09-09 北京龙腾佳讯科技股份公司 开放数据网中无状态验证码验证方法、装置及电子设备
CN114584327A (zh) * 2022-05-09 2022-06-03 山东捷瑞数字科技股份有限公司 一种客户端生成的图形验证码的验证方法及系统

Similar Documents

Publication Publication Date Title
CN106899610A (zh) 一种无需存储的验证码验证方法
US20210273796A1 (en) Method and system for many-to-many symmetric cryptography and a network employing the same
US9584495B2 (en) Method and system for establishing secure communications using composite key cryptography
CN110022217B (zh) 一种基于区块链的广告传媒业务数据可信存证系统
US6125185A (en) System and method for encryption key generation
US9008312B2 (en) System and method of creating and sending broadcast and multicast data
CN107888560B (zh) 一种移动智能终端邮件安全传输系统及方法
US20170244687A1 (en) Techniques for confidential delivery of random data over a network
US7979707B2 (en) Secure seed generation protocol
CN111030814B (zh) 秘钥协商方法及装置
US20190363877A1 (en) Equivocation Augmentation Dynamic Secrecy System
US20090138708A1 (en) Cryptographic module distribution system, apparatus, and program
CN109981255B (zh) 密钥池的更新方法和系统
CN109543434B (zh) 区块链信息加密方法、解密方法、存储方法及装置
CN101989984A (zh) 电子文件安全共享系统及方法
CN110719165A (zh) 一种区块链分布式动态网络密钥生成和加密方法
CN101359991A (zh) 基于标识的公钥密码体制私钥托管系统
US20190268145A1 (en) Systems and Methods for Authenticating Communications Using a Single Message Exchange and Symmetric Key
CN111080299B (zh) 一种交易信息的防抵赖方法及客户端、服务器
JPH07325785A (ja) ネットワーク利用者認証方法および暗号化通信方法とアプリケーションクライアントおよびサーバ
CN108880995A (zh) 基于区块链的陌生社交网络用户信息及消息推送加密方法
CN101552792A (zh) 一种利用动态二级密钥来传递信息的方法和设备
Sujithra et al. ID based adaptive-key signcryption for data security in cloud environment
US8914640B2 (en) System for exchanging data between at least one sender and one receiver
JP2006115083A (ja) 正規コンテンツ確認方法

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
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: 20170627