Data transmission method, electronic device, storage medium and computer program product
Patent Information
- Application Number
- CN202610896224.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-22
- Publication Date
- 2026-09-18
AI Technical Summary
[0005]本申请实施例提供一种数据传输方法、电子设备、存储介质及计算机程序产品,用于解决相关技术中因中心化服务器导致数据传输失败、数据传输过程中数据泄露等问题
本申请提供了一种数据传输方法、电子设备、存储介质及计算机程序产品,发送设备将待传输数据加密为第一加密数据后上传至分布式存储网络,接收分布式存储网络基于第一加密数据的存储地址返回的地址标识信息。发送设备根据单个第一图片和携带地址标识信息、发送设备的设备标识的隐文信息,生成单个第二图片并发送至接收设备。接收设备根据第二图片确定隐文信息,根据隐文信息,从分布式存储网络中获取并组合得到第一加密数据,并将第一加密数据解密为待传输数据。通过分布式存储网络实现去中心化,消除了对中心服务器的依赖,保证第一加密数据的高可用性和持久性,并降低隐私泄漏风险。进一步,通过将隐文信息隐藏至单个图片中,从而无论传输数据的大小,单张图片即可实现携带待传输数据的隐文信息,从而实现在数据传输的过程中,通过单张图片即可传输大量的数据,提高数据的传输效率。此外,由于减少了图片的传输数量,可以进一步提高数据传输的效率。
Smart Images

Figure CN122783282A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information security technology, and more specifically, to a data transmission method, electronic device, storage medium, and computer program product. Background Technology
[0002] With the widespread use of the Internet, people's awareness of cybersecurity is constantly improving, and the demand for transmitting data securely is also increasing.
[0003] Currently, data transmission typically involves a sending device uploading encrypted data to a centralized server such as a cloud drive or cloud storage. The receiving device then retrieves the encrypted data from the centralized server and decrypts it to obtain the desired data. However, data transmission can fail if the centralized server malfunctions. Furthermore, malicious attacks on centralized servers can lead to data leaks.
[0004] In summary, improving the security and privacy of data transmission is a pressing technical issue that needs to be addressed. Summary of the Invention
[0005] This application provides a data transmission method, electronic device, storage medium, and computer program product to solve problems such as data transmission failure due to centralized servers and data leakage during data transmission in related technologies. To achieve the above objectives, the technical solutions adopted in this application are as follows: In a first aspect, embodiments of this application provide a data transmission method applied to a transmitting device, the method comprising: The data to be transmitted is encrypted to obtain the first encrypted data; The first encrypted data is uploaded to a distributed storage network so that the first encrypted data is stored in segments in the distributed storage network; A single second image is generated based on the hidden text information and a single first image. The hidden text information carries the address identification information sent by the distributed storage network and the device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data. The hidden text information is used to obtain and combine the first encrypted data from the distributed storage network. The first image is used to hide the hidden text information. The second image is sent to the receiving device.
[0006] As an optional implementation, encrypting the data to be transmitted to obtain first encrypted data includes: The data to be transmitted is encrypted to obtain the first data; The first data is segmented to obtain the first encrypted data, wherein the first encrypted data is composed of at least one encrypted data block in a sequential relationship.
[0007] As an optional implementation, after uploading the first encrypted data to the distributed storage network and before generating a single second image, the method further includes: Receive address identification information sent by the distributed storage network, wherein the address identification information is the address identifier corresponding to each encrypted data block; The hidden text information is determined based on the address identification information, the device identification of the sending device, and the sequence information, wherein the sequence information represents the sequential relationship between the encrypted data blocks.
[0008] As an optional implementation, any address identifier is determined by calculating its hash value based on the content of the encrypted data block corresponding to the address identifier.
[0009] As an optional implementation, before encrypting the data to be transmitted to obtain the first data, the method further includes: Generate a first key pair and a second key pair for the transmitting device, wherein the first key pair includes a first public key and a first private key, and the second key pair includes a second public key and a second private key; The first public key and the second public key are sent to the receiving device through the distributed storage network, and the third public key in the third key pair of the receiving device and the fourth public key in the fourth key pair of the receiving device are received through the distributed storage network.
[0010] As an optional implementation, sending the first public key and the second public key to the receiving device through the distributed storage network includes: The first public key and the second public key are encapsulated into first public key data, the first public key data is uploaded to the distributed storage network, and the target address identifier sent by the distributed storage network based on the hash value of the first public key data is received. The target address identifier is written as cryptic text into the third image to obtain the fourth image; The fourth image is sent to the receiving device so that the receiving device can obtain the first public key and the second public key through the fourth image.
[0011] As an optional implementation, encrypting the data to be transmitted to obtain first encrypted data includes: A fifth key is generated, and the data to be transmitted is symmetrically encrypted using the fifth key to obtain the ciphertext of the data to be transmitted. A random number is generated, which is used as the sixth key. The sixth key is then encrypted using the third public key of the receiving device to obtain the ciphertext of the sixth key. The fifth key is symmetrically encrypted using the sixth key to obtain the ciphertext of the fifth key; The message header, message version number, algorithm version number, ciphertext of the fifth key, ciphertext of the sixth key, and ciphertext of the data to be transmitted are concatenated to obtain concatenated data, and the hash value of the concatenated data is determined. The hash value of the concatenated data is digitally signed using the second private key of the sending device to obtain the signed data. The message header, the message version number, and the algorithm version number are integrated into the message header field; the ciphertext of the sixth key and the ciphertext of the fifth key are integrated into the key field; the ciphertext of the data to be transmitted is used as the ciphertext field; the signed data is used as the signature field; and the message header field, the key field, the ciphertext field, and the signature field are integrated into the first data.
[0012] Secondly, embodiments of this application provide a data transmission method applied to a receiving device, the method comprising: Receive a single second image sent by a sending device, wherein the second image is an image carrying hidden text information; Based on the second image, the hidden text information is determined, wherein the hidden text information carries the address identification information sent by the distributed storage network and the device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data, and the first encrypted data is distributed and stored in the distributed storage network in segments. Based on the hidden text information, first encrypted data is obtained and combined from the distributed storage network, wherein the first encrypted data is composed of at least one encrypted data block in a sequential relationship; The first encrypted data is decrypted to obtain the data to be transmitted.
[0013] As an optional implementation, the hidden information includes address identification information, device identification of the sending device, and sequence information, wherein the address identification information is the address identifier corresponding to each encrypted data block, and the sequence information represents the sequential relationship between the encrypted data blocks; The step of obtaining and combining the first encrypted data from the distributed storage network based on the hidden text information includes: According to the address identification information, second encrypted data is obtained from the distributed storage network, wherein the second encrypted data includes at least one encrypted data block, and the order of the encrypted data blocks in the second encrypted data and the first encrypted data is the same or different; The first encrypted data is obtained by combining the sequence information and the second encrypted data.
[0014] As an optional implementation, any address identifier is determined by calculating its hash value based on the content of the encrypted data block corresponding to the address identifier.
[0015] As an optional implementation, the first encrypted data includes a message header field, a key field, a ciphertext field, and a signature field; The step of decrypting the first encrypted data to obtain the data to be transmitted includes: Based on the device identifier of the sending device, obtain the first public key and the second public key of the sending device; The second public key is used to verify the signed data in the signature field. If the verification is successful, the third private key of the receiving device is used to decrypt the ciphertext of the sixth key in the key field to obtain the sixth key. Using the sixth key, the ciphertext of the fifth key in the key field is symmetrically decrypted to obtain the fifth key; Using the fifth key, the ciphertext of the data to be transmitted in the ciphertext field is symmetrically decrypted to obtain the data to be transmitted.
[0016] Thirdly, embodiments of this application provide a data transmission apparatus corresponding to a data transmission method performed by a transmitting device, the data transmission apparatus comprising: The encryption module is used to encrypt the data to be transmitted, thus obtaining the first encrypted data; An upload module is used to upload the first encrypted data to a distributed storage network, so that the first encrypted data is stored in segments in the distributed storage network; A generation module is used to generate a single second image based on hidden text information and a single first image. The hidden text information carries address identification information sent by the distributed storage network and device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data. The hidden text information is used to obtain and combine the first encrypted data from the distributed storage network. The first image is used to hide the hidden text information. The sending module is used to send the second image to the receiving device.
[0017] As an optional implementation, the encryption module is specifically used for: The data to be transmitted is encrypted to obtain the first data; The first data is segmented to obtain the first encrypted data, wherein the first encrypted data is composed of at least one encrypted data block in a sequential relationship.
[0018] As an optional implementation, the data transmission device further includes: a first determining module, the first determining module being used to: Receive address identification information sent by the distributed storage network, wherein the address identification information is the address identifier corresponding to each encrypted data block; The hidden text information is determined based on the address identification information, the device identification of the sending device, and the sequence information, wherein the sequence information represents the sequential relationship between the encrypted data blocks.
[0019] As an optional implementation, any address identifier is determined by calculating its hash value based on the content of the encrypted data block corresponding to the address identifier.
[0020] As an optional implementation, the generation module is also used for: Generate a first key pair and a second key pair for the transmitting device, wherein the first key pair includes a first public key and a first private key, and the second key pair includes a second public key and a second private key; The first public key and the second public key are sent to the receiving device through the distributed storage network, and the third public key in the third key pair of the receiving device and the fourth public key in the fourth key pair of the receiving device are received through the distributed storage network.
[0021] As an optional implementation, the generation module is also used for: The first public key and the second public key are encapsulated into first public key data, the first public key data is uploaded to the distributed storage network, and the target address identifier sent by the distributed storage network based on the hash value of the first public key data is received. The target address identifier is written as cryptic text into the third image to obtain the fourth image; The fourth image is sent to the receiving device so that the receiving device can obtain the first public key and the second public key through the fourth image.
[0022] As an optional implementation, the encryption module is specifically used for: A fifth key is generated, and the data to be transmitted is symmetrically encrypted using the fifth key to obtain the ciphertext of the data to be transmitted. A random number is generated, which is used as the sixth key. The sixth key is then encrypted using the third public key of the receiving device to obtain the ciphertext of the sixth key. The fifth key is symmetrically encrypted using the sixth key to obtain the ciphertext of the fifth key; The message header, message version number, algorithm version number, ciphertext of the fifth key, ciphertext of the sixth key, and ciphertext of the data to be transmitted are concatenated to obtain concatenated data, and the hash value of the concatenated data is determined. The hash value of the concatenated data is digitally signed using the second private key of the sending device to obtain the signed data. The message header, the message version number, and the algorithm version number are integrated into the message header field; the ciphertext of the sixth key and the ciphertext of the fifth key are integrated into the key field; the ciphertext of the data to be transmitted is used as the ciphertext field; the signed data is used as the signature field; and the message header field, the key field, the ciphertext field, and the signature field are integrated into the first data.
[0023] Fourthly, embodiments of this application provide a data transmission apparatus corresponding to a data transmission method executed by a receiving device, the data transmission apparatus comprising: The receiving module is used to receive a single second image sent by the sending device, wherein the second image is an image carrying hidden text information; The second determining module is used to determine the hidden text information based on the second image, wherein the hidden text information carries address identification information sent by the distributed storage network and device identification of the sending device, the address identification information is determined by the distributed storage network based on the storage address of the first encrypted data, and the first encrypted data is distributed and stored in the distributed storage network in segments; The combination module is used to obtain and combine first encrypted data from the distributed storage network according to the hidden text information, wherein the first encrypted data is composed of at least one encrypted data block in a sequential relationship; The decryption module is used to decrypt the first encrypted data to obtain the data to be transmitted.
[0024] As an optional implementation, the hidden information includes address identification information, the device identifier of the sending device, and sequence information, wherein the address identification information is the address identifier corresponding to each encrypted data block, and the sequence information represents the sequential relationship between the encrypted data blocks; the combination module is specifically used for: According to the address identification information, second encrypted data is obtained from the distributed storage network, wherein the second encrypted data includes at least one encrypted data block, and the order of the encrypted data blocks in the second encrypted data and the first encrypted data is the same or different; The first encrypted data is obtained by combining the sequence information and the second encrypted data.
[0025] As an optional implementation, any address identifier is determined by calculating its hash value based on the content of the encrypted data block corresponding to the address identifier.
[0026] As an optional implementation, the first encrypted data includes a header field, a key field, a ciphertext field, and a signature field; the decryption module is specifically used for: Based on the device identifier of the sending device, obtain the first public key and the second public key of the sending device; The second public key is used to verify the signed data in the signature field. If the verification is successful, the third private key of the receiving device is used to decrypt the ciphertext of the sixth key in the key field to obtain the sixth key. Using the sixth key, the ciphertext of the fifth key in the key field is symmetrically decrypted to obtain the fifth key; Using the fifth key, the ciphertext of the data to be transmitted in the ciphertext field is symmetrically decrypted to obtain the data to be transmitted.
[0027] Fifthly, embodiments of this application provide an electronic device, which is either the transmitting device or the receiving device. The electronic device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the method steps performed by the transmitting device as described in the first aspect or the receiving device as described in the second aspect.
[0028] Sixthly, embodiments of this application provide a computer storage medium on which a computer program is stored. When the computer program is run by a processor, it executes the method steps performed by the transmitting device as described in the first aspect or the receiving device as described in the second aspect.
[0029] In a seventh aspect, embodiments of this application provide a computer program product having a computer-readable storage medium, wherein a computer program stored on the computer-readable storage medium, when executed by a processor, performs the method steps performed by the transmitting device as described in the first aspect or the receiving device as described in the second aspect.
[0030] The beneficial effects of this application are: This application provides a data transmission method, electronic device, storage medium, and computer program product. The sending device encrypts the data to be transmitted into first encrypted data and uploads it to a distributed storage network. It then receives address identification information returned by the distributed storage network based on the storage address of the first encrypted data. The sending device generates a single second image based on a single first image and hidden information carrying the address identification information and the sending device's device identifier, and sends this image to a receiving device. The receiving device determines the hidden information based on the second image, retrieves and combines it from the distributed storage network according to the hidden information to obtain the first encrypted data, and decrypts the first encrypted data into the data to be transmitted. Decentralization is achieved through the distributed storage network, eliminating dependence on a central server, ensuring high availability and persistence of the first encrypted data, and reducing the risk of privacy leakage. Furthermore, by hiding the hidden information in a single image, regardless of the size of the transmitted data, a single image can carry the hidden information of the data to be transmitted, thereby enabling the transmission of large amounts of data through a single image during data transmission, improving data transmission efficiency. In addition, reducing the number of images transmitted further improves data transmission efficiency. Attached Figure Description
[0031] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of the architecture of the data transmission system provided in the embodiments of this application; Figure 2 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 1 ; Figure 3 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 2 ; Figure 4 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 3 ; Figure 5 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 4 ; Figure 6 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 5 ; Figure 7A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 6 ; Figure 8 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 7 ; Figure 9 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 8 ; Figure 10 A module structure diagram of a data transmission device provided in an embodiment of this application; Figure 11 A module structure diagram of another data transmission device provided in the embodiments of this application; Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0034] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0035] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0036] One possible approach involves sharing information by hiding it within images. However, this often still relies on centralized servers to store the actual data, using images as links to these servers, making it impossible to escape dependence on a centralized architecture. Furthermore, this method of hiding information in images is easily detected and removed by social media platforms, making it relatively weak against interference.
[0037] Based on the above-mentioned problems, this application provides a data transmission method that improves security and privacy during data transmission.
[0038] Figure 1 This is a schematic diagram of the architecture of a data transmission system provided in an embodiment of this application. Figure 1 As shown, the data transmission system includes a transmitting device, a receiving device, and a distributed storage network, with the transmitting and receiving devices connected to the distributed storage network.
[0039] The transmitting device encrypts and slices the data to be transmitted, resulting in multiple encrypted data blocks. These encrypted data blocks are then uploaded to a distributed storage network. A series of permanently online nodes on the distributed storage network continuously maintain these encrypted data blocks, ensuring their long-term online availability and guaranteeing their high availability and durability. Furthermore, storing these encrypted data blocks in the distributed storage network achieves decentralization, eliminating dependence on a central server.
[0040] The sending device generates structured hidden text information based on the address identification information of the distributed storage network, the device identifier of the sending device, and the order information required to combine the encrypted data blocks. This hidden text information is embedded into the Exchangeable Image File (EXIF) metadata field of the carrier image (i.e., the first image). The carrier image with embedded hidden text information (i.e., the second image) is then sent to the receiving device. The receiving device downloads the encrypted data blocks from the distributed storage network according to the hidden text information, combines and decrypts the encrypted data blocks according to the order information in the hidden text, and restores the data to be transmitted. This achieves decentralized data transmission, thereby improving the privacy and security of data transmission.
[0041] Figure 2 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 1 The following example, using the interaction between a sending and receiving device in a data transmission system, illustrates the flow of the data transmission method. Figure 2 As shown, the method includes: S101. The transmitting device encrypts the data to be transmitted to obtain the first encrypted data.
[0042] For example, the encryption method used by the sending device to encrypt the data to be transmitted can be found below. Figure 3 The description.
[0043] Optionally, the sending device encrypts and segments the data to be transmitted to form the first encrypted data, which includes four core fields: a header field, a key field, a ciphertext field, and a signature field.
[0044] The message header field stores basic information such as the message version and the storage key algorithm version, which is used by the receiving device to verify the message header. The key field stores the ciphertext of the key required for decryption, the ciphertext field stores the ciphertext of the encrypted data to be transmitted, and the signature field stores the signed data from the sending device so that the receiving device can verify the legitimacy of the data source.
[0045] S102. The transmitting device uploads the first encrypted data to the distributed storage network so that the first encrypted data is distributed and stored in segments in the distributed storage network.
[0046] The sending device uploads the first encrypted data in segments to a distributed storage network, which includes multiple nodes. Nodes may include the initial upload node, cache nodes, and permanently online nodes maintained by a file pinning service.
[0047] The sending device divides the first encrypted data into multiple encrypted data blocks and uploads them segment by segment to at least one initial upload node in the distributed storage network. Each initial upload node performs a hash operation based on the content of the encrypted data block it stores to obtain the hash value of the encrypted data block. The hash value of the encrypted data block is used as the corresponding unique address identifier of the encrypted data block, where the address identifier can be called the Distributed Storage Identifier (CID).
[0048] In a distributed storage network, a distributed hash table (DHT) uses the hash value of each encrypted data block as the index key and the address of at least one node storing the encrypted data block as the index value, thus constructing a distributed key-value mapping table.
[0049] S103. The transmitting device generates a single second image based on the hidden text information and the single first image.
[0050] The hidden information carries the address identification information sent by the distributed storage network and the device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data. The hidden information is used to obtain and combine the first encrypted data from the distributed storage network, and the first image is used to hide the hidden information.
[0051] For example, a distributed storage network generates address identification information based on the unique address identifier corresponding to each encrypted data block, and sends the address identification information to the sending device so that the sending device can determine the storage address of the first encrypted data based on the address identification information. Based on the address identification information and the DHT in the distributed storage network, the storage addresses of each encrypted data block in the distributed storage network can be accurately located, allowing the receiving device to download each encrypted data block from the respective storage addresses in the distributed storage network.
[0052] The transmitting device hides the hidden text information in a first image and uses this first image as a second image. The hidden text information is not visually identifiable in the second image.
[0053] S104. The sending device sends the second image to the receiving device.
[0054] The sending device sends a second image carrying hidden information to the receiving device through any channel. Since the second image has no sensitive identifier, it is not easy to be intercepted or censored during the image sharing process, making it difficult to remove the sensitive data, i.e., hidden information, hidden in the second image, thus improving the ability to resist blocking and censorship.
[0055] For example, the sending device can send the second image to the receiving device through channels such as email or cloud storage. This application does not impose specific restrictions on the channels through which the sending device sends the second image to the receiving device.
[0056] S105. The receiving device determines the hidden text information based on the second image.
[0057] The hidden message carries the address identification information sent by the distributed storage network and the device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data. The first encrypted data is distributed and stored in segments in the distributed storage network.
[0058] After receiving the second image, the receiving device uses specialized software or tools to parse the second image and extract the hidden coded information from it.
[0059] The address identification information is used by the receiving device to download each encrypted data block from the distributed storage network. The device identifier of the sending device is used by the receiving device to obtain the first public key data required for decryption when decrypting the first encrypted data.
[0060] S106. The receiving device retrieves each encrypted data block from the distributed storage network based on the hidden text information.
[0061] Since the receiving and transmitting devices are connected to the same distributed storage network, the receiving device can locate the storage address of each encrypted data block based on the DHT of the distributed storage network and the address identifier information in the hidden text. A single encrypted data block can be stored simultaneously on the initial upload node, cache node, and permanently online node of the distributed storage network.
[0062] After the receiving device determines the storage address of each encrypted data block, it can determine the distance to each storage address of the encrypted data block based on the address of the receiving device. The receiving device can then download the encrypted data block from the node that is closest to the address of the receiving device and is currently online, thereby improving download efficiency.
[0063] S107. The receiving device combines the encrypted data blocks into the first encrypted data according to the hidden text information.
[0064] The receiving device combines the encrypted data blocks according to the hidden text information into the first encrypted data, ensuring the accuracy of the data block combination. The first encrypted data is composed of at least one encrypted data block arranged in a specific order.
[0065] S108. The receiving device decrypts the first encrypted data to obtain the data to be transmitted.
[0066] The receiving device verifies the message header based on the message header field in the first encrypted data. After the verification is successful, it obtains the first public key data required for decryption based on the device identifier of the sending device.
[0067] The receiving device decrypts the first encrypted data using the first public key data to obtain the data to be transmitted. It is worth noting that, in this application, the data to be transmitted refers to the business data during data transmission. At the sending end, it is the original plaintext data to be encrypted and transmitted; at the receiving end, it is the decrypted and restored plaintext data from the same source. In other words, for the sending device, the data to be transmitted is the data to be sent; for the receiving device, the data to be transmitted is the data to be received.
[0068] In this embodiment, the sending device encrypts the data to be transmitted into first encrypted data and uploads it to the distributed storage network, receiving address identification information returned by the distributed storage network based on the storage address of the first encrypted data. The sending device generates a single second image based on a single first image and hidden information carrying the address identification information and the sending device's device identifier, and sends it to the receiving device. The receiving device determines the hidden information based on the second image, retrieves and combines it from the distributed storage network to obtain the first encrypted data, and decrypts the first encrypted data into the data to be transmitted. Decentralization is achieved through the distributed storage network, eliminating dependence on a central server, ensuring the high availability and persistence of the first encrypted data, and reducing the risk of privacy leakage. By hiding the hidden information in a single image, regardless of the size of the transmitted data, a single image can carry the hidden information of the data to be transmitted, thereby reducing the number of images transmitted during data transmission and improving data transmission efficiency.
[0069] Furthermore, in the distributed storage network, the storage address of each encrypted data block of the first encrypted data is mapped to its content. Any tampering with the content of the encrypted data block will cause the address identification information to change, thus making it impossible to obtain and combine the correct first encrypted data from the distributed storage network, thereby realizing the inherent data integrity verification.
[0070] Figure 3 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 2 .like Figure 3 As shown, in step S101 above, the sending device encrypts the data to be transmitted to obtain the first encrypted data, including: S201. Encrypt the data to be transmitted to obtain the first data.
[0071] The transmitting device encrypts the data to be transmitted, encrypting it into first data, which includes four core fields: header field, key field, ciphertext field, and signature field.
[0072] S202. The first data is segmented to obtain the first encrypted data.
[0073] In this embodiment, the first encrypted data is composed of at least one encrypted data block arranged in a sequential order.
[0074] For example, the sending device divides the first data into at least one encrypted data block, and the first encrypted data is composed of at least one encrypted data block in a sequential relationship. The first encrypted data also includes four core fields: message header field, key field, ciphertext field and signature field.
[0075] The first data is divided into first encrypted data, which makes it easier to upload and store the first encrypted data in segments to the distributed storage network.
[0076] In this embodiment, the sending device encrypts the data to be transmitted to obtain first data, and then segments the first data to obtain first encrypted data. This facilitates the uploading and storage of the encrypted data in segments to a distributed storage network. Furthermore, distributed storage further enhances the security of the complete data; for example, even if some encrypted data blocks are maliciously obtained, the complete data cannot be retrieved.
[0077] Figure 4 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 3 .like Figure 4 As shown, after the sending device uploads the first encrypted data to the distributed storage network in step S102 and before the sending device generates a single second image in step S103, the method for generating hidden text information includes: S301. Receive address identification information sent by the distributed storage network.
[0078] In this embodiment, the address identification information can be the address identifier corresponding to each encrypted data block.
[0079] In a distributed storage network, each initial upload node determines a unique address identifier corresponding to each encrypted data block based on the encrypted data blocks it stores. The distributed storage network generates address identification information based on the unique address identifier corresponding to each encrypted data block and sends it to the sending device. The sending device receives the address identification information from the distributed storage network.
[0080] S302. Determine the hidden message information based on the address identification information, the device identification of the sending device, and the sequence information.
[0081] In this embodiment, the sequence information represents the sequential relationship between the encrypted data blocks.
[0082] The sending device generates a structured resource list based on the address identification information, the device identifier of the sending device, and the order information required to combine the encrypted data blocks, and uses this structured resource list as hidden information. Subsequently, by employing image steganography technology, the hidden information is written into the EXIF metadata field of the first image (i.e., the carrier image) to generate the second image.
[0083] EXIF metadata is a hidden attribute area of the carrier image. The resource list is written as hidden information into the EXIF metadata field of the first image. This will not change the visual effect and format of the first image, ensuring strong resistance to censorship and interception of the hidden information transmission.
[0084] In this embodiment, the sending device receives address identification information sent by the distributed storage network, and determines hidden text information based on the address identification information, the sending device's device identifier, and sequence information. This facilitates the receiving device in obtaining and combining the hidden text information to obtain the first encrypted data, and then decrypting the first encrypted data.
[0085] It is worth noting that the sending device sends the address identification information to a series of permanently online nodes in the file fixation service of the distributed storage network, instructing each permanently online node to permanently save each encrypted data block corresponding to each address identifier in the address identification information.
[0086] Each permanently online node locates the storage address of each encrypted data block in the distributed storage network based on the mapping relationship between the address identifiers in the address identification information and the DHT of the distributed storage network, and backs up each encrypted data block in the permanently online node according to the storage address, so as to store each encrypted data block online for a long time.
[0087] After backup is complete, the storage of each encrypted data block no longer depends on the sending device's initial upload node in the distributed storage network. Even if the sending device is powered off, offline, or the temporary cache node clears data, the permanently online nodes will continue to provide access services for each encrypted data block, ensuring that the receiving device can subsequently find and download all encrypted data blocks using the address identification information. This improves the availability and durability of each encrypted data block, guaranteeing its long-term accessibility.
[0088] As an optional implementation, any address identifier is determined by calculating its hash value based on the content of the encrypted data block corresponding to the address identifier.
[0089] In a distributed storage network, each initial upload node performs a hash operation on the binary content of the encrypted data block it stores to obtain the hash value of the encrypted data block content, and uses the hash value of the encrypted data block content as the address identifier corresponding to the encrypted data block.
[0090] Each address identifier is determined solely by the content of the corresponding encrypted data block. If the content of the encrypted data block remains unchanged, the address identifier remains constant. However, any modification to any byte of the content of the encrypted data block will generate a completely different address identifier, making it impossible to correctly download the encrypted data block from the distributed storage network.
[0091] In this embodiment, each address identifier is determined by the distributed storage network by calculating its hash value based on the content of the encrypted data block corresponding to the address identifier. This establishes a mapping relationship between the storage address and content of each encrypted data block in the distributed storage network. Any tampering with the content of an encrypted data block will result in a change in the address identifier information, making it impossible to retrieve the correct encrypted data block from the distributed storage network, thus improving the storage security of each encrypted data block.
[0092] Figure 5 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 4 .like Figure 5 As shown, before the transmitting device encrypts the data to be transmitted and obtains the first data in step S201 above, the following steps are included: S401, Generate the first key pair and the second key pair for the transmitting device.
[0093] The first key pair includes a first public key and a first private key, and the second key pair includes a second public key and a second private key.
[0094] For example, before transmitting data to the receiving device, the two parties exchange keys to facilitate subsequent data transmission and reception between the two devices. Alternatively, the sending device can also exchange keys simultaneously with data transmission; as long as the keys and transmitted data are sent separately, subsequent data transmission and reception between the two devices can also be achieved.
[0095] The transmitting device generates a first key pair and a second key pair. The first key pair can be a Kyber key pair, comprising a first public key and a first private key (i.e., the transmitting device's Kyber public key and Kyber private key). The second key pair can be a Dilithium key pair, comprising a second public key and a second private key (i.e., the transmitting device's Dilithium public key and Dilithium private key). Both the Kyber and Dilithium key pairs are post-quantum algorithm key pairs, which can resist attacks from future quantum computers.
[0096] Accordingly, the receiving device generates a third key pair and a fourth key pair. The third key pair can be the receiving device's Kyber key pair, comprising a third public key and a third private key (i.e., the receiving device's Kyber public key and Kyber private key). The fourth key pair can be the receiving device's Dilithium key pair, comprising a fourth public key and a fourth private key (i.e., the receiving device's Dilithium public key and Dilithium private key). Both the Kyber key pair and the Dilithium key pair are post-quantum algorithm key pairs, which can resist cracking attacks from future quantum computers.
[0097] S402. Send the first public key and the second public key to the receiving device through the distributed storage network, and receive the third public key in the third key pair of the receiving device and the fourth public key in the fourth key pair of the receiving device through the distributed storage network.
[0098] For example, the sending device stores a first private key and a second private key locally. The sending device sends the first public key and the second public key to a distributed storage network and retrieves a third public key and a fourth public key from the distributed storage network. The receiving device sends the third public key and the fourth public key to the distributed storage network and retrieves the first public key and the second public key from the distributed storage network; the receiving device also stores its third private key and the fourth private key locally.
[0099] The third public key received by the sending device is used to encrypt data when the sending device sends data to the receiving device, and the fourth public key received by the sending device is used to verify the signature when the sending device receives data from the receiving device.
[0100] Accordingly, the first public key received by the receiving device is used to encrypt data when the receiving device sends data to the sending device, and the second public key received by the receiving device is used to verify the signature data when the receiving device receives data from the sending device.
[0101] Once the sending and receiving devices exchange public keys, the keys remain valid indefinitely unless either party changes their keys. This simplifies subsequent communication processes.
[0102] In this embodiment, the transmitting device generates a first key pair and a second key pair, and sends the first public key from the first key pair and the second public key from the second key pair to the receiving device through a distributed storage network. The receiving device also receives the third public key from the third key pair and the fourth public key from the fourth key pair through the distributed storage network. Both the transmitting and receiving devices employ dual-post-quantum algorithm key pairs to resist quantum attacks, and the key exchange based on the distributed storage network provides the key foundation for subsequent data transmission between the two parties.
[0103] Figure 6 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 5 .like Figure 6 As shown, in step S402 above, sending the first public key and the second public key to the receiving device through a distributed storage network includes: S501. Encapsulate the first public key and the second public key into first public key data, upload the first public key data to the distributed storage network, and receive the target address identifier determined by the distributed storage network based on the hash value of the first public key data.
[0104] For example, the sending device encapsulates the first public key and the second public key (i.e., the sending device's Kyber public key and Dilithium public key) into structured first public key data, and uploads the first public key data to a node in the distributed storage network (such as the initial upload node). The distributed storage network performs a hash operation on the first public key data to obtain the hash value of the first public key data, and uses the hash value of the first public key data as the target address identifier of the first public key data.
[0105] The distributed storage network returns the target address identifier of the first public key data to the sending device. Based on the target address identifier and the DHT in the distributed storage network, the storage address of the first public key data in the distributed storage network can be found.
[0106] S502. Write the target address identifier as hidden text into the third image to obtain the fourth image.
[0107] For example, the transmitting device uses dedicated software or tools and image steganography to hide the target address identifier as steganography in a third image, and uses the third image containing the hidden target address identifier as a fourth image.
[0108] S503. The fourth image is sent to the receiving device so that the receiving device can obtain the first public key and the second public key through the fourth image.
[0109] For example, the sending device sends the fourth image to the receiving device via email, cloud storage, or other channels. After receiving the fourth image, the receiving device uses dedicated software or tools to parse it, extracts the hidden target address identifier from it, and finds the storage address of the first public key data based on the target address identifier and the DHT of the distributed storage network. Then, based on this storage address, it accurately downloads the first public key data from the distributed storage network to obtain the first and second public keys of the sending device required for decryption.
[0110] In this embodiment, the sending device encapsulates the first and second public keys into first public key data and uploads it to the distributed storage network. It then receives a target address identifier sent by the distributed storage network based on the hash value of the first public key data. The sending device writes the target address identifier as cryptic text into a third image to obtain a fourth image, and sends the fourth image to the receiving device, enabling the receiving device to obtain the first and second public keys through the fourth image. This achieves decentralized public key exchange and enhances the resistance to censorship and privacy protection during public key exchange.
[0111] Accordingly, the steps for the receiving device to send the third and fourth public keys to the sending device through the distributed storage network are similar to the steps for the sending device to send the first and second public keys to the receiving device through the distributed storage network in the previous embodiment, and will not be described in detail here.
[0112] Figure 7 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 6 .like Figure 7 As shown, in step S201 above, the sending device encrypts the data to be transmitted to obtain the first data, including: S601. Generate a fifth key and use the fifth key to perform symmetric encryption on the data to be transmitted to obtain the ciphertext of the data to be transmitted.
[0113] For example, the transmitting device uses a quantum random number generator to generate a fifth key SK, which can be 32 bytes, for instance.
[0114] The transmitting device uses the fifth key SK as the encryption key and employs a symmetric encryption algorithm (such as the SM4 algorithm) to symmetrically encrypt the data to be transmitted, thus obtaining the ciphertext Encrypt of the data to be transmitted.
[0115] S602. Generate a random number, use the random number as the sixth key, and encrypt the sixth key using the third public key of the receiving device to obtain the ciphertext of the sixth key.
[0116] For example, the transmitting device uses a quantum random number generator to generate a random number and uses that random number as the sixth key EK.
[0117] The transmitting device uses the receiving device's third public key (i.e., the receiving device's Kyber public key) as the encryption key to encrypt the sixth key EK, obtaining the ciphertext KE of the sixth key. Since the encryption key is the receiving device's third public key, the receiving device can use its locally stored third private key as the decryption key for accurate decryption.
[0118] S603. Use the sixth key to perform symmetric encryption on the fifth key to obtain the ciphertext of the fifth key.
[0119] For example, the transmitting device uses the sixth key EK as the encryption key to perform symmetric encryption on the fifth key SK, obtaining the ciphertext SKE of the fifth key.
[0120] S604. Concatenate the message header, message version number, algorithm version number, ciphertext of the fifth key, ciphertext of the sixth key, and ciphertext of the data to be transmitted to obtain the concatenated data, and determine the hash value of the concatenated data.
[0121] For example, the sending device concatenates the specified message header, message version number, algorithm version number, ciphertext SKE of the fifth key, ciphertext KE of the sixth key, and ciphertext Encrypt of the data to be transmitted in sequence to obtain the concatenated data. The algorithm version number indicates the identifiers of all algorithms required by the receiving device for decryption.
[0122] The transmitting device performs a hash operation on the concatenated data to obtain the hash value EN of the concatenated data.
[0123] S605. Use the second private key of the sending device to digitally sign the hash value of the concatenated data to obtain the signed data.
[0124] For example, the sending device uses its second private key (i.e., the Dilithium private key) to digitally sign the hash value EN of the concatenated data to obtain the signed data.
[0125] Since the sending device uses its second private key to sign the data, the receiving device can use the sending device's second public key, which it downloads from the distributed storage network, to accurately verify the signed data.
[0126] S606. Integrate the message header, message version number, and algorithm version number into a message header field; integrate the ciphertext of the sixth key and the ciphertext of the fifth key into a key field; use the ciphertext of the data to be transmitted as a ciphertext field; use the signed data as a signature field; and integrate the message header field, key field, ciphertext field, and signature field into first data.
[0127] For example, the sending device integrates the specified message header, message version number and algorithm version number into a message header field, integrates the ciphertext KE of the sixth key and the ciphertext SKE of the fifth key into a key field, uses the ciphertext Encrypt of the data to be transmitted as the ciphertext field, and uses the signed data as the signature field.
[0128] The transmitting device integrates the message header field, key field, ciphertext field, and signature field to generate first data containing the message header field, key field, ciphertext field, and signature field.
[0129] In this embodiment, the sending device generates a fifth key and uses it to symmetrically encrypt the data to be transmitted, obtaining the ciphertext of the data to be transmitted. The sending device generates a random number, uses the random number as a sixth key, and encrypts the sixth key using the receiving device's third public key, obtaining the ciphertext of the sixth key. The sending device then uses the sixth key to symmetrically encrypt the fifth key, obtaining the ciphertext of the fifth key. The sending device concatenates the message header, message version number, algorithm version number, the ciphertext of the fifth key, the ciphertext of the sixth key, and the ciphertext of the data to be transmitted, obtaining concatenated data and determining the hash value of the concatenated data. The sending device uses its second private key to digitally sign the hash value of the concatenated data, obtaining signed data. The message header, message version number, and algorithm version number are integrated into a message header field; the ciphertext of the sixth key and the ciphertext of the fifth key are integrated into a key field; the ciphertext of the data to be transmitted is used as the ciphertext field; the signed data is used as the signature field; and the message header field, key field, ciphertext field, and signature field are integrated into first data. Enhance the quantum-resistant security of the first data to prevent forgery or tampering with the first data.
[0130] Figure 8 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 7 .like Figure 8 As shown, in the above steps, the receiving device obtains each encrypted data block from the distributed storage network according to the hidden text information, and combines the encrypted data blocks into the first encrypted data, including: S701. Obtain the second encrypted data from the distributed storage network based on the address identification information.
[0131] The second encrypted data includes at least one encrypted data block, and the order of the encrypted data blocks in the second encrypted data and the first encrypted data may be the same or different.
[0132] For example, the receiving device finds the storage address of each encrypted data block based on the DHT of the distributed storage network and the address identifier corresponding to each encrypted data block in the address identification information, and then downloads each encrypted data block from the distributed storage network based on the storage address of each encrypted data block to obtain the second encrypted data composed of each encrypted data block.
[0133] S702. Based on the sequence information and the second encrypted data, the first encrypted data is obtained by combining them.
[0134] For example, considering that the order of each encrypted data block in the second encrypted data is inconsistent with the order of each encrypted data block represented by the order information, the receiving device combines the second encrypted data into the first encrypted data according to the order of each encrypted data block represented by the order information. If the order of each encrypted data block in the second encrypted data is consistent with that in the first encrypted data, then the second encrypted data is used as the first encrypted data.
[0135] In this embodiment, the receiving device retrieves second encrypted data from the distributed storage network based on address identification information, and combines the second encrypted data with the sequence information to obtain first encrypted data. This ensures the accuracy of each encrypted data block in the first encrypted data, guaranteeing that the correct first encrypted data proceeds to the decryption stage.
[0136] Figure 9 A flowchart illustrating the data transmission method provided in the embodiments of this application. Figure 8 .like Figure 9 As shown, in step S108 above, the receiving device decrypts the encrypted data to obtain the data to be transmitted, including: S801. Obtain the first public key and the second public key of the sending device based on the device identifier of the sending device.
[0137] For example, the receiving device can retrieve the first and second public keys of the sending device from its local storage based on the device identifier of the sending device. These public keys were received during the prior public key exchange between the two parties.
[0138] The first and second public keys of the sending device are used by the receiving device for decryption and signature verification, respectively.
[0139] S802. Using the second public key, the signed data in the signature field is verified. If the verification is successful, the third private key of the receiving device is used to decrypt the ciphertext of the sixth key in the key field to obtain the sixth key.
[0140] For example, since the sending device uses its second private key (i.e., the Dilithium private key) to sign, the receiving device uses the sending device's second public key (i.e., the Dilithium public key) to verify the signed data in the signature field of the first encrypted data. This verifies whether the first encrypted data obtained by the receiving device is legitimately from the sending device, preventing the first encrypted data from being tampered with or forged.
[0141] If the signature verification is successful, since the ciphertext KE of the sixth key is obtained by the sending device encrypting the sixth key EK with the third public key of the receiving device (i.e., the receiving device's Kyber public key) as the encryption key, the receiving device will use the third private key of the receiving device (i.e., the receiving device's Kyber private key) as the decryption key to decrypt the ciphertext KE of the sixth key, thus obtaining the sixth key EK.
[0142] If the signature verification fails, the receiving device terminates the process to avoid using the first encrypted data that has been forged or tampered with.
[0143] S803. Using the sixth key, the ciphertext of the fifth key in the key field is symmetrically decrypted to obtain the fifth key.
[0144] For example, since the ciphertext SKE of the fifth key is obtained by the sending device symmetrically encrypting the fifth key SK using the sixth key EK as the encryption key, the receiving device uses the decrypted sixth key EK as the decryption key to symmetrically decrypt the ciphertext SKE of the fifth key in the key field of the first encrypted data to obtain the fifth key SK.
[0145] S804. Using the fifth key, the ciphertext of the data to be transmitted in the ciphertext field is symmetrically decrypted to obtain the data to be transmitted.
[0146] For example, since the encrypted Encrypt of the data to be transmitted is obtained by the sending device using the fifth key SK as the encryption key and employing a symmetric encryption algorithm to symmetrically encrypt the data to be transmitted, the receiving device uses the decrypted fifth key SK as the decryption key to decrypt the encrypted Encrypt of the data to be transmitted, and obtains the data to be transmitted.
[0147] In this embodiment, the receiving device obtains the first and second public keys of the sending device based on the sending device's device identifier. Using the second public key, it verifies the signed data in the signature field. If the verification passes, it uses its third private key to decrypt the ciphertext of the sixth key in the key field, obtaining the sixth key. Using the sixth key, it performs symmetric decryption on the ciphertext of the fifth key in the key field, obtaining the fifth key. Finally, it uses the fifth key to perform symmetric decryption on the ciphertext of the data to be transmitted in the ciphertext field, obtaining the data to be transmitted. This achieves the decryption of the first encrypted data, ensuring the accuracy and security of the data to be transmitted.
[0148] Based on the same inventive concept, this application also provides a data transmission device corresponding to the data transmission method executed by the transmitting device. Since the principle of the device in this application is similar to the data transmission method executed by the transmitting device in the above-mentioned application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0149] Figure 10 This is a module structure diagram of a data transmission device provided in an embodiment of this application. Figure 10 As shown, the device includes: Encryption module 901 is used to encrypt the data to be transmitted to obtain the first encrypted data; Upload module 902 is used to upload the first encrypted data to the distributed storage network so that the first encrypted data is distributed and stored in segments in the distributed storage network; The generation module 903 is used to generate a single second image based on the hidden text information and a single first image. The hidden text information carries the address identification information sent by the distributed storage network and the device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data. The hidden text information is used to obtain and combine the first encrypted data from the distributed storage network. The first image is used to hide the hidden text information. The sending module 904 is used to send the second image to the receiving device.
[0150] As an optional implementation, the encryption module 901 is specifically used for: Encrypt the data to be transmitted to obtain the first data; The first data is segmented to obtain the first encrypted data, wherein the first encrypted data is composed of at least one encrypted data block in a sequential relationship.
[0151] As an optional implementation, the data transmission device further includes: a first determining module 905, the first determining module 905 being used for: Receive address identification information sent by the distributed storage network, wherein the address identification information is the address identifier corresponding to each encrypted data block; Based on the address identifier information, the device identifier of the sending device, and the sequence information, the hidden text information is determined, where the sequence information represents the sequential relationship between each encrypted data block.
[0152] As an optional implementation, any address identifier is determined by calculating its hash value based on the content of the encrypted data block corresponding to the address identifier.
[0153] As an optional implementation, the generation module 903 is also used for: Generate a first key pair and a second key pair for the transmitting device. The first key pair includes a first public key and a first private key, and the second key pair includes a second public key and a second private key. The first and second public keys are sent to the receiving device through a distributed storage network, and the third public key in the third key pair and the fourth public key in the fourth key pair of the receiving device are received through the distributed storage network.
[0154] As an optional implementation, the generation module 903 is also used for: The first public key and the second public key are encapsulated into first public key data, the first public key data is uploaded to the distributed storage network, and the target address identifier sent by the distributed storage network based on the hash value of the first public key data is received. The target address identifier is written as cryptic text into the third image to obtain the fourth image; The fourth image is sent to the receiving device so that the receiving device can obtain the first public key and the second public key through the fourth image.
[0155] As an optional implementation, the encryption module 901 is specifically used for: Generate a fifth key and use the fifth key to perform symmetric encryption on the data to be transmitted to obtain the ciphertext of the data to be transmitted; Generate a random number, use the random number as the sixth key, and encrypt the sixth key using the third public key of the receiving device to obtain the ciphertext of the sixth key; The fifth key is symmetrically encrypted using the sixth key to obtain the ciphertext of the fifth key; The message header, message version number, algorithm version number, ciphertext of the fifth key, ciphertext of the sixth key, and ciphertext of the data to be transmitted are concatenated to obtain the concatenated data, and the hash value of the concatenated data is determined. The hash value of the concatenated data is digitally signed using the second private key of the sending device to obtain the signed data. The message header, message version number, and algorithm version number are integrated into a message header field. The ciphertext of the sixth key and the ciphertext of the fifth key are integrated into a key field. The ciphertext of the data to be transmitted is used as the ciphertext field. The signed data is used as the signature field. The message header field, key field, ciphertext field, and signature field are integrated into the first data.
[0156] Based on the same inventive concept, this application also provides a data transmission device corresponding to the data transmission method executed by the receiving device. Since the principle of the device in this application is similar to the data transmission method executed by the receiving device in the above-mentioned embodiments of this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0157] Figure 11 This is a module structure diagram of another data transmission device provided in an embodiment of this application. (See diagram below.) Figure 11 As shown, the device includes: The receiving module 1001 is used to receive a single second image sent by the transmitting device, wherein the second image is an image carrying hidden text information; The second determining module 1002 is used to determine hidden text information based on the second image. The hidden text information carries address identification information sent by the distributed storage network and device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data. The first encrypted data is distributed and stored in the distributed storage network in segments. The combination module 1003 is used to obtain and combine first encrypted data from the distributed storage network according to the hidden text information, wherein the first encrypted data is composed of at least one encrypted data block in a sequential relationship; The decryption module 1004 is used to decrypt the first encrypted data to obtain the data to be transmitted.
[0158] As an optional implementation, the hidden information includes address identification information, device identifier of the transmitting device, and sequence information, wherein the address identification information is the address identifier corresponding to each encrypted data block, and the sequence information represents the sequential relationship between the encrypted data blocks; the combination module 1003 is specifically used for: Based on the address identification information, second encrypted data is obtained from the distributed storage network, wherein the second encrypted data includes at least one encrypted data block, and the order of the encrypted data blocks in the second encrypted data and the first encrypted data is the same or different; The first encrypted data is obtained by combining the sequence information and the second encrypted data.
[0159] As an optional implementation, any address identifier is determined by calculating its hash value based on the content of the encrypted data block corresponding to the address identifier.
[0160] As an optional implementation, the first encrypted data includes a header field, a key field, a ciphertext field, and a signature field; the decryption module 1004 is specifically used for: Based on the device identifier of the sending device, obtain the first public key and the second public key of the sending device; The second public key is used to verify the signed data in the signature field. If the verification is successful, the third private key of the receiving device is used to decrypt the ciphertext of the sixth key in the key field to obtain the sixth key. Using the sixth key, the ciphertext of the fifth key in the key field is symmetrically decrypted to obtain the fifth key; Using the fifth key, the ciphertext of the data to be transmitted in the ciphertext field is symmetrically decrypted to obtain the data to be transmitted.
[0161] This application also provides an electronic device, which can be the aforementioned transmitting or receiving device. For example... Figure 11 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application, including a processor 111, a memory 112, and a bus 113. The memory 112 stores machine-readable instructions executable by the processor 111. When the electronic device is running, the processor 111 communicates with the memory 112 via the bus 113, and the processor 111 executes the machine-readable instructions to perform the method steps performed by the transmitting or receiving device described above.
[0162] This application also provides a computer storage medium, such as... Figure 1 As shown, a computer program is stored on a computer-readable storage medium. When the computer program is run by a processor, it executes the method steps performed by the transmitting or receiving device described above.
[0163] This application also provides a computer program product having a computer-readable storage medium. When a computer program stored on the computer-readable storage medium is run by a processor, it executes the method steps performed by the transmitting or receiving device described above.
[0164] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0165] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as 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 solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0166] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A data transmission method, characterized in that, Applied to a transmitting device, the method includes: The data to be transmitted is encrypted to obtain the first encrypted data; The first encrypted data is uploaded to a distributed storage network so that the first encrypted data is stored in segments in the distributed storage network; A single second image is generated based on the hidden text information and a single first image. The hidden text information carries the address identification information sent by the distributed storage network and the device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data. The hidden text information is used to obtain and combine the first encrypted data from the distributed storage network. The first image is used to hide the hidden text information. The second image is sent to the receiving device.
2. The method as described in claim 1, characterized in that, The process of encrypting the data to be transmitted to obtain first encrypted data includes: The data to be transmitted is encrypted to obtain the first data; The first data is segmented to obtain the first encrypted data, wherein the first encrypted data is composed of at least one encrypted data block in a sequential relationship.
3. The method as described in claim 2, characterized in that, After uploading the first encrypted data to the distributed storage network and before generating a single second image, the method further includes: Receive address identification information sent by the distributed storage network, wherein the address identification information is the address identifier corresponding to each encrypted data block; The hidden text information is determined based on the address identification information, the device identification of the sending device, and the sequence information, wherein the sequence information represents the sequential relationship between the encrypted data blocks.
4. The method according to claim 1, characterized in that, Before encrypting the data to be transmitted to obtain the first encrypted data, the process includes: Generate a first key pair and a second key pair for the transmitting device, wherein the first key pair includes a first public key and a first private key, and the second key pair includes a second public key and a second private key; The first public key and the second public key are sent to the receiving device through the distributed storage network, and the third public key in the third key pair of the receiving device and the fourth public key in the fourth key pair of the receiving device are received through the distributed storage network.
5. A data transmission method, characterized in that, Applied to a receiving device, the method includes: Receive a single second image sent by a transmitting device, wherein the second image is an image carrying hidden text information; Based on the second image, the hidden text information is determined, wherein the hidden text information carries the address identification information sent by the distributed storage network and the device identification of the sending device. The address identification information is determined by the distributed storage network based on the storage address of the first encrypted data, and the first encrypted data is distributed and stored in the distributed storage network in segments. Based on the hidden text information, first encrypted data is obtained and combined from the distributed storage network, wherein the first encrypted data is composed of at least one encrypted data block in a sequential relationship; The first encrypted data is decrypted to obtain the data to be transmitted.
6. The method as described in claim 5, characterized in that, The hidden information includes address identification information, device identification of the sending device, and sequence information, wherein the address identification information is the address identifier corresponding to each encrypted data block, and the sequence information represents the sequential relationship between the encrypted data blocks; The step of obtaining and combining the first encrypted data from the distributed storage network based on the hidden text information includes: According to the address identification information, second encrypted data is obtained from the distributed storage network, wherein the second encrypted data includes at least one encrypted data block, and the order of the encrypted data blocks in the second encrypted data and the first encrypted data is the same or different; The first encrypted data is obtained by combining the sequence information and the second encrypted data.
7. The method as described in claim 6, characterized in that, The step of decrypting the first encrypted data to obtain the data to be transmitted includes: Based on the device identifier of the sending device, obtain the first public key and the second public key of the sending device; The second public key is used to verify the signed data in the signature field. If the verification is successful, the third private key of the receiving device is used to decrypt the ciphertext of the exchange key in the key field to obtain the exchange key. Using the exchange key, the ciphertext of the session key in the key field is symmetrically decrypted to obtain the session key; Using the session key, the ciphertext of the data to be transmitted in the ciphertext field is symmetrically decrypted to obtain the data to be transmitted.
8. An electronic device, characterized in that, include: The electronic device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the data transmission method as described in any one of claims 1 to 4 or 5 to 7.
9. A computer storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the data transmission method as described in any one of claims 1 to 4 or 5 to 7.
10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the method described in any one of claims 1 to 4 or 5 to 7.