[go: up one dir, main page]

CN114844644A - Resource request method, device, electronic equipment and storage medium - Google Patents

Resource request method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114844644A
CN114844644A CN202210259476.1A CN202210259476A CN114844644A CN 114844644 A CN114844644 A CN 114844644A CN 202210259476 A CN202210259476 A CN 202210259476A CN 114844644 A CN114844644 A CN 114844644A
Authority
CN
China
Prior art keywords
request
token
terminal
server
key
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
CN202210259476.1A
Other languages
Chinese (zh)
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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202210259476.1A priority Critical patent/CN114844644A/en
Publication of CN114844644A publication Critical patent/CN114844644A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/321Cryptographic 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 involving a third party or a trusted authority
    • H04L9/3213Cryptographic 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 involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/126Applying verification of the received information the source of the received data
    • 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

Landscapes

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

Abstract

The application discloses a resource request method, a resource request device, electronic equipment and a storage medium. And the terminal encrypts the information corresponding to the request to obtain a token based on the session key of the server, and sends the token and the information corresponding to the request to the server along with the request. The server determines a terminal based on the Cookie in the request, encrypts information carried by the request according to a session key of the determined terminal to generate a corresponding token, verifies the token carried by the request based on the generated token, and sends corresponding resources to the determined terminal under the condition that the token carried by the request is matched with the generated token. In the scheme, the identity of the request terminal is verified through the token, and even if an attacker obtains the terminal Cookie and the token carried by the request, the attacker cannot request other resources except the resource corresponding to the token, so that session hijacking caused by Cookie leakage can be avoided, and the session safety of the server and the terminal equipment is improved.

Description

资源请求方法、装置、电子设备及存储介质Resource request method, device, electronic device and storage medium

技术领域technical field

本申请涉及网络技术领域,尤其涉及一种资源请求方法、装置、电子设备及存储介质。The present application relates to the field of network technologies, and in particular, to a resource request method, apparatus, electronic device, and storage medium.

背景技术Background technique

Cookie,是服务器等电子设备为了辨别用户身份,进行Session会话跟踪而储存在终端设备上的数据。Cookie泄露后,攻击者能够利用Cookie劫持会话,会话的安全性低。Cookies are data stored on terminal devices by electronic devices such as servers to identify users and track session sessions. After the cookie is leaked, the attacker can use the cookie to hijack the session, and the security of the session is low.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本申请实施例提供一种资源请求方法、装置、电子设备及存储介质,以至少解决相关技术存在的会话的安全性低的问题。In view of this, the embodiments of the present application provide a resource request method, apparatus, electronic device, and storage medium, so as to at least solve the problem of low session security in the related art.

本申请实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present application are implemented as follows:

本申请实施例提供了一种资源请求方法,应用于第一终端,所述方法包括:An embodiment of the present application provides a resource request method, which is applied to a first terminal, and the method includes:

基于第一密钥对第一信息进行加密处理,生成第一令牌;所述第一密钥表征所述第一终端与第一服务器之间的会话密钥;Encrypting the first information based on the first key to generate a first token; the first key represents a session key between the first terminal and the first server;

向所述第一服务器发送第一请求;所述第一请求用于向所述第一服务器请求第一资源,且携带有所述第一令牌和所述第一信息;其中,sending a first request to the first server; the first request is used to request a first resource from the first server, and carries the first token and the first information; wherein,

所述第一信息包括所述第一资源的描述信息和第一时间;所述第一时间表征与所述第一请求相关的时间;所述第一资源在所述第一服务器基于所述第一密钥和所述第一信息对所述第一令牌验证通过后下发至所述第一终端。The first information includes description information of the first resource and a first time; the first time represents a time related to the first request; the first resource is stored in the first server based on the first time. A key and the first information are sent to the first terminal after passing the verification of the first token.

其中,上述方案中,所述基于第一密钥对第一信息进行加密处理,生成第一令牌,包括:Wherein, in the above solution, encrypting the first information based on the first key to generate the first token includes:

将所述第一信息输入第一组件,得到所述第一组件输出的第一令牌;其中,Inputting the first information into a first component to obtain a first token output by the first component; wherein,

所述第一组件用于根据对应的密钥对输入的信息进行加密处理,生成并输出令牌;所述第一组件对应的代码经过混淆处理。The first component is used for encrypting the input information according to the corresponding key, and generating and outputting a token; the code corresponding to the first component is obfuscated.

上述方案中,在将所述第一信息输入第一组件之后,在得到所述第一组件输出的第一令牌之前,还包括:In the above solution, after the first information is input into the first component and before the first token output by the first component is obtained, the method further includes:

基于对第二信息的第一操作,得到所述第一密钥;其中,Based on the first operation on the second information, the first key is obtained; wherein,

所述第二信息表征对所述第一密钥进行第二操作后得到的信息;所述第二操作表征分段存储操作;所述第一操作表征所述第二操作的逆向操作。The second information represents information obtained by performing a second operation on the first key; the second operation represents a segmented storage operation; and the first operation represents a reverse operation of the second operation.

上述方案中,所述第一组件对应的代码表征为第一编程语言的代码,由第二编程语言的代码经过混淆处理后再转换得到。In the above solution, the code corresponding to the first component is represented as the code of the first programming language, which is obtained by converting the code of the second programming language after obfuscation.

上述方案中,在所述基于第一密钥对第一信息进行加密处理,生成第一令牌之前,所述方法还包括:In the above solution, before the first information is encrypted based on the first key to generate the first token, the method further includes:

在所述第一终端成功登录所述第一服务器的情况下,接收所述第一服务器下发的所述第一密钥。In the case that the first terminal successfully logs in to the first server, the first key issued by the first server is received.

上述方案中,在所述接收所述第一服务器下发的所述第一密钥之前,所述方法还包括:In the above solution, before the receiving the first key issued by the first server, the method further includes:

向所述第一服务器发送设定标识;其中,sending a setting identifier to the first server; wherein,

所述第一服务器在接收到所述设定标识的情况下向所述第一终端下发所述第一密钥。The first server delivers the first key to the first terminal in the case of receiving the setting identifier.

本申请实施例还提供了一种资源请求方法,应用于第一服务器,所述方法包括:The embodiment of the present application also provides a resource request method, which is applied to the first server, and the method includes:

接收第二请求;所述第二请求用于请求第二资源,且携带有第二令牌和第三信息;所述第三信息包括所述第二资源的描述信息和第二时间;所述第二时间表征与所述第二请求相关的时间;receiving a second request; the second request is used to request a second resource, and carries a second token and third information; the third information includes description information and a second time of the second resource; the a second time characterizes the time associated with the second request;

基于第二密钥对所述第三信息进行加密处理,生成第三令牌;所述第二密钥表征第二终端与所述第一服务器之间的会话密钥;所述第二终端根据第二请求中的Cookie确定出;The third information is encrypted based on the second key to generate a third token; the second key represents the session key between the second terminal and the first server; the second terminal according to The cookie in the second request is determined;

在所述第二令牌与所述第三令牌匹配的情况下,向所述第二终端发送所述第二资源。If the second token matches the third token, the second resource is sent to the second terminal.

上述方案中,在所述接收第二请求之前,所述方法还包括:In the above solution, before the receiving the second request, the method further includes:

在所述第二终端成功登录所述第一服务器的情况下,生成并向所述第二终端下发所述第二密钥。When the second terminal successfully logs in to the first server, the second key is generated and delivered to the second terminal.

上述方案中,所述生成并向所述第二终端下发所述第二密钥,包括:In the above solution, the generating and delivering the second key to the second terminal includes:

在接收到所述第二终端发送的设定标识的情况下,生成并向所述第二终端下发所述第二密钥。In the case of receiving the setting identifier sent by the second terminal, the second key is generated and delivered to the second terminal.

上述方案中,所述生成第三令牌,包括:In the above solution, the generating the third token includes:

在所述第二请求满足第一设定条件的情况下,生成第三令牌;In the case that the second request satisfies the first set condition, generating a third token;

所述第一设定条件包括:The first setting conditions include:

请求中的Cookie验证通过;The cookie verification in the request is passed;

和/或,and / or,

请求携带的第二时间在设定时间段内。The second time carried by the request is within the set time period.

上述方案中,所述方法还包括:In the above scheme, the method also includes:

在所述第二令牌与所述第三令牌不匹配的情况下,根据所述第二请求中的Cookie删除所述第一服务器存储的对应Cookie。If the second token does not match the third token, delete the corresponding cookie stored by the first server according to the cookie in the second request.

本申请实施例还提供了一种资源请求装置,应用于第一终端,包括:The embodiment of the present application also provides a resource requesting apparatus, which is applied to the first terminal, including:

第一生成单元,用于基于第一密钥对第一信息进行加密处理,生成第一令牌;所述第一密钥表征所述第一终端与第一服务器之间的会话密钥;a first generating unit, configured to encrypt the first information based on a first key to generate a first token; the first key represents a session key between the first terminal and the first server;

第一发送单元,用于向所述第一服务器发送第一请求;所述第一请求用于向所述第一服务器请求第一资源,且携带有所述第一令牌和所述第一信息;其中,a first sending unit, configured to send a first request to the first server; the first request is used to request a first resource from the first server, and carries the first token and the first information; of which,

所述第一信息包括所述第一资源的描述信息和第一时间;所述第一时间表征与所述第一请求相关的时间;所述第一资源在所述第一服务器基于所述第一密钥和所述第一信息对所述第一令牌验证通过后下发至所述第一终端。The first information includes description information of the first resource and a first time; the first time represents a time related to the first request; the first resource is stored in the first server based on the first time. A key and the first information are sent to the first terminal after passing the verification of the first token.

本申请实施例还提供了一种资源请求装置,应用于第一服务器,包括:The embodiment of the present application also provides a resource requesting device, which is applied to the first server, including:

第一接收单元,用于接收第二请求;所述第二请求用于请求第二资源,且携带有第二令牌和第三信息;所述第三信息包括所述第二资源的描述信息和第二时间;所述第二时间表征与所述第二请求相关的时间;a first receiving unit, configured to receive a second request; the second request is used to request a second resource, and carries a second token and third information; the third information includes description information of the second resource and a second time; the second time represents the time associated with the second request;

第二生成单元,用于基于第二密钥对所述第三信息进行加密处理,生成第三令牌;所述第二密钥表征第二终端与所述第一服务器之间的会话密钥;所述第二终端根据第二请求中的Cookie确定出;a second generating unit, configured to encrypt the third information based on a second key to generate a third token; the second key represents a session key between the second terminal and the first server ; The second terminal determines according to the Cookie in the second request;

第二发送单元,用于在所述第二令牌与所述第三令牌匹配的情况下,向所述第二终端发送所述第二资源。A second sending unit, configured to send the second resource to the second terminal when the second token matches the third token.

本申请实施例还提供了一种电子设备,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,Embodiments of the present application also provide an electronic device, including: a processor and a memory for storing a computer program that can be executed on the processor,

其中,所述处理器用于运行所述计算机程序时,执行上述任一种资源请求方法的步骤。Wherein, the processor is configured to execute the steps of any one of the above resource request methods when running the computer program.

本申请实施例还提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种资源请求方法的步骤。Embodiments of the present application further provide a storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the foregoing resource request methods.

在本申请实施例中,终端基于与服务器的会话密钥加密请求对应的信息,包括待请求资源的描述信息和请求相关的时间,得到令牌,并将令牌和请求对应的上述信息随请求发送至服务器。服务器基于请求中的Cookie确定终端,根据与确定出的终端的会话密钥,加密请求携带的信息,包括请求资源的描述信息和请求相关的时间,生成对应的令牌,并基于生成的令牌验证请求携带的令牌,在请求携带的令牌和生成的令牌匹配的情况下,服务器向确定出的终端发送对应的资源。在上述基于令牌的验证结果下发资源的方案中,通过令牌验证请求终端的身份,由于令牌与请求相关,攻击者即使获取请求携带的终端Cookie和令牌,也无法请求除令牌对应的资源以外的其它资源,这样,能够避免Cookie泄露导致的会话劫持,提升了服务器和终端设备会话的安全性。In the embodiment of the present application, the terminal obtains the token based on the information corresponding to the session key encryption request of the server, including the description information of the resource to be requested and the time related to the request, and sends the above information corresponding to the token and the request with the request. sent to the server. The server determines the terminal based on the cookie in the request, encrypts the information carried in the request according to the session key of the determined terminal, including the description information of the requested resource and the time related to the request, generates a corresponding token, and generates a corresponding token based on the generated token. The token carried in the request is verified, and in the case that the token carried in the request matches the generated token, the server sends the corresponding resource to the determined terminal. In the above scheme of distributing resources based on the token-based verification result, the identity of the requesting terminal is verified by the token. Since the token is related to the request, the attacker cannot request for the removal of the token even if he obtains the terminal cookie and token carried in the request. In this way, session hijacking caused by cookie leakage can be avoided, and the security of the session between the server and the terminal device is improved.

附图说明Description of drawings

图1为本申请实施例提供的资源请求方法的终端侧实现流程示意图;FIG. 1 is a schematic flowchart of a terminal-side implementation of a resource request method provided by an embodiment of the present application;

图2为本申请另一实施例提供的资源请求方法中生成第一令牌的实现流程示意图;FIG. 2 is a schematic flowchart of an implementation of generating a first token in a resource request method provided by another embodiment of the present application;

图3为本申请另一实施例提供的资源请求方法中编程语言转换示意图;3 is a schematic diagram of programming language conversion in a resource request method provided by another embodiment of the present application;

图4为本申请另一实施例提供的资源请求方法中分组示意图;4 is a schematic diagram of grouping in a resource request method provided by another embodiment of the present application;

图5为本申请另一实施例提供的资源请求方的实现流程示意图;FIG. 5 is a schematic diagram of an implementation flow of a resource requester according to another embodiment of the present application;

图6为本申请另一实施例提供的资源请求方法的服务器侧实现流程示意图;FIG. 6 is a schematic flowchart of a server-side implementation of a resource request method provided by another embodiment of the present application;

图7为本申请另一实施例提供的资源请求方法的实现流程示意图;FIG. 7 is a schematic diagram of an implementation flowchart of a resource request method provided by another embodiment of the present application;

图8为本申请另一实施例提供的资源请求方法的实现流程示意图;FIG. 8 is a schematic diagram of an implementation flowchart of a resource request method provided by another embodiment of the present application;

图9为本申请应用实施例提供的资源请求方法的交互示意图;FIG. 9 is an interactive schematic diagram of a resource request method provided by an application embodiment of the present application;

图10为本申请实施例提供的资源请求装置的结构示意图;FIG. 10 is a schematic structural diagram of a resource requesting apparatus provided by an embodiment of the present application;

图11为本申请另一实施例提供的资源请求装置的结构示意图;FIG. 11 is a schematic structural diagram of a resource requesting apparatus provided by another embodiment of the present application;

图12为本申请实施例提供的一种电子设备的结构示意图。FIG. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

具体实施方式Detailed ways

Cookie,是服务器等电子设备为了辨别用户身份,进行Session会话跟踪而储存在终端设备上的数据。在一次会话过程当中,攻击者能够利用Cookie作为第三方参与,在数据包中插入恶意数据、请求资源、监听会话,甚至可以是代替一方接管会话,会话的安全性低。Cookies are data stored on terminal devices by electronic devices such as servers to identify users and track session sessions. During a session, an attacker can use a cookie as a third party to participate, insert malicious data into the data packet, request resources, monitor the session, or even take over the session instead of one party. The security of the session is low.

基于此,在本申请的各种实施例中,终端基于与服务器的会话密钥加密请求对应的信息,包括待请求资源的描述信息和请求相关的时间,得到令牌,并将令牌和请求对应的上述信息随请求发送至服务器。服务器基于请求中的Cookie确定终端,根据与确定出的终端的会话密钥,加密请求携带的信息,包括请求资源的描述信息和请求相关的时间,生成对应的令牌,并基于生成的令牌验证请求携带的令牌,在请求携带的令牌和生成的令牌匹配的情况下,服务器向确定出的终端发送对应的资源。在上述基于令牌的验证结果下发资源的方案中,通过令牌验证请求终端的身份,由于令牌与请求相关,攻击者即使获取请求携带的终端Cookie和令牌,也无法请求除令牌对应的资源以外的其它资源,这样,能够避免Cookie泄露导致的会话劫持,提升了服务器和终端设备会话的安全性。Based on this, in various embodiments of the present application, the terminal obtains the token based on the information corresponding to the server's session key encryption request, including the description information of the resource to be requested and the time related to the request, and associates the token with the request. The corresponding above information is sent to the server along with the request. The server determines the terminal based on the cookie in the request, encrypts the information carried in the request according to the session key of the determined terminal, including the description information of the requested resource and the time related to the request, generates a corresponding token, and generates a corresponding token based on the generated token. The token carried in the request is verified, and in the case that the token carried in the request matches the generated token, the server sends the corresponding resource to the determined terminal. In the above scheme of distributing resources based on the token-based verification result, the identity of the requesting terminal is verified by the token. Since the token is related to the request, the attacker cannot request for the removal of the token even if he obtains the terminal cookie and token carried in the request. In this way, session hijacking caused by cookie leakage can be avoided, and the security of the session between the server and the terminal device is improved.

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

下面将通过实施例并结合附图具体地对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems will be specifically described in detail below with reference to the accompanying drawings. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

图1为本申请实施例提供的资源请求方法的实现流程示意图,本申请实施例提供了一种资源请求方法,应用于第一终端,其中,第一终端包括但不限于手机、平板等电子设备。第一终端可以通过装载浏览器等方式实现资源请求方法。资源请求方法包括:FIG. 1 is a schematic diagram of an implementation flow of a resource request method provided by an embodiment of the present application. An embodiment of the present application provides a resource request method, which is applied to a first terminal, where the first terminal includes but is not limited to electronic devices such as mobile phones and tablets. . The first terminal may implement the resource request method by loading a browser or the like. Resource request methods include:

步骤101:基于第一密钥对第一信息进行加密处理,生成第一令牌。Step 101: Encrypt the first information based on the first key to generate a first token.

其中,所述第一密钥表征所述第一终端与第一服务器之间的会话密钥。Wherein, the first key represents a session key between the first terminal and the first server.

步骤102:向所述第一服务器发送第一请求;所述第一请求用于向所述第一服务器请求第一资源,且携带有所述第一令牌和所述第一信息。Step 102: Send a first request to the first server; the first request is used to request a first resource from the first server, and carries the first token and the first information.

其中,所述第一信息包括所述第一资源的描述信息和第一时间;所述第一时间表征与所述第一请求相关的时间;所述第一资源在所述第一服务器基于所述第一密钥和所述第一信息对所述第一令牌验证通过后下发至所述第一终端。Wherein, the first information includes description information of the first resource and a first time; the first time represents a time related to the first request; the first resource is stored in the first server based on the The first key and the first information are sent to the first terminal after passing the verification of the first token.

在步骤101中,第一终端与第一服务器之间预先建立了会话关系,第一终端拥有与第一服务器的会话密钥(也就是第一密钥)。第一终端确定待请求的第一资源的描述信息,并根据当前请求相关的时间确定出第一时间。第一终端以第一信息(包括第一资源的描述信息和第一时间)为计算的输入,利用第一密钥进行哈希函数计算,得到计算输出的第一令牌。令牌的计算可以通过基于哈希的消息身份验证码(HMAC,Hash-based MessageAuthentication Code),基于哈希函数和会话密钥实现。In step 101, a session relationship is pre-established between the first terminal and the first server, and the first terminal has a session key (that is, a first key) with the first server. The first terminal determines the description information of the first resource to be requested, and determines the first time according to the time related to the current request. The first terminal takes the first information (including the description information of the first resource and the first time) as the input of the calculation, and uses the first key to calculate the hash function to obtain the first token that is output by the calculation. The calculation of the token can be achieved through a hash-based message authentication code (HMAC, Hash-based MessageAuthentication Code), based on a hash function and a session key.

其中,第一信息表征与当前请求对应的信息,包括第一时间和第一资源的描述信息。基于第一信息能够生成唯一的令牌,以标识对应的请求。第一时间能够将当前请求与此前或此后的请求区分开,例如,可以是在当前生成请求的时间段内的时刻或时间段。优选地,第一终端根据每次请求都需要执行的设定行为的执行时间确定第一时间,包括但不限于:终端接收到指示发起资源请求的指令的时间;终端生成第一令牌的时间。在一些实施例中,第一时间可以是时间戳的形式。The first information represents information corresponding to the current request, including the first time and description information of the first resource. A unique token can be generated based on the first information to identify the corresponding request. The first time can distinguish the current request from previous or subsequent requests, and may be, for example, a time or a time period within the time period in which the request is currently generated. Preferably, the first terminal determines the first time according to the execution time of the set behavior that needs to be executed for each request, including but not limited to: the time when the terminal receives an instruction instructing to initiate a resource request; the time when the terminal generates the first token . In some embodiments, the first time may be in the form of a timestamp.

第一资源是指可以被访问的对象,例如文档、图像、声音等数据。第一资源的描述信息表征相应资源位置的描述信息,根据请求方式的不同,描述信息包括:请求网址和/或web表单信息。由于每次请求对应的第一时间不同,每次请求对应的第一令牌不同,第一令牌与第一请求存在对应关系。The first resource refers to an object that can be accessed, such as data such as documents, images, and sounds. The description information of the first resource represents the description information of the corresponding resource location, and according to different request methods, the description information includes: request website and/or web form information. Since the first time corresponding to each request is different, the first token corresponding to each request is different, and there is a corresponding relationship between the first token and the first request.

第一密钥表征第一终端和第一服务器之间会话的会话密钥,由终端和服务器通过协商确定出,会话密钥可以代表这次会话中与服务器通信的终端的身份。The first key represents the session key of the session between the first terminal and the first server, and is determined by the terminal and the server through negotiation, and the session key may represent the identity of the terminal communicating with the server in this session.

在步骤102中,第一终端至少基于生成的第一令牌、第一信息(也就是第一令牌对应的信息),生成并向第一服务器发送第一请求的请求报文,以请求第一服务器下发第一资源。在第一服务器对第一令牌验证通过的情况下,第一终端接收第一服务器基于第一请求对应发送的第一资源。这里,请求报文中还携带有第一终端的Cookie,服务器根据接收到的请求报文携带的Cookie判断对应终端的身份,在服务器存储的会话密钥中确定出与终端身份对应的会话密钥,以实现根据会话密钥和第一信息验证第一令牌。In step 102, the first terminal generates and sends a request message of the first request to the first server based on at least the generated first token and the first information (that is, the information corresponding to the first token), so as to request the first request. A server delivers the first resource. In the case that the first server passes the verification of the first token, the first terminal receives the first resource correspondingly sent by the first server based on the first request. Here, the request message also carries the cookie of the first terminal. The server determines the identity of the corresponding terminal according to the cookie carried in the received request message, and determines the session key corresponding to the terminal identity from the session key stored by the server. , so as to verify the first token according to the session key and the first information.

在上述基于令牌的验证结果下发资源的方案中,对于每次资源请求,第一终端需要执行步骤101生成对应的令牌,并在步骤102发送请求时携带生成令牌,以获得服务器在请求携带的令牌验证通过后下发的资源。In the above solution for issuing resources based on the token-based verification result, for each resource request, the first terminal needs to perform step 101 to generate a corresponding token, and send the request in step 102 with the generated token to obtain the The resource issued after the token carried in the request is verified.

作为本申请的另一实施例,如图2所示,基于第一密钥对第一信息进行加密处理,生成第一令牌,包括:As another embodiment of the present application, as shown in FIG. 2 , encrypting the first information based on the first key to generate the first token includes:

步骤1011:将所述第一信息输入第一组件,得到所述第一组件输出的第一令牌。Step 1011: Input the first information into the first component to obtain the first token output by the first component.

其中,所述第一组件用于根据对应的密钥对输入的信息进行加密处理,生成并输出令牌;所述第一组件对应的代码经过混淆处理。Wherein, the first component is used for encrypting the input information according to the corresponding key, and generating and outputting a token; the code corresponding to the first component is obfuscated.

第一终端将第一信息输入第一组件,由第一组件根据对应的密钥(也就是第一密钥)对输入的第一信息进行加密处理生成第一令牌,第一终端得到第一组件输出的第一令牌。其中,第一组件对应的代码经过混淆处理,第一组件相当于黑盒,从而保护第一组件的代码逻辑,提高了攻击者逆向分析破解的难度,也就是说,对第一组件对应的代码的混淆处理,能够降低被逆向破解的风险。The first terminal inputs the first information into the first component, and the first component encrypts the input first information according to the corresponding key (that is, the first key) to generate the first token, and the first terminal obtains the first token. The first token output by the component. Among them, the code corresponding to the first component is obfuscated, and the first component is equivalent to a black box, so as to protect the code logic of the first component and improve the difficulty of reverse analysis and cracking by attackers, that is, the code corresponding to the first component is The obfuscation process can reduce the risk of reverse cracking.

第一终端通过调用代码经过混淆处理的第一组件,实现基于第一密钥对第一信息的加密处理得到第一令牌。在资源请求过程中利用混淆处理过的组件生成令牌,这样,生成第一令牌的代码逻辑对前端不可见,提升了前端操作的安全性,增加了攻击者逆向工程的难度和时间成本,从而提高了会话的安全性。The first terminal obtains the first token by invoking the first component whose code has undergone obfuscation processing to implement encryption processing of the first information based on the first key. In the process of resource request, the obfuscated component is used to generate the token. In this way, the code logic for generating the first token is invisible to the front-end, which improves the security of the front-end operation and increases the difficulty and time cost of reverse engineering for attackers. Thus, the security of the session is improved.

作为本申请的一个实施例,所述第一组件对应的代码表征为第一编程语言的代码,由第二编程语言的代码经过混淆处理后再转换得到。As an embodiment of the present application, the code corresponding to the first component is represented as the code of the first programming language, which is obtained by converting the code of the second programming language after obfuscation processing.

首先生成第一组件对应的第二编程语言的代码,再对第二编程语言的代码进行代码混淆处理,将混淆处理后的第二编程语言代码转换为第一编程语言的代码。在实际应用中,第二编程语言可以是C/C++,第一编程语言可以是JS。First, the code of the second programming language corresponding to the first component is generated, and then code obfuscation is performed on the code of the second programming language, and the obfuscated second programming language code is converted into the code of the first programming language. In practical applications, the second programming language may be C/C++, and the first programming language may be JS.

对不同编程语言的代码进行转换,可以借助OLLVM的后端实现,增加了逆向工程的时间成本和难度。The code conversion of different programming languages can be implemented with the backend of OLLVM, which increases the time cost and difficulty of reverse engineering.

这样,增加了攻击者逆向工程的难度和时间成本,降低了被逆向破解的风险,从而提高了会话的安全性。In this way, the difficulty and time cost of reverse engineering by the attacker are increased, and the risk of being reversely cracked is reduced, thereby improving the security of the session.

作为本申请的一个实施例,结合图3示出编程语言转换示意图进行说明,生成第一组件对应的C/C++(第二编程语言)代码,通过Clang前端将C/C++的代码转换为LLVM IRcode,再借助OLLVM的后端对前端生成的IR code进行负优化,使用的混淆策略有基本块分割、指令膨胀、虚假块填充和控制流平坦。利用LLVM webasm的后端和wasm-ld链接器将混淆后的IR code转换为前端js(第一编程语言)代码。As an embodiment of the present application, with reference to the schematic diagram of programming language conversion shown in FIG. 3, the C/C++ (second programming language) code corresponding to the first component is generated, and the C/C++ code is converted into LLVM IRcode through the Clang front-end , and then negatively optimize the IR code generated by the front-end with the help of the back-end of OLLVM. The obfuscation strategies used are basic block segmentation, instruction inflation, false block filling and control flow flattening. Convert the obfuscated IR code to front-end js (first programming language) code using the LLVM webasm backend and wasm-ld linker.

作为本申请的一个实施例,在将所述第一信息输入第一组件之后,在得到所述第一组件输出的第一令牌之前,还包括:As an embodiment of the present application, after the first information is input into the first component, and before the first token output by the first component is obtained, the method further includes:

基于对第二信息的第一操作,得到所述第一密钥;其中,Based on the first operation on the second information, the first key is obtained; wherein,

所述第二信息表征对所述第一密钥进行第二操作后得到的信息;所述第二操作表征分段存储操作;所述第一操作表征所述第二操作的逆向操作。The second information represents information obtained by performing a second operation on the first key; the second operation represents a segmented storage operation; and the first operation represents a reverse operation of the second operation.

第一终端对第一密钥经过分段存储操作(第二操作),得到存储在设定存储介质中的第二信息。在将第一信息输入第一组件之后,第一组件对设定存储介质中存储的第二信息进行数据读取和还原处理(第一操作),得到第一密钥。其中,分段存储操作包括将会话密钥根据图4拆分成第一设定数量的字段,并将拆分后的字段分组,将每组数据分段存储于存储介质。设定组件读取分段存储于不同位置的数据,再根据图4的逆向操作还原得到第一密钥。在分组时,可以将拆分的字段等分或不等分至第二设定数量的组内。The first terminal performs a segmented storage operation (second operation) on the first key to obtain the second information stored in the setting storage medium. After the first information is input into the first component, the first component performs data reading and restoration processing (first operation) on the second information stored in the setting storage medium to obtain the first key. The segment storage operation includes splitting the session key into a first set number of fields according to FIG. 4 , grouping the split fields, and storing each group of data in a storage medium in segments. The setting component reads the data stored in different locations in segments, and then restores the first key according to the reverse operation in FIG. 4 . When grouping, the split fields can be equally or unequally divided into a second set number of groups.

这里,第二操作可以认为是一种编码操作,第一操作是对应的解码操作,将第一密钥以对应的编码结果存储,在第一组件还原得到第一密钥。Here, the second operation can be considered as an encoding operation, the first operation is a corresponding decoding operation, the first key is stored with the corresponding encoding result, and the first key is obtained by restoring the first component.

实际应用中,以图4示出的分组示意图为例进行说明,将会话密钥拆分成16个字段,将拆分后的字段以如图的方式进行排列,并划分为4组。In practical applications, the grouping diagram shown in FIG. 4 is taken as an example for description, the session key is split into 16 fields, the split fields are arranged as shown in the figure, and divided into 4 groups.

这样,第一密钥被隐藏在黑盒的第一组件中,保证会话密钥对前端不可见,增加了攻击者逆向工程的难度和时间成本,从而提高了会话的安全性。In this way, the first key is hidden in the first component of the black box, which ensures that the session key is invisible to the front end, which increases the difficulty and time cost of reverse engineering by the attacker, thereby improving the security of the session.

作为本申请的另一个实施例,如图5所示,在所述基于第一密钥对第一信息进行加密处理,生成第一令牌之前,所述方法还包括:As another embodiment of the present application, as shown in FIG. 5 , before the first information is encrypted based on the first key to generate the first token, the method further includes:

步骤501:在所述第一终端成功登录所述第一服务器的情况下,接收所述第一服务器下发的所述第一密钥。Step 501: In the case that the first terminal successfully logs in to the first server, receive the first key issued by the first server.

第一终端将登录信息发送至第一服务器,第一服务器基于登录信息对第一终端进行用户认证。在服务器确定用户认证成功之后,也就是在第一终端成功登录第一服务器之后,第一终端和第一服务器之间成功建立会话关系,第一服务器为新创建的会话生成Cookie和会话密钥(也就是第一密钥),并向第一终端下发Cookie和第一密钥。其中,登录信息用于服务器对终端的认证,包括但不限于:用户标识(uid)和/或密码(pwd)。The first terminal sends the login information to the first server, and the first server performs user authentication on the first terminal based on the login information. After the server determines that the user authentication is successful, that is, after the first terminal successfully logs in to the first server, a session relationship is successfully established between the first terminal and the first server, and the first server generates a Cookie and a session key for the newly created session ( That is, the first key), and deliver the cookie and the first key to the first terminal. The login information is used for the authentication of the terminal by the server, including but not limited to: user ID (uid) and/or password (pwd).

作为本申请的一个实施例,在所述接收所述第一服务器下发的所述第一密钥之前,所述方法还包括:As an embodiment of the present application, before the receiving the first key issued by the first server, the method further includes:

向所述第一服务器发送设定标识。Send a setting identifier to the first server.

其中,所述第一服务器在接收到所述设定标识的情况下向所述第一终端下发所述第一密钥。Wherein, the first server delivers the first key to the first terminal in the case of receiving the setting identifier.

在第一终端与第一服务器建立会话关系的过程中,第一终端向第一服务器发送设定标识,以表明第一终端支持特定的会话认证方式和协议版本,这里的特定会话认证方式和协议版本与本申请实施例的资源请求方法对应,区别于标准Cookies认证方式。服务器接收到设定标识,则确定第一终端支持特定会话认证方式和协议版本,向第一终端下发Cookie和第一密钥。During the process of establishing a session relationship between the first terminal and the first server, the first terminal sends a setting identifier to the first server to indicate that the first terminal supports a specific session authentication mode and protocol version, where the specific session authentication mode and protocol The version corresponds to the resource request method in the embodiment of this application, and is different from the standard Cookies authentication method. After receiving the setting identifier, the server determines that the first terminal supports a specific session authentication mode and protocol version, and issues a cookie and a first key to the first terminal.

第一终端向第一服务器发送设定标识的方式,可以是与登录信息一起的发送给第一服务器,也可以是额外发送给第一服务器,在此不进行限定。优选地,设定标识以报文字头的方式携带于登录信息中。The manner in which the first terminal sends the setting identifier to the first server may be sent to the first server together with the login information, or may be additionally sent to the first server, which is not limited herein. Preferably, the setting identifier is carried in the login information in the form of a message header.

通过设定标识,第一终端向第一服务器传递了终端支持特定会话认证方式和协议版本的信息,第一服务器获知该信息后确定以本申请实施例对应的方式与第一终端通信。By setting the identifier, the first terminal transmits information that the terminal supports a specific session authentication method and protocol version to the first server, and the first server determines to communicate with the first terminal in a manner corresponding to the embodiment of the present application after learning the information.

图6为本申请另一实施例提供的资源请求方法的实现流程示意图,本申请实施例提供了一种资源请求方法,应用于第一服务器。资源请求方法包括:FIG. 6 is a schematic diagram of an implementation flowchart of a resource request method provided by another embodiment of the present application. An embodiment of the present application provides a resource request method, which is applied to a first server. Resource request methods include:

步骤601:接收第二请求。Step 601: Receive a second request.

其中,所述第二请求用于请求第二资源,且携带有第二令牌和第三信息;所述第三信息包括所述第二资源的描述信息和第二时间;所述第二时间表征与所述第二请求相关的时间。The second request is used to request a second resource, and carries a second token and third information; the third information includes description information of the second resource and a second time; the second time Characterizes the time associated with the second request.

步骤602:基于第二密钥对所述第三信息进行加密处理,生成第三令牌。Step 602: Encrypt the third information based on the second key to generate a third token.

其中,所述第二密钥表征第二终端与所述第一服务器之间的会话密钥;所述第二终端根据第二请求中的Cookie确定出。Wherein, the second key represents a session key between the second terminal and the first server; the second terminal is determined according to the cookie in the second request.

步骤603:在所述第二令牌与所述第三令牌匹配的情况下,向所述第二终端发送所述第二资源。Step 603: In the case that the second token matches the third token, send the second resource to the second terminal.

第一服务器预先与一些终端建立了会话关系,生成并下发了对应的会话密钥和Cookie。第一服务器接收到的请求,可能是用户通过终端使用自己的身份发送的,也可能是攻击者冒用的用户终端的身份发送的,而第一服务器根据请求携带的Cookie只能确定出请求对应的终端身份,无法辨别请求发送方是否为Cookie的身份,也就是说,第一服务器不能区分请求是由用户终端或攻击者发送的。The first server establishes session relationships with some terminals in advance, and generates and issues corresponding session keys and cookies. The request received by the first server may be sent by the user using his own identity through the terminal, or may be sent by the identity of the user terminal used by the attacker, and the first server can only determine the corresponding request according to the cookie carried in the request. The identity of the terminal is not able to distinguish whether the sender of the request is the identity of the cookie, that is to say, the first server cannot distinguish whether the request is sent by the user terminal or the attacker.

在步骤601中,第一服务器接收到第二请求,第二请求携带有第二令牌、第二令牌对应的第三信息和Cookie。其中,第三信息表征与当前请求对应的信息,包括第二时间和第二资源的描述信息。基于第三信息能够生成唯一的令牌,以标识对应的请求。对于用户通过终端发送的请求,第二时间能够将当前请求与此前或此后的请求区分开,例如,可以是在当前生成请求的时间段内的时刻或时间段。优选地,第二终端根据每次请求都需要执行的设定行为的执行时间确定第二时间。在一些实施例中,第二时间可以是时间戳的形式。第二令牌由终端通过会话密钥加密处理对应的源数据得到,第二令牌的源数据可以是第三信息,也可以不是第三信息,例如,出于攻击的目的,第三方(攻击者)截获并利用第二令牌发起资源请求,所请求的资源通常不同于原请求的资源,那么第二令牌的源数据不是第三信息。In step 601, the first server receives a second request, and the second request carries a second token, third information corresponding to the second token, and a cookie. The third information represents information corresponding to the current request, including the second time and description information of the second resource. A unique token can be generated based on the third information to identify the corresponding request. For the request sent by the user through the terminal, the second time can distinguish the current request from the previous or subsequent requests, for example, it may be a moment or a time period within the time period in which the request is currently generated. Preferably, the second terminal determines the second time according to the execution time of the set behavior that needs to be executed for each request. In some embodiments, the second time may be in the form of a timestamp. The second token is obtained by the terminal by encrypting the corresponding source data with the session key. The source data of the second token may or may not be the third information. For example, for the purpose of attack, a third party (attack (user) intercepts and initiates a resource request by using the second token, and the requested resource is usually different from the originally requested resource, so the source data of the second token is not the third information.

因而,在步骤602中,第一服务器根据第二请求携带的Cookie确定出终端身份为第二终端,并利用与第二终端的会话密钥(也就是第二密钥)加密第三信息得到第三令牌,以第三令牌对第二令牌进行验证,从而实现对发送方的辨认。这里第一服务器以第三令牌对第二令牌进行验证的方式,可以是将第三令牌与第二令牌进行比对,在第三令牌与第二令牌的数据相同的情况下,确定第二令牌与第三令牌匹配。这里,根据Cookie确定出的第二终端,可能是发送第二请求的用户终端的身份,也可能是攻击者冒用的身份。Therefore, in step 602, the first server determines that the terminal identity is the second terminal according to the cookie carried by the second request, and encrypts the third information with the session key (that is, the second key) of the second terminal to obtain the first terminal. Three tokens, the third token is used to verify the second token, so as to realize the identification of the sender. Here, the way that the first server verifies the second token with the third token may be to compare the third token with the second token, and in the case that the data of the third token and the second token are the same Next, it is determined that the second token matches the third token. Here, the second terminal determined according to the cookie may be the identity of the user terminal that sends the second request, or may be the identity fraudulently used by the attacker.

作为本申请的一个实施例,所述生成第三令牌,包括:As an embodiment of the present application, the generating the third token includes:

在所述第二请求满足第一设定条件的情况下,生成第三令牌;In the case that the second request satisfies the first set condition, generating a third token;

所述第一设定条件包括:The first setting conditions include:

请求中的Cookie验证通过;The cookie verification in the request is passed;

和/或,and / or,

请求携带的第二时间在设定时间段内。The second time carried by the request is within the set time period.

第一服务器判断接收到的第二请求是否满足第一设定条件,在满足第一设定条件的情况下,生成第三令牌。其中,第一设定条件可以是请求中的Cookie验证通过,可以是请求携带的第二时间在设定时间段内,还可以是请求中的Cookie验证通过且请求携带的第二时间在设定时间段内。需要说明的是,第二请求满足第一设定条件,是第一服务器生成第三令牌的前提条件。The first server determines whether the received second request satisfies the first set condition, and generates a third token if the first set condition is met. The first setting condition may be that the cookie in the request has passed the verification, the second time carried in the request can be within the set time period, or the cookie in the request has passed the verification and the second time carried in the request has been set within the time period. It should be noted that the second request satisfies the first set condition, which is a precondition for the first server to generate the third token.

实际应用中,以第一设定条件包括请求中的Cookie验证通过和请求携带的第二时间在设定时间段内为例,对第三令牌生成前的判断条件进行说明:第一服务器验证Cookie,如果Cookie验证不通过则返回提示信息;如果Cookie验证通过,则判断第二时间是否在设定时间段内;如果第二时间在设定时间段内,第一服务器生成第三令牌。其中,判断第二时间是否在设定时间段内,需要以终端与服务器的时间对齐为前提。时间段为一个设定时间范围,可根据各个服务器需要进行设定,如果安全需求较高,则设定时间范围应该更小。In practical applications, the first set condition includes that the cookie in the request has passed the verification and the second time carried in the request is within the set time period as an example, to illustrate the judgment conditions before the third token is generated: the first server verifies Cookie, if the cookie verification fails, a prompt message is returned; if the cookie verification passes, it is determined whether the second time is within the set time period; if the second time is within the set time period, the first server generates a third token. Wherein, determining whether the second time is within the set time period needs to be based on the time alignment of the terminal and the server. The time period is a set time range, which can be set according to the needs of each server. If the security requirements are high, the set time range should be smaller.

在步骤603中,在请求携带的第二令牌与生成的第三令牌匹配的情况下,第一服务器确定第二令牌的源数据是第三信息,换句话说,第二请求是由用户终端发送的。此时,第一服务器向第二终端发送第二请求所请求的第二资源。In step 603, in the case that the second token carried in the request matches the generated third token, the first server determines that the source data of the second token is the third information, in other words, the second request is made by Sent by the user terminal. At this time, the first server sends the second resource requested by the second request to the second terminal.

作为本申请的一个实施例,如图7所示,所述方法还包括:As an embodiment of the present application, as shown in FIG. 7 , the method further includes:

步骤604:在所述第二令牌与所述第三令牌不匹配的情况下,根据所述第二请求中的Cookie删除所述第一服务器存储的对应Cookie。Step 604: If the second token does not match the third token, delete the corresponding cookie stored by the first server according to the cookie in the second request.

在请求携带的第二令牌与生成的第三令牌不匹配的情况下,第一服务器确定第二请求并非用户终端发送的,而是由第三方(攻击者)发送的。由于第三方已经获取对应用户终端的Cookie信息,并利用Cookie信息发起第二请求,与第二终端的会话的Cookie已经泄露,第一服务器删除对应Cookie,还可以发送消息要求第二终端重新登录。In the case that the second token carried in the request does not match the generated third token, the first server determines that the second request is not sent by the user terminal, but is sent by a third party (an attacker). Since the third party has obtained the cookie information of the corresponding user terminal and used the cookie information to initiate a second request, the cookie of the session with the second terminal has been leaked, and the first server deletes the corresponding cookie, and can also send a message to request the second terminal to log in again.

通过令牌验证请求终端的身份,由于令牌与请求相关,攻击者即使获取请求携带的终端Cookie和令牌,也无法请求除令牌对应的资源以外的其它资源,这样,能够避免Cookie泄露导致的会话劫持,提升了服务器和终端设备会话的安全性。The identity of the requesting terminal is verified by the token. Since the token is related to the request, even if the attacker obtains the terminal cookie and token carried in the request, he cannot request other resources except the resource corresponding to the token. In this way, the leakage of cookies can be avoided. Session hijacking, which improves the security of server and terminal device sessions.

作为本申请的另一个实施例,如图8所示,在所述接收第二请求之前,所述方法还包括:As another embodiment of the present application, as shown in FIG. 8 , before the receiving the second request, the method further includes:

步骤801:在所述第二终端成功登录所述第一服务器的情况下,生成并向所述第二终端下发所述第二密钥。Step 801: When the second terminal successfully logs in to the first server, generate and deliver the second key to the second terminal.

第二终端将登录信息发送至第一服务器,第一服务器基于登录信息对第二终端进行用户认证。在服务器确定用户认证成功之后,也就是在第二终端成功登录第一服务器之后,第二终端和第一服务器之间成功建立会话关系,第一服务器为新创建的会话生成Cookie和会话密钥(也就是第二密钥),并向第二终端下发Cookie和第二密钥。其中,登录信息用于服务器对终端的认证,包括但不限于:用户标识(uid)和/或密码(pwd)。The second terminal sends the login information to the first server, and the first server performs user authentication on the second terminal based on the login information. After the server determines that the user authentication is successful, that is, after the second terminal successfully logs in to the first server, a session relationship is successfully established between the second terminal and the first server, and the first server generates a Cookie and a session key for the newly created session ( That is, the second key), and deliver the cookie and the second key to the second terminal. The login information is used for the authentication of the terminal by the server, including but not limited to: user ID (uid) and/or password (pwd).

作为本申请的一个实施例,所述生成并向所述第二终端下发所述第二密钥,包括:As an embodiment of the present application, the generating and delivering the second key to the second terminal includes:

在接收到所述第二终端发送的设定标识的情况下,生成并向所述第二终端下发所述第二密钥。In the case of receiving the setting identifier sent by the second terminal, the second key is generated and delivered to the second terminal.

在第二终端与第一服务器建立会话关系的过程中,第二终端向第一服务器发送设定标识,以表明第二终端支持特定的会话认证方式和协议版本,这里的特定会话认证方式和协议版本与本申请实施例的资源请求方法对应,区别于标准Cookies认证方式。第一服务器在接收到第二终端发送的设定标识的情况下,则确定第二终端支持特定会话认证方式和协议版本,生成并向第二终端下发Cookie和第二密钥。需要说明的是,第一服务器接收到第二终端发送的设定标识,是第一服务器生成并向第二终端下发Cookie和第二密钥的前提条件。During the process of establishing a session relationship between the second terminal and the first server, the second terminal sends a setting identifier to the first server to indicate that the second terminal supports a specific session authentication mode and protocol version, where the specific session authentication mode and protocol The version corresponds to the resource request method in the embodiment of this application, and is different from the standard Cookies authentication method. In the case of receiving the setting identifier sent by the second terminal, the first server determines that the second terminal supports a specific session authentication method and protocol version, and generates and delivers a cookie and a second key to the second terminal. It should be noted that the reception of the setting identifier sent by the second terminal by the first server is a precondition for the first server to generate and distribute the cookie and the second key to the second terminal.

第二终端向第一服务器发送设定标识的方式,可以是与登录信息一起的发送给第一服务器,也可以是额外发送给第一服务器,在此不进行限定。优选地,设定标识以报文字头的方式携带于登录信息中。The manner in which the second terminal sends the setting identifier to the first server may be sent to the first server together with the login information, or may be additionally sent to the first server, which is not limited herein. Preferably, the setting identifier is carried in the login information in the form of a message header.

通过设定标识,第二终端向第一服务器传递了终端支持特定会话认证方式和协议版本的信息,第一服务器获知该信息后确定以本申请实施例对应的方式与第二终端通信。By setting the identifier, the second terminal transmits information that the terminal supports a specific session authentication method and protocol version to the first server, and the first server determines to communicate with the second terminal in a manner corresponding to the embodiment of the present application after learning the information.

下面结合应用实施例对本申请再作进一步详细的描述。The present application will be described in further detail below in conjunction with application examples.

Cookie泄露后,攻击者能够重复利用Cookie发起会话,会话的安全性低。同时,服务器难以将攻击者的请求与用户的请求区分开,导致资源信息泄露。After the cookie is leaked, the attacker can reuse the cookie to initiate a session, and the security of the session is low. At the same time, it is difficult for the server to distinguish the attacker's request from the user's request, resulting in resource information leakage.

基于此,本申请应用实施例提出了一种基于黑盒实现OTC的防Cookie劫持认证加固方案。图9示出了本申请应用实施例提供的交互示意图,图中浏览器/客户端表征终端侧,服务器表征服务侧(服务器侧),整个过程中至少包括:Based on this, an application embodiment of the present application proposes a black-box-based OTC anti-cookie hijacking authentication reinforcement solution. FIG. 9 shows a schematic diagram of interaction provided by an application embodiment of the present application. In the figure, the browser/client represents the terminal side, and the server represents the service side (server side). The whole process includes at least:

(1)初始化阶段(1) Initialization stage

初始化阶段发生于用户登录时,服务器分发代表这次会话身份的会话密钥(ks),浏览器/客户端接收到密钥后将利用黑盒实现方法隐藏该会话密钥。The initialization phase occurs when the user logs in. The server distributes the session key (k s ) representing the identity of the session. After the browser/client receives the key, the black box implementation method is used to hide the session key.

1.1登录操作1.1 Login operation

浏览器向服务器发送用户标识(uid)和密码(pwd)以及一个特殊的HTTP头字段:X-OTC(即设定标识)。该报头字段表明浏览器支持OTC会话认证和OTC协议版本(v)。The browser sends the user ID (uid) and password (pwd) to the server along with a special HTTP header field: X-OTC (ie, set ID). This header field indicates that the browser supports OTC session authentication and OTC protocol version (v).

1.2认证用户1.2 Authenticating users

在成功的用户认证之后,服务器检查请求中是否存在X-OTC报头字段。After successful user authentication, the server checks the request for the presence of the X-OTC header field.

如果该报头字段存在,则服务器为新创建的会话(cid)生成Cookie和会话密钥(ks)。该会话密钥代表了此次与服务器通信的浏览器/客户端身份。If this header field is present, the server generates a cookie and session key (k s ) for the newly created session (cid). The session key represents the browser/client identity for this communication with the server.

如果浏览器请求中不存在X-OTC报头字段,则可以切换到标准Cookies认证,也可以停止通信并通知用户OTC支持是强制性的。If the X-OTC header field is not present in the browser request, it can switch to standard Cookies authentication, or it can stop the communication and inform the user that OTC support is mandatory.

随后,服务器存储用户标识(uid)、会话标识(cid)和该会话密钥(ks)。The server then stores the user ID (uid), session ID (cid) and the session key ( ks ).

1.3返回操作1.3 Return operation

服务器将生成的Cookie和对称加密后的会话密钥(ks)返还给浏览器/客户端。The server returns the generated cookie and the symmetric encrypted session key (k s ) to the browser/client.

1.4隐藏密钥操作1.4 Hidden key operation

为了保证浏览器/客户端存储的机密性,浏览器/客户端在前端通过设定组件将加密后的会话密钥(ks)进行分段存储处理。In order to ensure the confidentiality of the browser/client storage, the browser/client performs segment storage processing on the encrypted session key (k s ) through the setting component at the front end.

其中,将加密后的会话密钥拆分成第一设定数量的字段,并将拆分后的字段分组,将每组数据分段存储于存储介质。结合图4对分段存储处理过程进行说明,将加密后的会话密钥拆分成16个字段,并将拆分后的字段按照图4的方式进行分组。The encrypted session key is split into a first set number of fields, the split fields are grouped, and each group of data is segmented and stored in a storage medium. The segmented storage process will be described with reference to FIG. 4 . The encrypted session key is split into 16 fields, and the split fields are grouped according to the manner in FIG. 4 .

为了保证前端操作的安全性,对设定组件对应的JS代码进行代码混淆,这里的设定组件可以执行本应用实施例中的隐藏密钥操作、取密钥操作和部分请求操作,具体地,可以执行会话密钥的编解码处理和令牌生成。In order to ensure the security of the front-end operation, code obfuscation is performed on the JS code corresponding to the setting component. The setting component here can perform the hidden key operation, the key retrieval operation and some request operations in this application embodiment. Specifically, Encoding and decoding of session keys and token generation can be performed.

(2)请求阶段(2) Request stage

请求阶段发生于客户通过终端发起的每次请求时,浏览器/客户端逆向操作会话密钥(ks),并生成唯一的OTC令牌。The request phase occurs when the client initiates each request through the terminal, the browser/client reverses the session key (k s ) and generates a unique OTC token.

2.1取密钥操作2.1 Key operation

设定组件将分段存储于不同位置的数据取出,再根据图4的逆向操作还原,得到加密后的会话密钥(ks),最后解密获得会话密钥。The setting component takes out the segmented data stored in different locations, restores it according to the reverse operation in FIG. 4 , obtains the encrypted session key (k s ), and finally decrypts to obtain the session key.

2.2请求操作2.2 Request operation

对于每一个请求,浏览器会在Cookie字段之外附加一个OTC令牌(即第一令牌)。随后,浏览器/客户端将Cookie和OTC令牌(令牌生成时间(t)和HMAC值)发送给服务器。For each request, the browser appends an OTC token (ie, the first token) to the Cookie field. Subsequently, the browser/client sends the cookie and OTC token (token generation time (t) and HMAC value) to the server.

其中,OTC令牌使用会话密钥生成的基于哈希的消息身份验证码(HMAC(ks,url|t|data))。HMAC计算包括请求的网址(url)、令牌生成时间(t),对于POST请求还包含的任何web表单信息(data),而GET请求的参数包含在网址中。因此,对于每个请求携带的令牌,对应的生成时间不同,对应一个唯一的消息身份验证码,从而保证令牌的唯一性。即使请求相同的资源(请求的网址和POST请求中包含的任何web表单信息),对应的令牌也不相同。攻击者只能重放完全相同的请求,请求相同的资源,因为修改请求的任何载荷,对应的HMAC都会改变,从而无法通过验证。因此,攻击者不能重用OTC令牌来非法重定向会话。where the OTC token uses a hash-based message authentication code (HMAC(k s , url|t|data)) generated by the session key. The HMAC calculation includes the requested URL (url), the token generation time (t), and any web form information (data) included for POST requests, while the parameters for GET requests are included in the URL. Therefore, for the token carried by each request, the corresponding generation time is different, corresponding to a unique message authentication code, thereby ensuring the uniqueness of the token. Even if the same resource is requested (the requested URL and any web form information included in the POST request), the corresponding token is not the same. An attacker can only replay the exact same request, requesting the same resource, because modifying any payload of the request will change the corresponding HMAC, thus failing the verification. Therefore, attackers cannot reuse OTC tokens to illegally redirect sessions.

(3)验证阶段(3) Verification stage

验证阶段发生于请求阶段之后,服务器将对用户的请求进行验证。如果验证成功则返回数据,否则要求用户重新登录。The verification phase occurs after the request phase, and the server will verify the user's request. Returns data if authentication is successful, otherwise requires the user to log in again.

3.1验证操作3.1 Verify operation

服务器首先验证Cookie中的信息,若验证不成功,则返回Cookie失效或Cookie错误信息。其次,服务器检查令牌生成时间(t)是否在设定时间段内。此步骤的前提是需要对齐浏览器/客户端与服务器的时间,判断请求携带的时间戳是否在时间段内。时间段为一个设定时间范围,可根据各个服务器需要进行设定,如果安全需求较高,则设定时间范围应该更小。随后,服务器使用会话密钥ks和请求中的信息(url和data)计算新的HMAC。然后,服务器将新计算的HMAC与令牌中包含的HMAC进行比较。The server first verifies the information in the cookie, and if the verification is unsuccessful, it returns the cookie invalid or cookie error message. Second, the server checks whether the token generation time (t) is within the set time period. The premise of this step is to align the time between the browser/client and the server to determine whether the timestamp carried in the request is within the time period. The time period is a set time range, which can be set according to the needs of each server. If the security requirements are high, the set time range should be smaller. Then, the server computes a new HMAC using the session key ks and the information in the request (url and data). The server then compares the newly calculated HMAC with the HMAC contained in the token.

3.2返回操作3.2 Return operation

如果HMAC值匹配,则请求验证通过,服务器返回请求对应的资源。如果HMAC值不匹配,或者上文提及的任何检查失败,请求将被拒绝,返回校验不通过。If the HMAC value matches, the request verification is passed, and the server returns the resource corresponding to the request. If the HMAC values do not match, or any of the checks mentioned above fail, the request will be rejected and the check will fail.

(4)注销阶段(4) Cancellation stage

4.1注销操作4.1 Logout operation

会话将继续,直到会话票证过期或用户指示注销。注销时,浏览器/客户端向服务器发送Cookie和一个带有相应OTC令牌的请求,该报头字段只包含值为零(0)的HMAC(ks,0),该HMAC指示浏览器删除此域的凭证(浏览器强制策略)。The session will continue until the session ticket expires or the user instructs to log out. On logout, the browser/client sends the cookie and a request with the corresponding OTC token to the server, the header field just contains an HMAC(k s , 0) with a value of zero (0), which instructs the browser to delete this Credentials for the domain (browser enforcement policy).

4.2注销验证操作4.2 Logout verification operation

浏览器/服务器端基于HMAC删除此域的凭证。同时,防止攻击者欺骗服务器响应任意删除或修改OTC凭证。The browser/server side deletes the credentials for this domain based on HMAC. At the same time, it prevents attackers from tricking the server into responding to arbitrary deletion or modification of OTC credentials.

4.3注销成功4.3 Successful logout

注销成功,此次会话完成。The logout is successful and the session is complete.

前文提及,对设定组件对应的JS代码进行代码混淆。优选地,将相关的C/C++代码转换为LLVM Ir code,随后通过OLLVM进行代码混淆。若在浏览器/服务器端,则通过LLVM-webasm后端编译为前端js代码。如图3示出的,具体流程如下:As mentioned above, code obfuscation is performed on the JS code corresponding to the setting component. Preferably, the relevant C/C++ code is converted into LLVM Ir code, followed by code obfuscation through OLLVM. If it is on the browser/server side, it is compiled into front-end js code through the LLVM-webasm backend. As shown in Figure 3, the specific process is as follows:

首先,生成实现上述OTC算法的C/C++的代码。First, the C/C++ code that implements the above OTC algorithm is generated.

第二,Clang前端将C/C++的代码转换为LLVM IR code。Second, the Clang front end converts the C/C++ code to LLVM IR code.

第三,借助OLLVM的后端,对前端生成的IR code进行负优化,使用的混淆策略有基本块分割、指令膨胀、虚假块填充和控制流平坦。Third, with the backend of OLLVM, the IR code generated by the frontend is negatively optimized, and the obfuscation strategies used are basic block segmentation, instruction inflation, false block filling, and control flow flattening.

第四,利用LLVM webasm的后端和wasm-ld链接器将混淆后的IR code转换为前端js代码。Fourth, use the LLVM webasm backend and wasm-ld linker to convert the obfuscated IR code into front-end js code.

在本应用实施例提供的方案,通过与用户(终端)会话绑定的会话密钥,为每个请求包(包括时间戳和请求资源的描述信息)生成基于哈希的消息身份验证码,进行完整性校验,防止Cookie被劫持后重复利用。同时,黑盒实现方法能够保证设备密钥的获取和HMAC的实现均对用户不可见。在本应用实施例提供的方案,至少具有以下一种效果:In the solution provided in this application example, a hash-based message authentication code is generated for each request packet (including the time stamp and the description information of the requested resource) through the session key bound to the user (terminal) session, and the Integrity check to prevent Cookie from being reused after being hijacked. At the same time, the black box implementation method can ensure that the acquisition of the device key and the implementation of the HMAC are invisible to the user. The solution provided in this application example has at least one of the following effects:

(1)Cookie泄露后无法重复利用,能够防止攻击者获取更多系统信息;(1) Cookies cannot be reused after being leaked, which can prevent attackers from obtaining more system information;

(2)混淆后的代码为黑盒,逆向难以分析得到源码本身逻辑,这样,降低了被逆向破解的风险;(2) The obfuscated code is a black box, and it is difficult to obtain the logic of the source code itself through reverse analysis, thus reducing the risk of reverse cracking;

(3)运行实现代码混淆的设定组件所消耗的系统资源(运行性能)减少。(3) System resources (operational performance) consumed by running the setting component that implements code obfuscation are reduced.

这里,对本应用实施例中出现的术语进行解释。Here, the terms appearing in this application embodiment are explained.

OTC(One-Time Cookie):一次性Cookie,是一种防止Cookie泄露后重复利用的客户端防劫持方案。Cookie是储存在用户终端上的数据,当浏览器再请求该网站时,浏览器把请求的网址连同Cookie一同提交给服务器。服务器检查该Cookie,以此来辨认用户状态。OTC (One-Time Cookie): A one-time cookie, which is a client-side anti-hijacking scheme that prevents the cookie from being reused after being leaked. Cookies are data stored on the user terminal. When the browser requests the website again, the browser submits the requested URL together with the cookie to the server. The server checks the cookie to identify the user's status.

OLLVM:一个基于LLVM编译器的开源混淆方案,极大地增加了逆向工程的时间成本和难度。主要的混淆策略有基本块分割、指令膨胀、虚假块填充和控制流平坦。OLLVM: An open source obfuscation scheme based on the LLVM compiler, which greatly increases the time cost and difficulty of reverse engineering. The main obfuscation strategies are basic block splitting, instruction bloat, spurious block filling and control flow flattening.

Clang:基于LLVM后端的前端编译器,完全支持C++11标准并且与GNU C语言规范几乎完全兼容。在编译过程中主要负责词法分析、语法分析、语意分析、中间代码(IR)生成。Clang: Front-end compiler based on the LLVM backend, fully supports the C++11 standard and is almost fully compatible with the GNU C language specification. In the compilation process, it is mainly responsible for lexical analysis, syntax analysis, semantic analysis, and intermediate code (IR) generation.

LLVM-webAsm:LLVM后端中的一种,可将中间代码转换为JS代码。编译器后端的职责是将前端生成的中间代码(IR code)进行优化,并根据编译时指定的目标平台来生成对应的终端代码。在这里webAsm可被看成一种平台就如同x86,x86_64,aarch64一样。LLVM-webAsm: One of the LLVM backends that converts intermediate code to JS code. The responsibility of the back end of the compiler is to optimize the intermediate code (IR code) generated by the front end, and generate the corresponding terminal code according to the target platform specified at compile time. Here webAsm can be seen as a platform like x86, x86_64, aarch64.

HMAC(Hash-based Message Authentication Code):是一种利用密码学中的散列函数来进行消息认证的一种机制,所能提供的消息认证包括消息完整性验证和信源身份认证。HMAC算法更像是一种加密算法,由于HMAC算法引入了密钥,安全性已经不完全依赖于所使用的Hash算法。HMAC (Hash-based Message Authentication Code): It is a mechanism that uses the hash function in cryptography to perform message authentication. The message authentication that can be provided includes message integrity verification and source identity authentication. The HMAC algorithm is more like an encryption algorithm. Since the HMAC algorithm introduces a key, the security is not completely dependent on the Hash algorithm used.

为实现本申请实施例的方法,本申请实施例还提供了一种资源请求装置,应用于第一终端,如图10所示,该装置包括:In order to implement the method of the embodiment of the present application, the embodiment of the present application further provides a resource requesting apparatus, which is applied to the first terminal. As shown in FIG. 10 , the apparatus includes:

第一生成单元1001,用于基于第一密钥对第一信息进行加密处理,生成第一令牌;所述第一密钥表征所述第一终端与第一服务器之间的会话密钥;a first generating unit 1001, configured to encrypt the first information based on a first key to generate a first token; the first key represents a session key between the first terminal and the first server;

第一发送单元1002,用于向所述第一服务器发送第一请求;所述第一请求用于向所述第一服务器请求第一资源,且携带有所述第一令牌和所述第一信息;其中,A first sending unit 1002, configured to send a first request to the first server; the first request is used to request a first resource from the first server, and carries the first token and the first request an information; of which,

所述第一信息包括所述第一资源的描述信息和第一时间;所述第一时间表征与所述第一请求相关的时间;所述第一资源在所述第一服务器基于所述第一密钥和所述第一信息对所述第一令牌验证通过后下发至所述第一终端。The first information includes description information of the first resource and a first time; the first time represents a time related to the first request; the first resource is stored in the first server based on the first time. A key and the first information are sent to the first terminal after passing the verification of the first token.

其中,在一个实施例中,所述第一生成单元1001,用于:Wherein, in one embodiment, the first generating unit 1001 is configured to:

将所述第一信息输入第一组件,得到所述第一组件输出的第一令牌;其中,Inputting the first information into a first component to obtain a first token output by the first component; wherein,

所述第一组件用于根据对应的密钥对输入的信息进行加密处理,生成并输出令牌;所述第一组件对应的代码经过混淆处理。The first component is used for encrypting the input information according to the corresponding key, and generating and outputting a token; the code corresponding to the first component is obfuscated.

在一个实施例中,所述装置还包括:In one embodiment, the apparatus further includes:

操作单元,用于在将所述第一信息输入第一组件之后,在得到所述第一组件输出的第一令牌之前,基于对第二信息的第一操作,得到所述第一密钥;其中,所述第二信息表征对所述第一密钥进行第二操作后得到的信息;所述第二操作表征分段存储操作;所述第一操作表征所述第二操作的逆向操作。an operation unit, configured to obtain the first key based on a first operation on the second information after the first information is input into the first component and before the first token output by the first component is obtained ; wherein, the second information represents the information obtained after performing the second operation on the first key; the second operation represents a segmented storage operation; the first operation represents the reverse operation of the second operation .

在一个实施例中,所述第一组件对应的代码表征为第一编程语言的代码,由第二编程语言的代码经过混淆处理后再转换得到。In one embodiment, the code corresponding to the first component is represented as the code of the first programming language, which is obtained by converting the code of the second programming language after obfuscation processing.

在一个实施例中,所述装置还包括:In one embodiment, the apparatus further comprises:

第二接收单元,用于在所述第一生成单元1001基于第一密钥对第一信息进行加密处理,生成第一令牌之前,在所述第一终端成功登录所述第一服务器的情况下,接收所述第一服务器下发的所述第一密钥。The second receiving unit is configured to, before the first generating unit 1001 encrypts the first information based on the first key and generates the first token, when the first terminal successfully logs in to the first server Next, receive the first key issued by the first server.

在一个实施例中,所述装置还包括:In one embodiment, the apparatus further comprises:

第三发送单元,用于在所述第二接收单元接收所述第一服务器下发的所述第一密钥之前,向所述第一服务器发送设定标识;其中,所述第一服务器在接收到所述设定标识的情况下向所述第一终端下发所述第一密钥。a third sending unit, configured to send a setting identifier to the first server before the second receiving unit receives the first key issued by the first server; wherein the first server is in The first key is delivered to the first terminal when the setting identifier is received.

实际应用时,所述第一发送单元1002、所述第二接收单元、所述第三发送单元可由基于资源请求装置中的通信接口实现,所述第一生成单元1001、所述操作单元可由基于资源请求装置中的处理器实现。In practical application, the first sending unit 1002, the second receiving unit, and the third sending unit may be implemented by a communication interface in the resource requesting device, and the first generating unit 1001 and the operating unit may be implemented by a resource request-based device. A processor implementation in a resource requesting device.

需要说明的是:上述实施例提供的资源请求装置在进行资源请求时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的资源请求装置与资源请求方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the resource requesting device provided in the above embodiment performs resource request, only the division of the above program modules is used as an example for illustration. That is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the resource requesting apparatus and the resource requesting method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.

为实现本申请实施例的方法,本申请实施例还提供了一种资源请求装置,应用于第一服务器,如图11所示,该装置包括:In order to implement the method of the embodiment of the present application, the embodiment of the present application further provides a resource requesting apparatus, which is applied to the first server. As shown in FIG. 11 , the apparatus includes:

第一接收单元1101,用于接收第二请求;所述第二请求用于请求第二资源,且携带有第二令牌和第三信息;所述第三信息包括所述第二资源的描述信息和第二时间;所述第二时间表征与所述第二请求相关的时间;The first receiving unit 1101 is configured to receive a second request; the second request is used to request a second resource, and carries a second token and third information; the third information includes a description of the second resource information and a second time; the second time characterizes the time associated with the second request;

第二生成单元1102,用于基于第二密钥对所述第三信息进行加密处理,生成第三令牌;所述第二密钥表征第二终端与所述第一服务器之间的会话密钥;所述第二终端根据第二请求中的Cookie确定出;The second generating unit 1102 is configured to perform encryption processing on the third information based on a second key to generate a third token; the second key represents the session encryption between the second terminal and the first server key; the second terminal determines according to the Cookie in the second request;

第二发送单元1103,用于在所述第二令牌与所述第三令牌匹配的情况下,向所述第二终端发送所述第二资源。The second sending unit 1103 is configured to send the second resource to the second terminal when the second token matches the third token.

其中,在一个实施例中,所述装置还包括:Wherein, in one embodiment, the device further includes:

第四发送单元,用于在所述第一接收单元1101接收第二请求之前,在所述第二终端成功登录所述第一服务器的情况下,生成并向所述第二终端下发所述第二密钥。a fourth sending unit, configured to generate and deliver the second request to the second terminal when the second terminal successfully logs in to the first server before the first receiving unit 1101 receives the second request. second key.

在一个实施例中,所述第四发送单元,用于:In one embodiment, the fourth sending unit is used for:

在接收到所述第二终端发送的设定标识的情况下,生成并向所述第二终端下发所述第二密钥。In the case of receiving the setting identifier sent by the second terminal, the second key is generated and delivered to the second terminal.

在一个实施例中,所述第二生成单元1102,用于:In one embodiment, the second generating unit 1102 is configured to:

在所述第二请求满足第一设定条件的情况下,生成第三令牌;In the case that the second request satisfies the first set condition, generating a third token;

所述第一设定条件包括:The first setting conditions include:

请求中的Cookie验证通过;The cookie verification in the request is passed;

和/或,and / or,

请求携带的第二时间在设定时间段内。The second time carried by the request is within the set time period.

在一个实施例中,所述装置还包括:In one embodiment, the apparatus further comprises:

删除单元,用于在所述第二令牌与所述第三令牌不匹配的情况下,根据所述第二请求中的Cookie删除所述第一服务器存储的对应Cookie。A deletion unit, configured to delete the corresponding cookie stored by the first server according to the cookie in the second request when the second token does not match the third token.

实际应用时,所述第一接收单元1101、所述第二发送单元1103可由基于资源请求装置中的通信接口实现,所述第二生成单元1102、删除单元可由基于资源请求装置中的处理器实现,所述第四发送单元可由基于资源请求装置中的处理器结合通信接口实现。In practical applications, the first receiving unit 1101 and the second sending unit 1103 can be implemented by a communication interface in the resource request-based device, and the second generation unit 1102 and the deletion unit can be implemented by a processor in the resource-based device. , the fourth sending unit may be implemented by a processor in the resource request-based device in combination with a communication interface.

需要说明的是:上述实施例提供的资源请求装置在进行资源请求时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的资源请求装置与资源请求方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the resource requesting device provided in the above embodiment performs resource request, only the division of the above program modules is used as an example for illustration. That is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the resource requesting apparatus and the resource requesting method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.

基于上述程序模块的硬件实现,且为了实现本申请实施例资源请求方法,本申请实施例还提供了一种电子设备。图12为本申请实施例电子设备的硬件组成结构示意图,如图12所示,电子设备包括:Based on the hardware implementation of the above program modules, and in order to implement the resource request method of the embodiment of the present application, the embodiment of the present application further provides an electronic device. FIG. 12 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in FIG. 12 , the electronic device includes:

通信接口1,能够与其它设备比如网络设备等进行信息交互;Communication interface 1, which can exchange information with other devices such as network devices;

处理器2,与通信接口1连接,以实现与其它设备进行信息交互,用于运行计算机程序时,执行上述一个或多个技术方案提供的方法。而所述计算机程序存储在存储器3上。The processor 2 is connected to the communication interface 1 to realize information interaction with other devices, and is used to execute the method provided by one or more of the above technical solutions when running the computer program. The computer program is instead stored on the memory 3 .

当然,实际应用时,电子设备中的各个组件通过总线系统4耦合在一起。可理解,总线系统4用于实现这些组件之间的连接通信。总线系统4除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图12中将各种总线都标为总线系统4。Of course, in practical application, various components in the electronic device are coupled together through the bus system 4 . It can be understood that the bus system 4 is used to realize the connection communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the various buses are designated as bus system 4 in FIG. 12 .

本申请实施例中的存储器3用于存储各种类型的数据以支持电子设备的操作。这些数据的示例包括:用于在电子设备上操作的任何计算机程序。The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on an electronic device.

可以理解,存储器3可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random AccessMemory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,SynchronousDynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本申请实施例描述的存储器2旨在包括但不限于这些和任意其它适合类型的存储器。It is understood that the memory 3 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-only memory) Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory (Flash Memory), Magnetic Surface Memory , CD-ROM, or Compact Disc Read-Only Memory (CD-ROM, Compact Disc Read-Only Memory); the magnetic surface memory can be a magnetic disk memory or a tape memory. The volatile memory may be Random Access Memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory Memory (DRAM, Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM, SynchronousDynamic Random Access Memory), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous Link Dynamic Random Access Memory (SLDRAM, SyncLink Dynamic Random Access Memory), Direct Memory Bus Random Access Memory (DRRAM, Direct Rambus Random Access Memory) . The memory 2 described in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.

上述本申请实施例揭示的方法可以应用于处理器2中,或者由处理器2实现。处理器2可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器2中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2可以是通用处理器、DSP,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器2可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器3,处理器2读取存储器3中的程序,结合其硬件完成前述方法的步骤。The methods disclosed in the above embodiments of the present application may be applied to the processor 2 or implemented by the processor 2 . The processor 2 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by a hardware integrated logic circuit in the processor 2 or an instruction in the form of software. The above-mentioned processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The processor 2 may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of this application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, the storage medium is located in the memory 3, and the processor 2 reads the program in the memory 3, and completes the steps of the foregoing method in combination with its hardware.

处理器2执行所述程序时实现本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。When the processor 2 executes the program, the corresponding process in each method of the embodiments of the present application is implemented, which is not repeated here for brevity.

在示例性实施例中,本申请实施例还提供了一种存储介质,即计算机存储介质,具体为计算机可读存储介质,例如包括存储计算机程序的存储器3,上述计算机程序可由处理器2执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器。In an exemplary embodiment, the embodiment of the present application further provides a storage medium, that is, a computer storage medium, specifically a computer-readable storage medium, for example, including a memory 3 storing a computer program, and the above-mentioned computer program can be executed by the processor 2, to complete the steps described in the preceding method. The computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置、电子设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, electronic device and method may be implemented in other manners. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of.

上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, execute It includes the steps of the above method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other media that can store program codes.

或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或网络设备等)执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence or in the parts that make contributions to the prior art. The computer software products are stored in a storage medium and include several instructions for A computer device (which may be a personal computer, a server, or a network device, etc.) is caused to execute all or part of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other mediums that can store program codes.

可以理解的是,在本申请实施例中,涉及到用户信息的数据,当本申请实施例运用到具体产品或技术中时,需要获得用户许可或者同意,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。It can be understood that, in the embodiments of this application, the data related to user information, when the embodiments of this application are applied to specific products or technologies, the user's permission or consent needs to be obtained, and the collection, use and processing of relevant data require Comply with relevant laws, regulations and standards of relevant countries and regions.

需要说明的是,本申请实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。除非另有说明和限定,术语“连接”应做广义理解,例如,可以是电连接,也可以是两个元件内部的连通,可以是直接相连,也可以通过中间媒介间接相连,对于本领域的普通技术人员而言,可以根据具体情况理解上述术语的具体含义。It should be noted that the technical solutions described in the embodiments of the present application may be combined arbitrarily unless there is a conflict. Unless otherwise stated and defined, the term "connection" should be understood in a broad sense, for example, it may be an electrical connection, or a communication between two elements, a direct connection, or an indirect connection through an intermediate medium. For those of ordinary skill, the specific meanings of the above terms can be understood according to specific situations.

另外,在本申请实例中,“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解“第一\第二\第三”区分的对象在适当情况下可以互换,以使这里描述的本申请的实施例可以除了在这里图示或描述的那些以外的顺序实施。In addition, in the examples of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the "first\second\third" distinctions may be interchanged under appropriate circumstances so that the embodiments of the application described herein may be practiced in sequences other than those illustrated or described herein.

本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一个”表示多个中的任意一个或多个中的至少两个的任意组合,例如,包括A、B、C中的至少一个,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is only an association relationship to describe the associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and A and B exist independently B these three cases. In addition, the term "at least one" herein refers to any combination of any one of a plurality or at least two of a plurality, for example, including at least one of A, B, and C, may mean including from A, B, and C Any one or more elements selected from the set.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

在具体实施方式中所描述的各个实施例中的各个具体技术特征,在不矛盾的情况下,可以进行各种组合,例如通过不同的具体技术特征的组合可以形成不同的实施方式,为了避免不必要的重复,本申请中各个具体技术特征的各种可能的组合方式不再另行说明。The specific technical features in the various embodiments described in the detailed description can be combined in various ways if there is no contradiction. For example, different specific technical features can be combined to form different implementations. In order to avoid inconsistencies Necessary repetition, various possible combinations of various specific technical features in this application will not be described separately.

Claims (15)

1. A resource request method, applied to a first terminal, includes:
encrypting the first information based on the first key to generate a first token; the first key characterizes a session key between the first terminal and a first server;
sending a first request to the first server; the first request is used for requesting a first resource from the first server and carries the first token and the first information; wherein,
the first information comprises description information and a first time of the first resource; the first time characterizes a time associated with the first request; and the first resource is issued to the first terminal after the first server verifies the first token based on the first key and the first information.
2. The method of claim 1, wherein the encrypting the first information based on the first key to generate the first token comprises:
inputting the first information into a first component to obtain a first token output by the first component; wherein,
the first component is used for encrypting the input information according to the corresponding key to generate and output a token; and the codes corresponding to the first components are subjected to obfuscation processing.
3. The method of claim 2, wherein after inputting the first information into the first component, before obtaining the first token output by the first component, further comprising:
obtaining the first key based on a first operation on second information; wherein,
the second information represents information obtained after second operation is carried out on the first secret key; the second operation characterizes a segmented storage operation; the first operation characterizes a reverse operation of the second operation.
4. The method of claim 2, wherein the code corresponding to the first component is characterized as a code of a first programming language, and is obtained by converting a code of a second programming language after obfuscation processing.
5. The method of claim 1, wherein prior to said cryptographically processing the first information based on the first key to generate the first token, the method further comprises:
and receiving the first key issued by the first server under the condition that the first terminal successfully logs in the first server.
6. The method of claim 5, wherein before the receiving the first key sent by the first server, the method further comprises:
sending a setting identifier to the first server; wherein,
and the first server issues the first key to the first terminal under the condition of receiving the set identifier.
7. A resource request method applied to a first server, the method comprising:
receiving a second request; the second request is used for requesting a second resource and carries a second token and third information; the third information comprises description information of the second resource and a second time; the second time characterizes a time associated with the second request;
encrypting the third information based on a second key to generate a third token; the second key characterizes a session key between a second terminal and the first server; the second terminal determines according to the Cookie in the second request;
and sending the second resource to the second terminal under the condition that the second token is matched with the third token.
8. The method of claim 7, wherein prior to said receiving the second request, the method further comprises:
and under the condition that the second terminal successfully logs in the first server, generating and issuing the second key to the second terminal.
9. The method of claim 8, wherein the generating and issuing the second key to the second terminal comprises:
and generating and issuing the second key to the second terminal under the condition of receiving the setting identifier sent by the second terminal.
10. The method of claim 7, wherein generating the third token comprises:
generating a third token under the condition that the second request meets a first set condition;
the first setting condition includes:
the Cookie in the request passes the verification;
and/or the presence of a gas in the gas,
the second time carried by the request is within a set time period.
11. The method of claim 7, further comprising:
and under the condition that the second token is not matched with the third token, deleting the corresponding Cookie stored in the first server according to the Cookie in the second request.
12. A resource request device, applied to a first terminal, includes:
a first generation unit configured to perform encryption processing on first information based on a first key to generate a first token; the first key characterizes a session key between the first terminal and a first server;
a first sending unit, configured to send a first request to the first server; the first request is used for requesting a first resource from the first server and carries the first token and the first information; wherein,
the first information comprises description information and a first time of the first resource; the first time characterizes a time associated with the first request; and the first resource is issued to the first terminal after the first server verifies the first token based on the first key and the first information.
13. A resource request apparatus, applied to a first server, comprising:
a first receiving unit configured to receive a second request; the second request is used for requesting a second resource and carries a second token and third information; the third information comprises description information of the second resource and a second time; the second time characterizes a time associated with the second request;
a second generation unit configured to perform encryption processing on the third information based on a second key to generate a third token; the second key characterizes a session key between a second terminal and the first server; the second terminal determines according to the Cookie in the second request;
a second sending unit, configured to send the second resource to the second terminal when the second token matches the third token.
14. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 6, or to perform the steps of the method of any one of claims 7 to 11, when the computer program is run.
15. A storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements at least one of:
the steps of the method of any one of claims 1 to 6;
the process steps of any one of claims 7 to 11.
CN202210259476.1A 2022-03-16 2022-03-16 Resource request method, device, electronic equipment and storage medium Pending CN114844644A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210259476.1A CN114844644A (en) 2022-03-16 2022-03-16 Resource request method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210259476.1A CN114844644A (en) 2022-03-16 2022-03-16 Resource request method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114844644A true CN114844644A (en) 2022-08-02

Family

ID=82561935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210259476.1A Pending CN114844644A (en) 2022-03-16 2022-03-16 Resource request method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114844644A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582368A (en) * 2023-07-13 2023-08-11 中国矿业大学(北京) Network information security protection method and system
CN117389752A (en) * 2023-12-07 2024-01-12 合芯科技(苏州)有限公司 Method and device for allocating accelerator resources, computer equipment and storage medium

Citations (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719205A (en) * 2009-12-25 2010-06-02 国家广播电影电视总局电影数字节目管理中心 Digital copyright management method and system
US7814204B1 (en) * 2002-02-11 2010-10-12 Extreme Networks, Inc. Method of and system for analyzing the content of resource requests
CN102378170A (en) * 2010-08-27 2012-03-14 中国移动通信有限公司 Method, device and system of authentication and service calling
CN103685194A (en) * 2012-09-20 2014-03-26 中国移动通信集团公司 Capacity calling method and device, and terminal
US20150381366A1 (en) * 2014-06-26 2015-12-31 Xiaomi Inc. Methods and apparatuses for binding token key to account
CN105391734A (en) * 2015-12-10 2016-03-09 布比(北京)网络技术有限公司 Secure login system, secure login method, login server and authentication server
CN105830107A (en) * 2013-12-19 2016-08-03 维萨国际服务协会 Cloud-based transaction method and system
US20170346807A1 (en) * 2016-05-24 2017-11-30 Vantiv, Llc Technologies for token-based authentication and authorization of distributed computing resources
WO2018019069A1 (en) * 2016-07-25 2018-02-01 华为技术有限公司 Resource operation method and apparatus
CN108712412A (en) * 2018-05-15 2018-10-26 北京五八信息技术有限公司 A kind of encryption and decryption method of database, device, storage medium and terminal
CN109936546A (en) * 2017-12-18 2019-06-25 北京三快在线科技有限公司 Data encryption storage method and device and calculating equipment
US20190215157A1 (en) * 2017-03-03 2019-07-11 Tencent Technology (Shenzhen) Company Limited Information storage method, device, and computer-readable storage medium
CN110535642A (en) * 2019-09-02 2019-12-03 北京智游网安科技有限公司 A kind of method, intelligent terminal and the storage medium of dispersion storage key
US20200104473A1 (en) * 2018-09-27 2020-04-02 International Business Machines Corporation Authorization of resource access
CN111181898A (en) * 2018-11-13 2020-05-19 中国石油化工股份有限公司 Data security protection method based on background server and APP client
EP3678348A1 (en) * 2019-01-04 2020-07-08 Ping Identity Corporation Methods and systems for data traffic based adpative security
CN111475824A (en) * 2020-03-23 2020-07-31 深圳前海百递网络有限公司 Data access method, device, equipment and storage medium
CN113783867A (en) * 2021-09-07 2021-12-10 福建天泉教育科技有限公司 Request authentication method and terminal
US20210409378A1 (en) * 2020-06-30 2021-12-30 Microsoft Technology Licensing, Llc Method and System of Securing VPN Communications
CN113872974A (en) * 2021-09-29 2021-12-31 深圳市微购科技有限公司 Method, server and computer-readable storage medium for network session encryption
CN114157434A (en) * 2021-11-30 2022-03-08 中国光大银行股份有限公司 Login verification method and device, electronic equipment and storage medium

Patent Citations (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7814204B1 (en) * 2002-02-11 2010-10-12 Extreme Networks, Inc. Method of and system for analyzing the content of resource requests
CN101719205A (en) * 2009-12-25 2010-06-02 国家广播电影电视总局电影数字节目管理中心 Digital copyright management method and system
CN102378170A (en) * 2010-08-27 2012-03-14 中国移动通信有限公司 Method, device and system of authentication and service calling
CN103685194A (en) * 2012-09-20 2014-03-26 中国移动通信集团公司 Capacity calling method and device, and terminal
CN105830107A (en) * 2013-12-19 2016-08-03 维萨国际服务协会 Cloud-based transaction method and system
US20150381366A1 (en) * 2014-06-26 2015-12-31 Xiaomi Inc. Methods and apparatuses for binding token key to account
CN105391734A (en) * 2015-12-10 2016-03-09 布比(北京)网络技术有限公司 Secure login system, secure login method, login server and authentication server
US20170346807A1 (en) * 2016-05-24 2017-11-30 Vantiv, Llc Technologies for token-based authentication and authorization of distributed computing resources
WO2018019069A1 (en) * 2016-07-25 2018-02-01 华为技术有限公司 Resource operation method and apparatus
CN107659406A (en) * 2016-07-25 2018-02-02 华为技术有限公司 A kind of resource operating methods and device
US20190215157A1 (en) * 2017-03-03 2019-07-11 Tencent Technology (Shenzhen) Company Limited Information storage method, device, and computer-readable storage medium
CN109936546A (en) * 2017-12-18 2019-06-25 北京三快在线科技有限公司 Data encryption storage method and device and calculating equipment
CN108712412A (en) * 2018-05-15 2018-10-26 北京五八信息技术有限公司 A kind of encryption and decryption method of database, device, storage medium and terminal
US20200104473A1 (en) * 2018-09-27 2020-04-02 International Business Machines Corporation Authorization of resource access
CN111181898A (en) * 2018-11-13 2020-05-19 中国石油化工股份有限公司 Data security protection method based on background server and APP client
EP3678348A1 (en) * 2019-01-04 2020-07-08 Ping Identity Corporation Methods and systems for data traffic based adpative security
CN110535642A (en) * 2019-09-02 2019-12-03 北京智游网安科技有限公司 A kind of method, intelligent terminal and the storage medium of dispersion storage key
CN111475824A (en) * 2020-03-23 2020-07-31 深圳前海百递网络有限公司 Data access method, device, equipment and storage medium
US20210409378A1 (en) * 2020-06-30 2021-12-30 Microsoft Technology Licensing, Llc Method and System of Securing VPN Communications
CN113783867A (en) * 2021-09-07 2021-12-10 福建天泉教育科技有限公司 Request authentication method and terminal
CN113872974A (en) * 2021-09-29 2021-12-31 深圳市微购科技有限公司 Method, server and computer-readable storage medium for network session encryption
CN114157434A (en) * 2021-11-30 2022-03-08 中国光大银行股份有限公司 Login verification method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582368A (en) * 2023-07-13 2023-08-11 中国矿业大学(北京) Network information security protection method and system
CN116582368B (en) * 2023-07-13 2023-09-22 中国矿业大学(北京) Network information security protection method and system
CN117389752A (en) * 2023-12-07 2024-01-12 合芯科技(苏州)有限公司 Method and device for allocating accelerator resources, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN101051904B (en) Method for landing by account number cipher for protecting network application sequence
WO2017028804A1 (en) Web real-time communication platform authentication and access method and device
CN107809317A (en) A kind of identity identifying method and system based on token digital signature
CN112202705A (en) Digital signature verification generation and verification method and system
CN114499876B (en) Internet of Things data storage method based on blockchain and NB-IoT chip
KR102137122B1 (en) Security check method, device, terminal and server
CN109981680B (en) Access control implementation method and device, computer equipment and storage medium
CN103095847A (en) Cloud storage safety-ensuring method and system thereof
US11153093B2 (en) Protection of online applications and webpages using a blockchain
CN114244508A (en) Data encryption method, device, equipment and storage medium
CN113872932B (en) SGX-based micro-service interface authentication method, system, terminal and storage medium
KR20190120899A (en) Single Sign-On Method Using Browser Fingerprint
CN113395406A (en) Encryption authentication method and system based on power equipment fingerprints
CN111147525A (en) Authentication method, system, server and storage medium based on API gateway
CN114844644A (en) Resource request method, device, electronic equipment and storage medium
CN104270346B (en) The methods, devices and systems of two-way authentication
CN114726606B (en) User authentication method, client, gateway and authentication server
CN110572392A (en) Identity authentication method based on HyperLegger network
US11550932B2 (en) Method for a terminal to acquire and access data
Barbosa et al. Rogue key and impersonation attacks on FIDO2: From theory to practice
CN112699404A (en) Method, device and equipment for verifying authority and storage medium
CN115242471B (en) Information transmission method, information transmission device, electronic equipment and computer readable storage medium
CN114500074B (en) Single-point system security access method and device and related equipment
CN117134907A (en) Security control method and device, storage medium and electronic device
CN116647345A (en) Method and device for generating permission token, storage medium and computer equipment

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: 20220802