Data transmission method, device, equipment, medium and program product
By encrypting the data using randomly generated keys in data transmission and encrypting the keys using asymmetric encryption technology, the problem that HTTP protocol plaintext transmission is difficult to ensure data security is solved, and high security of data transmission is achieved.
Patent Information
- Application Number
- CN202411958515.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, when data transmission is performed between computers or between front and back ends, plaintext transmission based on HTTP protocol is difficult to ensure data security.
The randomly generated random key is used to encrypt the transmitted data, and the asymmetrically encrypted public key is used to encrypt the key to form the encrypted data and the encryption key, and sent to the receiver for decryption.
Through the use of random keys, the security of data transmission is improved and the confidentiality and integrity of data during transmission is ensured.
Smart Images

Figure CN119728277A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data security technology, and in particular to a data transmission method, apparatus, device, medium and program product. Background Art
[0002] With the development of computer technology and network technology, the frequency and amount of data transmitted between computers using the network are increasing. In the field of software development, with the popularization of front-end and back-end separation architecture, the frequency and amount of sensitive data transmission between the front-end and back-end are also increasing.
[0003] In the process of implementing the present disclosure, the inventors found that there are at least the following problems in the prior art: when data is transmitted between computers or between the front and back ends, in order to ensure data transmission efficiency, an interface specification based on the HyperText Transfer Protocol (HTTP) protocol is usually used. However, since this protocol uses plain text for data transmission, data security is difficult to ensure. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a data transmission method, apparatus, device, medium and program product.
[0005] According to a first aspect of the present disclosure, a data transmission method is provided, which is applied to a data sending end, including: using a randomly generated method to determine a random key for encrypting data to be transmitted; using the random key to encrypt the data to be transmitted to obtain encrypted data; using an asymmetric encrypted public key to encrypt the random key to obtain an encryption key; sending the encrypted data and the encryption key to a data receiving end, so that the data receiving end processes the encrypted data and the encryption key to obtain the data to be transmitted; wherein the data receiving end processes the encrypted data and the encryption key, including: using an asymmetric encrypted private key to decrypt the encryption key to obtain a random key, wherein the asymmetric encrypted private key corresponds to the asymmetric encrypted public key; and using the random key to decrypt the encrypted data to obtain the data to be transmitted.
[0006] According to an embodiment of the present disclosure, encrypted data and an encryption key are sent to a data receiving end, including: determining transmission data based on the encrypted data and the encryption key, wherein the encrypted data is a data body of the transmission data and the encryption key is a data header of the transmission data; and sending the transmission data to the data receiving end.
[0007] According to an embodiment of the present disclosure, a random key used to encrypt data to be transmitted is determined using a randomly generated method, including: determining a symmetric encryption algorithm used to encrypt data to be transmitted from multiple preset encryption algorithms; determining a password format of the symmetric encryption algorithm; and determining the random key based on the password format using a random number generation method.
[0008] According to an embodiment of the present disclosure, the data to be transmitted is encrypted using a random key to obtain encrypted data, including: determining an encryption rule based on a symmetric encryption algorithm; and encrypting the data to be transmitted using a random key based on the encryption rule to obtain encrypted data.
[0009] According to a second aspect of the present disclosure, a data transmission method is provided, which is applied to a data receiving end, and includes: in response to receiving transmission data from a data sending end, determining an encryption key and encrypted data based on the transmission data; decrypting the encryption key using an asymmetric encryption private key to obtain a random key, wherein the asymmetric encryption private key corresponds to the asymmetric encryption public key, and the random key is the key used by the data sending end to encrypt the data to be transmitted; and decrypting the encrypted data using the random key to obtain the data to be transmitted; wherein the transmission data is determined in the following manner: the data sending end encrypts the data to be transmitted using the random key to obtain encrypted data; encrypting the random key using the asymmetric encryption public key to obtain the encryption key; and determining the transmission data based on the encrypted data and the encryption key.
[0010] According to an embodiment of the present disclosure, an encryption key is decrypted using an asymmetric encryption private key to obtain a random key, including: parsing the received transmission data to determine the data header and data body; determining the encryption key and encrypted data based on the data header and data body; and decrypting the encryption key using an asymmetric encryption private key.
[0011] According to an embodiment of the present disclosure, encrypted data is decrypted using a random key to obtain data to be transmitted, including: determining encryption rules based on a symmetric encryption algorithm used to encrypt the data to be transmitted; and based on the encryption rules, decrypting the encrypted data using a random key to obtain the data to be transmitted.
[0012] The third aspect of the present disclosure provides a data transmission device, which is applied to a data sending end, including: a key determination module, which is used to determine a random key used to encrypt data to be transmitted using a randomly generated method; a data encryption module, which is used to encrypt the data to be transmitted using the random key to obtain encrypted data; a key encryption module, which is used to encrypt the random key using an asymmetric encryption public key to obtain an encryption key; a data sending module, which is used to send the encrypted data and the encryption key to a data receiving end, so that the data receiving end processes the encrypted data and the encryption key to obtain the data to be transmitted; wherein the data receiving end processes the encrypted data and the encryption key, including: decrypting the encryption key using an asymmetric encryption private key to obtain a random key, wherein the asymmetric encryption private key corresponds to the asymmetric encryption public key; and decrypting the encrypted data using the random key to obtain the data to be transmitted.
[0013] The fourth aspect of the present disclosure provides a data transmission device, which is applied to a data receiving end, and includes: a data decomposition module, which is used to determine an encryption key and encrypted data based on the transmission data in response to receiving the transmission data from the data sending end; a key decryption module, which is used to decrypt the encryption key using an asymmetric encryption private key to obtain a random key, wherein the asymmetric encryption private key corresponds to the asymmetric encryption public key, and the random key is the key used by the data sending end when encrypting the data to be transmitted; and a data decryption module, which is used to decrypt the encrypted data using the random key to obtain the data to be transmitted; wherein the transmission data is determined in the following manner: the data sending end encrypts the data to be transmitted using the random key to obtain the encrypted data; the random key is encrypting the asymmetric encryption public key to obtain the encryption key; based on the encrypted data and the encryption key, the transmission data is determined.
[0014] A fifth aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0015] The sixth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.
[0016] The seventh aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.
[0017] According to the embodiments of the present disclosure, a random key is randomly generated, and the random key is used to encrypt the data to be transmitted, thereby obtaining encrypted data. Since the random key is randomly generated, it is difficult for a third party to crack the encrypted data to obtain the data to be transmitted, thereby improving the security of the data to be transmitted. In order to enable the data receiving end to accurately decrypt the encrypted data, the random key needs to be transmitted to the data receiving end. In order to further improve the data security, the random key is encrypted using the public key of asymmetric encryption, and then the encrypted encryption key is transmitted to the data receiving end, so that the data receiving end can decrypt the encryption key based on the private key of asymmetric encryption to obtain the random key, and further decrypt the encrypted data. Therefore, the data between the data sending end and the data receiving end is transmitted in a ciphertext manner, further enhancing the security and efficiency of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above contents and other purposes, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0019] Figure 1 The application scenario diagram of the data transmission method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown;
[0020] Figure 2 A flowchart of a data transmission method according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 3 A flowchart of a data transmission method according to another embodiment of the present disclosure is schematically shown;
[0022] Figure 4 A block diagram schematically illustrates an encryption and decryption process according to an embodiment of the present disclosure;
[0023] Figure 5 Schematically shows a structural block diagram of a data transmission device according to another embodiment of the present disclosure;
[0024] Figure 6 A structural block diagram of a data transmission device according to an embodiment of the present disclosure is schematically shown; and
[0025] Figure 7 A block diagram of an electronic device suitable for implementing a data transmission method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0026] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0027] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "include", "comprising", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0028] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0029] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0030] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0031] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0032] In related technologies, there is also a method of transmission using Hypertext Transfer Protocol Secure (HTTPS), which can encrypt the transmitted data during the transmission process, but the technical threshold is high and requires certificate cost overhead, making it difficult to popularize.
[0033] An embodiment of the present disclosure provides a data transmission method, which is applied to a data sending end, including: using a randomly generated method to determine a random key used to encrypt data to be transmitted; using the random key to encrypt the data to be transmitted to obtain encrypted data; using an asymmetric encrypted public key to encrypt the random key to obtain an encryption key; sending the encrypted data and the encryption key to a data receiving end, so that the data receiving end processes the encrypted data and the encryption key to obtain the data to be transmitted; wherein the data receiving end processes the encrypted data and the encryption key, including: using an asymmetric encrypted private key to decrypt the encryption key to obtain a random key, wherein the asymmetric encrypted private key corresponds to the asymmetric encrypted public key; and using the random key to decrypt the encrypted data to obtain the data to be transmitted.
[0034] Figure 1 An application scenario diagram of the data transmission method, apparatus, device, medium, and program product according to an embodiment of the present disclosure is schematically shown.
[0035] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0036] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0038] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0039] It should be noted that the data transmission method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data transmission device provided in the embodiment of the present disclosure can generally be set in the server 105. The data transmission method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the data transmission device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0040] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0041] The following will be based on Figure 1 The scene described by Figure 2~Figure 6 The data transmission method according to the embodiment of the present disclosure is described in detail.
[0042] Figure 2 The flowchart of the data transmission method according to the embodiment of the present disclosure is schematically shown.
[0043] like Figure 2 As shown, the data transmission method of this embodiment includes operations S210 to S240.
[0044] In operation S210, a random key for encrypting data to be transmitted is determined in a randomly generated manner.
[0045] According to an embodiment of the present disclosure, after determining the format of the random key, the built-in random function of the programming language can be used to generate a digital string that conforms to the format, thereby determining the random key. The random key can also be determined by using a random number generator, a hash function, etc.
[0046] In operation S220, the data to be transmitted is encrypted using a random key to obtain encrypted data.
[0047] According to an embodiment of the present disclosure, a symmetric encryption method is used to calculate the data to be transmitted using a random key to obtain encrypted data.
[0048] In operation S230, the random key is encrypted using an asymmetric public key to obtain an encrypted key.
[0049] According to an embodiment of the present disclosure, asymmetric encryption includes a public key and a private key, wherein the public key is stored at the data sending end, and the private key corresponding to the public key is stored at the data receiving end. The random key is encrypted using the public key to obtain an encrypted key. After the encrypted key is sent to the data receiving end, the data receiving end can use the private key to decrypt the encrypted key to obtain the correct random key.
[0050] In operation S240, the encrypted data and the encryption key are sent to the data receiving end, so that the data receiving end processes the encrypted data and the encryption key to obtain the data to be transmitted.
[0051] According to an embodiment of the present disclosure, the data receiving end processes the encrypted data and the encryption key, including: decrypting the encryption key using an asymmetric encryption private key to obtain a random key, wherein the asymmetric encryption private key corresponds to the asymmetric encryption public key; and decrypting the encrypted data using the random key to obtain the data to be transmitted.
[0052] According to the embodiments of the present disclosure, a random key is randomly generated, and the random key is used to encrypt the data to be transmitted, thereby obtaining encrypted data. Since the random key is randomly generated, it is difficult for a third party to crack the encrypted data to obtain the data to be transmitted, thereby improving the security of the data to be transmitted. In order to enable the data receiving end to accurately decrypt the encrypted data, the random key needs to be transmitted to the data receiving end. In order to further improve the data security, the random key is encrypted using the public key of asymmetric encryption, and then the encrypted encryption key is transmitted to the data receiving end, so that the data receiving end can decrypt the encryption key based on the private key of asymmetric encryption to obtain the random key, and further decrypt the encrypted data. Therefore, the data between the data sending end and the data receiving end is transmitted in a ciphertext manner, further enhancing the security and efficiency of data transmission.
[0053] According to an embodiment of the present disclosure, encrypted data and an encryption key are sent to a data receiving end, including: determining transmission data based on the encrypted data and the encryption key, wherein the encrypted data is a data body of the transmission data and the encryption key is a data header of the transmission data; and sending the transmission data to the data receiving end.
[0054] According to the embodiment of the present disclosure, the data format of the transmission data is determined, wherein the data format includes a data header format and a data body format, the encryption key is converted according to the data header format, the encrypted data is converted according to the data body format, and the data header and the data body are spliced, encapsulated, etc. to obtain the transmission data. The transmission data is sent to the data receiving end via the network.
[0055] According to an embodiment of the present disclosure, the encrypted data and the encryption key are concatenated and encapsulated according to the data format of the transmission data, thereby ensuring that the encrypted data and the encryption result of the random key used to encrypt it are sent through the same transmission data, so that the data receiving end can obtain the encrypted data and the corresponding encryption key based on the analysis of the transmission data, thereby determining the accuracy of the subsequent decryption process.
[0056] According to an embodiment of the present disclosure, a random key used to encrypt data to be transmitted is determined using a randomly generated method, including: determining a symmetric encryption algorithm used to encrypt data to be transmitted from multiple preset encryption algorithms; determining a password format of the symmetric encryption algorithm; and determining the random key based on the password format using a random number generation method.
[0057] According to an embodiment of the present disclosure, the preset encryption algorithm includes a plurality of symmetric encryption algorithms, such as the Advanced Encryption Standard, the Data Encryption Standard, the Triple Data Encryption Algorithm, etc. A symmetric encryption algorithm for encrypting the data to be transmitted is selected from the preset encryption algorithms, and the cryptographic format corresponding to the symmetric encryption algorithm is determined, wherein the cryptographic format is the format corresponding to the secret key of the symmetric encryption algorithm, including length, data type, etc.
[0058] According to the embodiments of the present disclosure, a symmetric encryption algorithm can be selected according to the importance of the data to be transmitted. For example, when the importance of the data to be transmitted is high, a more complex and more secure symmetric encryption algorithm can be selected. When the importance of the data to be transmitted is low, in order to ensure data transmission efficiency, a symmetric encryption algorithm with relatively low complexity can be selected from algorithms whose security meets basic requirements.
[0059] According to an embodiment of the present disclosure, based on the password format, the requirements such as the length and data type of the key of the selected symmetric encryption algorithm are determined, and a random number generation method is used to generate a digital string or character string that meets the above requirements to obtain a random key.
[0060] According to the embodiments of the present disclosure, a random key is generated using a random number generation method based on the password format of the selected symmetric encryption algorithm, which can ensure that the random key is consistent with the symmetric encryption algorithm, and ensure that the random key used for encryption each time is different and unpredictable, further improving the security of data transmission.
[0061] According to an embodiment of the present disclosure, the data to be transmitted is encrypted using a random key to obtain encrypted data, including: determining an encryption rule based on a symmetric encryption algorithm; and encrypting the data to be transmitted using a random key based on the encryption rule to obtain encrypted data.
[0062] According to an embodiment of the present disclosure, the encryption rules of the symmetric encryption algorithm can be used to determine how to perform calculations on the data to be transmitted based on the random key. Therefore, after the encryption rules are determined, the data to be transmitted can be processed according to the encryption rules using the random key to obtain encrypted data.
[0063] For example, when the Advanced Encryption Standard is selected as the symmetric encryption algorithm, the data to be transmitted can be divided into 128-bit data blocks, and each data block is processed by byte substitution, row permutation, column mixing, round key addition, etc., and then the processed data blocks are combined in sequence to obtain encrypted data. When the Data Encryption Standard is selected as the symmetric encryption algorithm, the random key is 56 bits, the data to be transmitted can be divided into 64-bit data blocks, and each data block is subjected to byte substitution, row permutation, etc. using the random key to obtain encrypted data.
[0064] According to the embodiments of the present disclosure, since the symmetric encryption algorithm corresponds to the random key, the encryption rules based on the symmetric encryption algorithm can achieve accurate encryption of the data to be transmitted using the random key, so that after the encrypted data is transmitted to the data receiving end, the subsequent decryption process can proceed smoothly.
[0065] Figure 3 The flowchart of a data transmission method according to another embodiment of the present disclosure is schematically shown.
[0066] like Figure 3 As shown, the data transmission method of this embodiment includes operations S310 to S330.
[0067] In operation S310, in response to receiving transmission data from a data transmitting end, an encryption key and encryption data are determined based on the transmission data.
[0068] According to an embodiment of the present disclosure, the transmission data is determined in the following manner: the data sender encrypts the data to be transmitted using a random key to obtain encrypted data; encrypts the random key using an asymmetric encryption public key to obtain an encryption key; and determines the transmission data based on the encrypted data and the encryption key.
[0069] According to an embodiment of the present disclosure, the transmission data may include multiple preset formats. After receiving the transmission data, it is determined which of the multiple preset formats the transmission data belongs to, and the transmission data is segmented according to the preset format to obtain an encryption key and encrypted data.
[0070] In operation S320, the encrypted key is decrypted using the asymmetric encrypted private key to obtain a random key.
[0071] According to the embodiments of the present disclosure, the private key of the asymmetric encryption corresponds to the public key of the asymmetric encryption, and the random key is the key used by the data sender to encrypt the data to be transmitted. Since the encryption key is obtained by encrypting the public key of the asymmetric encryption, the encryption key can be correctly decrypted using the private key corresponding to the public key to obtain the random key.
[0072] In operation S330, the encrypted data is decrypted using the random key to obtain data to be transmitted.
[0073] According to an embodiment of the present disclosure, a random key is used to decrypt encrypted data according to a symmetric encryption algorithm corresponding to the random key to restore the data to be transmitted, wherein the process of decrypting the encrypted data is the inverse process of encrypting the data to be transmitted.
[0074] According to an embodiment of the present disclosure, the received transmission data is segmented at the data receiving end, and the encryption key is decrypted using a private key, and the encrypted data is decrypted using the random key obtained by decryption to determine the data to be transmitted. The random key is encrypted and decrypted using a pair of corresponding public keys and private keys, respectively, ensuring the security of the random key transmission process, as well as the efficiency and accuracy of decryption. Since the random key is randomly generated at the data sending end, and the random key is used to encrypt and decrypt the data to be transmitted at the data sending end and the data receiving end, respectively, it is also possible to ensure the security of the data to be transmitted during the transmission process, as well as the efficiency and accuracy of decryption at the data receiving end.
[0075] According to an embodiment of the present disclosure, an encryption key is decrypted using an asymmetric encryption private key to obtain a random key, including: parsing the received transmission data to determine the data header and data body; determining the encryption key and encrypted data based on the data header and data body; and decrypting the encryption key using an asymmetric encryption private key.
[0076] According to an embodiment of the present disclosure, the transmission data is parsed to determine its data format, and the data format is matched with a plurality of preset formats to determine a preset format that matches successfully. Based on the preset format that matches successfully, the length of the data header and data body of the preset format is determined, and the transmission data is further segmented to obtain the data header and data body of the transmission data.
[0077] According to the embodiments of the present disclosure, the data header and the data body are processed based on the inverse operations of the encapsulation process of the encryption key and the encrypted data, the encryption key and the encrypted data are restored, the encryption key is decrypted using the asymmetric encrypted private key, and the random key is determined.
[0078] According to the embodiment of the present disclosure, the transmission data is segmented to obtain a data header and a data body, and the encryption key and the encrypted data are further determined, and the encryption key is decrypted using the asymmetric encryption private key to obtain a random key, so that the encrypted data can be decrypted using the random key. Since the encryption key is encrypted using the public key corresponding to the private key, the encryption key can be decrypted using the private key, thereby improving the security of the data transmission process and improving the decryption efficiency.
[0079] According to an embodiment of the present disclosure, encrypted data is decrypted using a random key to obtain data to be transmitted, including: determining encryption rules based on a symmetric encryption algorithm used to encrypt the data to be transmitted; and based on the encryption rules, decrypting the encrypted data using a random key to obtain the data to be transmitted.
[0080] According to an embodiment of the present disclosure, the symmetric encryption algorithm corresponding to the random key is determined according to the format of the random key, and the decryption rule when decrypting is determined based on the encryption rule when encrypting by the symmetric encryption algorithm, and the encrypted data is decrypted using the random key to obtain the data to be transmitted, wherein the decryption rule is the inverse process of the encryption rule.
[0081] According to the embodiments of the present disclosure, after restoring the data to be transmitted, the data receiving end can use the data to be transmitted to perform subsequent data processing.
[0082] According to an embodiment of the present disclosure, a corresponding symmetric encryption algorithm is determined by using a random key, and a decryption rule for decrypting the encrypted data is further determined so that the encrypted data can be accurately restored to the data to be transmitted, thereby improving the accuracy of data transmission.
[0083] Figure 4 A block diagram schematically shows an encryption and decryption process according to an embodiment of the present disclosure.
[0084] like Figure 4 As shown, the data sending end randomly generates a random key 410, and uses the random key 410 to encrypt the data 420 to be transmitted to obtain encrypted data 430, uses the public key 440 of the data sending end to encrypt the random key 410 to obtain an encrypted key 450, and determines the transmission data 460 based on the encrypted data 430 and the encrypted key 450, and sends the transmission data 460 to the data receiving end.
[0085] After receiving the transmission data 460, the data receiving end splits the transmission data 460 into encrypted data 430 and encryption key 450, uses the private key 470 to decrypt the encryption key 450 to obtain the random key 410, and uses the random key 410 to decrypt the encrypted data 430 to obtain the data to be transmitted 420, thereby completing the transmission of the data to be transmitted 420 from the data sending end to the data receiving end.
[0086] Based on the above data transmission method, the present disclosure also provides a data transmission device. Figure 5~Figure 6 The device is described in detail.
[0087] Figure 5 The structural block diagram of the data transmission device according to an embodiment of the present disclosure is schematically shown.
[0088] like Figure 5 As shown, the data transmission device 500 applied to the data sending end of this embodiment includes a key determination module 510, a data encryption module 520, a key encryption module 530 and a data sending module 540.
[0089] The key determination module 510 is used to determine a random key for encrypting the data to be transmitted by using a random generation method. In one embodiment, the key determination module 510 can be used to perform the operation S210 described above, which will not be described in detail here.
[0090] The data encryption module 520 is used to encrypt the data to be transmitted using a random key to obtain encrypted data. In one embodiment, the data encryption module 520 can be used to perform the operation S220 described above, which will not be described in detail here.
[0091] The key encryption module 530 is used to encrypt the random key using the public key of the asymmetric encryption to obtain the encrypted key. In one embodiment, the key encryption module 530 can be used to perform the operation S230 described above, which will not be described in detail here.
[0092] The data sending module 540 is used to send the encrypted data and the encryption key to the data receiving end so that the data receiving end processes the encrypted data and the encryption key to obtain the data to be transmitted. In one embodiment, the data sending module 540 can be used to perform the operation S240 described above, which will not be repeated here.
[0093] According to an embodiment of the present disclosure, the data sending module 540 includes a data combining submodule and a data sending submodule.
[0094] The data combination submodule is used to determine the transmission data based on the encrypted data and the encryption key, wherein the encrypted data is the data body of the transmission data and the encryption key is the data header of the transmission data.
[0095] The data sending submodule is used to send the transmission data to the data receiving end.
[0096] According to an embodiment of the present disclosure, the key determination module 510 includes an algorithm determination submodule, a format determination submodule and a key determination submodule.
[0097] The algorithm determination submodule is used to determine a symmetric encryption algorithm for encrypting data to be transmitted from a plurality of preset encryption algorithms.
[0098] The format determination submodule is used to determine the password format of the symmetric encryption algorithm.
[0099] The secret key determination submodule is used to determine the random secret key based on the password format using a random number generation method.
[0100] According to an embodiment of the present disclosure, the data encryption module 520 includes a first rule determination submodule and a data encryption submodule.
[0101] The first rule determination submodule is used to determine encryption rules based on a symmetric encryption algorithm.
[0102] The data encryption submodule is used to encrypt the data to be transmitted using a random key based on encryption rules to obtain encrypted data.
[0103] Figure 6 The structural block diagram of the data transmission device according to an embodiment of the present disclosure is schematically shown.
[0104] like Figure 6 As shown, the data transmission device 600 applied to the data receiving end of this embodiment includes a data decomposition module 610, a key decryption module 620 and a data decryption module 630.
[0105] The data decomposition module 610 is used to determine the encryption key and the encrypted data based on the transmission data in response to receiving the transmission data from the data transmitting end. In one embodiment, the data decomposition module 610 can be used to perform the operation S310 described above, which will not be described in detail here.
[0106] The key decryption module 620 is used to decrypt the encryption key using the asymmetric encryption private key to obtain a random key, wherein the asymmetric encryption private key corresponds to the asymmetric encryption public key, and the random key is the key used by the data sender when encrypting the data to be transmitted. In one embodiment, the key decryption module 620 can be used to perform the operation S320 described above, which will not be repeated here.
[0107] The data decryption module 630 is used to decrypt the encrypted data using a random key to obtain the data to be transmitted. In one embodiment, the data decryption module 630 can be used to perform the operation S330 described above, which will not be described in detail here.
[0108] According to an embodiment of the present disclosure, the key decryption module 620 includes a data parsing submodule, a data determination submodule and a key decryption submodule.
[0109] The data analysis submodule is used to analyze the received transmission data and determine the data header and data body.
[0110] The data determination submodule is used to determine the encryption key and encrypted data based on the data header and data body.
[0111] The secret key decryption submodule is used to decrypt the encrypted secret key using the asymmetric encrypted private key.
[0112] According to an embodiment of the present disclosure, the data decryption module 630 includes a second rule determination submodule and a data decryption submodule.
[0113] The second rule determination submodule is used to determine an encryption rule based on a symmetric encryption algorithm used to encrypt the data to be transmitted.
[0114] The data decryption submodule is used to decrypt the encrypted data using a random key based on the encryption rules to obtain the data to be transmitted.
[0115] According to an embodiment of the present disclosure, the data transmission device 500 includes a key determination module 510, a data encryption module 520, a key encryption module 530, a data sending module 540, a data decomposition module 610, a key decryption module 620, and a data decryption module 630. Any multiple modules can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the key determination module 510, the data encryption module 520, the key encryption module 530, the data transmission module 540, the data decomposition module 610, the key decryption module 620 and the data decryption module 630 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the key determination module 510, the data encryption module 520, the key encryption module 530, the data transmission module 540, the data decomposition module 610, the key decryption module 620 and the data decryption module 630 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.
[0116] Figure 7 A block diagram of an electronic device suitable for implementing a data transmission method according to an embodiment of the present disclosure is schematically shown.
[0117] like Figure 7 As shown, the electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 to a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0118] In RAM 703, various programs and data required for the operation of electronic device 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other via bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0119] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the input / output (I / O) interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage portion 708 as needed.
[0120] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0121] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or RAM 703 described above and / or one or more memories other than ROM 702 and RAM 703.
[0122] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present disclosure.
[0123] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 701. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0124] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0125] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0126] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0127] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0128] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0129] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data transmission method, applied to a data sending end, characterized in that: The method comprises: Using a randomly generated method, determine a random key for encrypting the data to be transmitted; Encrypting the data to be transmitted using the random key to obtain encrypted data; Encrypting the random key using an asymmetric public key to obtain an encrypted key; Sending the encrypted data and the encryption key to a data receiving end so that the data receiving end processes the encrypted data and the encryption key to obtain the data to be transmitted; The data receiving end processes the encrypted data and the encryption key, including: Decrypting the encryption key using an asymmetric encrypted private key to obtain the random key, wherein the asymmetric encrypted private key corresponds to the asymmetric encrypted public key; and The encrypted data is decrypted using the random key to obtain the data to be transmitted.
2. The method according to claim 1, characterized in that The step of sending the encrypted data and the encryption key to a data receiving end includes: Determine transmission data based on the encrypted data and the encryption key, wherein the encrypted data is a data body of the transmission data and the encryption key is a data header of the transmission data; and The transmission data is sent to the data receiving end.
3. The method according to claim 1, characterized in that The method of using a random generation method to determine a random key for encrypting the data to be transmitted includes: Determining a symmetric encryption algorithm for encrypting the data to be transmitted from a plurality of preset encryption algorithms; determining a cryptographic format for the symmetric encryption algorithm; and Based on the password format, the random key is determined using a random number generation method.
4. The method according to claim 3, characterized in that The step of encrypting the data to be transmitted by using the random key to obtain encrypted data includes: Based on the symmetric encryption algorithm, determining encryption rules; and Based on the encryption rule, the data to be transmitted is encrypted using the random key to obtain the encrypted data.
5. A data transmission method, applied to a data receiving end, characterized in that: The method comprises: In response to receiving transmission data from a data transmitter, determining an encryption key and encrypted data based on the transmission data; Decrypting the encryption key using an asymmetric encryption private key to obtain a random key, wherein the asymmetric encryption private key corresponds to the asymmetric encryption public key, and the random key is a key used by the data sender to encrypt the data to be transmitted; and Decrypting the encrypted data using the random key to obtain the data to be transmitted; The transmission data is determined in the following manner: The data sending end encrypts the data to be transmitted using the random key to obtain the encrypted data; Encrypting the random key using the asymmetric encryption public key to obtain the encrypted key; The transmission data is determined based on the encrypted data and the encryption key.
6. The method according to claim 5, characterized in that The method of decrypting the encrypted key using the asymmetric encrypted private key to obtain the random key includes: Parsing the received transmission data to determine the data header and the data body; Determining the encryption key and the encrypted data based on the data header and the data body; and The encryption key is decrypted using the asymmetrically encrypted private key.
7. The method according to claim 5, characterized in that The decrypting the encrypted data using the random key to obtain the data to be transmitted includes: Determining an encryption rule based on a symmetric encryption algorithm used to encrypt the data to be transmitted; and Based on the encryption rule, the encrypted data is decrypted using the random key to obtain the data to be transmitted.
8. A data transmission device, applied to a data sending end, characterized in that: The device comprises: A key determination module, used to determine a random key used to encrypt data to be transmitted using a randomly generated method; A data encryption module, used to encrypt the data to be transmitted using the random key to obtain encrypted data; A secret key encryption module, used to encrypt the random secret key using an asymmetric public key to obtain an encrypted secret key; A data sending module, used for sending the encrypted data and the encryption key to a data receiving end, so that the data receiving end processes the encrypted data and the encryption key to obtain the data to be transmitted; The data receiving end processes the encrypted data and the encryption key, including: Decrypting the encryption key using an asymmetric encrypted private key to obtain the random key, wherein the asymmetric encrypted private key corresponds to the asymmetric encrypted public key; and The encrypted data is decrypted using the random key to obtain the data to be transmitted.
9. A data transmission device, applied to a data receiving end, characterized in that: The device comprises: a data decomposition module, configured to, in response to receiving transmission data from a data transmitting end, determine an encryption key and encrypted data based on the transmission data; a key decryption module, configured to decrypt the encryption key using an asymmetric encrypted private key to obtain a random key, wherein the asymmetric encrypted private key corresponds to the asymmetric encrypted public key, and the random key is a key used by the data sending end to encrypt the data to be transmitted; and A data decryption module, used to decrypt the encrypted data using the random key to obtain the data to be transmitted; The transmission data is determined in the following manner: The data sending end encrypts the data to be transmitted using the random key to obtain the encrypted data; Encrypting the random key using the asymmetric encryption public key to obtain the encrypted key; The transmission data is determined based on the encrypted data and the encryption key.
10. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
11. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.