Data transmission method and device based on request message

By generating a current key to encrypt the message to be transmitted, and then using a public key and obfuscation encryption to double-encrypt the key, the security problem of data transmission in non-HTTP protocol environments is solved, and the security and integrity of data transmission are achieved.

CN119484137BActive Publication Date: 2025-12-12AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411709801.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-12-12
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

In non-HTTP protocol environments, existing technologies cannot effectively ensure the security of data transmission, especially in internal networks, local networks, areas with limited hardware, software, or technical conditions, temporary locations, or areas with restricted internet access. Data transmission via HTTP is impossible in these environments, and sensitive information contained in POST messages cannot be transmitted securely.

Method used

The data transmission method based on request messages is adopted. The current key is generated to encrypt the message to be transmitted. The key is double-encrypted using public key and obfuscation encryption. The message packet is generated and sent to the server. The server decrypts the message and verifies the data integrity using the private key.

Benefits of technology

It improves the security of data transmission, prevents key leakage, ensures the integrity of transmitted content, prevents illegal tampering, prevents replay attacks, and enhances the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484137B_ABST
    Figure CN119484137B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data transmission method and device based on a request message. The method is applied to a client and includes: obtaining a to-be-transmitted message and generating a current key; performing encryption processing on the to-be-transmitted message according to the current key to obtain a message ciphertext digest; wherein the message ciphertext digest represents digest information of the encrypted to-be-transmitted message; performing encryption processing on the current key based on preset public key information to obtain ciphertext information of the current key; performing packing processing on the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message to obtain a message packet, and sending the message packet to a server. The method can effectively improve the security of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data transmission, and particularly relates to a data transmission method and device based on a request message. BACKGROUND

[0002] Hypertext Transfer Protocol (HTTP for short) is a simple request-response protocol, and data can be transmitted to a server safely through the HTTP protocol in general cases.

[0003] However, in some specific cases, data cannot be transmitted through the HTTP protocol, such as internal network or local network transmission, software and hardware or technical condition limitation, temporary or one-time data transmission, and Internet connection limited areas.

[0004] Therefore, how to realize safe data transmission in a non-HTTP protocol environment during data transmission is a problem to be solved at present. SUMMARY

[0005] Embodiments of the present application provide a data transmission method and device based on a request message, to improve the safety during data transmission.

[0006] In a first aspect, the embodiments of the present application provide a data transmission method based on a request message, comprising:

[0007] obtaining a to-be-transmitted message, and generating a current key;

[0008] encrypting the to-be-transmitted message according to the current key to obtain a message ciphertext digest; wherein the message ciphertext digest represents the digest information of the encrypted to-be-transmitted message;

[0009] encrypting the current key based on preset public key information to obtain ciphertext information of the current key;

[0010] packing the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message to obtain a message package, and sending the message package to a server.

[0011] In a second aspect, the embodiments of the present application provide a data transmission method based on a request message, comprising:

[0012] receive a packet from a client; wherein the packet is used to represent obtaining a to-be-transmitted message, and generating a current key; perform encryption processing on the to-be-transmitted message according to the current key, to obtain a message ciphertext digest; wherein the message ciphertext digest represents digest information of the encrypted to-be-transmitted message; perform encryption processing on the current key based on preset public key information, to obtain ciphertext information of the current key; perform packet processing on the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message, to obtain a packet, and send the packet to a server;

[0013] perform decryption processing on the ciphertext information of the current key in the packet according to preset private key information, to obtain the current key; wherein the preset private key information and the preset public key information correspond to each other;

[0014] perform encryption processing on the encrypted to-be-transmitted message according to a preset digest encryption algorithm, to obtain to-be-verified ciphertext;

[0015] if the to-be-verified ciphertext and the message ciphertext digest are consistent, perform decryption processing on the encrypted to-be-transmitted message according to the current key, to obtain the to-be-transmitted message.

[0016] In a third aspect, the present application provides a data transmission device based on a request packet, comprising:

[0017] an obtaining module, configured to obtain a to-be-transmitted message, and generate a current key;

[0018] a first encryption module, configured to perform encryption processing on the to-be-transmitted message according to the current key, to obtain a message ciphertext digest; wherein the message ciphertext digest represents digest information of the encrypted to-be-transmitted message;

[0019] a second encryption module, configured to perform encryption processing on the current key based on preset public key information, to obtain ciphertext information of the current key;

[0020] a packet processing module, configured to perform packet processing on the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message, to obtain a packet, and send the packet to a server.

[0021] In a fourth aspect, the present application provides a data transmission device based on a request packet, comprising:

[0022] The receiving module is configured to receive a message packet from a client, wherein the message packet is used to represent obtaining a to-be-transmitted message, generating a current key, performing encryption processing on the to-be-transmitted message according to the current key to obtain a message ciphertext digest, wherein the message ciphertext digest represents digest information of the encrypted to-be-transmitted message, performing encryption processing on the current key based on preset public key information to obtain ciphertext information of the current key, performing packet processing on the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message to obtain the message packet, and sending the message packet to a server.

[0023] The first decryption module is configured to perform decryption processing on the ciphertext information of the current key in the message packet according to preset private key information to obtain the current key, wherein the preset private key information and the preset public key information correspond to each other.

[0024] The second decryption module is configured to perform encryption processing on the encrypted to-be-transmitted message according to a preset digest encryption algorithm to obtain to-be-verified ciphertext.

[0025] The verification module is configured to, if the to-be-verified ciphertext and the message ciphertext digest are consistent, perform decryption processing on the encrypted to-be-transmitted message according to the current key to obtain the to-be-transmitted message.

[0026] In a fifth aspect, an embodiment of the present application provides an electronic device, including a memory and a processor.

[0027] The memory stores computer execution instructions.

[0028] The processor executes the computer execution instructions stored in the memory, so that the processor executes the first aspect and / or various possible implementation manners of the first aspect.

[0029] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the first aspect and / or various possible implementation manners of the second aspect.

[0030] In a seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the first aspect and / or various possible implementation manners of the first aspect.

[0031] The embodiment of the present application provides a data transmission method and device based on a request message. When a client obtains a to-be-transmitted message, a current key is first generated; then the to-be-transmitted message is encrypted according to the current key, to obtain a message content ciphertext, that is, an encrypted to-be-transmitted message; based on a digest encryption algorithm, a message ciphertext digest is obtained according to the message content ciphertext; again, the current key is encrypted based on preset public key information, to obtain a symmetric encryption key ciphertext, and the symmetric encryption key ciphertext is processed by confusion, to obtain ciphertext information of the current key; finally, the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged, to obtain a message package, and the message package is sent to a server. The method encrypts the message by using the key, and double-encrypts the key by using the public key and confusion encryption, so that the key is prevented from being leaked, and the security of data transmission is effectively improved. BRIEF DESCRIPTION OF DRAWINGS

[0032] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0033] Figure 1 A flowchart of a data transmission method based on a request message provided by the present application is shown in the figure;

[0034] Figure 2 A flowchart of a data transmission method based on a request message provided by the present application is shown in the figure;

[0035] Figure 3 A flowchart of a data transmission method based on a request message provided by the present application is shown in the figure;

[0036] Figure 4 A flowchart of a data transmission method based on a request message provided by the present application is shown in the figure;

[0037] Figure 5 A flowchart of a data transmission method based on a request message provided by the present application is shown in the figure;

[0038] Figure 6 A structural diagram of a data transmission device based on a request message provided by the present application is shown in the figure;

[0039] Figure 7 A structural diagram of a data transmission device based on a request message provided by the present application is shown in the figure;

[0040] Figure 8 A structural diagram of a data transmission device based on a request message provided by the present application is shown in the figure;

[0041] Figure 9A structure schematic diagram of a data transmission device based on a request message is provided in the present application.

[0042] Figure 10 A structure schematic diagram of a data transmission device based on a request message is provided in the present application.

[0043] The specific embodiments of the present application have been shown in the above-described drawings, and will be described in more detail hereinafter. These drawings and the written description are not intended to restrict the scope of the present application concept in any way, but to illustrate the present application concept to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0044] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The same numbers are used in different drawings to represent the same or similar elements. The embodiments described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.

[0045] In the technical solution of the present application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information comply with relevant laws and regulations and do not violate public order and good customs.

[0046] First, the terms involved in the present application are explained:

[0047] Post message: It is a request message in the http protocol. In the http protocol, the request message is composed of three parts: request line, request header and request body. The post method is used to submit data to the destination server and has a specific request body.

[0048] Timestamp: It is a time stamp, which is a complete and verifiable data that can indicate that a piece of data has existed before a certain time. It is usually a character sequence and is used to uniquely identify a time.

[0049] Nonce: In cryptography, nonce is the abbreviation of number once, which refers to an arbitrary or non-repeating random number value that is used only once. It plays an important role in the initial vector and encryption hash function in encryption technology, which is used to ensure that the verification information is not reused to resist replay attacks.

[0050] Based on the description of the data transmission method in the background art, in the prior art, generally, data can be transmitted to the server securely through the http protocol. To solve the security problem in data transmission, a key is generated on the server side and then transmitted to the client side, so as to encrypt the data. However, in a non-http scenario, there is a risk of key leakage.

[0051] In addition, in some specific cases, such as internal network or local network transmission, software and hardware or technical condition limitation, temporary or one-time data transmission, and limited internet connection area, data cannot be transmitted through the http protocol. Secondly, the post message content contains sensitive information or classified content, such as user sensitive information, user authentication information (account, password), etc. Or the post message contains submission content that is difficult to solve by parameterization or needs to be prevented from being scanned by security penetration tools, and data cannot be transmitted through the http protocol.

[0052] The application provides a data transmission method based on a request message, relating to the field of data transmission, and particularly to a data transmission method and device based on a request message, aiming to solve the above technical problems in the prior art.

[0053] The technical solutions of the application and how the technical solutions solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described again in some embodiments. The embodiments of the application will be described below with reference to the drawings.

[0054] Figure 1 A flowchart of a data transmission method based on a request message provided by the application is shown in the figure. The method is applied to a client, such as Figure 1 As shown in the figure, the method comprises the following steps.

[0055] S101, obtaining a to-be-transmitted message and generating a current key.

[0056] Exemplarily, the message represents information for http protocol interaction, the request message is composed of a request line, a request header and a request body, and is used to exchange information when requesting between systems, and the key is a password or code used for encrypting and decrypting data, wherein the key is a symmetric encryption key, for example, the client is provided with an encryption module, before transmitting the http post message, the encryption module of the transmission client first generates a 32-bit unique string, and uses the string to generate a symmetric encryption key through an AES-256 encryption algorithm, and the key is generated in a "one-time pad" manner, wherein the method for generating the symmetric encryption key includes but is not limited to AES-256 and the like, wherein "one-time pad" means that a new symmetric encryption key is generated each time the request message is transmitted.

[0057] The beneficial effect of such setting is that the key is generated in a "one-time pad" manner at the client, which can avoid leakage of the key and improve the security of data transmission.

[0058] S102, according to the current key, the to-be-transmitted message is encrypted to obtain a message ciphertext digest; wherein the message ciphertext digest represents the digest information of the encrypted to-be-transmitted message.

[0059] Exemplarily, the message ciphertext digest represents the digest information of the encrypted to-be-transmitted message, the current key is a symmetric encryption key, which is used to encrypt data at the client, and the encrypted to-be-transmitted message represents the message content ciphertext generated after the message content is encrypted using the symmetric encryption key. For example, the client is provided with an encryption module and a digest module, after obtaining the to-be-transmitted message, the symmetric encryption key is first generated in the encryption module of the client, then the message content is encrypted using the key to generate the message content ciphertext, and the digest module of the client generates the digest information of the ciphertext based on a preset message digest algorithm according to the generated message content ciphertext, that is, the message ciphertext digest is obtained. The digest information exists in the form of a string and is used to encrypt the message content ciphertext. In this embodiment, the preset message digest algorithm is not specifically limited.

[0060] The beneficial effect of such setting is that the encryption module and the digest module are used to encrypt the message, which is conducive to improving the security of data transmission and ensuring the integrity of the transmission content.

[0061] In this embodiment, the to-be-transmitted message is encrypted according to the current key to obtain a message ciphertext digest, including: the to-be-transmitted message is encrypted according to the current key to obtain an encrypted to-be-transmitted message; and the encrypted to-be-transmitted message is encrypted according to a preset digest encryption algorithm to obtain a message ciphertext digest.

[0062] Exemplarily, the message represents information for http protocol interaction, and is used for exchanging information when making a request between systems. The encrypted message to be transmitted is message content ciphertext. The key is a password or code used for encrypting and decrypting data. The key is a symmetric encryption key. The client is provided with an encryption module and a digest module. The encryption module is used to generate a symmetric encryption key, and encrypt the message content using the symmetric key to generate message content ciphertext. The digest module is used to generate digest information of the message content ciphertext, i.e., message ciphertext digest, according to the incoming message content ciphertext. The digest information is in the form of a string, and is used to encrypt the message content ciphertext. For example, after obtaining the message to be transmitted, the message content is first encrypted using the current key to generate message content ciphertext. The current key refers to the symmetric encryption key generated by the client and used to encrypt the message content. Then, the digest module of the client generates digest information, i.e., message ciphertext digest, based on the message content ciphertext obtained according to a message digest algorithm. The message digest algorithm used to generate the string includes, but is not limited to, SHA-256 algorithm, SHA-1 algorithm, MD5 algorithm, and the like.

[0063] The beneficial effect of such an arrangement is that the digest module is used to generate the content ciphertext digest string, which is beneficial to ensuring the integrity of the transmitted content and preventing illegal tampering.

[0064] S103, encrypting the current key based on the preset public key information to obtain ciphertext information of the current key.

[0065] Exemplarily, the key is a password or code used for encrypting and decrypting data. The key is a symmetric encryption key. The public key is used to encrypt the symmetric key at the client. The client is provided with an asymmetric key generation module, a secure key module, and a confusion module. The asymmetric key generation module is located at the server and is used to generate a public-private key pair required for secure transmission. The generated private key is automatically saved at the server. The distribution of the public key is completed through the number information of the client. The number information is a unique identifier of the client. The public key and the number information are both preset in the client and correspond to each other. The public key can find the corresponding client according to the number information, and is finally saved in the secure key module of the client. For example, after obtaining the message to be transmitted, the message content is encrypted based on the symmetric encryption key of the client to generate message content ciphertext. The digest encryption algorithm is used to generate digest information of the message ciphertext, i.e., message ciphertext digest. The digest information refers to a string used to encrypt the message content ciphertext. The symmetric encryption key is encrypted by the public key saved at the client to obtain symmetric encryption key ciphertext. Finally, the symmetric encryption key ciphertext is subjected to confusion processing to obtain confusion symmetric encryption key ciphertext, i.e., ciphertext information of the current key.

[0066] The beneficial effect of such an arrangement is that the key is encrypted by using the public-private key pair, which is conducive to preventing key leakage and improving the security of data transmission.

[0067] S104, the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged to obtain a message package, and the message package is sent to the server.

[0068] Exemplarily, after the client obtains the to-be-transmitted message, the to-be-transmitted message is first encrypted by using the generated symmetric encryption key on the client to obtain message content ciphertext, i.e., the encrypted to-be-transmitted message. The message content ciphertext is encrypted based on a digest encryption algorithm to generate digest information of the message content ciphertext, where the digest information refers to a string used for encrypting the message content ciphertext, i.e., the message ciphertext digest. Then, the symmetric encryption key is encrypted by using the public key stored on the client to obtain symmetric encryption key ciphertext. After the symmetric encryption key ciphertext is obfuscated, the ciphertext information of the current key is obtained. The ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged to obtain a message package, and the message package is transmitted to the server. The message package can include the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, a timestamp, and a random number. After the server receives the message package, the server first verifies the validity of the timestamp and the random number. If the timestamp and the random number are invalid, the server sends processing result information to the client. If the timestamp and the random number are valid, the server first performs anti-obfuscation processing on the ciphertext information of the current key to obtain symmetric encryption key ciphertext. Then, the symmetric encryption key ciphertext is decrypted by using the private key of the server to obtain the message ciphertext digest. The encrypted to-be-transmitted message obtained by disassembling is encrypted by using the digest encryption algorithm to obtain to-be-verified ciphertext. The to-be-verified ciphertext is compared with the message ciphertext digest for consistency. If the to-be-verified ciphertext and the message ciphertext digest are inconsistent, the server sends processing result information to the client. If the to-be-verified ciphertext and the message ciphertext digest are consistent, the encrypted to-be-transmitted message is decrypted by using the current key of the server to finally obtain message content plaintext.

[0069] The beneficial effect of such an arrangement is that the data is encrypted in a multi-layer encryption manner, which is conducive to improving the security of data transmission.

[0070] The embodiment of the application provides a data transmission method and device based on a request message. When a client obtains a to-be-transmitted message, a current key is first generated; then, the to-be-transmitted message is encrypted according to the current key, to obtain a message content ciphertext, that is, an encrypted to-be-transmitted message; according to the message content ciphertext, a message ciphertext digest is obtained based on a digest encryption algorithm; again, the current key is encrypted based on preset public key information, to obtain a symmetric encryption key ciphertext, the symmetric encryption key ciphertext is subjected to confusion processing, to obtain ciphertext information of the current key; finally, the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are subjected to packing processing, to obtain a message package, and the message package is sent to a server. The method encrypts the message by using the key, and double-encrypts the key by using the public key and confusion encryption, so that the leakage of the key is prevented, and the security of data transmission is effectively improved.

[0071] Figure 2 A flowchart of a data transmission method based on a request message provided by the application is shown in FIG. 1. Figure 2 The method comprises the following steps.

[0072] S201, a to-be-transmitted message is obtained, and a current key is generated.

[0073] This step can refer to step S101 described above, and will not be described here.

[0074] S202, the to-be-transmitted message is encrypted according to the current key, to obtain a message ciphertext digest; wherein the message ciphertext digest represents digest information of the encrypted to-be-transmitted message.

[0075] This step can refer to step S102 described above, and will not be described here.

[0076] S203, the current key is encrypted based on preset public key information, to obtain an encrypted current key.

[0077] Exemplarily, the public key is generated at the server, distributed to the corresponding client according to the numbering information, and stored in the client, and used for encrypting the symmetric encryption key generated by the client, wherein the symmetric encryption key is the current key, and the numbering information is the unique identifier of the client, and the numbering information is contained in the client and the public key and corresponds one-to-one, and the client is preconfigured with an asymmetric key generation module and a secure key module, wherein the asymmetric key generation module generates a public-private key pair required for secure transmission at the server based on an asymmetric encryption algorithm, and the asymmetric encryption algorithm for generating the public-private key pair includes but is not limited to RSA, ECC, SM2, etc. For example, after obtaining the to-be-transmitted message, the client encrypts the to-be-transmitted message by using the current key to generate message content ciphertext, generates digest information of the message content ciphertext by using a digest encryption algorithm, that is, obtains message ciphertext digest, encrypts the generated symmetric encryption key by using the public key stored in the client to obtain symmetric encryption key ciphertext, that is, the encrypted current key.

[0078] The beneficial effect of such an arrangement is that it facilitates the prevention of key leakage during transmission and improves the security of data transmission.

[0079] S204, the encrypted current key is obfuscated to obtain ciphertext information of the current key.

[0080] Exemplarily, the current key is the symmetric encryption key generated by the client, and the client is preconfigured with an obfuscation module for preventing collision attacks and further protecting the security of the symmetric encryption key, wherein the obfuscation method includes but is not limited to string bit transformation, random bit insertion and reduction, etc. The obfuscation module is divided into two types: a client obfuscation module and a server obfuscation module. The client obfuscation module is used for obfuscating the symmetric encryption key ciphertext to generate obfuscated symmetric encryption key ciphertext. For example, after obtaining the to-be-transmitted message, the client encrypts the message content by using the symmetric encryption key to obtain message content ciphertext, encrypts the message content ciphertext based on a digest encryption algorithm to generate digest information of the message content ciphertext, that is, obtains message ciphertext digest, and then encrypts the current key by using the public key stored in the client to obtain symmetric encryption key ciphertext, that is, the encrypted current key. The encrypted current key is obfuscated to obtain ciphertext information of the current key.

[0081] The beneficial effect of such an arrangement is that it facilitates the prevention of collision attacks and further protects the security of the symmetric encryption key.

[0082] The embodiment of the application provides a data transmission method and device based on a request message. When a client obtains a to-be-transmitted message, a current key is first generated; then, the to-be-transmitted message is encrypted based on the current key, to obtain a message content ciphertext, that is, an encrypted to-be-transmitted message; based on the message content ciphertext, a message ciphertext digest is obtained based on a digest encryption algorithm; again, the current key is encrypted based on preset public key information, to obtain a symmetric encryption key ciphertext, the symmetric encryption key ciphertext is subjected to confusion processing, to obtain ciphertext information of the current key; finally, the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are subjected to packing processing, to obtain a message package, and the message package is sent to a server. The method encrypts the message by using the key, and double-encrypts the key by using the public key and confusion encryption, so that the leakage of the key is prevented, and the security of data transmission is effectively improved.

[0083] Figure 3 A flowchart of a data transmission method based on a request message provided by the application is shown in FIG. 1. Figure 3 The method comprises the following steps.

[0084] S301, a to-be-transmitted message is obtained, and a current key is generated.

[0085] This step can refer to step S201, and details are not repeated.

[0086] S302, the to-be-transmitted message is encrypted based on the current key, to obtain a message ciphertext digest; wherein the message ciphertext digest represents digest information of the encrypted to-be-transmitted message.

[0087] This step can refer to step S202, and details are not repeated.

[0088] S303, the current key is encrypted based on preset public key information, to obtain ciphertext information of the current key.

[0089] This step can refer to step S303, and details are not repeated.

[0090] S304, a time stamp and a random number are generated.

[0091] Exemplarily, the timestamp is a complete and verifiable data capable of indicating that a piece of data has existed before a certain time, usually a character sequence, for uniquely identifying a moment of time, and the random number is an arbitrary or non-repeating random number value used only once, for ensuring that the verification information is not reused to resist replay attacks. For example, after the client obtains the to-be-transmitted message, the to-be-transmitted message and the current key are encrypted, and finally the obfuscated symmetric encryption key ciphertext, i.e., the ciphertext information of the current key, is obtained. Then, the timestamp and the random number of this transmission are generated in the client, for preventing the content of each message from being attacked by replay attacks. The system contains a replay prevention module, which is divided into a client-side replay prevention module and a server-side replay prevention module. The client-side replay prevention module is used to generate the timestamp and the random number, and the server-side replay prevention module is used to verify the validity of the timestamp and the random number.

[0092] The beneficial effect of such an arrangement is that it facilitates preventing messages from being attacked by replay attacks and improves the security of data transmission.

[0093] S305, the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number are packaged to obtain a message package.

[0094] Exemplarily, after the client obtains the to-be-transmitted message, the message is first encrypted by using the symmetric encryption key generated by the client to obtain the message content ciphertext, i.e., the encrypted to-be-transmitted message. The message content ciphertext is encrypted based on a digest encryption algorithm to generate the digest information of the message content ciphertext, i.e., to obtain the message ciphertext digest, wherein the digest information refers to a string used for encrypting the message content ciphertext. Then, the symmetric encryption key is encrypted by using the public key stored in the client to obtain the symmetric encryption key ciphertext, wherein the symmetric encryption key is the current key. The symmetric encryption key ciphertext is obfuscated and encrypted to obtain the obfuscated symmetric encryption key ciphertext, i.e., the ciphertext information of the current key. Finally, the client generates the timestamp and the random number of this transmission, and packages the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number to obtain a message package.

[0095] The beneficial effect of such an arrangement is that the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number are packaged and sent to the server, which facilitates improving the security of data transmission.

[0096] The embodiment of the present application provides a data transmission method and device based on a request message. When a client obtains a to-be-transmitted message, a current key is first generated; then the to-be-transmitted message is encrypted based on the current key, to obtain a message content ciphertext, that is, an encrypted to-be-transmitted message; based on the message content ciphertext, a message ciphertext digest is obtained based on a digest encryption algorithm; again, the current key is encrypted based on preset public key information, to obtain a symmetric encryption key ciphertext, and the symmetric encryption key ciphertext is processed by confusion, to obtain ciphertext information of the current key; finally, the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged, to obtain a message package, and the message package is sent to a server. The method encrypts the message by using the key, and double-encrypts the key by using the public key and confusion encryption, so that the leakage of the key is prevented, and the security of data transmission is effectively improved.

[0097] Figure 4 A flowchart of a data transmission method based on a request message is provided in the present application. The method is applied to a server, as shown in the figure, and the method comprises the following steps. Figure 4

[0098] S401, receiving a message package from a client; wherein the message package is used to represent that a to-be-transmitted message is obtained, a current key is generated, the to-be-transmitted message is encrypted based on the current key, to obtain a message ciphertext digest; wherein the message ciphertext digest represents digest information of the encrypted to-be-transmitted message; the current key is encrypted based on preset public key information, to obtain ciphertext information of the current key; the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged, to obtain a message package, and the message package is sent to a server.

[0099] Exemplarily, the message package comprises the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, a timestamp, and a random number. For example, after the client obtains the to-be-transmitted message, the message content is encrypted by using the current key to obtain a message content ciphertext, the message content ciphertext is encrypted based on a digest encryption algorithm, to obtain a message ciphertext digest, the current key is double-encrypted by using a public key and a confusion module stored by the client, to obtain ciphertext information of the current key, finally, a timestamp and a random number of this transmission are generated by the client, and the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number are packaged, to obtain a message package, the message package is transmitted to a server, and the server sequentially decrypts the timestamp, the random number, the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message, to finally obtain a message content plaintext.

[0100] ​The beneficial effect of such an arrangement is that the data transmission is encrypted in a multi-encryption manner, which is conducive to improving the security during data transmission.

[0101] S402, according to the preset private key information, the ciphertext information of the current key in the message package is decrypted to obtain the current key; wherein, the preset private key information and the preset public key information correspond.

[0102] Exemplarily, the server generates a public-private key pair for encrypting the current key, wherein the public key is distributed to the client according to the number information and stored in the client, wherein the number information is the unique identifier of the client, the public key finds the corresponding client according to the number information and stores it, while the private key is directly stored in the server after being generated in the server, the private key information and the public key information correspond to each other, for example, after the client receives the to-be-transmitted message, the message and the current key are encrypted, the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp and the random number are packaged to form a message package and sent to the server, after the server receives the message package, the message package is first disassembled to obtain the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp and the random number, after verifying the validity of the timestamp and the random number, the ciphertext information of the current key is first de-obfuscated to obtain the symmetric encryption key ciphertext, the symmetric encryption key ciphertext is decrypted using the private key of the server to obtain the symmetric encryption key, that is, the current key.

[0103] The beneficial effect of such an arrangement is that the data is decrypted using the public-private key pair and the obfuscation module, which is conducive to preventing key leakage.

[0104] In this embodiment, the ciphertext information of the current key in the message package is decrypted according to the preset private key information to obtain the current key, including: the ciphertext information of the current key in the message package is de-obfuscated to obtain the encrypted current key; the encrypted current key is decrypted according to the preset private key information to obtain the current key.

[0105] Exemplarily, the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number are contained in the message packet, and the system is preconfigured with a confusion module, wherein the confusion module is divided into a client-side confusion module and a server-side confusion module, the anti-confusion processing refers to that the server performs anti-confusion operation on the confusion symmetric encryption key ciphertext to obtain the symmetric encryption key ciphertext, that is, the encrypted current key, and the public-private key pair is generated at the server, wherein the public key is distributed to the client according to the number and stored, the number information is the unique identifier of the client, the public key can find the corresponding client according to the number information and is stored in the client and used for encrypting the current key, the private key is stored at the server and used for decrypting the ciphertext information of the current key received by the server, and the public key and the private key are in one-to-one correspondence. For example, after the server obtains the message packet, the message packet is first disassembled to obtain the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number, after the timestamp and the random number are verified to be valid, the server performs anti-confusion processing on the ciphertext information of the current key to obtain the symmetric encryption key ciphertext, that is, the encrypted current key, and the encrypted current key is decrypted based on the private key stored at the server to obtain the symmetric encryption key, that is, the current key.

[0106] The beneficial effect of such arrangement is that the key is double-encrypted, which is conducive to preventing key leakage and improving the security of data transmission.

[0107] S403. According to a preconfigured digest encryption algorithm, the encrypted to-be-transmitted message is encrypted to obtain to-be-verified ciphertext.

[0108] Exemplarily, the to-be-verified ciphertext is used for consistency verification of the message ciphertext digest obtained from the client, and the client generates a content ciphertext digest string, that is, the message ciphertext digest, based on the digest encryption algorithm according to the incoming message content ciphertext. The digest encryption algorithm for generating the digest string includes but is not limited to SHA-256, SHA-1, MD5, and the like. For example, after the client obtains the to-be-transmitted message, the message content and the current key are encrypted to finally obtain the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message, and finally the client packs the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the generated timestamp, and the random number in the form of a message packet and sends the message packet to the server. After the server receives the message packet, the message packet is first disassembled, the timestamp and the random number are verified after the disassembled message packet is obtained, and then the encrypted to-be-transmitted message obtained by disassembly is encrypted at the server by using the digest encryption algorithm to obtain the to-be-verified ciphertext for verification.

[0109] The beneficial effect of such an arrangement is that the integrity of the data transmitted to the server can be verified, and the security of data transmission is improved.

[0110] S404, if the to-be-verified ciphertext and the message ciphertext digest are consistent, the encrypted to-be-transmitted message is decrypted according to the current key to obtain the to-be-transmitted message.

[0111] By way of example, the message packet is obtained by the client after packaging processing, and the message packet includes the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number. The to-be-verified ciphertext is obtained by encrypting the encrypted to-be-transmitted message obtained by the server after disassembling the message packet according to a preset digest encryption algorithm. The message ciphertext digest is obtained by encrypting the message by the client using the digest encryption algorithm. For example, after the server obtains the message packet sent by the client, the message packet is disassembled to obtain the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number. After the timestamp and the random number are verified to be valid, the ciphertext information of the current key is de-obfuscated and private key processed to obtain a symmetric encryption key, i.e., the current key. The to-be-verified ciphertext is compared with the message ciphertext digest for consistency. If they are inconsistent, the result is sent to the client for feedback. If the two kinds of ciphertexts are consistent, it indicates that the transmitted data is complete or has not been tampered with. Then, the encrypted to-be-transmitted message obtained by disassembling is decrypted using the symmetric encryption key, i.e., the current key, transmitted to the server by the client to obtain the to-be-transmitted message, and the result is sent to the client.

[0112] The beneficial effect of such an arrangement is that the integrity of the data transmitted to the server can be verified, and the security of data transmission is improved.

[0113] In the embodiment, the timestamp and the random number are obtained from the message packet. If the timestamp and the random number are determined to be valid data, the ciphertext information of the current key in the message packet is decrypted according to the preset private key information to obtain the current key.

[0114] Exemplarily, the timestamp is used to uniquely identify a moment of time, the random number is used to ensure that the verification information is not reused, the ciphertext information of the current key is obtained by encrypting the key by the public key and by the confusion processing, the private key is generated at the server and is automatically stored at the server, and is used to decrypt the symmetric encryption key ciphertext obtained by encrypting the symmetric encryption key by the public key of the client, wherein the public key and the private key are one-to-one correspondence. For example, after the client encrypts the message content and the current key, the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message, and the generated timestamp and random number are packaged to form a message packet, and are sent to the server. After the server obtains the message packet, the message packet is disassembled, the timestamp and the random number are obtained in the message packet, and the validity of the timestamp and the random number is verified first. If it is invalid, the processing result and the detailed information are sent to the client. If it is valid, the ciphertext information of the current key is first de-confused to obtain the symmetric encryption key ciphertext, the symmetric encryption key ciphertext is decrypted by the private key to obtain the symmetric encryption key, that is, the current key.

[0115] The beneficial effect of such a setting is that the setting of the timestamp and the random number facilitates preventing the message from being replayed and improves the security of data transmission.

[0116] In the embodiment, determining the timestamp and the random number as valid data comprises: obtaining a current time, and determining the timestamp as valid data if a time difference between the current time and the timestamp is less than a preset difference threshold. If the random number does not exist in a preset historical database, the random number is determined as valid data, and the random number is stored in the preset historical database; wherein the preset historical database is used to store the random numbers that have been generated.

[0117] Exemplarily, the message packet is obtained by packaging the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number of the client, the timestamp is used to uniquely identify the time at a moment, and the random number is used to ensure that the verification information is not reused to resist replay attacks, a historical database is preset in the system, the preset historical database is used to store the generated random numbers, and the historical database includes but is not limited to a key value database such as a redis database, a memcache database, and a relational database such as a mysql database. For example, after the message packet transmitted by the client to the server is obtained, the server disassembles the message packet to obtain the timestamp and the random number, validity of the timestamp is verified, a time difference threshold is preset in the system, a current time is obtained, if a time difference between the current time and the timestamp is not within the preset time difference threshold range, it is indicated that the data is invalid, and verification result information is sent to the client; if the time difference between the current time and the timestamp is within the preset time difference threshold range, it is determined that the timestamp is valid data, then validity of the random number is verified, the obtained random number is compared with the random number in the preset historical database first, if the historical database does not contain the random number, it is indicated that the random number is valid data, the ciphertext information of the current key is decrypted and processed, and the random number is stored in the historical database, otherwise, it is invalid data, and processing result information is sent to the client.

[0118] The beneficial effect of such a setting is that the security of the data is determined by judging the validity of the timestamp and the random number, thereby facilitating the improvement of the security of data transmission.

[0119] The embodiment of the application provides a data transmission method and device based on a request message. When the client obtains a to-be-transmitted message, a current key is first generated; then the to-be-transmitted message is encrypted based on the current key to obtain message content ciphertext, that is, the encrypted to-be-transmitted message, and a message ciphertext digest is obtained based on the digest encryption algorithm based on the message content ciphertext; again, the current key is encrypted based on preset public key information to obtain symmetric encryption key ciphertext, and the symmetric encryption key ciphertext is processed to obtain ciphertext information of the current key; finally, the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged to obtain a message packet, and the message packet is sent to the server. The method encrypts the message by using the key, and double-encrypts the key by using the public key and the confusion encryption, thereby preventing the leakage of the key and effectively improving the security of data transmission.

[0120] Figure 5 A whole flowchart of a data transmission method based on a request message provided by the application is shown in FIG. 1. Figure 5 The method specifically includes the following steps:

[0121] S501, the encryption module generates a symmetric encryption key using a "one-time pad" method, and the generated symmetric encryption key encrypts the plaintext content of the message to generate a message content ciphertext.

[0122] Illustratively, the client encryption module generates a symmetric encryption key using a "one-time pad" high-strength method, and encrypts the plaintext content of the message using the key, wherein "one-time pad" means that a new symmetric encryption key is generated each time the client transmits a message. First, a 32-bit unique string is generated in the client, then the string is used to generate a symmetric encryption key based on the encryption algorithm, the method of generating the symmetric encryption key includes but is not limited to AES-256 encryption algorithm, etc., and finally the key is used to encrypt the plaintext content of the message to generate a message content ciphertext.

[0123] The beneficial effect of such an arrangement is that the "one-time pad" method is used to generate the key directly in the client, avoiding key leakage and facilitating improved data transmission security.

[0124] S502, the digest module generates a content ciphertext digest string for the message content ciphertext.

[0125] Illustratively, the message content ciphertext is obtained by encrypting the message content using the symmetric encryption key of the client, and the client has a pre-set digest module, which is divided into two types: client digest module and server digest module. The client digest module generates a content ciphertext digest string based on a digest encryption algorithm according to the message content ciphertext, and the method of generating the digest string includes but is not limited to SHA-256 algorithm, SHA-1 algorithm, MD5 algorithm, etc.

[0126] The beneficial effect of such an arrangement is that it facilitates verification of the integrity of the transmitted data, ensuring the security of data transmission.

[0127] S503, the public key of the security key module encrypts the symmetric encryption key to generate a symmetric encryption key ciphertext.

[0128] Illustratively, the system has a pre-set security key module, which is divided into two types: client security key module and server security key module. The client security key module is used to access the public key in the public-private key pair generated by the server, wherein the public key is distributed to the client through the numbering information, the numbering information represents the unique identifier of the client, and the symmetric encryption key of the message content is encrypted through the public key to generate a symmetric encryption key ciphertext.

[0129] The beneficial effect of such an arrangement is that the key is encrypted using a public key, which is beneficial for preventing key leakage.

[0130] S504, the obfuscation module performs obfuscation processing on the symmetric encryption key ciphertext to generate obfuscated symmetric encryption key ciphertext.

[0131] Exemplarily, the system is provided with an obfuscation module, which is divided into a client-side obfuscation module and a server-side obfuscation module, for preventing collision attacks and further ensuring the security of the symmetric encryption key. The client-side obfuscation module is used to perform obfuscation processing on the symmetric encryption key ciphertext to generate obfuscated symmetric encryption key ciphertext.

[0132] The beneficial effect of such a setting is that the key is double-encrypted, which facilitates the security of the key, avoids key leakage, and improves the security of data transmission.

[0133] S505, the anti-replay module generates a timestamp and a random number for the current transmission.

[0134] Exemplarily, the anti-replay module is divided into a client-side anti-replay module and a server-side anti-replay module, for preventing replay attacks on the content of each message. The client-side anti-replay module is used to generate a timestamp and a random number for the current transmission, and the server-side anti-replay module is used to verify the validity of the timestamp and the random number generated by the client.

[0135] The beneficial effect of such a setting is that the timestamp and the random number are used to encrypt the data, which facilitates the security of data transmission.

[0136] S506, the obfuscated symmetric encryption key ciphertext, the message content ciphertext, the content ciphertext digest string, the timestamp, and the random number are combined to generate a message transmission body.

[0137] S507, the obfuscated symmetric encryption key ciphertext, the message content ciphertext, the content ciphertext digest string, the timestamp, and the random number are split out.

[0138] S508, the anti-replay module verifies the validity of the timestamp and the random number.

[0139] Exemplarily, after the client combines the obfuscated symmetric encryption key ciphertext, the message content ciphertext, the content ciphertext digest string, the timestamp, and the random number to generate a message transmission body, the message transmission body is transmitted to the server. The server splits out the obfuscated symmetric encryption key ciphertext, the message content ciphertext, the content ciphertext digest string, the timestamp, and the random number, and uses the server-side anti-replay module to verify the timestamp and the random number. If the verification result is invalid, the server sends a processing result notification information to the client. If the verification result is valid, the server decrypts the obfuscated symmetric encryption key ciphertext.

[0140] The beneficial effect of such a setting is that the timestamp and the random number are verified for their validity, which facilitates the security of the data.

[0141] S509, the obfuscation module de-obfuscates the obfuscated symmetric encryption key ciphertext to obtain the symmetric encryption key ciphertext.

[0142] Exemplarily, the server-side obfuscation module is configured to de-obfuscate the obfuscated symmetric encryption key ciphertext to obtain the symmetric encryption key ciphertext. The obfuscation method includes, but is not limited to, string bit transformation, random bit insertion and reduction, etc. In actual use, the obfuscation method and the de-obfuscation method in the obfuscation module can be updated regularly as needed. The obfuscation method and the de-obfuscation method are updated on the server side, and the updated obfuscation method is distributed to the client-side obfuscation module through the number information. After receiving the updated library, the client-side obfuscation module automatically implements hot update and takes effect. The hot update means updating part of the program without stopping the running of the whole program. The number information represents the unique identification of the client. The de-obfuscation method is directly updated on the server side, thereby better guaranteeing the security of data transmission.

[0143] The above arrangement has the advantage of better guaranteeing the security of data transmission.

[0144] S510, the security key module uses the private key to decrypt the symmetric encryption key ciphertext to obtain the symmetric encryption key.

[0145] Exemplarily, the security key module includes a client-side security key module and a server-side security key module. The server-side security key module is configured to access the private key of the public-private key pair generated by the server side, and decrypt the designated symmetric encryption key ciphertext through the private key to obtain the symmetric encryption key. In actual use, the public-private key pair can be generated regularly by the asymmetric key generation module as needed, and the public key and the private key of the generated public-private key pair are updated to the client-side security key module and the server-side security key module, respectively. The public key is distributed to the client through the number information, and the number information represents the unique identification of the client. The private key is automatically stored on the server after being generated on the server, thereby better improving the security of data transmission.

[0146] The above arrangement has the advantage of avoiding key leakage and better improving the security of data transmission.

[0147] S511, the digest module generates a verification content ciphertext digest string from the message content ciphertext, and judges whether the verification content ciphertext digest string is consistent with the content ciphertext digest string split from the message transmission body.

[0148] Exemplarily, the abstract module is divided into a client-side abstract module and a server-side abstract module, both of which generate a content ciphertext abstract string according to the content ciphertext of the incoming message, judge whether the verification content ciphertext abstract string generated by the server is consistent with the content ciphertext abstract string split from the message body, if not, it indicates that the message content transmission is incomplete or tampered with, and the processing result information is sent to the client, if yes, the decryption module of the server is used to decrypt the data.

[0149] The beneficial effect of such an arrangement is that the integrity of data transmission is facilitated.

[0150] S512, the server decryption module uses the symmetric encryption key to perform decryption operation to obtain the message content plaintext.

[0151] Exemplarily, the server decryption module decrypts the message content ciphertext by using the symmetric encryption key to obtain the message content plaintext, and the decryption module corresponds to the encryption module of the client.

[0152] The beneficial effect of such an arrangement is that the security of data transmission is facilitated.

[0153] Figure 6 A structure diagram of a data transmission device based on a request message provided by the present application is shown in the figure, which is applied to a client, such as Figure 6 As shown in the figure, the device 600 provided by the present embodiment comprises:

[0154] The acquisition module 601 acquires the to-be-transmitted message and generates a current key.

[0155] The first encryption module 602 is configured to encrypt the to-be-transmitted message according to the current key to obtain a message ciphertext abstract; wherein the message ciphertext abstract represents the abstract information of the encrypted to-be-transmitted message.

[0156] The second encryption module 603 encrypts the current key based on the preset public key information to obtain the ciphertext information of the current key.

[0157] The packing module 604 packs the ciphertext information of the current key, the message ciphertext abstract and the encrypted to-be-transmitted message to obtain a message package, and sends the message package to the server.

[0158] Figure 7 A structure diagram of a data transmission device based on a request message provided by the present application is shown in the figure, which is applied to a client, such as Figure 7As shown, the apparatus 700 includes an acquisition module 701, a first encryption module 702, a second encryption module 703, wherein the first encryption module 702 includes a first encryption unit 7021 and a second encryption unit 7022, the second encryption module 703 includes a third encryption unit 7031 and a confusion unit 7032, and the packing module 704 includes a generation unit 7041 and a packing unit 7042.

[0159] In one example, the first encryption module 702 includes:

[0160] The first encryption unit 7021 is configured to perform encryption processing on the to-be-transmitted message according to the current key to obtain an encrypted to-be-transmitted message.

[0161] The second encryption unit 7022 is configured to perform encryption processing on the encrypted to-be-transmitted message according to a preset digest encryption algorithm to obtain the message ciphertext digest.

[0162] In one example, the second encryption module 703 includes:

[0163] The third encryption unit 7031 is configured to perform encryption processing on the current key based on preset public key information to obtain an encrypted current key.

[0164] The confusion unit 7032 is configured to perform confusion processing on the encrypted current key to obtain ciphertext information of the current key.

[0165] In one example, the packing module 704 includes:

[0166] The generation unit 7041 is configured to generate a timestamp and a random number.

[0167] The packing unit 6042 is configured to perform packing processing on the ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number to obtain a message packet.

[0168] Figure 8 A structural schematic diagram of a data transmission apparatus based on a request message provided in the present application, the apparatus is applied to a server side, for example, Figure 8 As shown, the apparatus 800 provided in the present embodiment includes:

[0169] The receiving module 801 is configured to receive a message packet from the client; wherein the message packet represents the acquisition of a message to be transmitted and the generation of a current key; encrypting the message to be transmitted according to the current key to obtain a ciphertext digest; wherein the ciphertext digest represents the digest information of the encrypted message to be transmitted; encrypting the current key based on preset public key information to obtain ciphertext information of the current key; packaging the ciphertext information of the current key, the ciphertext digest, and the encrypted message to be transmitted into a message packet, and sending the message packet to the server;

[0170] The first decryption module 802 is used to decrypt the ciphertext information of the current key in the message packet according to the preset private key information to obtain the current key; wherein the preset private key information corresponds to the preset public key information;

[0171] The second decryption module 803 is used to encrypt the encrypted message to be transmitted according to a preset digest encryption algorithm to obtain the ciphertext to be verified.

[0172] The verification module 804 is used to decrypt the encrypted message to be transmitted according to the current key if the ciphertext to be verified is consistent with the message ciphertext digest, so as to obtain the message to be transmitted.

[0173] Figure 9 A schematic diagram of a data transmission device based on a request message provided in this application is shown below. Figure 9 As shown, the device 900 includes a receiving module 901, a first decryption module 902, a second decryption module 903, and a verification module 904. The first decryption module 902 includes a deobfuscation unit 9021, a decryption unit 9022, an acquisition unit 9023, and a determination unit 9024.

[0174] In one example, the first decryption module 902 includes:

[0175] The deobfuscation unit 9021 is used to deobfuscate the ciphertext information of the current key in the message packet to obtain the encrypted current key;

[0176] The decryption unit 9022 is used to decrypt the encrypted current key according to the preset private key information to obtain the current key.

[0177] One example also includes:

[0178] Acquisition unit 9023 is used to acquire a timestamp and a random number from the packet;

[0179] The determining unit 9024 is configured to, if it is determined that the timestamp and the random number are valid data, continue to perform the decryption processing on the ciphertext information of the current key in the message packet according to the preset private key information, to obtain the current key.

[0180] In one example, the determining unit 9024 includes:

[0181] The first determining sub-unit is configured to acquire a current time, and determine that the timestamp is valid data if a time difference between the current time and the timestamp is less than a preset difference threshold.

[0182] The second determining sub-unit is configured to determine that the random number is valid data if the random number does not exist in a preset historical database, and store the random number in the preset historical database. The preset historical database is configured to store random numbers that have been generated.

[0183] The data transmission apparatus based on a request message provided in this embodiment can perform the method provided in the method embodiments, and has similar implementation principles and technical effects. Details are not described herein.

[0184] Figure 10 FIG. 1 shows a structural schematic diagram of a data transmission device based on a request message provided in this application. As shown in the figure, the electronic device 1000 provided in this embodiment includes at least one processor 1001 and a memory 1002. Optionally, the device 1000 further includes a communication component 1003. The processor 1001, the memory 1002 and the communication component 1003 are connected through a bus. Figure 10

[0185] In the specific implementation process, the at least one processor 1001 executes the computer execution instructions stored in the memory 1002, so that the at least one processor 1001 performs the method described above.

[0186] The specific implementation process of the processor 1001 can refer to the method embodiments described above, and has similar implementation principles and technical effects. Details are not described herein.

[0187] ​In the above embodiments, it should be understood that the processor can be a central processing unit (CPU) and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or can also be any conventional processor. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution or combined with hardware and software modules in the processor for execution.

[0188] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory.

[0189] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0190] The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the above method.

[0191] The present application also provides a computer readable storage medium having computer execution instructions stored therein, wherein when a processor executes the computer execution instructions, the above method is implemented.

[0192] The above readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0193] An example readable storage medium is coupled to the processor such that the processor can read information from the readable storage medium and can write information to the readable storage medium. Of course, the readable storage medium can also be a part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.

[0194] The division of units is only a logical functional division, and in actual implementation, there can be another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0195] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0196] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.

[0197] If the functions are realized in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0198] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. The program executes to perform the steps of the above-mentioned method embodiments; and the foregoing storage medium includes various media capable of storing program codes, such as ROM, RAM, magnetic disk, or optical disk.

[0199] Finally, it should be noted that other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the present application disclosed herein. The present application is intended to include all such variations as fall within the general scope of the application, and includes the generic principles disclosed and the best mode known to the inventors to be currently practiced as well as variations thereof, without departing from the scope of the present application as defined by the claims. The specification and examples give the best application of the present application as currently known, and together with the description of the application serve to best illustrate the principles of the application. The scope of the application is expressly set forth in the claims.

Claims

1. A data transmission method based on a request message, characterized by, The method is applied to a client, and the method comprises: Obtaining a to-be-transmitted message, and generating a current key; According to the current key, the to-be-transmitted message is encrypted to obtain a message ciphertext digest; wherein the message ciphertext digest represents the digest information of the encrypted to-be-transmitted message; Based on the preset public key information, the current key is encrypted to obtain the ciphertext information of the current key; The ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged to obtain a message package, and the message package is sent to a server; According to the current key, the to-be-transmitted message is encrypted to obtain a message ciphertext digest, comprising: According to the current key, the to-be-transmitted message is encrypted to obtain an encrypted to-be-transmitted message; According to a preset digest encryption algorithm, the encrypted to-be-transmitted message is encrypted to obtain the message ciphertext digest; Based on the preset public key information, the current key is encrypted to obtain the ciphertext information of the current key, comprising: Based on the preset public key information, the current key is encrypted to obtain an encrypted current key; The encrypted current key is obfuscated to obtain the ciphertext information of the current key.

2. The method of claim 1, wherein, The ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged to obtain a message package, comprising: Generating a timestamp and a random number; The ciphertext information of the current key, the message ciphertext digest, the encrypted to-be-transmitted message, the timestamp, and the random number are packaged to obtain a message package.

3. A data transmission method based on a request message, characterized by, The method is applied to a server, and the method comprises: A message package is received from a client; wherein the message package represents that a to-be-transmitted message is obtained, a current key is generated, according to the current key, the to-be-transmitted message is encrypted to obtain a message ciphertext digest; wherein the message ciphertext digest represents the digest information of the encrypted to-be-transmitted message; based on the preset public key information, the current key is encrypted to obtain the ciphertext information of the current key; the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged to obtain a message package, and the message package is sent to a server; According to the preset private key information, the ciphertext information of the current key in the message package is decrypted to obtain the current key; wherein the preset private key information and the preset public key information correspond; According to a preset digest encryption algorithm, the encrypted to-be-transmitted message is encrypted to obtain a to-be-verified ciphertext; If the to-be-verified ciphertext and the message ciphertext digest are consistent, the encrypted to-be-transmitted message is decrypted according to the current key to obtain the to-be-transmitted message; According to the preset private key information, the ciphertext information of the current key in the message package is decrypted to obtain the current key, comprising: The ciphertext information of the current key in the message package is anti-obfuscated to obtain an encrypted current key; According to the preset private key information, the encrypted current key is decrypted to obtain the current key.

4. The method of claim 3, wherein, Also include: Obtain the timestamp and random number from the message packet; If it is determined that the timestamp and the random number are valid data, then continue to perform the decryption processing on the ciphertext information of the current key in the message packet according to the preset private key information to obtain the current key.

5. The method of claim 4, wherein, Determine that the timestamp and the random number are valid data, including: Obtain the current time, and if the time difference between the current time and the timestamp is less than a preset difference threshold, then determine that the timestamp is valid data; If the random number does not exist in a preset historical database, then determine that the random number is valid data, and store the random number in the preset historical database; wherein the preset historical database is used to store the random numbers that have been generated.

6. A data transmission apparatus based on a request message, characterized by The device is applied to a client, and the device includes: An obtaining module obtains a to-be-transmitted message and generates a current key; A first encryption module encrypts the to-be-transmitted message according to the current key to obtain a message ciphertext digest; wherein the message ciphertext digest represents the digest information of the encrypted to-be-transmitted message; A second encryption module encrypts the current key based on preset public key information to obtain ciphertext information of the current key; A packaging module packages the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message to obtain a message packet, and sends the message packet to a server; The first encryption module includes a first encryption unit and a second encryption unit; The first encryption unit is configured to encrypt the to-be-transmitted message according to the current key to obtain the encrypted to-be-transmitted message; The second encryption unit is configured to encrypt the encrypted to-be-transmitted message according to a preset digest encryption algorithm to obtain the message ciphertext digest; The second encryption module includes a third encryption unit and a confusion unit; The third encryption unit is configured to encrypt the current key based on the preset public key information to obtain an encrypted current key; The confusion unit is configured to confuse the encrypted current key to obtain the ciphertext information of the current key.

7. A data transmission apparatus based on a request message, characterized by The device is applied to a server, and the device includes: A receiving module receives a message packet from a client; wherein the message packet is used to represent that a to-be-transmitted message is obtained and a current key is generated; the to-be-transmitted message is encrypted according to the current key to obtain a message ciphertext digest; wherein the message ciphertext digest represents the digest information of the encrypted to-be-transmitted message; the current key is encrypted based on preset public key information to obtain ciphertext information of the current key; the ciphertext information of the current key, the message ciphertext digest, and the encrypted to-be-transmitted message are packaged to obtain a message packet, and the message packet is sent to a server; The first decryption module decrypts the ciphertext information of the current key in the message packet according to preset private key information to obtain the current key; wherein the preset private key information and the preset public key information correspond to each other; The second decryption module encrypts the encrypted to-be-transmitted message according to a preset digest encryption algorithm to obtain to-be-verified ciphertext; The verification module decrypts the encrypted to-be-transmitted message according to the current key to obtain the to-be-transmitted message if the to-be-verified ciphertext is consistent with the message ciphertext digest; The first decryption module comprises an anti-obfuscation unit and a decryption unit; The anti-obfuscation unit is configured to perform anti-obfuscation processing on the ciphertext information of the current key in the message packet to obtain an encrypted current key; The decryption unit is configured to decrypt the encrypted current key according to the preset private key information to obtain the current key.

Citation Information

Patent Citations

  • Data transmission method, device and equipment, computer readable storage medium and product

    CN114745207A

  • Information verification method and related apparatus, device, and storage medium

    US20230071847A1