Request data processing method and device and storage medium

By using encryption modules between the client and the server to generate and verify key pairs, combining password and verification information generation strategies, the problem of low accuracy and security of request data transmission in the prior art is solved, and a higher level of Safety and accuracy.

CN119420473APending Publication Date: 2025-02-11HILLSTONE NETWORKS CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411390596.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In the prior art, the accuracy and security of transmitting request data by carrying an identity are low, especially when the attacking party obtains the client identity, the server cannot determine the authenticity of the request.

Method used

The encryption module is used to generate a key pair, and the initial request is generated through the first public key. After the server responds, the client decrypts the second key and timestamp, and combines the password generation policy and the verification information generation policy to generate the target password and the target verification information. , the combination is sent to the server as the target request, and the server verifies the request data through post-processing.

Benefits of technology

Through this method, the security and accuracy of requested data transmission and processing are improved. Even if the attacking party obtains the target password and target verification information, it cannot be used effectively, ensuring the authenticity and integrity of the requested data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420473A_ABST
    Figure CN119420473A_ABST
Patent Text Reader

Abstract

The invention discloses a request data processing method and device and a storage medium. Relates to the field of network security. The method comprises the following steps: a client calls a WASM to generate a first key pair, generates an initial request based on a first public key, and sends the initial request to a server; receiving a first ciphertext fed back by the server in response to the initial request, and decrypting the first ciphertext to obtain a second key and a first timestamp; calling a password generation strategy in the WASM to process the second key and the first timestamp to obtain a target password, calling a verification information generation strategy in the WASM, and processing the request data, the target password and the first private key according to the verification information generation strategy to obtain target verification information; and combining the target password, the target verification information and the request data into a target request, and sending the target request to a server. According to the method and the device, the problem that the accuracy and the security of transmitting the request data in a manner of carrying the identifier in the related technology are relatively low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security, and in particular to a method, device and storage medium for processing request data. Background Art

[0002] When a client sends request data to a server, it usually carries an identifier in the request. The server determines whether the request is sent by the client by identifying the identifier, thereby ensuring the security and accuracy of the request data.

[0003] However, when the attacker obtains the identifier in the client, the server cannot determine whether the request is sent by the client or the attacker, and thus cannot guarantee the security and accuracy of the request executed by the server.

[0004] Currently, no effective solution has been proposed to address the problem of low accuracy and security of request data transmitted by carrying identifiers in related technologies. Summary of the invention

[0005] The present application provides a method, device and storage medium for processing request data to solve the problem of low accuracy and security of transmitting request data by carrying identifiers in the related art.

[0006] According to one aspect of the present application, a method for processing request data is provided, which is applied to a client, and the method includes: calling an encryption module to generate a first key pair, and generating an initial request based on a first public key in the first key pair, and sending the initial request to a server; receiving a first ciphertext fed back by the server in response to the initial request, and calling the encryption module to decrypt the first ciphertext to obtain a second key and a first timestamp, wherein the first ciphertext is encrypted by the server using a first public key, and the encryption module decrypts the first ciphertext using a first private key in the first key pair; upon receiving the user's request data, calling a password generation strategy in the encryption module, processing the second key and the first timestamp according to the password generation strategy to obtain a target password, and calling a verification information generation strategy in the encryption module, processing the request data, the target password and the first private key according to the verification information generation strategy to obtain target verification information; combining the target password, the target verification information and the request data into a target request, and sending the target request to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes.

[0007] Optionally, the password generation strategy carries a preset encryption algorithm, and the second key and the first timestamp are processed according to the password generation strategy to obtain the target password, including: calculating the first time difference between the first moment when the user's request data is received and the second moment when the first ciphertext is received; adding the first time difference and the first timestamp to obtain the second timestamp; using the second key to encrypt the second timestamp using the preset encryption algorithm to obtain the target password.

[0008] Optionally, the verification information generation strategy carries a preset digest algorithm, and the request data, target password and first private key are processed according to the verification information generation strategy to obtain the target verification information, including: encoding the request data to obtain a target string, and combining the target string and the target password according to the preset digest algorithm to obtain initial verification information; encrypting the initial verification information using the first private key to obtain the target verification information.

[0009] According to one aspect of the present application, another method for processing request data is provided, which is applied to a server, and the method includes: receiving an initial request sent by a client, encrypting a second key and a first timestamp based on a first public key in the initial request to obtain a first ciphertext, and sending the first ciphertext to the client, wherein the first public key is obtained by the client calling an encryption module; upon receiving a target request sent by the client, obtaining a target password and target verification information in the target request, wherein the target request is composed by the client according to request data, a target password and target verification information, the target password is obtained by the client encrypting the second key and the first timestamp according to a password generation strategy in the encryption module, and the second key and the first timestamp are obtained by the client decrypting the first ciphertext based on the first private key; verifying the request data according to the target password and the target verification information, and processing the request data if the verification passes.

[0010] Optionally, verifying the request data according to the target password and the target verification information includes: verifying the target password according to the second key and the first timestamp to obtain a first verification result; verifying the target verification information according to the first public key, the request data and the target password to obtain a second verification result; when the first verification result and the second verification result are both verified, it is determined that there is no abnormality in the request data.

[0011] Optionally, the target password is verified according to the second key and the first timestamp to obtain a first verification result, including: obtaining a third moment when the target request sent by the client is received; parsing the target password by means of a preset encryption algorithm and the second key to obtain a target timestamp; comparing the target timestamp with the third moment to obtain a first comparison result; comparing the target password with historical passwords in a database to obtain a second comparison result, wherein the database stores historical passwords received at multiple historical moments; and determining the first verification result based on the first comparison result and the second comparison result.

[0012] Optionally, comparing the target timestamp and the third moment to obtain a first comparison result includes: calculating the time difference between the target timestamp and the third moment to obtain a third time difference, and determining whether the third time difference is greater than a time difference threshold; when the third time difference is greater than the time difference threshold, determining that the first comparison result is abnormal; when the third time difference is less than or equal to the time difference threshold, determining that there is no abnormality in the first comparison result.

[0013] Optionally, the target password is compared with historical passwords in a database to obtain a second comparison result, including: when there is no historical password identical to the target password in the database, determining that the second comparison result is normal; when there is a historical password identical to the target password in the database, determining that the second comparison result is abnormal; determining the first verification result according to the first comparison result and the second comparison result includes: when both the first comparison result and the second comparison result are normal, determining that the first verification result is verified as passed; when the first comparison result and / or the second comparison result are abnormal, determining that the first verification result is failed.

[0014] Optionally, the target verification information is verified according to the first public key, the request data and the target password to obtain the second verification result, including: decrypting the target verification information by the first public key to obtain the verification data; encoding the request data to obtain an initial character string, and combining the initial character string and the target password according to a preset summary algorithm to obtain the data to be verified; when the data to be verified and the verification data are the same, determining that the second verification result is passed; when the data to be verified and the verification data are not the same, determining that the second verification result is failed.

[0015] Optionally, before receiving the initial request sent by the client, the method also includes: receiving a login request sent by the user, and parsing the login request to obtain user information; identifying the user information through the user identity information stored in the database, and receiving the initial request sent by the client when the identification result indicates that there is no abnormality in the user information; and sending a prompt message to the client when the identification result indicates that there is an abnormality in the user information, wherein the prompt message is used to indicate that the client cannot access the server.

[0016] According to another aspect of the present invention, there is also provided a device for processing request data, comprising:

[0017] A generating unit, configured to call an encryption module to generate a first key pair, generate an initial request based on a first public key in the first key pair, and send the initial request to a server;

[0018] a decryption unit, configured to receive a first ciphertext fed back by the server in response to the initial request, and call the encryption module to decrypt the first ciphertext to obtain a second key and a first timestamp, wherein the first ciphertext is obtained by being encrypted by the server using a first public key, and the encryption module decrypts the first ciphertext using a first private key in a first key pair;

[0019] a processing unit, configured to, upon receiving the user's request data, call the password generation strategy in the encryption module, process the second key and the first timestamp according to the password generation strategy to obtain a target password, and call the verification information generation strategy in the encryption module, process the request data, the target password and the first private key according to the verification information generation strategy to obtain target verification information;

[0020] The first sending unit is used to combine the target password, target verification information and request data into a target request, and send the target request to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes.

[0021] According to another aspect of the present invention, there is also provided a device for processing request data, comprising:

[0022] An encryption unit, used for receiving an initial request sent by a client, encrypting a second key and a first timestamp based on a first public key in the initial request to obtain a first ciphertext, and sending the first ciphertext to the client, wherein the first public key is obtained by the client calling an encryption module;

[0023] an acquisition unit, configured to acquire a target password and target verification information in the target request upon receiving the target request sent by the client, wherein the target request is formed by the client according to the request data, the target password and the target verification information, the target password is obtained by the client encrypting the second key and the first timestamp according to the password generation strategy in the encryption module, and the second key and the first timestamp are obtained by the client decrypting the first ciphertext based on the first private key;

[0024] The verification unit is used to verify the request data according to the target password and the target verification information, and process the request data if the verification passes.

[0025] According to another aspect of the present invention, a computer storage medium is provided. The computer storage medium is used to store a program. When the program is executed, the device where the computer storage medium is located is controlled to execute a method for processing requested data.

[0026] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein when the computer-readable instructions are executed, a method for processing request data provided in the aforementioned embodiment is executed.

[0027] Through this application, the following steps are adopted: calling an encryption module to generate a first key pair, and generating an initial request based on the first public key in the first key pair, and sending the initial request to a server; receiving a first ciphertext fed back by the server in response to the initial request, and calling an encryption module to decrypt the first ciphertext to obtain a second key and a first timestamp, wherein the first ciphertext is obtained by encrypting the server through the first public key, and the encryption module decrypts the first ciphertext through the first private key in the first key pair; in the case of receiving the user's request data, calling the password generation strategy in the encryption module, processing the second key and the first timestamp according to the password generation strategy, obtaining the target password, and calling the verification information generation strategy in the encryption module, processing the request data, the target password and the first private key according to the verification information generation strategy, obtaining the target verification information; combining the target password, the target verification information and the request data into a target request, and sending the target request to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes. The problem of low accuracy and security of transmitting request data by carrying an identifier in the related art is solved.

[0028] In this embodiment, the first public key is sent to the server to ensure the security of the second key sent by the server, and the target password and target verification information are generated by using the second key, the first timestamp and the request data, so that the server can verify the sender of the request and the request data according to the target password and the target verification information. Since the target password and the target verification information are changed according to the second key, the first timestamp and the request data each time a request is initiated, even if the attacker obtains the target password and the target verification information, they cannot use them, thereby achieving the technical effect of improving the security and accuracy of the transmission and processing of the request data. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0030] Figure 1 is a flowchart of a method for processing request data provided according to an embodiment of the present application;

[0031] Figure 2 is a flowchart of another method for processing request data provided according to an embodiment of the present application;

[0032] Figure 3 is a schematic diagram of a system for processing request data provided according to an embodiment of the present application;

[0033] Figure 4 is a schematic diagram of a request data processing device provided according to an embodiment of the present application;

[0034] Figure 5 is a schematic diagram of another device for processing request data provided according to an embodiment of the present application;

[0035] Figure 6 It is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0036] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0037] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] It should be noted that the request data processing method determined in the present disclosure can be used in the field of network security, and can also be used in any field other than the field of network security. The application field of the request data processing method determined in the present disclosure is not limited.

[0040] It should be noted that the collected information, user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) used in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated. Corresponding operation portals are provided for users to choose to authorize or refuse to use. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0041] The embodiments or examples of the present disclosure are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection of the present disclosure. In the absence of contradiction, each step in a certain embodiment or example can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.

[0042] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0043] Browser JavaScript: or simply JavaScript, is a high-level, interpreted programming language that is widely used in web development to create interactive web pages and rich web applications. JavaScript runs in the user's browser, rather than directly on the server. This means that JavaScript code can interact directly with the user's web interface, responding to user actions such as clicking buttons, filling out forms, scrolling pages, etc., and dynamically updating web page content accordingly.

[0044] WASM (WebAssembly): is a new code format for the web that aims to provide a faster execution speed than traditional JavaScript. It allows developers to write programs in high-level languages ​​such as C, C++, Rust, etc., and compile these programs into code that can run in the browser.

[0045] Digest algorithm: also known as hash algorithm or hash algorithm, is an algorithm that maps data of arbitrary length to a hash value (digest) of fixed length.

[0046] According to an embodiment of the present application, a method for processing request data is provided, which is applied to a client.

[0047] Figure 1 1 is a flowchart of a method for processing request data provided according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0048] Step S101: Call an encryption module to generate a first key pair, generate an initial request based on a first public key in the first key pair, and send the initial request to a server.

[0049] It should be noted that the encryption module of the client browser can be implemented using WASM. The encryption algorithm, private key, etc. can be compiled using other programming languages ​​through WASM, so that the encryption algorithm, private key and other contents cannot be obtained by the browser's js code, thereby enhancing security.

[0050] Furthermore, the encryption module may store multiple WASM programs, each of which may be used to generate keys, use keys for encryption, etc. In order to ensure the security of the request data sent by the client, the key (such as a private key) may be configured in an execution program in the encryption module. When the execution program is applied, the execution program may decrypt the encrypted file according to the private key configured therein, and store the decrypted content in the encryption module, thereby preventing the attacker from obtaining the private key and encrypted content from the client browser, thereby ensuring the security of the encrypted file.

[0051] Exemplarily, before the browser needs to send request data to the server, it needs to send the first public key first. At this time, the first public key can be sent to the server through the initial request by sending the initial request. When sending the initial request, the execution program in the encryption module can be called to generate a first key pair, wherein the first key pair includes a first public key and a first private key. The first private key can be retained in the encryption module, and the first public key is sent to the client browser. When the client browser generates the initial request, the first public key needs to be added to the request header, so that after receiving the initial request, the server can parse the initial request and obtain the first public key in the request header, and then use the first public key to encrypt the data content fed back to the client browser, thereby ensuring the security of the interactive content between the client browser and the server.

[0052] Step S102, receiving the first ciphertext fed back by the server in response to the initial request, and calling the encryption module to decrypt the first ciphertext to obtain a second key and a first timestamp, wherein the first ciphertext is encrypted by the server using a first public key, and the encryption module decrypts the first ciphertext using a first private key in the first key pair.

[0053] Exemplarily, after receiving the initial request, the server needs to verify the user identity. After the verification is passed, the server will feedback the first ciphertext to the client browser, wherein the first ciphertext carries the second key and the first timestamp generated by the server, and the second key and the first timestamp are encrypted using the first public key. After the client browser receives the first ciphertext, it can directly call the encryption module to decrypt the first ciphertext according to the first private key, thereby obtaining the second key and the first timestamp in the first ciphertext. Then, when sending request data to the server, verification information between the client browser and the server can be generated according to the second key and the first timestamp, and the security and accuracy of the request data can be ensured based on the verification information.

[0054] It should be noted that the first timestamp may be the time information when the server generates the second key.

[0055] Step S103, when receiving the user's request data, calling the password generation strategy in the encryption module, processing the second key and the first timestamp according to the password generation strategy to obtain the target password, and calling the verification information generation strategy in the encryption module, processing the request data, the target password and the first private key according to the verification information generation strategy to obtain the target verification information.

[0056] Exemplarily, the password generation strategy may be an encryption method pre-configured in a certain execution program in the encryption module. When the client browser receives the user's request data, it indicates that the user needs to send the request data to the server. At this time, it is necessary to call the password generation strategy in the encryption module to generate a verification password. When generating the verification password, the execution program in the encryption module may process the second key and the first timestamp and encrypt the second key and the first timestamp through the password generation strategy carried in the execution program to obtain the target password, thereby determining whether the request data is sent by the client browser through the target password.

[0057] It should be noted that the password generation policy carried in the execution program needs to be associated with the server, that is, it is necessary to ensure that the server also has the password generation policy, so as to ensure that the target password encrypted by the execution program through the password generation policy can be decrypted by the server to obtain the second key and the first timestamp contained therein, thereby determining whether the request data is sent by the client browser by determining whether the second key and the first timestamp are correct.

[0058] Similarly, the verification information generation strategy can also be a verification information generation method pre-configured in a certain execution program in the encryption module. When the client browser receives the user's request data, the request data and the target password need to be processed through the verification information generation strategy to obtain the verification information composed of the request data and the target password. The server identifies and confirms the target verification information, so that it can be determined whether the request data has been tampered with by identifying the target verification information, thereby ensuring the accuracy of the request data.

[0059] In order to ensure the security of the verification information, the first private key may be used to sign the verification information, thereby obtaining the target verification information.

[0060] It should be noted that the verification information generation strategy carried in the execution program also needs to be associated with the server, that is, it is necessary to ensure that the server also has the verification information generation strategy, so that after receiving the request data, the server can use the same verification information generation strategy to process the request data and the second key to obtain verification information, and then compare the verification information with the verification information generated by the client browser, so as to determine whether the request data has been tampered with by judging whether the verification information is the same.

[0061] Step S104, combining the target password, target verification information and request data into a target request, and sending the target request to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes.

[0062] Exemplarily, after generating the target verification information and the target password, the target verification information and the target password can be added to the request header, and the request data can be used as the request content to constitute the request information, and the request information can be sent to the server. The server can then determine whether the request data has been tampered with and whether the request data comes from the client browser based on the target verification information and the target password, thereby achieving the technical effect of ensuring the security and accuracy of the request data.

[0063] The processing method of request data provided by the embodiment of the present application generates a first key pair by calling an encryption module, generates an initial request based on the first public key in the first key pair, and sends the initial request to the server; receives the first ciphertext fed back by the server in response to the initial request, and calls the encryption module to decrypt the first ciphertext to obtain a second key and a first timestamp, wherein the first ciphertext is obtained by the server through encryption of the first public key, and the encryption module decrypts the first ciphertext through the first private key in the first key pair; in the case of receiving the user's request data, calls the password generation strategy in the encryption module, processes the second key and the first timestamp according to the password generation strategy, obtains the target password, and calls the verification information generation strategy in the encryption module, processes the request data, the target password and the first private key according to the verification information generation strategy, obtains the target verification information; combines the target password, the target verification information and the request data into a target request, and sends the target request to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes. The problem of low accuracy and security of transmitting request data by carrying an identifier in the related art is solved. By sending the first public key to the server, the security of the second key sent by the server is guaranteed, and by using the second key, the first timestamp and the request data to generate the target password and the target verification information, the server can verify the sender of the request and the request data according to the target password and the target verification information. Since the target password and the target verification information will be changed according to the second key, the first timestamp and the request data each time a request is initiated, even if the attacker obtains the target password and the target verification information, they cannot use them, thereby achieving the technical effect of improving the security and accuracy of the request data transmission and processing.

[0064] Optionally, in the request data processing method provided in the embodiment of the present application, the password generation strategy carries a preset encryption algorithm, and the second key and the first timestamp are processed according to the password generation strategy to obtain the target password, including: calculating the first time difference between the first moment when the user's request data is received and the second moment when the first ciphertext is received; adding the first time difference and the first timestamp to obtain the second timestamp; using the second key to encrypt the second timestamp using the preset encryption algorithm to obtain the target password.

[0065] It should be noted that the password generation strategy can be a preset callable program in the encryption module. When the client browser obtains the second key and the first timestamp, the password generation strategy can be called to process the second key and the first timestamp to obtain the target password.

[0066] It should be noted that the encryption module can also store the second key and the first timestamp, and when the client browser calls the password generation strategy, the encryption module provides the second key and the first timestamp, and processes the second key and the first timestamp through the password generation strategy, thereby ensuring that the client browser will not obtain the second key and the first timestamp, thereby avoiding the leakage of the second key and the first timestamp by the client browser.

[0067] Exemplarily, when processing the second key and the first timestamp according to the password generation strategy, the first timestamp needs to be processed first. It is necessary to first obtain the second moment when the first ciphertext is received, that is, the time information recorded when the client browser receives the first ciphertext after the server sends the first ciphertext to the client browser. At the same time, the first moment when the user request data is received is obtained, and the time difference between the first moment and the second moment is calculated. The time difference is the time difference between the server sending the first ciphertext to the client browser and the user using the client browser to send the request data, that is, the first time difference.

[0068] Furthermore, after obtaining the first time difference, the first time difference can be added to the first timestamp to obtain a second timestamp. Since the time required for generating a request message in the client browser and sending the request message to the server is short and can be ignored, the calculated second timestamp can be regarded as the moment when the server receives the request message sent by the client browser. Using the second timestamp as part of the target password can enable the server to compare the moment when the request message sent by the client browser is received with the second timestamp. Since the attacker cannot obtain the preset encryption algorithm, it can verify whether the request message is sent by the client browser based on the comparison result, thereby ensuring the security of the request data transmission.

[0069] After obtaining the second timestamp, the second key can be used to encrypt the second timestamp through a preset encryption algorithm. For example, when using the preset encryption algorithm, the second key needs to be used as a parameter to execute the preset encryption algorithm, so that the second timestamp is encrypted using the second key through the preset encryption algorithm to obtain the target password. The target password can then be added to the request information as a verification information, so that the server can verify the target password to determine the accuracy of the sender of the request information, thereby ensuring the security of the request information received by the server, and by carrying the timestamp in the target password, the password is protected from replay, that is, the password cannot be used again.

[0070] This embodiment processes the first timestamp to obtain the second timestamp, and uses the second timestamp and the second key to form a target password, thereby ensuring the anti-replay property of the password, and when the server verifies the target password, the accuracy of the requested information can be guaranteed by the target password.

[0071] Optionally, in the request data processing method provided in the embodiment of the present application, the verification information generation strategy carries a preset digest algorithm, and the request data, the target password and the first private key are processed according to the verification information generation strategy to obtain the target verification information, including: encoding the request data to obtain a target string, and combining the target string and the target password according to the preset digest algorithm to obtain initial verification information; encrypting the initial verification information using the first private key to obtain the target verification information.

[0072] Exemplarily, when generating target verification information, since the request data may contain text, it is necessary to first encode the request data to obtain a target string, and use a preset digest algorithm to calculate the content combined with the target string and the target password to obtain initial verification information. The initial verification information is also the verification information used to verify whether the request data is correct.

[0073] In order to ensure the security of the verification information, the first private key may be used to sign and encrypt the initial verification information to obtain the target verification information, and the target verification information is added to the request header of the request information to send the target verification information to the server.

[0074] This embodiment obtains verification information by performing summary processing on the request data, and then when the server determines that the verification information is accurate, it ensures that the request content in the request information has not been tampered with, thereby ensuring the accuracy of the request data.

[0075] Based on the same inventive concept as the aforementioned embodiment, according to an embodiment of the present application, another method for processing request data is provided, which is applied to a server.

[0076] Figure 2 FIG. 1 is a flowchart of another method for processing request data provided according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0077] Step S201, receiving an initial request sent by the client, encrypting a second key and a first timestamp based on a first public key in the initial request to obtain a first ciphertext, and sending the first ciphertext to the client, wherein the first public key is obtained by the client calling an encryption module.

[0078] Exemplarily, after receiving the initial request, the server needs to parse the initial request to obtain the first public key in the initial request, generate a second key and obtain the time of generating the second key, obtain a first timestamp, and use the first public key to encrypt the second key and the first timestamp to obtain a first ciphertext, and send the first ciphertext to the client, so that the client can obtain the second key and the first timestamp from the first ciphertext.

[0079] Step S202, when a target request sent by the client is received, a target password and target verification information in the target request are obtained, wherein the target request is composed by the client according to the request data, the target password and the target verification information, the target password is obtained by the client encrypting the second key and the first timestamp according to the password generation strategy in the encryption module, and the second key and the first timestamp are obtained by the client decrypting the first ciphertext based on the first private key.

[0080] Exemplarily, when the server receives a target request sent by the client, it needs to parse the target request to obtain the target password and target verification information in the request header, and then parse and verify the target password and target verification information to determine whether there is any abnormality in the request data.

[0081] Step S203, verifying the request data according to the target password and the target verification information, and processing the request data if the verification passes.

[0082] Exemplarily, after receiving the target password and target verification information, it is necessary to determine whether the target password and target verification information are correct, and if both the target password and target verification information are correct, determine that there is no abnormality in the request data in the request information, so as to process the request data and ensure the accuracy of the request data.

[0083] The processing method of request data provided by the embodiment of the present application receives the initial request sent by the client, encrypts the second key and the first timestamp based on the first public key in the initial request, obtains the first ciphertext, and sends the first ciphertext to the client, wherein the first public key is obtained by the client calling the encryption module; in the case of receiving the target request sent by the client, obtains the target password and target verification information in the target request, wherein the target request is composed by the client according to the request data, the target password and the target verification information, the target password is obtained by the client according to the password generation strategy in the encryption module to encrypt the second key and the first timestamp, and the second key and the first timestamp are obtained by the client based on the first private key to decrypt the first ciphertext; the request data is verified according to the target password and the target verification information, and the request data is processed when the verification is passed, which solves the problem of low accuracy and security of transmitting the request data by carrying the identifier in the related art. By sending the second key encrypted by the first public key to the client, the security of the second key sent by the server is guaranteed, and by verifying the target key and the target verification information, it is determined whether the request data is abnormal according to the verification result, thereby achieving the technical effect of improving the security and accuracy of the request data transmission and processing.

[0084] Optionally, in the request data processing method provided in the embodiment of the present application, verifying the request data according to the target password and the target verification information includes: verifying the target password according to the second key and the first timestamp to obtain a first verification result; verifying the target verification information according to the first public key, the request data and the target password to obtain a second verification result; when the first verification result and the second verification result are both verified, it is determined that there is no abnormality in the request data.

[0085] Exemplarily, when verifying the target password, since the target password is obtained by encrypting the second key and the first timestamp by the client according to the password generation strategy in the encryption module, and since the second key and the first timestamp are both sent by the server to the client browser, the target password can be verified by the second key and the first timestamp, thereby obtaining a first verification result.

[0086] Similarly, when verifying the target verification information, since the target verification information is obtained by combining the target password and the request data, and the server also obtains the request data and the target password, the target verification information can be verified based on the target password and the request data to obtain a second verification result.

[0087] After obtaining the first verification result and the second verification result, if both the first verification result and the second verification result are verified to be passed, it indicates that the target password and the target verification information are correct. At this time, it can be determined that the request data is correct, so that the server can process the request data and complete the user's request service.

[0088] This embodiment verifies the target password and the target verification information, and determines whether the request data is correct based on the verification result, thereby ensuring the accuracy of the request data.

[0089] Optionally, in the request data processing method provided in the embodiment of the present application, the target password is verified according to the second key and the first timestamp to obtain a first verification result, including: obtaining a third moment when the target request sent by the client is received; parsing the target password by a preset encryption algorithm and the second key to obtain a target timestamp; comparing the target timestamp with the third moment to obtain a first comparison result; comparing the target password with historical passwords in a database to obtain a second comparison result, wherein the database stores historical passwords received at multiple historical moments; determining the first verification result based on the first comparison result and the second comparison result.

[0090] It should be noted that when verifying the target password, since the target password contains a second timestamp (ie, the target timestamp) obtained by adding the first timestamp and the first time difference, it is necessary to calculate the second timestamp in the server as well, and compare the second timestamp calculated by the server with the second timestamp carried in the target password to determine whether the second timestamp in the target password is accurate.

[0091] Exemplarily, the third moment when the target request sent by the client is received can be obtained. Since the time calculated by the second timestamp is the sum of the first timestamp and the first time difference, the second timestamp and the third moment should theoretically be consistent. At this time, the second timestamp can be compared with the third moment to obtain the first comparison result.

[0092] Furthermore, after obtaining the first comparison result, it is necessary to determine whether the target password is a repeated password. At this time, it is necessary to compare the target password with the historical passwords in the database to determine whether the target password exists in the database, and then determine whether the target password is a repeated password, and determine the recognition result as the second comparison result, so as to comprehensively determine the first verification result based on the first comparison result and the second comparison result, thereby ensuring the accuracy of the first verification result.

[0093] This embodiment achieves the technical effect of confirming whether the sender of the request data is abnormal by determining whether the target timestamp and the target key are correct, thereby ensuring the accuracy of the request data.

[0094] Optionally, in the request data processing method provided in an embodiment of the present application, the target timestamp and the third moment are compared to obtain a first comparison result, including: calculating the time difference between the target timestamp and the third moment to obtain a third time difference, and determining whether the third time difference is greater than a time difference threshold; when the third time difference is greater than the time difference threshold, determining that the first comparison result is abnormal; and when the third time difference is less than or equal to the time difference threshold, determining that there is no abnormality in the first comparison result.

[0095] Exemplarily, when determining the first comparison result, although the second timestamp and the third moment should be consistent in theory, due to the errors and delays that may exist in the data transmission process, a small error will occur between the second timestamp and the third moment. At this time, the time difference between the target timestamp and the third moment can be calculated, and it is determined whether the third time difference is greater than the time difference threshold. In the case where the third time difference is greater than the time difference threshold, it indicates that the third time difference is greatly different from the time difference threshold, and the difference between the target timestamp and the third moment is large. At this time, it can be determined that the target timestamp is wrong, and the first comparison result is abnormal. In the case where the third time difference is less than or equal to the time difference threshold, it indicates that although the second timestamp and the third moment are inconsistent, the difference is very small. At this time, it can be determined that the target timestamp is within the allowable error range, and the first comparison result is determined to be normal, so as to determine the first comparison result according to the degree of difference between the second timestamp and the third moment.

[0096] This embodiment determines whether the target password is accurate by determining whether the timestamp is accurate, thereby improving the accuracy of identifying the target password.

[0097] Optionally, in the request data processing method provided in the embodiment of the present application, the target password is compared with the historical passwords in the database to obtain a second comparison result, including: when there is no historical password identical to the target password in the database, determining that the second comparison result is normal; when there is a historical password identical to the target password in the database, determining that the second comparison result is abnormal; determining the first verification result based on the first comparison result and the second comparison result includes: when both the first comparison result and the second comparison result are normal, determining that the first verification result is verified; when the first comparison result and / or the second comparison result are abnormal, determining that the first verification result is failed.

[0098] Exemplarily, when determining the second comparison result, the historical passwords in the database can be compared with the target password. When there is a historical password that is identical to the target password, it indicates that the target password has been reused and there is a risk of leakage. At this time, it indicates that there is an abnormality in the second comparison result. When there is no historical password that is identical to the target password in the database, it indicates that the target password is used for the first time. At this time, it can be determined that the target password has not been leaked, and the second comparison result is normal. The target password is stored in the database, thereby updating the historical passwords in the database. Then, based on the method of determining whether the target password is a historical password, the anti-replay property of the target password is guaranteed.

[0099] Furthermore, after obtaining the first comparison result and the second comparison result, the first verification result can be comprehensively determined based on the results of the first comparison result and the second comparison result. When the first comparison result and the second comparison result are both normal, and the target timestamp and the target key are correct, the first verification result is determined to be passed. When the first comparison result and / or the second comparison result are abnormal, and at least one of the target timestamp and the target key is incorrect, the first verification result is determined to be failed. In this way, it is possible to determine whether the target request is abnormal based on the first verification result, thereby achieving the effect of accurately identifying whether the request is abnormal, thereby ensuring the security of the server's request processing operations.

[0100] This embodiment determines whether the target password is accurate by determining whether the target key is accurate, thereby improving the accuracy of identifying the target password.

[0101] Optionally, in the request data processing method provided in the embodiment of the present application, the target verification information is verified according to the first public key, the request data and the target password, and obtaining the second verification result includes: decrypting the target verification information by the first public key to obtain the verification data; encoding the request data to obtain an initial character string, and combining the initial character string and the target password according to a preset summary algorithm to obtain the data to be verified; when the data to be verified and the verification data are the same, determining that the second verification result is passed; when the data to be verified and the verification data are not the same, determining that the second verification result is failed.

[0102] Exemplarily, when verifying the target verification information, since the target verification information is composed in the client as follows: the request data and the target password are processed by a preset digest algorithm and then signed by a first private key, after the server receives the target verification information, the target verification information can be decrypted using the first public key to obtain the verification data in the target verification information.

[0103] Furthermore, after obtaining the verification data, the verification data composition method can be adopted in the server, the request data is encoded in the same encoding method to obtain the target character string, and the target password and the target character string are processed by the same preset digest algorithm to obtain the data to be verified, and the data to be verified and the verification data are compared. When the request data and the target password are correct, the data to be verified and the verification data will be exactly the same. Therefore, when the data to be verified and the verification data are exactly the same, it indicates that the request data is correct, that is, the second verification result is passed. When the data to be verified and the verification data are different, it indicates that there is an error in the request data, or there is an error in the target password. At this time, the second verification result is determined to be failed, thereby completing the verification operation on the request data and ensuring that the request data has not been tampered with.

[0104] This embodiment ensures that the request data has not been tampered with by verifying the target verification information, thereby ensuring the accuracy of the request data.

[0105] Optionally, in the request data processing method provided in the embodiment of the present application, before receiving the initial request sent by the client, the method also includes: receiving a login request sent by the user, and parsing the login request to obtain user information; identifying the user information through the user identity information stored in the database, and when the identification result indicates that the user information is normal, receiving the initial request sent by the client; when the identification result indicates that the user information is abnormal, sending a prompt message to the client, wherein the prompt message is used to indicate that the client cannot access the server.

[0106] Exemplarily, before receiving the initial request sent by the client, the user identity needs to be identified. At this time, it is necessary to obtain user information from the login request and use the user identity information stored in the database to identify the user information. If there is no abnormality in the user information, for example, the user information is located in the database, then the initial request sent by the user can be received, thereby ensuring the security of the received initial request.

[0107] It should be noted that when the identification result indicates that there is an abnormality in the user information, it indicates that the user has failed to log in. At this time, a prompt message needs to be sent to the client to prompt the user that the login operation has failed and that a different account needs to be changed to log in, thereby ensuring the security of the request interaction between the client and the server and avoiding the phenomenon of attackers using the client to send requests.

[0108] This embodiment ensures the legitimacy of the identity of the user sending the request by verifying the initial request, thereby ensuring the security and accuracy of the request data.

[0109] Figure 3is a schematic diagram of a system for processing request data provided in an embodiment of the present application, such as Figure 3 As shown, when the request data is transmitted through the request data processing system, the encryption module is first called by the client to generate a first key pair, and the first public key is added to the request header of the initial request, and the initial request is sent to the server. After receiving the initial request, the server stores the first public key, generates a second key and a first timestamp, and uses the first public key to encrypt the second key and the first timestamp to obtain a first ciphertext, and feeds the first ciphertext back to the client.

[0110] Furthermore, the client calls the first private key in the encryption module to decrypt the first ciphertext to obtain the second key and the first timestamp.

[0111] When the client receives the request data, it is necessary to call the encryption module to encrypt the second key and the first timestamp according to the preset encryption algorithm to obtain the target password, and call the encryption module to process the target password and the request data according to the preset summary algorithm and then encrypt them using the first private key to obtain the target verification information, and combine the target verification information, the target password and the request data into the target request information, and send the target request information to the server.

[0112] After receiving the target request information, the server needs to decrypt the target password according to the preset encryption algorithm and the second key to obtain the first timestamp, and determine whether the first timestamp is consistent with the first timestamp sent by the server to the client. If they are consistent, it is determined that there is no abnormality in the target password. Similarly, if there is no abnormality in the target password, the server needs to decrypt the target verification information through the first public key to obtain the first data, and process the request data and the target password in the target verification information according to the preset summary algorithm to obtain the second data, and determine whether the first data and the second data are consistent. If they are consistent, it is determined that the request data in the target request information has not been tampered with, so that the request data can be processed by the server, thereby ensuring the security of the transmission process of the request data and the tamper-proof nature of the request data.

[0113] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0114] The embodiment of the present application also provides a request data processing device. It should be noted that the request data processing device of the embodiment of the present application can be used to execute the request data processing method provided by the embodiment of the present application. The request data processing device provided by the embodiment of the present application is introduced below.

[0115] Figure 4 is a schematic diagram of a request data processing device provided according to an embodiment of the present application. Figure 4 As shown, the device includes: a generating unit 41, a decrypting unit 42, a processing unit 43, and a first sending unit 44.

[0116] The generating unit 41 is configured to call the encryption module to generate a first key pair, generate an initial request based on a first public key in the first key pair, and send the initial request to the server.

[0117] The decryption unit 42 is used to receive the first ciphertext fed back by the server in response to the initial request, and call the encryption module to decrypt the first ciphertext to obtain the second key and the first timestamp, wherein the first ciphertext is encrypted by the server using the first public key, and the encryption module decrypts the first ciphertext using the first private key in the first key pair.

[0118] The processing unit 43 is used to call the password generation strategy in the encryption module when receiving the user's request data, process the second key and the first timestamp according to the password generation strategy to obtain the target password, and call the verification information generation strategy in the encryption module, process the request data, the target password and the first private key according to the verification information generation strategy to obtain the target verification information.

[0119] The first sending unit 44 is used to combine the target password, target verification information and request data into a target request, and send the target request to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes.

[0120] In the processing device for request data provided by the embodiment of the present application, the generation unit 41 calls the encryption module to generate a first key pair, generates an initial request based on the first public key in the first key pair, and sends the initial request to the server; the decryption unit 42 receives the first ciphertext fed back by the server in response to the initial request, and calls the encryption module to decrypt the first ciphertext to obtain the second key and the first timestamp, wherein the first ciphertext is obtained by the server through encryption using the first public key, and the encryption module decrypts the first ciphertext using the first private key in the first key pair; the processing unit 43, upon receiving the user's request data, calls the password generation strategy in the encryption module, processes the second key and the first timestamp according to the password generation strategy to obtain the target password, and calls the verification information generation strategy in the encryption module, processes the request data, the target password and the first private key according to the verification information generation strategy to obtain the target verification information; the first sending unit 44 combines the target password, the target verification information and the request data into a target request, and sends the target request to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes. The problem of low accuracy and security of request data transmitted by carrying an identifier in the related technology is solved. The first public key is sent to the server to ensure the security of the second key sent by the server, and the target password and target verification information are generated by using the second key, the first timestamp and the request data, so that the server can verify the sender of the request and the request data according to the target password and the target verification information. Since the target password and the target verification information will be changed according to the second key, the first timestamp and the request data each time a request is initiated, even if the attacker obtains the target password and the target verification information, it cannot be used, thereby achieving the technical effect of improving the security and accuracy of the request data transmission and processing.

[0121] Optionally, in the request data processing device provided in the embodiment of the present application, the password generation strategy carries a preset encryption algorithm, and the processing unit 43 includes: a first calculation module, used to calculate the first time difference between the first moment when the user's request data is received and the second moment when the first ciphertext is received; a second calculation module, used to add the first time difference and the first timestamp to obtain a second timestamp; and a third calculation module, used to use the second key to encrypt the second timestamp through a preset encryption algorithm to obtain a target password.

[0122] Optionally, in the request data processing device provided in the embodiment of the present application, the verification information generation strategy carries a preset digest algorithm, and the processing unit 43 includes: a combination module, used to encode the request data to obtain a target string, and combine the target string and the target password according to the preset digest algorithm to obtain initial verification information; an encryption module, used to encrypt the initial verification information using a first private key to obtain target verification information.

[0123] Figure 5 is a schematic diagram of another device for processing request data provided according to an embodiment of the present application. Figure 5 As shown, the device includes: an encryption unit 51, an acquisition unit 52, and a verification unit 53.

[0124] The encryption unit 51 is used to receive the initial request sent by the client, encrypt the second key and the first timestamp based on the first public key in the initial request to obtain the first ciphertext, and send the first ciphertext to the client, wherein the first public key is obtained by the client calling the encryption module.

[0125] The acquisition unit 52 is used to obtain the target password and target verification information in the target request when receiving the target request sent by the client, wherein the target request is composed by the client according to the request data, the target password and the target verification information, the target password is obtained by the client encrypting the second key and the first timestamp according to the password generation strategy in the encryption module, and the second key and the first timestamp are obtained by the client decrypting the first ciphertext based on the first private key.

[0126] The verification unit 53 is used to verify the request data according to the target password and the target verification information, and process the request data if the verification passes.

[0127] The processing device for request data provided by the embodiment of the present application comprises an encryption unit 51 receiving an initial request sent by a client, encrypting a second key and a first timestamp based on a first public key in the initial request, obtaining a first ciphertext, and sending the first ciphertext to the client, wherein the first public key is obtained by the client calling an encryption module; an acquisition unit 52, upon receiving a target request sent by the client, obtains a target password and target verification information in the target request, wherein the target request is formed by the client according to request data, a target password and target verification information, the target password is obtained by the client encrypting the second key and the first timestamp according to a password generation strategy in the encryption module, and the second key and the first timestamp are obtained by the client decrypting the first ciphertext based on a first private key; a verification unit 53 verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes. The problem of low accuracy and security of transmitting request data by carrying an identifier in the related art is solved. By sending the second key encrypted by the first public key to the client, the security of the second key sent by the server is guaranteed, and by verifying the target key and the target verification information, it is determined whether there is an abnormality in the requested data based on the verification result, thereby achieving the technical effect of improving the security and accuracy of the requested data transmission and processing.

[0128] Optionally, in the request data processing device provided in the embodiment of the present application, the verification unit 53 includes: a first verification module, used to verify the target password according to the second key and the first timestamp to obtain a first verification result; a second verification module, used to verify the target verification information according to the first public key, the request data and the target password to obtain a second verification result; a determination module, used to determine that there is no abnormality in the request data when both the first verification result and the second verification result pass the verification.

[0129] Optionally, in the request data processing device provided in the embodiment of the present application, the first verification module includes: an acquisition submodule, used to acquire a third moment when the target request sent by the client is received; a parsing submodule, used to parse the target password through a preset encryption algorithm and a second key to obtain a target timestamp; a first comparison submodule, used to compare the target timestamp with the third moment to obtain a first comparison result; a second comparison submodule, used to compare the target password with historical passwords in a database to obtain a second comparison result, wherein the database stores historical passwords received at multiple historical moments; a first determination submodule, used to determine a first verification result based on the first comparison result and the second comparison result.

[0130] Optionally, in the request data processing device provided in the embodiment of the present application, the first comparison submodule includes: a first calculation submodule, used to calculate the time difference between the target timestamp and the third moment, obtain the third time difference, and determine whether the third time difference is greater than the time difference threshold; a second determination submodule, used to determine that the first comparison result is abnormal when the third time difference is greater than the time difference threshold, and determine that there is no abnormality in the first comparison result when the third time difference is less than or equal to the time difference threshold.

[0131] Optionally, in the request data processing device provided in the embodiment of the present application, the second comparison submodule includes: a third determination submodule, used to determine that the second comparison result is normal when there is no historical password identical to the target password in the database; a fourth determination submodule, used to determine that the second comparison result is abnormal when there is a historical password identical to the target password in the database; the first determination submodule includes: a fifth determination submodule, used to determine that the first verification result is verified as passed when both the first comparison result and the second comparison result are normal; a sixth determination submodule, used to determine that the first verification result is failed when the first comparison result and / or the second comparison result are abnormal.

[0132] Optionally, in the request data processing device provided in the embodiment of the present application, the second verification module includes: a decryption submodule, used to decrypt the target verification information through the first public key to obtain verification data; an encoding submodule, used to encode the request data to obtain an initial character string, and combine the initial character string and the target password according to a preset summary algorithm to obtain the data to be verified; a seventh determination submodule, used to determine that the second verification result is passed in the case that the data to be verified and the verification data are the same; an eighth determination submodule, used to determine that the second verification result is failed in the case that the data to be verified and the verification data are not the same.

[0133] Optionally, in the request data processing device provided in the embodiment of the present application, before receiving the initial request sent by the client, the device also includes: a parsing unit, used to receive a login request sent by the user, and parse the login request to obtain user information; an identification unit, used to identify the user information through the user identity information stored in the database, and when the identification result indicates that the user information is normal, receive the initial request sent by the client; a second sending unit, used to send a prompt message to the client when the identification result indicates that the user information is abnormal, wherein the prompt message is used to indicate that the client cannot access the server.

[0134] The above-mentioned request data processing device includes a processor and a memory. The above-mentioned generation unit 41, decryption unit 42, processing unit 43, first sending unit 44, encryption unit 51, acquisition unit 52, verification unit 53, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0135] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of low accuracy and security of transmitting request data by carrying identifiers in related technologies is solved by adjusting kernel parameters.

[0136] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0137] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the method for processing request data is implemented.

[0138] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for processing request data is executed when the program is running.

[0139] Figure 6 is a schematic diagram of an electronic device provided according to an embodiment of the present application, such as Figure 6 As shown, an embodiment of the present invention provides an electronic device, the electronic device 60 includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the steps of the above-mentioned request data processing method when executing the program. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0140] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the steps of the above-mentioned request data processing method.

[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0145] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0146] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0147] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0148] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0149] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for processing request data, characterized in that: Applied to the client, including: Calling an encryption module to generate a first key pair, generating an initial request based on a first public key in the first key pair, and sending the initial request to a server; receiving a first ciphertext fed back by the server in response to the initial request, and calling the encryption module to decrypt the first ciphertext to obtain a second key and a first timestamp, wherein the first ciphertext is encrypted by the server using the first public key, and the encryption module decrypts the first ciphertext using the first private key in the first key pair; In the case of receiving the user's request data, calling the password generation strategy in the encryption module, processing the second key and the first timestamp according to the password generation strategy to obtain the target password, and calling the verification information generation strategy in the encryption module, processing the request data, the target password and the first private key according to the verification information generation strategy to obtain the target verification information; The target password, the target verification information and the request data are combined into a target request, and the target request is sent to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification passes.

2. The method according to claim 1, characterized in that The password generation strategy carries a preset encryption algorithm, and the second key and the first timestamp are processed according to the password generation strategy to obtain the target password, including: Calculating a first time difference between a first moment of receiving the user's request data and a second moment of receiving the first ciphertext; Adding the first time difference and the first timestamp to obtain a second timestamp; The second timestamp is encrypted using the second key through the preset encryption algorithm to obtain the target password.

3. The method according to claim 1, characterized in that The verification information generation strategy carries a preset digest algorithm. The request data, the target password and the first private key are processed according to the verification information generation strategy to obtain the target verification information including: Encoding the request data to obtain a target character string, and combining the target character string and the target password according to the preset digest algorithm to obtain initial verification information; The initial verification information is encrypted using the first private key to obtain the target verification information.

4. A method for processing request data, characterized in that: Applicable to servers, including: Receive an initial request sent by a client, encrypt a second key and a first timestamp based on a first public key in the initial request to obtain a first ciphertext, and send the first ciphertext to the client, wherein the first public key is obtained by the client calling an encryption module; Upon receiving a target request sent by the client, obtaining a target password and target verification information in the target request, wherein the target request is formed by the client according to request data, the target password and the target verification information, the target password is obtained by the client encrypting a second key and a first timestamp according to a password generation strategy in the encryption module, and the second key and the first timestamp are obtained by the client decrypting the first ciphertext based on the first private key; The request data is verified according to the target password and the target verification information, and the request data is processed if the verification passes.

5. The method according to claim 4, characterized in that Verifying the request data according to the target password and the target verification information includes: Verify the target password according to the second key and the first timestamp to obtain a first verification result; Verify the target verification information according to the first public key, the request data and the target password to obtain a second verification result; When both the first verification result and the second verification result pass the verification, it is determined that there is no abnormality in the request data.

6. The method according to claim 5, characterized in that The target password is verified according to the second key and the first timestamp, and a first verification result is obtained, including: Acquire a third time when the target request sent by the client is received; Parsing the target password using a preset encryption algorithm and the second key to obtain a target timestamp; Comparing the target timestamp with the third moment to obtain a first comparison result; Comparing the target password with historical passwords in a database to obtain a second comparison result, wherein the database stores historical passwords received at multiple historical moments; The first verification result is determined according to the first comparison result and the second comparison result.

7. The method according to claim 6, characterized in that Comparing the target timestamp with the third time to obtain a first comparison result includes: Calculating a time difference between the target timestamp and the third moment to obtain a third time difference, and determining whether the third time difference is greater than a time difference threshold; When the third time difference is greater than the time difference threshold, the first comparison result is determined to be abnormal; and when the third time difference is less than or equal to the time difference threshold, the first comparison result is determined to be normal.

8. The method according to claim 6, characterized in that Comparing the target password with the historical passwords in the database, obtaining a second comparison result includes: If there is no historical password identical to the target password in the database, determining that the second comparison result is normal; If there is a historical password identical to the target password in the database, determining that the second comparison result is abnormal; Determining the first verification result according to the first comparison result and the second comparison result includes: When both the first comparison result and the second comparison result are normal, determining that the first verification result passes the verification; When the first comparison result and / or the second comparison result is abnormal, it is determined that the first verification result fails the verification.

9. The method according to claim 5, characterized in that The target verification information is verified according to the first public key, the request data and the target password, and the second verification result obtained includes: Decrypting the target verification information by using the first public key to obtain verification data; Encode the request data to obtain an initial character string, and combine the initial character string and the target password according to a preset digest algorithm to obtain data to be verified; When the data to be verified is the same as the verification data, determining that the second verification result is passed; When the data to be verified is different from the verification data, the second verification result is determined to be failure of verification.

10. A device for processing request data, characterized in that: include: A generating unit, configured to call an encryption module to generate a first key pair, generate an initial request based on a first public key in the first key pair, and send the initial request to a server; a decryption unit, configured to receive a first ciphertext fed back by the server in response to the initial request, and call the encryption module to decrypt the first ciphertext to obtain a second key and a first timestamp, wherein the first ciphertext is encrypted by the server using the first public key, and the encryption module decrypts the first ciphertext using the first private key in the first key pair; a processing unit, configured to, upon receiving request data from a user, call the password generation strategy in the encryption module, process the second key and the first timestamp according to the password generation strategy to obtain a target password, and call the verification information generation strategy in the encryption module, process the request data, the target password and the first private key according to the verification information generation strategy to obtain target verification information; The first sending unit is used to combine the target password, the target verification information and the request data into a target request, and send the target request to the server, wherein the server verifies the request data according to the target password and the target verification information, and processes the request data if the verification is successful.

11. A device for processing request data, characterized in that: include: an encryption unit, configured to receive an initial request sent by a client, encrypt a second key and a first timestamp based on a first public key in the initial request to obtain a first ciphertext, and send the first ciphertext to the client, wherein the first public key is obtained by the client calling an encryption module; an acquiring unit, configured to acquire a target password and target verification information in the target request upon receiving the target request sent by the client, wherein the target request is formed by the client according to request data, the target password and the target verification information, the target password is obtained by the client encrypting a second key and a first timestamp according to a password generation strategy in the encryption module, and the second key and the first timestamp are obtained by the client decrypting the first ciphertext based on a first private key; The verification unit is used to verify the request data according to the target password and the target verification information, and process the request data if the verification passes.

12. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, the method for processing request data described in any one of claims 1 to 3, or the method for processing request data described in any one of claims 4 to 9 is implemented.

Citation Information

Cited By

  • Cloud textbook reader code protection method and system

    CN120429884A