Image transmission methods, clients, servers, and storage media

By using MD5 and obfuscation algorithms to generate interactive requests between the client and server, and transmitting images in an encrypted manner, the problem of low security in image transmission is solved, and secure data transmission and anti-tampering effects are achieved.

CN119449964BActive Publication Date: 2025-10-31INNER MONGOLIA MOBILE +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310963470.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-01
Publication Date
2025-10-31
Estimated Expiration
2043-08-01

AI Technical Summary

Technical Problem

Image transmission between the client and the server has low security, is easily cracked, and the data is easily tampered with.

Method used

The MD5 algorithm is used to generate the first digest. Combined with asymmetric encryption and obfuscation algorithms, an interactive request is generated and the image is transmitted in encrypted form. The client and server verify data security through multiple algorithms.

Benefits of technology

It improves the security of image transmission, prevents data from being cracked and tampered with, and ensures the integrity and security of data during transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449964B_ABST
    Figure CN119449964B_ABST
Patent Text Reader

Abstract

This invention discloses an image transmission method, client, server, and storage medium, relating to the field of data transmission technology. The method includes: the client obtaining request parameters, generating an interaction request based on the request parameters, and sending the interaction request to the server; the server, when a first digest and a second digest match, generating a first image based on the request parameters and obtaining a second image, and generating a third image based on the first and second images using an obfuscation algorithm; the client decrypting the third image sent by the server using the obfuscation algorithm to obtain the decrypted third image, generating a target image based on the decrypted third image and a fourth image, and displaying the target image. This invention solves the problem of low security in image transmission between the client and server, achieving the effect of ensuring image transmission security and preventing data tampering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data transmission technology, and in particular to an image transmission method, client, server, and storage medium. Background Technology

[0002] In related technologies, image transmission between clients and servers typically employs segmented encryption to encrypt images before uploading them to the server, where the encrypted files are stored. However, when the client downloads images from the server, it accesses the same encrypted file each time, resulting in a consistently identical image stream. This makes the encrypted file vulnerable to cracking, significantly reducing security. Furthermore, even if the downloaded stream data is tampered with, it can still be displayed on the client, thus posing a risk of data tampering and further compromising image transmission security. Summary of the Invention

[0003] The main objective of this invention is to provide an image transmission method, client, server, and storage medium, aiming to solve the technical problem of low security in image transmission between the client and server in related technologies.

[0004] To achieve the above objectives, the present invention adopts the following technical solution:

[0005] In a first aspect, the present invention provides an image transmission method applied to a client, the method comprising:

[0006] Obtain request parameters, the request parameters including a first digest, the first digest being obtained based on the MD5 algorithm;

[0007] An interaction request is generated based on the request parameters and sent to the server. When the first digest and the second digest are consistent, the server generates a first image and obtains a second image based on the request parameters, and generates a third image based on the first image and the second image using an obfuscation algorithm. The second digest is obtained based on the MD5 algorithm and the request parameters.

[0008] The third image sent by the server is decrypted using an obfuscation algorithm to obtain the decrypted third image;

[0009] A target image is generated based on the decrypted third and fourth images, and the target image is displayed; wherein the fourth image is obtained according to the request parameters.

[0010] Optionally, in the above image transmission method, the step of obtaining the request parameters includes:

[0011] Generate a client timestamp based on the client's current system time;

[0012] The username is encrypted using an asymmetric encryption algorithm to obtain the encrypted username;

[0013] Based on the MD5 algorithm, a first digest is generated according to the encrypted username and the client timestamp;

[0014] The client timestamp, the encrypted username, and the first digest are determined as the request parameters.

[0015] Optionally, in the above image transmission method, the step of generating a target image based on the decrypted third and fourth images and displaying the target image includes:

[0016] A fourth image is generated based on the combination of the client timestamp and the username.

[0017] The character stream of the decrypted third image is compared with the character stream of the fourth image, and the same characters are deleted, while the different characters are kept.

[0018] Generate a target image based on the different characters;

[0019] Display the target image.

[0020] Optionally, in the above image transmission method, the step of displaying the target image includes:

[0021] The third image is decrypted using an asymmetric encryption algorithm to obtain the username information;

[0022] Compare the username information with the username;

[0023] When the username information matches the username, the target image is displayed.

[0024] Secondly, the present invention provides an image transmission method applied to a server, the method comprising:

[0025] The system receives an interaction request sent by a client, the interaction request being generated by the client based on acquired request parameters, wherein the request parameters include a first digest, the first digest being obtained by the client based on the MD5 algorithm;

[0026] When the first digest matches the second digest, a first image is generated based on the request parameters, and a second image is obtained; wherein the second digest is obtained based on the MD5 algorithm and the request parameters;

[0027] A third image is generated based on the first image and the second image using a confusing algorithm;

[0028] The third image is sent to the client, which then decrypts the third image using an obfuscation algorithm to obtain the decrypted third image. The client then generates a target image based on the decrypted third image and the fourth image, and displays the target image. The fourth image is obtained by the client based on the request parameters.

[0029] Optionally, in the above image transmission method, the request parameters further include a client timestamp and an encrypted username;

[0030] Before the step of generating a first image and obtaining a second image based on the request parameters when the first digest matches the second digest, the method further includes:

[0031] Based on the interaction request, the corresponding interaction credential information is extracted. The interaction credential information includes the server timestamp and the pre-stored username.

[0032] The client timestamp is compared with the server timestamp to obtain the time difference;

[0033] When the time difference does not exceed a preset time, the encrypted username is decrypted to obtain the decrypted username.

[0034] Compare the decrypted username with the pre-stored username;

[0035] When the decrypted username matches the pre-stored username, the second digest is generated based on the MD5 algorithm according to the decrypted username and the client timestamp.

[0036] Optionally, in the above image transmission method, the step of generating a first image according to the request parameters and obtaining a second image when the first digest and the second digest are consistent includes:

[0037] When the first digest matches the second digest, a first image is generated based on the combination of the client timestamp and the decrypted username.

[0038] Based on the decrypted username, the user's pre-stored image is extracted to obtain the second image.

[0039] Thirdly, the present invention provides a client, comprising:

[0040] Memory and processor;

[0041] The memory stores a computer program, which, when executed by the processor, implements the image transmission method described above.

[0042] Fourthly, the present invention provides a server, comprising:

[0043] Memory and processor;

[0044] The memory stores a computer program, which, when executed by the processor, implements the image transmission method described above.

[0045] Fifthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by one or more processors, implements the image transmission method described above.

[0046] The above-described one or more technical solutions provided by this invention can have the following advantages or at least achieve the following technical effects:

[0047] This invention proposes an image transmission method, client, server, and storage medium. The client obtains request parameters including a first digest based on the MD5 algorithm, generates an interaction request, and sends it to the server. When the first digest matches a second digest obtained based on the MD5 algorithm and the request parameters, the server generates a first image and obtains a second image based on the request parameters. A third image is then generated based on the first and second images using an obfuscation algorithm. The client then decrypts the third image sent by the server using the obfuscation algorithm, obtaining the decrypted third image. A target image is generated and displayed based on the decrypted third image and a fourth image, achieving the purpose of encrypted image data transmission. This method uses multiple encryption algorithms, including MD5 and obfuscation algorithms, for image transmission. The mutual verification of these algorithms reduces the risk of being cracked and prevents packet sniffing tools from intercepting the request, tampering with the data, and simulating access, which could lead to incorrect display on the client side. This ensures the security of image transmission and prevents data tampering. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these provided drawings without creative effort.

[0049] Figure 1 This is a flowchart illustrating the first embodiment of the image transmission method of the present invention;

[0050] Figure 2 This is a flowchart illustrating the second embodiment of the image transmission method of the present invention;

[0051] Figure 3 This is a schematic diagram of the interactive process of the image transmission method of the present invention.

[0052] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0054] It should be noted that in this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element. In this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this is based on the fact that those skilled in the art can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0055] Terminology Explanation:

[0056] MD5: MD5 stands for Message-Digest Algorithm, a widely used cryptographic hash function that produces a 128-bit (16-byte, 8 bits per byte) hash value (commonly represented in 32-bit hexadecimal, such as 0caa3b23b8da53f9e4e041d95dc8fa2c) to ensure the integrity and consistency of transmitted information.

[0057] Data is typically transmitted between the client and server using JSON or XML formats. JSON is a lightweight data exchange format. Currently, the client retrieves contact photos by submitting the image name and the current user's token to the server via the HTTP POST method. After verifying the information, the server returns JSON data. If verification fails, a failure message is returned; if verification succeeds, encrypted image data is returned. Simple encryption methods such as BASE64 encoding and 8-bit binary conversion are commonly used. These encryption methods can be easily cracked using common algorithms, making the transmitted data easily decryptable and posing a risk of data leakage between the client and server.

[0058] Analysis of the relevant technologies reveals that image transmission between the client and server typically employs segmented encryption to encrypt images before uploading them to the server, where the corresponding encrypted files are stored. The problem with this approach is that when the client downloads images from the server, it accesses the same encrypted file each time, resulting in an identical image stream file being returned each time. This makes the encrypted file easily cracked, significantly reducing security. Furthermore, the fact that the encryption method is the same for each download request makes the encrypted file even easier to crack.

[0059] Furthermore, client-side data display is achieved through API transmission. Packet capture tools can capture the entire data transmission process and can tamper with and save the data returned by the server, replacing the transmitted content. Since clients generally cannot verify whether the encrypted file uploaded to the server and the downloaded streaming file are the same file, even if the downloaded streaming file data is tampered with, it can still be displayed on the client. Therefore, there is a risk that data can be easily tampered with, reducing the security of image transmission.

[0060] In view of the low security issues in image transmission between clients and servers in related technologies, this invention provides an image transmission method, the overall idea of ​​which is as follows:

[0061] The client obtains request parameters including a first digest obtained based on the MD5 algorithm, generates an interactive request, and sends it to the server. When the first digest matches the second digest obtained based on the MD5 algorithm and the request parameters, the server generates a first image and obtains a second image based on the request parameters. It then generates a third image based on the first and second images using an obfuscation algorithm. The client then decrypts the third image sent by the server using the obfuscation algorithm to obtain the decrypted third image. Finally, the client generates and displays the target image based on the decrypted third image and a fourth image.

[0062] The above technical solution achieves the goal of encrypted image data transmission. This method uses multiple encryption algorithms, such as MD5 and obfuscation algorithms, for image transmission. The mutual verification of multiple algorithms can reduce the risk of being cracked and prevent packet capture tools from intercepting requests, tampering with data, and simulating access, which would lead to incorrect display on the client side. This ensures the security of image transmission and prevents data from being tampered with.

[0063] The image transmission method, client, server, and storage medium provided by the present invention will be described in detail below with reference to the accompanying drawings and through specific embodiments and implementation methods.

[0064] Example 1

[0065] Reference Figure 1 and Figure 3 The present invention provides a first embodiment of the image transmission method, which is applied to a client.

[0066] A client refers to a terminal device capable of network connectivity. A client can be a mobile phone, computer, tablet, laptop, embedded industrial control computer, or other terminal device. In this embodiment, the client connects to the server via a network to transmit images.

[0067] The following is combined Figure 1 The flowchart shown and Figure 3 The interactive flow diagram shown illustrates the image transmission method of this embodiment in detail. The method may include the following steps:

[0068] Step S110: Obtain request parameters, including a first digest, which is obtained based on the MD5 algorithm.

[0069] Specifically, the client obtains request parameters, which include a first digest obtained based on the MD5 algorithm and the basic request parameters. These basic request parameters may be unique identifiers representing the client's identity, unique timestamps representing the request, and / or user information representing the current user's identity on the client, etc., without limitation here.

[0070] Specifically, step S110 may include:

[0071] Step S111: Generate a client timestamp based on the client's current system time;

[0072] Step S112: Encrypt the username using an asymmetric encryption algorithm to obtain the encrypted username;

[0073] Step S113: Based on the MD5 algorithm, generate the first digest according to the encrypted username and client timestamp;

[0074] Step S114: Determine the client timestamp, encrypted username, and first digest as request parameters.

[0075] Asymmetric encryption algorithms require two keys: a public key and a private key. These are a pair; if data is encrypted with the public key, it can only be decrypted with the corresponding private key, and vice versa. Because encryption and decryption use different keys, it's called asymmetric encryption. Security generally depends on the algorithm and the keys. In asymmetric encryption algorithms, the key system corresponds to two keys. When one key is made public, the other key is not simultaneously revealed, unlike in symmetric cryptography. Therefore, asymmetric encryption algorithms have higher security. Furthermore, the good confidentiality and complex algorithm strength of asymmetric encryption algorithms can further enhance their security.

[0076] In this embodiment, the client generates a client timestamp securityCode based on the current system time, with the timestamp unit being milliseconds. Simultaneously, an asymmetric encryption algorithm is used to encrypt the username of the currently logged-in user on the client, resulting in the encrypted username legalMark. To prevent request information from being forged, an MD5 algorithm is used to generate a unique digest of the current request based on the client timestamp securityCode and the encrypted username legalMark, resulting in a first digest sysflag. Then, the client can use the client timestamp securityCode, the encrypted username legalMark, and the first digest sysflag as the main parameters for initiating the interaction request, thus obtaining the request parameters.

[0077] The MD5 encryption algorithm possesses characteristics such as irreversibility, high discreteness, compressibility (fixed length), and weak collision resistance. The client, based on asymmetric encryption and the MD5 algorithm, encrypts and transmits user information to the server. Simultaneously, it generates a first digest based on the current system time and timestamp. This first digest string can be understood as part of the initiated interaction request; it is irreversible and offers high security. By adding transmission parameters to the interaction request and employing multiple algorithms for mutual verification, it can prevent cracking.

[0078] Step S120: Generate an interaction request based on the request parameters and send the interaction request to the server. When the first digest and the second digest are consistent, the server generates a first image and obtains a second image based on the request parameters. Then, it generates a third image based on the first image and the second image using an obfuscation algorithm. The second digest is obtained based on the MD5 algorithm and the request parameters.

[0079] Specifically, after receiving the request parameters, the client generates an interaction request based on the request parameters and sends the interaction request to the server. After receiving the interaction request, the server can obtain a second digest based on the MD5 algorithm and the request parameters. Then, if the first digest matches the second digest, the server generates a first image based on the request parameters and obtains a second image. Finally, the server generates a third image based on the first image and the second image using an obfuscation algorithm and sends the third image to the client.

[0080] After the client uploads image data to the server, the server can verify whether the image data sent by the client is correct. If the data is correct, the server will then send the obfuscated image data to the client, thus enabling the client to download the image data.

[0081] More specifically, based on the request parameters including the client timestamp, encrypted username, and first digest, the client generates an interaction request and sends it to the server. Upon receiving the interaction request, the server can extract the corresponding interaction credential information, which may include the server timestamp and a pre-stored username. The server then compares the client timestamp with the server timestamp to obtain the time difference. If the time difference does not exceed a preset time, the encrypted username is decrypted to obtain the decrypted username. The decrypted username is then compared with the pre-stored username. If they match, a second digest is generated based on the decrypted username and client timestamp using the MD5 algorithm. If the first digest matches the second digest, a first image is generated based on the combination of the client timestamp and the decrypted username. The user's pre-stored image is then extracted based on the decrypted username to obtain the second image. Finally, a third image is generated based on the first and second images using an obfuscation algorithm, and this third image is sent to the client.

[0082] In this embodiment, after the client generates an interaction request and sends it to the server, the server performs the following operations:

[0083] First, the server extracts the corresponding interaction credential information (tokenid information) based on the interaction request. This tokenid information may include the server timestamp and the pre-stored username. The server timestamp is the current timestamp of the server, and the pre-stored username is the user information stored in advance on the server. The tokenid information is the unique credential for interaction between the client and the server and can be used to query whether the received interaction request is legitimate.

[0084] Then, the server compares the client's timestamp `securityCode` in the request parameters with the server's timestamp in the `tokenid` information to obtain the time difference. Based on this time difference and a preset time, the server determines whether the interaction request is valid. If the time difference does not exceed the preset time, the interaction request is considered valid, and subsequent steps can be executed, such as decrypting the encrypted username. If the time difference is greater than or equal to the preset time, the interaction request is considered invalid, and a prompt message can be directly returned to the client indicating that the image transmission failed. The preset time can be set according to actual needs, for example, to 1 minute.

[0085] Secondly, after the server determines that the interaction request is legitimate, it can use an asymmetric decryption algorithm to decrypt the characters of the encrypted username "legalMark" in the request parameters to obtain the decrypted username. Then, the decrypted username is compared with the pre-stored username in the tokenid information. If the decrypted username matches the pre-stored username, subsequent steps can be executed, such as generating a second digest. If the decrypted username does not match the pre-stored username, a prompt message can be directly returned to the client, indicating that the image transmission failed.

[0086] Next, if the decrypted username matches the pre-stored username, a new digest is generated using the MD5 algorithm based on the client timestamp securityCode in the request parameters and the decrypted username, resulting in a second digest. Then, the first digest is compared with the second digest. If the first digest matches the second digest, subsequent steps can be executed, such as generating the first image based on the combination of the client timestamp and the decrypted username. If the first digest does not match the second digest, a prompt message can be directly returned to the client, indicating that the image transmission failed.

[0087] Finally, when the first and second digests match, the server can use the combination of the client's timestamp (securityCode) and the decrypted username in the request parameters to generate a PNG or JPG image using open-source image code, obtaining the first image. Then, based on the decrypted username, it extracts the user's pre-stored image, such as their profile picture, to obtain the second image. Finally, based on an obfuscation algorithm, it generates a third image from the first and second images and sends this third image to the client. Specifically, generating the third image from the first and second images and sending it to the client can be achieved by using an I / O file stream to read the stream file of the first image and the stream file of the second image, saving these two stream files as a new file—the third image. This new file cannot be opened. To decrypt the third image, the first image is required to reconstruct the user's pre-stored image, such as their profile picture, thus increasing the security of image transmission.

[0088] In this embodiment, after receiving an interaction request, the server verifies the legitimacy of the request based on the request parameters, namely the client timestamp securityCode, the encrypted username legalMark, and the first digest sysflag. It also checks the request parameters; if they match, it performs character conversion based on the parameters to generate the first image. Simultaneously, it locates the corresponding person's headshot image based on the verified user information, thus obtaining the second image. Then, it uses an IO file stream to read the streaming files of the first and second images, saving the resulting file as the third image. This third image file cannot be opened directly. Because the generated first image contains relatively little information, the information contained in the synthesized third image can impact the server's memory, CPU, and network speed. Furthermore, an obfuscation algorithm is used to obfuscate the streaming file when generating the third image, ensuring the secure transmission of this third image.

[0089] In this embodiment, the processing on the server only encrypts a portion of the data, which can effectively reduce the server resource usage and time consumption during the client's encrypted image upload process, and can also effectively reduce the corresponding response time of the client during the decryption of the obtained image. On the server, request parameters are verified individually, including timestamps, usernames, and digests generated using the MD5 algorithm. This combination of multiple algorithms and verification processes not only prevents the client's interactive requests to the server from being cracked but also prevents packet sniffing tools from intercepting the requests and then simulating them to access the server. When an interactive request is intercepted by a packet sniffing tool, the transmission time increases significantly when the tool attempts to simulate the request. In this embodiment, the server verifies that the generation time of the request parameters in the interactive request is within one minute by checking if the time difference between the client's timestamp (securityCode) and the server's timestamp is within a preset time of one minute. Only after this condition is met are other parameters verified, effectively filtering out intercepted and simulated interactive requests. The request time is limited here; if the server determines the request is invalid, it directly rejects it and returns a prompt. Image generation only occurs after multiple parameters are mutually trusted. If the interactive request is intercepted and the data is tampered with, this can be identified beforehand. Therefore, even if the interactive request is intercepted, it will not impact server performance.

[0090] Step S130: Decrypt the third image sent by the server based on the obfuscation algorithm to obtain the decrypted third image.

[0091] Specifically, after the client receives the third image sent by the server, it decrypts the third image based on an obfuscation algorithm to obtain the decrypted third image.

[0092] In this embodiment, after the client obtains the encrypted file (third image) returned by the server, it can restore the source file using a custom obfuscation algorithm to obtain the decrypted third image. Specifically, the third image is decrypted, and obfuscated data is removed to obtain the target image. The server simultaneously places user information and time information into a stream file, generates an encrypted file, and returns it to the client. The client can save the corresponding encrypted stream file and, after verifying the consistency of the information in the file using the custom obfuscation algorithm, save it locally. Encryption can be used during storage. Through the above process, the downloaded user avatar image is ensured to be consistent with the interactive request uploaded to the server, preventing tampering. Furthermore, throughout the entire lifecycle, since each request parameter is different, the received encrypted file is also different, ensuring that the transmitted data is tamper-proof.

[0093] Step S140: Generate a target image based on the decrypted third and fourth images, and display the target image; wherein the fourth image is obtained according to the request parameters.

[0094] Specifically, while the client obtains the decrypted third image, it can also generate a fourth image based on the request parameters. Then, it generates the target image based on the decrypted third and fourth images, and displays the target image.

[0095] Specifically, step S140 may include:

[0096] Step S141: Generate the fourth image based on the combination of the client's timestamp and username;

[0097] Step S142: Compare the character stream of the decrypted third image with the character stream of the fourth image, delete the same characters, and keep the different characters;

[0098] Step S143: Generate target images based on different characters;

[0099] Step S144: Display the target image.

[0100] In this embodiment, the client obtains the decrypted third image and reads its character stream into memory, designated as file one. Simultaneously, it generates a fourth image based on a locally stored username (specifically, an unencrypted username) and a client timestamp (securityCode), and reads its character stream into memory, designated as file two. Then, it retrieves the character streams from both files one and two, compares them, deletes identical characters, and uses the remaining distinct characters to generate a new file, i.e., the target image. If the target image can be opened, it indicates successful restoration of the user's pre-stored image, and the target image is displayed. If the target image cannot be opened, restoration fails, and the encrypted image obtained by the client (the third image) may not be the user's pre-stored image, resulting in failure to display the user's avatar. Optionally, after generating the target image, the client can also encrypt and store it locally for quick retrieval or loading for display.

[0101] The encrypted image received by the client, also known as the third-party image, is different each time, making it impossible for others to intercept the image and greatly improving data security. Even if intercepted, it is difficult to analyze and crack the encrypted data, thus preventing the transmitted data from being tampered with.

[0102] Optionally, step S144 may include:

[0103] Step S144a: Decrypt the third image using an asymmetric encryption algorithm to obtain the username information;

[0104] Step S144b: Compare the username information with the username;

[0105] Step S144c: When the username information matches the username, display the target image.

[0106] Specifically, the client can also decrypt the third image using an asymmetric encryption algorithm to obtain the username information. The target image is only displayed if the username information matches the actual username, achieving dual authentication. The entire process is encrypted, ensuring greater data security and reliability. The username stored in the received encrypted image is compared with the username in the client. The image is only displayed if the comparison is successful. Thus, even if the data is tampered with, it will not be displayed on the client, thereby improving the security of the displayed data.

[0107] It should be noted that in this embodiment, the client and server can use the same asymmetric encryption algorithm. The client can use the public key of the asymmetric encryption algorithm for encryption, and the server can use the private key of the asymmetric encryption algorithm for decryption. When the client receives the third image and performs image reconstruction, it can also use the same asymmetric encryption algorithm and the private key of the asymmetric encryption algorithm for decryption.

[0108] In this embodiment, username information can be encrypted along with the third image using an asymmetric encryption algorithm, providing high security. The client verifies the consistency between the initiated interaction request and the information in the returned encrypted file; if they do not match, the image is not displayed; only if they match is the image displayed, further enhancing user information security. Specifically, the image transmission method in this embodiment can be applied to the uploading and downloading of personnel portrait images, ensuring the security of personnel portrait image interactions.

[0109] The image transmission method provided in this embodiment obtains request parameters, including a first digest obtained based on the MD5 algorithm, through a client, generates an interaction request, and sends it to a server. When the first digest matches the second digest obtained based on the MD5 algorithm and the request parameters, the server generates a first image and obtains a second image according to the request parameters. A third image is then generated based on the first and second images using an obfuscation algorithm. The client then decrypts the third image sent by the server using the obfuscation algorithm to obtain the decrypted third image. A target image is generated and displayed based on the decrypted third image and a fourth image, thus achieving the purpose of encrypted image data transmission. This method uses multiple encryption algorithms, such as the MD5 algorithm and the obfuscation algorithm, for image transmission. The mutual verification of multiple algorithms can reduce the risk of being cracked and prevent packet sniffing tools from intercepting the request, tampering with the data, and simulating access, which could lead to incorrect display on the client side. This ensures the security of image transmission and prevents data tampering.

[0110] Example 2

[0111] Based on the same inventive concept, referring to Figure 2 and Figure 3 The present invention provides a second embodiment of the image transmission method, which is applied to a server. A server refers to a network device capable of network connectivity; a server can be a server, a cloud platform, or other network device.

[0112] In this embodiment, the server is connected to the client network to achieve image transmission.

[0113] The following is combined Figure 2 The flowchart shown and Figure 3 The interactive flow diagram shown illustrates the image transmission method of this embodiment in detail. The method may include the following steps:

[0114] Step S210: Receive an interaction request sent by the client. The interaction request is generated by the client based on the obtained request parameters, wherein the request parameters include a first digest, which is obtained by the client based on the MD5 algorithm.

[0115] Step S220: When the first digest matches the second digest, generate a first image according to the request parameters and obtain a second image; wherein, the second digest is obtained based on the MD5 algorithm and the request parameters;

[0116] Step S230: Generate a third image based on the first image and the second image using an obfuscation algorithm;

[0117] Step S240: The third image is sent to the client, which decrypts the third image based on an obfuscation algorithm to obtain the decrypted third image, and generates a target image based on the decrypted third image and the fourth image, and displays the target image; wherein the fourth image is obtained by the client according to the request parameters.

[0118] Furthermore, the request parameters also include a client timestamp and an encrypted username; prior to step S220, the method may further include:

[0119] Step S250: Extract the corresponding interaction credential information based on the interaction request. The interaction credential information includes the server timestamp and the pre-stored username.

[0120] Step S260: Compare the client timestamp with the server timestamp to obtain the time difference;

[0121] Step S270: When the time difference does not exceed a preset time, the encrypted username is decrypted to obtain the decrypted username;

[0122] Step S280: Compare the decrypted username with the pre-stored username;

[0123] Step S290: When the decrypted username matches the pre-stored username, generate the second digest based on the MD5 algorithm according to the decrypted username and the client timestamp.

[0124] Furthermore, step S220 may include:

[0125] Step S221: When the first digest matches the second digest, generate a first image based on the combination of the client timestamp and the decrypted username;

[0126] Step S222: Extract the user's pre-stored image based on the decrypted username to obtain the second image.

[0127] In the image transmission method of this embodiment, the server obfuscates the string of the first digest submitted by the client with the authentication request parameters, calculates the second digest, and returns it to the client along with the user information. Furthermore, the character stream of the returned third image is encrypted and secure, ensuring that even if the transmitted data is intercepted, it is difficult to recover, thus guaranteeing data security.

[0128] It should be noted that for more implementation details in the specific implementation of the above method steps, please refer to the description of the specific implementation in Embodiment 1. The functions that can be achieved and the corresponding technical effects achieved in each step of the image transmission method provided in this embodiment can be referred to the description of the specific implementation in the first embodiment of the image transmission method of the present invention. For the sake of brevity, they will not be repeated here.

[0129] Example 3

[0130] Based on the same inventive concept, this embodiment provides a client, which refers to a terminal device capable of network connection. The client can be a mobile phone, computer, tablet computer, portable computer, embedded industrial control computer and other terminal devices. The client can include a memory and a processor.

[0131] The memory stores an image transmission program, which, when executed by the processor, implements the image transmission method as described in Embodiment 1.

[0132] It is understood that the client may also include multimedia components, input / output (I / O) interfaces, and communication components.

[0133] The processor is used to execute all or part of the steps in the image transmission method as described in Embodiment 1 above. The memory is used to store various types of data, which may include, for example, instructions from any application or method in the client, as well as data related to the application or method.

[0134] The processor may be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic components, and is used to perform all or part of the steps in the image transmission method of Embodiment 1 above.

[0135] The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0136] The multimedia component may include a screen, which may be a touchscreen, and an audio component for outputting and / or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory or transmitted via a communication component. The audio component also includes at least one speaker for outputting audio signals.

[0137] The I / O interface provides an interface between the processor and other interface modules, such as a keyboard, mouse, and buttons. These buttons can be virtual or physical buttons.

[0138] The communication component is used for wired or wireless communication between the terminal device and other devices. Wireless communication includes, for example, Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or one or more combinations thereof. Therefore, the corresponding communication component may include: a Wi-Fi module, a Bluetooth module, and an NFC module.

[0139] Example 4

[0140] Based on the same inventive concept, this embodiment provides a server, which refers to a network device capable of network connectivity. The server can be a server, a cloud platform, or other network device, and the server may include a memory and a processor.

[0141] The memory stores an image transmission program, which, when executed by the processor, implements the image transmission method as described in Embodiment 2.

[0142] The processor is used to execute all or part of the steps in the image transmission method of Embodiment 2 described above. The memory is used to store various types of data, which may include, for example, instructions of any application or method on the server, as well as data related to the application or method.

[0143] The processor may be implemented as an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic components, and is used to perform all or part of the steps in the image transmission method of Embodiment 2 above.

[0144] The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0145] It is understandable that a server may also include multimedia components, input / output (I / O) interfaces, and communication components, etc., which will not be elaborated here.

[0146] Example 5

[0147] Based on the same inventive concept, this embodiment provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, disk, optical disk, server, etc. The storage medium stores a computer program, which can be executed by one or more processors. When the computer program is executed by the processor, it can implement all or part of the steps of the various embodiments of the image transmission method of the present invention.

[0148] It should be noted that the sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above embodiments are only optional embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made under the inventive concept of the present invention using the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are all included within the patent protection scope of the present invention.

Claims

1. An image transmission method, characterized in that, Applied to a client, the method includes: Obtain request parameters, the request parameters including a first digest, the first digest being obtained based on the MD5 algorithm; An interaction request is generated based on the request parameters and sent to the server. When the first digest and the second digest are consistent, the server generates a first image and obtains a second image based on the request parameters, and generates a third image based on the first image and the second image using an obfuscation algorithm. The second digest is obtained based on the MD5 algorithm and the request parameters. The third image sent by the server is decrypted using an obfuscation algorithm to obtain the decrypted third image; A target image is generated based on the decrypted third and fourth images, and the target image is displayed; wherein the fourth image is obtained according to the request parameters.

2. The image transmission method as described in claim 1, characterized in that, The steps for obtaining request parameters include: Generate a client timestamp based on the client's current system time; The username is encrypted using an asymmetric encryption algorithm to obtain the encrypted username; Based on the MD5 algorithm, a first digest is generated according to the encrypted username and the client timestamp; The client timestamp, the encrypted username, and the first digest are determined as the request parameters.

3. The image transmission method as described in claim 2, characterized in that, The step of generating a target image based on the decrypted third and fourth images, and displaying the target image, includes: A fourth image is generated based on the combination of the client timestamp and the username. The character stream of the decrypted third image is compared with the character stream of the fourth image, and the same characters are deleted, while the different characters are kept. Generate a target image based on the different characters; Display the target image.

4. The image transmission method as described in claim 3, characterized in that, The step of displaying the target image includes: The third image is decrypted using an asymmetric encryption algorithm to obtain the username information; Compare the username information with the username; When the username information matches the username, the target image is displayed.

5. An image transmission method, characterized in that, Applied to a server, the method includes: The system receives an interaction request sent by a client, the interaction request being generated by the client based on acquired request parameters, wherein the request parameters include a first digest, the first digest being obtained by the client based on the MD5 algorithm; When the first digest matches the second digest, a first image is generated based on the request parameters, and a second image is obtained; wherein the second digest is obtained based on the MD5 algorithm and the request parameters; A third image is generated based on the first image and the second image using a confusing algorithm; The third image is sent to the client, which then decrypts the third image using an obfuscation algorithm to obtain the decrypted third image. The client then generates a target image based on the decrypted third image and the fourth image, and displays the target image. The fourth image is obtained by the client based on the request parameters.

6. The image transmission method as described in claim 5, characterized in that, The request parameters also include the client timestamp and encrypted username; Before the step of generating a first image and obtaining a second image based on the request parameters when the first digest matches the second digest, the method further includes: Based on the interaction request, the corresponding interaction credential information is extracted. The interaction credential information includes the server timestamp and the pre-stored username. The client timestamp is compared with the server timestamp to obtain the time difference; When the time difference does not exceed a preset time, the encrypted username is decrypted to obtain the decrypted username. Compare the decrypted username with the pre-stored username; When the decrypted username matches the pre-stored username, the second digest is generated based on the MD5 algorithm according to the decrypted username and the client timestamp.

7. The image transmission method as described in claim 6, characterized in that, The step of generating a first image and obtaining a second image based on the request parameters when the first digest matches the second digest includes: When the first digest matches the second digest, a first image is generated based on the combination of the client timestamp and the decrypted username. Based on the decrypted username, the user's pre-stored image is extracted to obtain the second image.

8. A client application, characterized in that, The client includes: Memory and processor; The memory stores a computer program, which, when executed by the processor, implements the image transmission method as described in any one of claims 1 to 4.

9. A server, characterized in that, The server includes: Memory and processor; The memory stores a computer program, which, when executed by the processor, implements the image transmission method as described in any one of claims 5 to 7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by one or more processors, implements the image transmission method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data transmission method, device and system, storage medium and electronic device

    CN111464496A

  • Method and device for transmitting anchor image picture in live broadcast interaction

    CN114339282A