Method, device and computer storage medium for transmitting service request information
By encrypting on the client side and performing double verification at the gateway, the replay attack problem is solved, ensuring that the server only receives fresh business request information, thereby improving network security and server stability.
Patent Information
- Application Number
- CN202410257057.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-06
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-03-06
AI Technical Summary
In existing technologies, attackers can modify the timestamps attached to business request information, making replay attacks undetectable by the authentication end and causing the server to receive multiple duplicate business request messages.
The client encrypts the timestamp and decrypts and verifies it through the gateway. Only when the difference in the duration of the timestamp is less than the preset value and the additional verification information is inconsistent with the pre-stored information is the business request information sent to the server. This dual verification mechanism prevents replay attacks.
This effectively prevents replay attacks, ensuring that the server only receives fresh business request information, thus improving network security and server stability.
Smart Images

Figure CN118827126B_ABST
Abstract
Description
Technical Field
[0001] This application pertains to cloud computing, big data, and edge computing, and particularly relates to a method, apparatus, device, and computer storage medium for transmitting business request information. Background Technology
[0002] With the enhancement of proactive internet protection technologies, traditional attack methods (such as exploiting security vulnerabilities and database breaches) are gradually decreasing. In the new era, cybersecurity risks often appear in covert forms, making them more difficult to identify. Among these, replay attacks are one of the most insidious cyberattack methods. A replay attack refers to an attacker using network eavesdropping or other means to obtain business request information, repeatedly sending that same information to the server, causing confusion in the server's business relationships, thereby achieving the attack's objective.
[0003] To counter replay attacks, existing technologies typically involve the client attaching a timestamp to the business request information before transmission. The authentication end verifies the business request information using the attached timestamp, and the server processes the verified business request information.
[0004] However, even with this method of countering replay attacks, attackers can still modify the timestamps attached to the business request information, making it impossible for the authentication end to distinguish duplicate business request information, and sending multiple duplicate business request information to the server, thus causing a replay attack. Summary of the Invention
[0005] This application provides a method, apparatus, device, and computer storage medium for transmitting service request information. It receives an encrypted timestamp sent by a target device and decrypts it. The decrypted timestamp is verified, preventing attackers from modifying the encrypted timestamp. Furthermore, the target additional verification information of the service request information is verified twice. Only when the time interval between the timestamp when the target device receives the request information and the timestamp when the gateway completes decryption is less than a first preset value, and the additional verification information of the service request information is inconsistent with the preset additional verification information, will the gateway send the service request information sent by the target device to the target server. This prevents multiple duplicate service request messages from entering the server, thus preventing replay attacks.
[0006] In a first aspect, embodiments of this application provide a method for transmitting service request information, applied to a gateway, comprising:
[0007] Receive first service request information sent by the target device. The first service request information includes target additional verification information and second service request information. The target additional verification information is information encrypted by the target device using a preset encryption algorithm with a first timestamp. The first timestamp is the timestamp at which the target device receives the second service request information.
[0008] The target additional verification information is decrypted using a preset decryption algorithm to obtain the first timestamp, and the second timestamp when the decryption is completed is obtained.
[0009] If the difference between the first timestamp and the second timestamp is less than the first preset value, and the target additional verification information is inconsistent with the pre-stored additional verification information, a second business request information is sent to the target server.
[0010] In one possible implementation, the target additional verification information includes a random factor, first additional verification information, and second additional verification information. The second additional verification information includes m second characters. The target additional verification information is decrypted using a preset decryption algorithm to obtain a first timestamp, including:
[0011] Each of the m second characters is matched with a preset character in the key stored in the gateway to determine the sequence number of the m second characters. The key includes the preset character and the corresponding sequence number of the preset character, where m is a positive integer.
[0012] Based on the sequence number of m second characters, the random factor, and the first additional verification information, the initial additional verification information is determined according to the first preset relationship information. The first preset relationship information includes the relationship information of the preset second character sequence number, the preset random factor, the preset first additional verification information, and the preset initial additional verification information. The preset second character sequence number includes the second character sequence number, the preset random factor includes the random factor, the preset first additional verification information includes the first additional verification information, and the preset initial additional verification information includes the initial additional verification information.
[0013] Based on the preset combination of information, the initial additional verification information is split to obtain the first timestamp.
[0014] In one possible implementation, the random factor includes m+1 first characters. Based on the sequence numbers of m second characters, the random factor, and the first additional verification information, initial additional verification information is determined according to the first preset relationship information, including:
[0015] Based on the (m+1)th first character and the first additional verification information, determine the mth third additional verification information according to the first preset relationship information;
[0016] Based on the sequence number of the m-th second character, the m-th first character, and the m-th third additional verification information, determine the (m-1)-th third additional verification information according to the first preset relationship information;
[0017] Given the first third additional check information, the initial additional check information is determined according to the sequence number of the first second character, the first first character, and the first third additional check information, based on the first preset relationship information.
[0018] In one possible implementation, before sending the second service request information to the target server when the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the additional verification information in the cache module, the method further includes:
[0019] Calculate the difference between the first timestamp and the second timestamp;
[0020] Check whether the difference is less than the first preset value to obtain the verification result;
[0021] If the difference between the first timestamp and the second timestamp is less than the first preset value, check whether the additional verification information of the verification target is inconsistent with the additional verification information in the cache module.
[0022] In one possible implementation embodiment, it further includes:
[0023] If the target additional verification information is inconsistent with the pre-stored additional verification information, the target additional verification information is saved.
[0024] Secondly, embodiments of this application provide a method for transmitting service request information, applied to a target device, comprising:
[0025] Upon receiving the second service request information, obtain the first timestamp of receiving the second service request information;
[0026] The first timestamp is encrypted using a preset encryption algorithm to obtain additional verification information for the target.
[0027] A first service request message is sent to the gateway. The first service request message includes target additional verification information and second service request information. The gateway uses a preset decryption algorithm to decrypt the target additional verification information to obtain a first timestamp and obtain a second timestamp when the decryption is completed. If the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the pre-stored additional verification information, the second service request message is sent to the target server.
[0028] In one possible implementation, the first timestamp is encrypted using a preset encryption algorithm to obtain target additional verification information, including:
[0029] Get a random number with a preset number of digits;
[0030] According to the preset combination information, the preset number of random bits and the first timestamp are combined to obtain the initial additional verification information;
[0031] The first character is obtained from the key stored in the target device and used as a random factor. The key includes a preset character and the sequence number corresponding to the preset character. The preset character includes the first character.
[0032] Based on the initial additional verification information and the random factor, the sequence number of the first additional verification information and the second character is determined according to the first preset relationship information. The first preset relationship information includes the sequence number of the preset second character, the preset random factor, the relationship information between the preset first additional verification information and the preset initial additional verification information. The sequence number of the preset second character includes the sequence number of the second character. The preset random factor includes the random factor. The preset first additional verification information includes the first additional verification information. The preset initial additional verification information includes the initial additional verification information.
[0033] The second character corresponding to the sequence number of the second character is obtained from the key and used as the second additional verification information;
[0034] The target additional verification information is obtained by combining the random factor, the first additional verification information, and the second additional verification information.
[0035] In one possible implementation, obtaining a first character from a key stored in the target device as a random factor includes:
[0036] The first target character is randomly selected from the key and used as the first character of the random factor;
[0037] Based on the initial additional verification information and the first first character, the sequence number of the nth first character of the random factor is determined according to the second preset relationship information. The second preset relationship information includes the relationship information between the preset initial additional verification information and the preset first character. The preset first character includes the first character, and n is a positive integer greater than 1.
[0038] The nth first character corresponding to the sequence number of the nth first character in the key is obtained and used as the nth first character of the random factor.
[0039] In one possible implementation, determining the sequence number of the first additional verification information and the second character according to the first preset relationship information, based on the initial additional verification information and the random factor, includes:
[0040] Based on the initial additional verification information and the first character of the random factor, determine the sequence number of the first third additional verification information and the first second character according to the first preset relationship information;
[0041] Based on the m-th third additional verification information and the (m+1)-th first character of the random factor, the sequence number of the (m+1)-th third additional verification information and the (m+1)-th second character is determined according to the first preset relationship information. If the sequence number of the (m+1)-th second character is the target value, the (m+1)-th third additional verification information is determined as the first additional verification information, where m is a positive integer and n≥m+1.
[0042] The second character corresponding to the sequence number of the second character is obtained from the key and used as the second additional verification information, including:
[0043] The second character corresponding to the sequence number of the second character from the first to the mth second character is obtained from the key and used as the second additional verification information.
[0044] Thirdly, embodiments of this application provide a service request information transmission device, applied to a gateway, comprising:
[0045] The receiving module is used to receive first service request information sent by the target device. The first service request information includes target additional verification information and second service request information. The target additional verification information is information encrypted by the target device using a preset encryption algorithm with a first timestamp. The first timestamp is the timestamp at which the target device receives the second service request information.
[0046] The decryption module is used to decrypt the target's additional verification information using a preset decryption algorithm, obtain the first timestamp, and obtain the second timestamp when the decryption is completed.
[0047] The sending module is used to send a second service request message to the target server when the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the pre-stored additional verification information.
[0048] Fourthly, embodiments of this application provide a service request information transmission apparatus, applied to a target device, comprising:
[0049] The acquisition module is used to acquire the first timestamp of receiving the second business request information when the second business request information is received.
[0050] The encryption module is used to encrypt the first timestamp using a preset encryption algorithm to obtain additional verification information for the target.
[0051] The sending module is used to send a first service request information to the gateway. The first service request information includes target additional verification information and second service request information. The gateway uses a preset decryption algorithm to decrypt the target additional verification information to obtain a first timestamp and obtain a second timestamp when the decryption is completed. If the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the pre-stored additional verification information, the second service request information is sent to the target server.
[0052] Fifthly, embodiments of this application provide an electronic device, the device comprising:
[0053] Processor and memory storing computer program instructions;
[0054] A method for transmitting business request information that implements any of the above when the processor executes computer program instructions.
[0055] Sixthly, embodiments of this application provide a computer storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, a method for transmitting business request information that implements any of the above-mentioned items.
[0056] In a seventh aspect, embodiments of this application provide a computer program product, characterized in that, when the instructions in the computer program product are executed by the processor of an electronic device, the electronic device is able to execute the method for transmitting service request information as described above.
[0057] This application discloses a method, apparatus, device, and computer storage medium for transmitting service request information. The method, applied to a gateway, includes: receiving first service request information sent by a target device, the first service request information including target additional verification information and second service request information; decrypting the target additional verification information using a preset decryption algorithm to obtain a first timestamp, and obtaining a second timestamp at the time of decryption completion; and sending the second service request information to a target server if the difference between the first timestamp and the second timestamp is less than a first preset value, and the target additional verification information is inconsistent with pre-stored additional verification information. Thus, the encrypted timestamp sent by the target device is received and decrypted; the decrypted timestamp is verified, preventing attackers from modifying the encrypted timestamp; and the target additional verification information of the service request information is verified twice. Only when the time interval between the timestamp when the target device receives the request information and the timestamp when the gateway completes decryption is less than a first preset value, and the additional verification information of the service request information is inconsistent with the preset additional verification information, will the gateway send the service request information sent by the target device to the target server. This prevents multiple duplicate service request information from entering the server, thus preventing replay attacks. Attached Figure Description
[0058] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 This is a flowchart illustrating a method for transmitting service request information according to an embodiment of this application;
[0060] Figure 2 This is a flowchart illustrating a method for transmitting service request information according to another embodiment of this application;
[0061] Figure 3 This is a flowchart illustrating a method for transmitting service request information according to another embodiment of this application;
[0062] Figure 4 This is a flowchart illustrating a method for transmitting service request information according to another embodiment of this application;
[0063] Figure 5 This is a flowchart illustrating a method for transmitting service request information according to another embodiment of this application;
[0064] Figure 6 This is a schematic diagram of a transmission device for service request information applied to a gateway, provided in another embodiment of this application;
[0065] Figure 7 This is a schematic diagram of the structure of a transmission device for service request information applied to a target device, provided in another embodiment of this application;
[0066] Figure 8 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0067] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0068] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0069] With the enhancement of proactive internet protection technologies, traditional attack methods (such as exploiting security vulnerabilities and database breaches) are gradually decreasing. In the new era, cybersecurity risks often appear in covert forms, making them more difficult to identify. Among these, replay attacks are one of the most insidious cyberattack methods. A replay attack refers to an attacker using network eavesdropping or other means to obtain business request information, repeatedly sending that same information to the server, causing confusion in the server's business relationships, thereby achieving the attack's objective.
[0070] To counter replay attacks, existing technologies typically involve the client attaching a timestamp to the business request information before transmission. The authentication end verifies the business request information using the attached timestamp, and the server processes the verified business request information.
[0071] However, even with this method of countering replay attacks, attackers can still modify the timestamps attached to the business request information, making it impossible for the authentication end to distinguish duplicate business request information, and sending multiple duplicate business request information to the server, thus causing a replay attack.
[0072] To address the problems of the prior art, embodiments of this application provide a method, apparatus, device, and computer storage medium for transmitting service request information. The method for transmitting service request information provided in this application embodiment will be described first below.
[0073] Figure 1 A flowchart illustrating a method for transmitting service request information according to an embodiment of this application is shown.
[0074] like Figure 1 As shown in the embodiments of this application, the method for transmitting service request information includes the following steps.
[0075] S110. Upon receiving the second service request information, the target device obtains the first timestamp of receiving the second service request information.
[0076] Here, the second service request information includes the service request information entered by the user. The target device can be a client.
[0077] As an example, the target device can receive a second business request from the user through the target page.
[0078] In some embodiments, the target device includes an encryption encapsulation module. Pre-acquired JavaScript code in the encryption encapsulation module can be used to intercept the second service request information and obtain a first timestamp of the target device receiving the second service request information.
[0079] As an example, the timestamp can be a millisecond-level timestamp. The first timestamp could be the number of milliseconds since midnight on the day the second business request information was received.
[0080] S120. The target device uses a preset encryption algorithm to encrypt the first timestamp to obtain target additional verification information.
[0081] Here, the preset encryption algorithm is set in advance.
[0082] In some embodiments, the target device can invoke a preset encryption algorithm via JavaScript code and use the preset encryption algorithm to encrypt the first timestamp to obtain target additional verification information. It is understood that the target additional verification information is the information after encrypting the first timestamp.
[0083] In some embodiments, the code corresponding to the preset encryption algorithm can be encapsulated into binary code using WebAssembly and stored on the target device as WebAssembly binary code. This prevents the preset encryption algorithm from being exposed and ensures compatibility with most mainstream browsers.
[0084] S130. The target device sends a first service request information to the gateway. The first service request information includes target additional verification information and second service request information.
[0085] Here, the target additional verification information is the information after encrypting the first timestamp. The second service request information is the service request information received by the target device.
[0086] In some embodiments, the target device packages the target additional verification information and the second service request information and sends them to the gateway.
[0087] S140. The gateway uses a preset decryption algorithm to decrypt the target additional verification information to obtain the first timestamp, and obtains the second timestamp when the decryption is completed.
[0088] Here, the preset decryption algorithm is set in advance.
[0089] In some embodiments, after receiving the first service request information, the gateway uses a preset decryption algorithm to decrypt the target additional verification information attached to the second service request information to obtain the first timestamp. It should be noted that the preset encryption algorithm and the preset decryption algorithm are a pair of reversible encryption algorithms.
[0090] S150. If the difference between the first timestamp and the second timestamp is less than the first preset value, and the target additional verification information is inconsistent with the pre-stored additional verification information, the gateway sends the second service request information to the target server.
[0091] Here, the first preset value is set in advance. For example, the first preset value is 30 seconds. The pre-stored additional verification information is the additional verification information received before the second timestamp.
[0092] In some embodiments, the gateway determines whether the second service request information constitutes a replay attack. If the difference between the first and second timestamps is less than a first preset value, and the target additional verification information does not match the pre-stored additional verification information, the gateway sends the second service request information to the target server. Specifically, if the timestamp at which the target device receives the second service request information is significantly different from the timestamp at which the gateway completes decryption, it indicates that the second service request information may have been received a long time ago, i.e., a duplicate service request information. Furthermore, if the target additional verification information matches the pre-stored additional verification information, it indicates that the target additional verification information has already appeared, i.e., it is duplicated. Duplicate second service request information is intercepted and identified as a replay attack.
[0093] In this way, the system receives and decrypts the encrypted timestamp sent by the target device; it then verifies the decrypted timestamp, preventing attackers from modifying the encrypted timestamp; furthermore, it performs two verification checks on the target additional verification information of the service request information. Only when the time interval between the timestamp when the target device receives the request information and the timestamp when the gateway completes decryption is less than a first preset value, and the additional verification information of the service request information is inconsistent with the preset additional verification information, will the gateway send the service request information sent by the target device to the target server. This prevents multiple duplicate service request information from entering the server, thus preventing replay attacks.
[0094] Based on this, in some embodiments, such as Figure 2 As shown, the above S120 may specifically include:
[0095] S121. Obtain a random number with a preset number of digits.
[0096] Here, the preset number of digits is set in advance. For example, two digits. The random number is a randomly generated number and can be at least one number.
[0097] S122. According to the preset combination information, combine the preset number of random digits and the first timestamp to obtain the initial additional verification information.
[0098] Here, the preset combination information is set in advance. For example, the preset combination algorithm combines a random number before and after the first timestamp.
[0099] In some embodiments, a random number of a preset number of bits and a first timestamp are combined to obtain initial additional verification information, thereby eliminating the regularity of the data for the first time.
[0100] S123. Obtain the first character from the key stored in the target device as a random factor. The key includes a preset character and the sequence number corresponding to the preset character. The preset character includes the first character.
[0101] Here, the key is a unique string. For example, the key could be a shuffled string of 62 characters, such as a_zA_Z0_9. It's important to note that the string length can be pre-set, and users can adjust it as needed. There is a one-to-one correspondence between characters and their corresponding numbers.
[0102] In some embodiments, the random factor includes at least one.
[0103] S124. Based on the initial additional verification information and the random factor, determine the sequence number of the first additional verification information and the second character according to the first preset relationship information. The first preset relationship information includes the sequence number of the preset second character, the preset random factor, the relationship information between the preset first additional verification information and the preset initial additional verification information. The sequence number of the preset second character includes the sequence number of the second character. The preset random factor includes the random factor. The preset first additional verification information includes the first additional verification information. The preset initial additional verification information includes the initial additional verification information.
[0104] Here, the first preset relationship is set in advance.
[0105] In some embodiments, the sequence number of the first additional verification information and the second character is obtained by using at least one first preset relationship information, based on the initial additional verification information and the random factor.
[0106] As an example, the first preset relational information is calculated using the remainder method. By calculating the quotient and remainder of the initial additional verification information and the random factor, the sequence number of the first additional verification information and the second character is finally determined. The remainder can be used as the sequence number of the second character, and the quotient from the last calculation can be used as the first additional verification information.
[0107] S125. Obtain the second character corresponding to the sequence number of the second character from the key, and use it as the second additional verification information.
[0108] In some embodiments, the sequence number of at least one second character can be determined using the first preset relationship information. The second character corresponding to the sequence number of the second character is obtained from the key, and this second character is used as second additional verification information.
[0109] S126. Combine the random factor, the first additional verification information, and the second additional verification information to obtain the target additional verification information.
[0110] In some embodiments, the combination of the random factor, the first additional verification information, and the second additional verification information can be pre-defined.
[0111] In this way, the target additional verification information obtained is fully encrypted, which attackers cannot arbitrarily modify, ensuring the ability to prevent replay attacks and guaranteeing the security of the timestamp attached to the second business request.
[0112] Based on this, in some embodiments, the above S123 may specifically include:
[0113] The target device randomly selects the first target character from the key and uses it as the first character of the random factor.
[0114] The target device determines the sequence number of the nth first character of the random factor according to the initial additional verification information and the first first character, and according to the second preset relationship information. The second preset relationship information includes the relationship information between the preset initial additional verification information and the preset first character. The preset first character includes the first character, and n is a positive integer greater than 1.
[0115] The target device obtains the nth first character corresponding to the sequence number of the nth first character from the key, and uses it as the nth first character of the random factor.
[0116] In some embodiments, in the first round of calculation, the second preset relationship information specifically includes initial additional verification information, and the relationship information between the sequence numbers of the first and second first characters. For example, the square of the initial additional verification information divided by the first first character equals the first target value, and the remainder is the sequence number of the second first character. In the second round of calculation, the second preset relationship information specifically includes the relationship information between the initial additional verification information, the sequence numbers of the second and third first characters, or the relationship information between the first target value, the sequence numbers of the second and third first characters. For example, the square of the initial additional verification information divided by the second first character equals the second target value, and the remainder is the sequence number of the third first character, or the square of the first target value divided by the second first character equals the second target value, and the remainder is the sequence number of the third first character; and so on, to calculate the random factor.
[0117] In this way, by using a varying random factor, linear changes in the encryption result are eliminated, increasing the security of the encryption process.
[0118] Based on this, in some embodiments, such as Figure 3 As shown, the above S124 may specifically include:
[0119] S210. The target device determines the sequence number of the first third additional verification information and the first second character according to the first preset relationship information based on the initial additional verification information and the first first character of the random factor.
[0120] S211. The target device determines the sequence number of the (m+1)th third additional verification information and the (m+1)th first character of the random factor according to the first preset relationship information. If the sequence number of the (m+1)th second character is the target value, the (m+1)th third additional verification information is determined as the first additional verification information, where m is a positive integer and n≥m+1.
[0121] Specifically, S125 mentioned above may include:
[0122] The target device retrieves the second character corresponding to the sequence number of the second character from the first to the mth second character from the key, and uses it as the second additional verification information.
[0123] In some embodiments, in the first round of calculation, the first preset relationship information may specifically include the relationship information of the initial additional verification information, the first first character of the random factor, the first third additional verification information, and the sequence number of the first second character. For example, the initial additional verification information divided by the first first character of the random factor equals the first third additional verification information, and the remainder is the sequence number of the first second character. In the second round of calculation, the first preset relationship information may specifically include the relationship information of the first third additional verification information, the second first character of the random factor, the second third additional verification information, and the sequence number of the second second character. For example, the first third additional verification information divided by the second first character of the random factor equals the second third additional verification information, and the remainder is the sequence number of the second second character. This process continues until the (m+1)th third additional verification information and the sequence number of the (m+1)th second character are obtained. If the sequence number of the (m+1)th second character is the target value, the (m+1)th third additional verification information is determined as the first additional verification information. The second characters corresponding to the sequence numbers of the first to the mth second characters are obtained from the key and used as the second additional verification information.
[0124] As an example, the target value here is 0.
[0125] In this way, by using multiple rounds of computation to encrypt the first timestamp and the random number, the timestamp becomes more secure and more effectively prevents replay attacks.
[0126] Based on this, in some embodiments, the target additional verification information includes a random factor, first additional verification information, and second additional verification information. The second additional verification information includes m second characters, such as... Figure 4 As shown, in S140 above, the gateway uses a preset decryption algorithm to decrypt the target additional verification information to obtain the first timestamp, which may specifically include:
[0127] S141. The gateway matches each of the m second characters with a preset character in the key stored in the gateway to determine the sequence number of the m second characters. The key includes the preset character and the sequence number corresponding to the preset character, where m is a positive integer.
[0128] S142. The gateway determines the initial additional verification information according to the sequence number of m second characters, the random factor and the first additional verification information, and the first preset relationship information. The first preset relationship information includes the relationship information of the preset second character sequence number, the preset random factor, the preset first additional verification information and the preset initial additional verification information. The preset second character sequence number includes the second character sequence number, the preset random factor includes the random factor, the preset first additional verification information includes the first additional verification information, and the preset initial additional verification information includes the initial additional verification information.
[0129] S143. The gateway splits the initial additional verification information according to the preset combination information to obtain the first timestamp.
[0130] Here, the key stored in the gateway is the same as the key stored in the target device.
[0131] In some embodiments, the gateway splits the target additional verification information to obtain a random factor, first additional verification information, and second additional verification information. The second additional verification information includes m second characters. The m second characters are matched against preset characters in the key stored in the gateway to determine the sequence number of each of the m second characters. Reversing the encryption process, based on the sequence number of the m second characters, the random factor, and the first additional verification information, initial additional verification information is determined according to a first preset relationship. The random number in the initial additional verification information is removed to obtain a first timestamp.
[0132] In some embodiments, if decryption fails, the second service request information is intercepted.
[0133] In this way, the restored first timestamp can be compared with the second timestamp, thereby intercepting duplicate second business requests and ensuring server security.
[0134] Based on this, in some embodiments, the random factor includes m+1 first characters, and the above S142 may specifically include:
[0135] The gateway determines the m-th third additional verification information according to the m+1-th first character and the first additional verification information, based on the first preset relationship information.
[0136] The gateway determines the (m-1)th third additional verification information according to the sequence number of the m-th second character, the m-th first character, and the m-th third additional verification information, based on the first preset relationship information.
[0137] Once the first third additional verification information is determined, the gateway determines the initial additional verification information according to the sequence number of the first second character, the first first character, and the first third additional verification information, in accordance with the first preset relationship information.
[0138] In some embodiments, the next round of calculation is performed based on the result obtained in the previous round of calculation. In the case of determining the first third additional verification information, the initial additional verification information is determined according to the sequence number of the first second character, the first first character, and the first third additional verification information, in accordance with the first preset relationship information.
[0139] In some embodiments, if any round of calculation fails, the second service request information is intercepted.
[0140] In this way, the second business request information corresponding to the target additional verification information that does not conform to the calculation process is intercepted, effectively preventing the second business request information from attempting to attack and ensuring the security of the server.
[0141] Based on this, in some embodiments, such as Figure 5 As shown, prior to S150 above, the method may further include:
[0142] S220, The gateway calculates the difference between the first timestamp and the second timestamp;
[0143] S221. Check whether the gateway verification difference is less than the first preset value, and obtain the verification result;
[0144] S222. If the difference between the first timestamp and the second timestamp is less than the first preset value, check whether the additional verification information of the gateway verification target is inconsistent with the additional verification information in the cache module.
[0145] In some embodiments, the decrypted first timestamp is used to determine whether it is a replay attack. If the timestamp verification fails, it is not necessary to further determine whether the target additional verification information is inconsistent with the additional verification information in the cache module.
[0146] In this way, by first determining whether there are any anomalies in the decryption process and the decryption result, and then determining whether the target additional verification information is inconsistent with the additional verification information in the cache module, security is not only better guaranteed, but also the replay of business request information is avoided from having to determine whether the target additional verification information is inconsistent with the additional verification information in the cache module, thus saving system resources.
[0147] Based on this, in some embodiments, the method may further include:
[0148] If the target additional verification information is inconsistent with the pre-stored additional verification information, the gateway saves the target additional verification information.
[0149] In some embodiments, the gateway caches target-attached verification information. This target-attached verification information can be deleted after the target duration.
[0150] This allows for the verification of subsequent additional verification information while reducing memory pressure.
[0151] In the embodiments provided in this application, under the AJAX architecture of web development, a gateway is set up between the target device and the target server. The gateway obtains all second service request information received by the target device and determines whether the second service request information is a replay attack. If so, it is intercepted; otherwise, it is sent to the target server and the processing result of the target server is returned to the target device. This effectively prevents unauthorized calls. By checking whether the second service request information exists in the WASM code, unauthorized calls can be effectively prevented, and the verification can be bypassed by directly calling the emulator.
[0152] The network security technology implementation based on the AJAX framework provided in this application conforms to the new trend of network development, has broad application prospects, and the encryption algorithm used is easier to implement, consumes fewer resources, is more scalable, and has higher security while maintaining the effectiveness of defending against replay attacks. Moreover, it is scalable for emerging AJAX frameworks, and its lifecycle extends with AJAX.
[0153] In the embodiments provided in this application, the reversible encryption algorithm is flexible and scalable, and can use keys of different lengths depending on the situation; the encryption calculation result is sufficiently random, which can resist brute-force attacks and effectively improve security performance. It can be based on a stateless design of HTTP / HTTPS, does not need to remember request states, is applicable to various scenarios, and has a wide range of applications. The calculation process is fast, unlike RSA which requires complex calculations, and can be implemented in a hardware gateway. Moreover, the encrypted result, i.e., the target additional verification information (generally less than 8 bits), does not produce a large result like DES, 3DES, AES, and RSA, which facilitates network transmission.
[0154] In the embodiments provided in this application, dual verification based on timestamps and target-attached verification information ensures comprehensive protection without blind spots, improving security and achieving zero false alarms and zero missed detections. The gateway stores small amounts of data over short periods, consuming minimal memory, thus making it more stable and capable of handling higher concurrent traffic.
[0155] In the embodiments provided in this application, the gateway can run either independently or as a module of the gateway (such as lua, pipy, openPCS), which can achieve flexibility and efficiency in system deployment.
[0156] Based on the service request information transmission method provided in the above embodiments, this application also provides specific implementations of the service request information transmission apparatus. Please refer to the following embodiments.
[0157] See Figure 6 The service request information transmission device 300 provided in this application embodiment is applied to a gateway and includes:
[0158] The receiving module 310 is used to receive first service request information sent by the target device. The first service request information includes target additional verification information and second service request information. The target additional verification information is information encrypted by the target device using a preset encryption algorithm with a first timestamp. The first timestamp is the timestamp at which the target device receives the second service request information.
[0159] The decryption module 320 is used to decrypt the target additional verification information using a preset decryption algorithm to obtain the first timestamp and obtain the second timestamp when the decryption is completed.
[0160] The sending module 330 is used to send a second service request information to the target server when the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the pre-stored additional verification information.
[0161] Based on this, in some embodiments, the target additional verification information includes a random factor, first additional verification information, and second additional verification information, wherein the second additional verification information includes m second characters, and the decryption module 320 may include:
[0162] The determining unit is used to match the m second characters with the preset characters in the key stored in the gateway to determine the sequence number of the m second characters. The key includes the preset characters and the sequence number corresponding to the preset characters, where m is a positive integer.
[0163] The determining unit is further configured to determine initial additional verification information according to the sequence number of m second characters, random factor and first additional verification information, and according to the first preset relationship information. The first preset relationship information includes the relationship information of preset second character sequence number, preset random factor, preset first additional verification information and preset initial additional verification information. The preset second character sequence number includes the second character sequence number, the preset random factor includes the random factor, the preset first additional verification information includes the first additional verification information, and the preset initial additional verification information includes the initial additional verification information.
[0164] The unit is also used to split the initial additional verification information according to the preset combination information to obtain the first timestamp.
[0165] Based on this, in some embodiments, the random factor includes m+1 first characters, and the determining unit can specifically be used for:
[0166] Based on the (m+1)th first character and the first additional verification information, determine the mth third additional verification information according to the first preset relationship information;
[0167] Based on the sequence number of the m-th second character, the m-th first character, and the m-th third additional verification information, determine the (m-1)-th third additional verification information according to the first preset relationship information;
[0168] Given the first third additional check information, the initial additional check information is determined according to the sequence number of the first second character, the first first character, and the first third additional check information, based on the first preset relationship information.
[0169] Based on this, in some embodiments, the device 300 may further include:
[0170] The calculation module is used to calculate the difference between the first timestamp and the second timestamp before sending the second business request information to the target server when the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the additional verification information in the cache module.
[0171] The verification module is used to verify whether the difference is less than a first preset value and obtain the verification result.
[0172] The verification module is also used to verify whether the additional verification information of the target is inconsistent with the additional verification information in the cache module when the difference between the first timestamp and the second timestamp is less than the first preset value.
[0173] Based on this, in some embodiments, the device 300 may further include:
[0174] The storage module is used to save the target additional verification information when the target additional verification information is inconsistent with the pre-stored additional verification information.
[0175] See Figure 7 The service request information transmission device 400 provided in this application embodiment is applied to a target device and includes:
[0176] The acquisition module 410 is used to acquire the first timestamp of receiving the second service request information when the second service request information is received.
[0177] The encryption module 420 is used to encrypt the first timestamp using a preset encryption algorithm to obtain target additional verification information;
[0178] The sending module 430 is used to send a first service request information to the gateway. The first service request information includes target additional verification information and second service request information. The gateway uses a preset decryption algorithm to decrypt the target additional verification information to obtain a first timestamp and obtain a second timestamp when the decryption is completed. If the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the pre-stored additional verification information, the gateway sends the second service request information to the target server.
[0179] Based on this, in some embodiments, the encryption module 420 may include:
[0180] The `get` submodule is used to obtain a random number of a preset number of digits.
[0181] The combination submodule is used to combine a random number of a preset number of bits and the first timestamp according to the preset combination information to obtain the initial additional verification information;
[0182] The acquisition submodule is also used to obtain the first character from the key stored in the target device as a random factor. The key includes a preset character and the sequence number corresponding to the preset character. The preset character includes the first character.
[0183] The determination submodule is also used to determine the sequence number of the first additional verification information and the second character according to the initial additional verification information and the random factor, and according to the first preset relationship information. The first preset relationship information includes the sequence number of the preset second character, the preset random factor, the relationship information between the preset first additional verification information and the preset initial additional verification information. The sequence number of the preset second character includes the sequence number of the second character. The preset random factor includes the random factor. The preset first additional verification information includes the first additional verification information. The preset initial additional verification information includes the initial additional verification information.
[0184] The acquisition submodule is also used to obtain the second character corresponding to the sequence number of the second character from the key, as the second additional verification information;
[0185] The combination submodule is also used to combine the random factor, the first additional verification information, and the second additional verification information to obtain the target additional verification information.
[0186] Based on this, in some embodiments, the acquisition submodule may include:
[0187] The acquisition unit is used to randomly acquire the first target character from the key, which is used as the first character of the random factor.
[0188] The determining unit is used to determine the sequence number of the nth first character of the random factor according to the initial additional verification information and the first first character, and according to the second preset relationship information. The second preset relationship information includes the relationship information between the preset initial additional verification information and the preset first character. The preset first character includes the first character, and n is a positive integer greater than 1.
[0189] The acquisition unit is also used to acquire the nth first character corresponding to the sequence number of the nth first character from the key, and use it as the nth first character of the random factor.
[0190] Based on this, in some embodiments, determining the submodule may include:
[0191] The determining unit is used to determine the sequence number of the first third additional verification information and the first second character according to the first preset relationship information based on the initial additional verification information and the first first character of the random factor.
[0192] The determining unit is further configured to determine the sequence number of the (m+1)th third additional verification information and the (m+1)th second character according to the first preset relationship information based on the m-th third additional verification information and the (m+1)th first character of the random factor, and determine the (m+1)th third additional verification information as the first additional verification information when the sequence number of the (m+1)th second character is the target value, where m is a positive integer and n≥m+1;
[0193] The submodule can be specifically used for:
[0194] The second character corresponding to the sequence number of the second character from the first to the mth second character is obtained from the key and used as the second additional verification information.
[0195] Each module of the service request information transmission device provided in this application embodiment can realize the functions of each step of the service request information transmission method provided above, and can achieve its corresponding technical effects. For the sake of brevity, it will not be described in detail here.
[0196] Based on the same inventive concept, embodiments of this application also provide an electronic device.
[0197] Figure 8 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.
[0198] An electronic device may include a processor 801 and a memory 802 storing computer program instructions.
[0199] Specifically, the processor 801 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0200] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 802 may include removable or non-removable (or fixed) media. Where appropriate, memory 802 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 802 is non-volatile solid-state memory.
[0201] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.
[0202] The processor 801 reads and executes computer program instructions stored in the memory 802 to implement any of the service request information transmission methods in the above embodiments.
[0203] In one example, the electronic device may also include a communication interface 803 and a bus 810. For example, Figure 8 As shown, the processor 801, memory 802, and communication interface 803 are connected through bus 810 and complete communication with each other.
[0204] The communication interface 803 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0205] Bus 810 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Linear Predictive Coding (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (Peripheral Component Interconnect-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VESA Local Bus, VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 810 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application contemplates any suitable bus or interconnection. The electronic device can execute the service request information transmission method described in the embodiments of the present invention, thereby implementing the service request information transmission method described above.
[0206] Furthermore, in conjunction with the service request information transmission method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the service request information transmission methods in the above embodiments.
[0207] This application also provides a computer program product, wherein the instructions in the computer program product, when executed by the processor of an electronic device, cause the electronic device to perform various processes implementing any of the above-described embodiments of the service request information transmission method.
[0208] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0209] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0210] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0211] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, 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, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0212] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for transmitting service request information, characterized in that, Applied to gateways, including: The system receives a first service request information sent by a target device. The first service request information includes target additional verification information and a second service request information. The target additional verification information is information encrypted by the target device using a preset encryption algorithm with a first timestamp. The first timestamp is the timestamp at which the target device receives the second service request information. The target additional verification information is decrypted using a preset decryption algorithm to obtain the first timestamp, and the second timestamp when the decryption is completed is obtained. If the difference between the first timestamp and the second timestamp is less than a first preset value, and the target additional verification information is inconsistent with the pre-stored additional verification information, the second service request information is sent to the target server. The target additional verification information includes a random factor, first additional verification information, and second additional verification information. The second additional verification information includes m second characters. The step of decrypting the target additional verification information using a preset decryption algorithm to obtain the first timestamp includes: The m second characters are matched with preset characters in the key stored in the gateway to determine the sequence number of the m second characters. The key includes preset characters and the sequence number corresponding to the preset characters, where m is a positive integer. Based on the sequence numbers of the m second characters, the random factor, and the first additional verification information, the initial additional verification information is determined according to the first preset relationship information. The first preset relationship information includes the relationship information of the sequence number of the preset second character, the preset random factor, the preset first additional verification information, and the preset initial additional verification information. The sequence number of the preset second character includes the sequence number of the second character. The preset random factor includes the random factor. The preset first additional verification information includes the first additional verification information. The preset initial additional verification information includes the initial additional verification information. According to the preset combination information, the initial additional verification information is split to obtain the first timestamp. The initial additional verification information includes a random number of preset length and the first timestamp. The random factor includes m+1 first characters. The step of determining initial additional verification information according to the sequence numbers of the m second characters, the random factor, and the first additional verification information, based on a first preset relationship information, includes: Based on the (m+1)th first character and the first additional verification information, determine the mth third additional verification information according to the first preset relationship information; Based on the sequence number of the m-th second character, the m-th first character, and the m-th third additional verification information, determine the (m-1)-th third additional verification information according to the first preset relationship information; In the case of determining the first third additional verification information, the initial additional verification information is determined according to the first preset relationship information based on the sequence number of the first second character, the first first character, and the first third additional verification information.
2. The method for transmitting service request information according to claim 1, characterized in that, Before sending the second service request information to the target server, if the difference between the first timestamp and the second timestamp is less than a first preset value, and the target additional verification information is inconsistent with the additional verification information in the cache module, the method further includes: Calculate the difference between the first timestamp and the second timestamp; Verify whether the difference is less than the first preset value to obtain the verification result; If the verification result is that the difference between the first timestamp and the second timestamp is less than a first preset value, then verify whether the target additional verification information is inconsistent with the additional verification information in the cache module.
3. The method for transmitting service request information according to claim 2, characterized in that, Also includes: If the target additional verification information is inconsistent with the pre-stored additional verification information, the target additional verification information is saved.
4. A method for transmitting service request information, characterized in that, Applied to target devices, including: Upon receiving the second service request information, obtain the first timestamp of receiving the second service request information; The first timestamp is encrypted using a preset encryption algorithm to obtain target additional verification information; Send a first service request message to the gateway. The first service request message includes the target additional verification information and the second service request message. The gateway uses a preset decryption algorithm to decrypt the target additional verification information to obtain the first timestamp and obtain the second timestamp when the decryption is completed. If the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the pre-stored additional verification information, send the second service request message to the target server. The step of encrypting the first timestamp using a preset encryption algorithm to obtain target additional verification information includes: Get a random number with a preset number of digits; According to the preset combination information, the preset number of random bits and the first timestamp are combined to obtain the initial additional verification information; The first character is obtained from the key stored in the target device as a random factor. The key includes a preset character and a sequence number corresponding to the preset character. The preset character includes the first character. Based on the initial additional verification information and the random factor, the sequence number of the first additional verification information and the second character is determined according to the first preset relationship information. The first preset relationship information includes the relationship information of the preset second character sequence number, the preset random factor, the preset first additional verification information and the preset initial additional verification information. The preset second character sequence number includes the second character sequence number. The preset random factor includes the random factor. The preset first additional verification information includes the first additional verification information. The preset initial additional verification information includes the initial additional verification information. The second character corresponding to the sequence number of the second character is obtained from the key and used as the second additional verification information; The random factor, the first additional verification information, and the second additional verification information are combined to obtain the target additional verification information; The step of determining the sequence number of the first additional verification information and the second character according to the first preset relationship information based on the initial additional verification information and the random factor includes: Based on the initial additional verification information and the first character of the random factor, the sequence number of the first third additional verification information and the first second character is determined according to the first preset relationship information; Based on the m-th third additional verification information and the (m+1)-th first character of the random factor, the sequence number of the (m+1)-th third additional verification information and the (m+1)-th second character is determined according to the first preset relationship information. If the sequence number of the (m+1)-th second character is the target value, the (m+1)-th third additional verification information is determined as the first additional verification information, where m is a positive integer and n≥m+1. The step of retrieving the second character corresponding to the sequence number of the second character from the key as the second additional verification information includes: The second characters corresponding to the sequence numbers of the first to the mth second characters are obtained from the key and used as the second additional verification information.
5. The method for transmitting service request information according to claim 4, characterized in that, The step of obtaining the first character from the key stored in the target device as a random factor includes: The first target character is randomly selected from the key and used as the first character of the random factor; Based on the initial additional verification information and the first first character, the sequence number of the nth first character of the random factor is determined according to the second preset relationship information. The second preset relationship information includes the relationship information between the preset initial additional verification information and the preset first character. The preset first character includes the first character, and n is a positive integer greater than 1. The nth first character corresponding to the sequence number of the nth first character is obtained from the key and used as the nth first character of the random factor.
6. A device for transmitting service request information, characterized in that, Applied to gateways, including: The receiving module is used to receive first service request information sent by the target device. The first service request information includes target additional verification information and second service request information. The target additional verification information is information encrypted by the target device using a preset encryption algorithm with a first timestamp. The first timestamp is the timestamp at which the target device receives the second service request information. The decryption module is used to decrypt the target additional verification information using a preset decryption algorithm to obtain the first timestamp and obtain the second timestamp when the decryption is completed. The sending module is used to send the second service request information to the target server when the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the pre-stored additional verification information. The target additional verification information includes a random factor, first additional verification information, and second additional verification information. The second additional verification information includes m second characters. The decryption module includes: The determining unit is used to match the m second characters with preset characters in the key stored in the gateway to determine the sequence number of the m second characters. The key includes preset characters and the sequence number corresponding to the preset characters, where m is a positive integer. The determining unit is further configured to determine initial additional verification information according to the sequence number of the m second characters, the random factor, and the first additional verification information, based on a first preset relationship information. The first preset relationship information includes the relationship information of the sequence number of the preset second characters, the preset random factor, the preset first additional verification information, and the preset initial additional verification information. The sequence number of the preset second characters includes the sequence number of the second characters, the preset random factor includes the random factor, the preset first additional verification information includes the first additional verification information, and the preset initial additional verification information includes the initial additional verification information. The determining unit is further configured to split the initial additional verification information according to the preset combination information to obtain the first timestamp, wherein the initial additional verification information includes a random number of preset length and the first timestamp; The random factor includes m+1 first characters, and the determining unit is used for: Based on the (m+1)th first character and the first additional verification information, determine the mth third additional verification information according to the first preset relationship information; Based on the sequence number of the m-th second character, the m-th first character, and the m-th third additional verification information, determine the (m-1)-th third additional verification information according to the first preset relationship information; In the case of determining the first third additional verification information, the initial additional verification information is determined according to the first preset relationship information based on the sequence number of the first second character, the first first character, and the first third additional verification information.
7. A device for transmitting service request information, characterized in that, Applied to target devices, including: The acquisition module is used to acquire the first timestamp of receiving the second business request information when the second business request information is received. The encryption module is used to encrypt the first timestamp using a preset encryption algorithm to obtain target additional verification information; The sending module is used to send a first service request information to the gateway. The first service request information includes the target additional verification information and the second service request information. The gateway uses a preset decryption algorithm to decrypt the target additional verification information to obtain the first timestamp and obtain the second timestamp when the decryption is completed. If the difference between the first timestamp and the second timestamp is less than a first preset value and the target additional verification information is inconsistent with the pre-stored additional verification information, the second service request information is sent to the target server. The encryption module includes: The `get` submodule is used to obtain a random number of a preset number of digits. The combination submodule is used to combine the preset number of random bits and the first timestamp according to the preset combination information to obtain initial additional verification information; The acquisition submodule is further configured to acquire a first character from the key stored in the target device as a random factor. The key includes a preset character and a sequence number corresponding to the preset character. The preset character includes the first character. The determination submodule is used to determine the sequence number of the first additional verification information and the second character according to the initial additional verification information and the random factor, and according to the first preset relationship information. The first preset relationship information includes the sequence number of the preset second character, the preset random factor, the relationship information between the preset first additional verification information and the preset initial additional verification information. The sequence number of the preset second character includes the sequence number of the second character. The preset random factor includes the random factor. The preset first additional verification information includes the first additional verification information. The preset initial additional verification information includes the initial additional verification information. The acquisition submodule is further configured to acquire the second character corresponding to the sequence number of the second character from the key, as the second additional verification information; The combination submodule is further configured to combine the random factor, the first additional verification information and the second additional verification information to obtain the target additional verification information; The determining submodule includes: The determining unit is used to determine the sequence number of the first third additional verification information and the first second character according to the first preset relationship information based on the initial additional verification information and the first first character of the random factor; The determining unit is further configured to determine the sequence number of the (m+1)th third additional verification information and the (m+1)th first character of the random factor according to the first preset relationship information, and determine the (m+1)th third additional verification information as the first additional verification information when the sequence number of the (m+1)th second character is the target value, wherein m is a positive integer and n≥m+1; The acquisition submodule is also used for: The second characters corresponding to the sequence numbers of the first to the mth second characters are obtained from the key and used as the second additional verification information.
8. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the method for transmitting service request information as described in any one of claims 1-3, or the method for transmitting service request information as described in any one of claims 4-5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the method for transmitting service request information as described in any one of claims 1-3, or the method for transmitting service request information as described in any one of claims 4-5.
10. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device is able to perform the service request information transmission method as described in any one of claims 1-3, or the service request information transmission method as described in any one of claims 4-5.
Citation Information
Patent Citations
Method, device and system for preventing replay attack
CN114499995A