Image processing method to improve cloud desktop transmission security
By encrypting images in the cloud desktop environment and embedding color channels into data groups, the problem that image encryption in cloud desktop web applications is easily cracked is solved, and the security and efficiency of data transmission are improved.
Patent Information
- Application Number
- CN202410977570.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-19
AI Technical Summary
The image encryption method of cloud desktop web applications is easily cracked by the correspondence between the pre-calculated hash value and plain text, resulting in compromised data transmission security. Existing technologies cannot effectively solve this problem.
By obtaining the original information in the image to be encrypted, dividing it into multiple data groups after encryption processing, and embedding these groups into the target color channel, the encrypted target image is generated to avoid pre-calculated hash values. Correspondence with plaintext is cracked.
It improves the security of cloud desktop transmission, ensures that the encrypted target image cannot be cracked, and enhances the security and transmission efficiency of data transmission.
Smart Images

Figure CN118540420B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image encryption technology, and in particular to an image processing method for improving the security of cloud desktop transmission. Background Art
[0002] With the development of the Internet, Web front-end applications play an increasingly important role in daily life and business activities. However, the security threats that come with it are also increasing, especially for the transmission and storage of sensitive information.
[0003] Traditional encryption methods such as Hypertext Transfer Protocol Secure (HTTP), Secure Sockets Layer (SSL) / Transport Layer Security (TLS) certificates, and hash algorithm encryption can ensure data security, but they are often limited by cost, performance, and practicality in cloud desktop Web applications. Some encryption methods are irreversible and cannot be cracked, but in some cases, attackers can try to crack them using pre-calculated hash values and plaintext correspondences such as "rainbow tables".
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiment of the present application provides an image processing method for improving the security of cloud desktop transmission, so as to at least solve the technical problem that the security of data transmission is affected by the fact that the image encryption method of the related cloud desktop Web application can be cracked by the correspondence between the pre-calculated hash value and the plaintext.
[0006] According to one aspect of an embodiment of the present application, there is provided an image processing method for improving the transmission security of a cloud desktop, which is applied to a cloud desktop environment, and includes: obtaining an image to be encrypted, wherein the image to be encrypted is deployed in the cloud desktop environment, and the image to be encrypted includes: original information; encrypting the original information to obtain target binary data; dividing the target binary data into a plurality of data groups, wherein the length of each data group is within a preset interval; and embedding the plurality of data groups into a target color channel corresponding to a target color to generate an encrypted target image.
[0007] Optionally, the original information includes: multiple character strings; encrypting the original information to obtain target binary data, including: according to preset rules, converting each character string in the original information into a target information exchange code value to obtain multiple target information exchange code values; converting each target information exchange code value in the multiple target information exchange code values into binary data to obtain multiple binary data; splicing the multiple binary data to obtain the target binary data.
[0008] Optionally, the target binary data is divided into multiple data groups, including: if the length of the original information is within a first preset interval, dividing the binary data into multiple data groups according to the preset length; if the length of the original information is within a second preset interval, dividing the binary data into multiple data groups according to a preset byte sequence and / or a preset separator; if the length of the original information is within a third preset interval, generating a random number within the preset interval, using the random number as the length of the data group, and dividing the binary data into multiple data groups.
[0009] Optionally, before a plurality of data groups are embedded into a target color channel corresponding to a target color and an encrypted target image is generated, the method further includes: obtaining an RGB value of each pixel in the image to be encrypted; placing the R value of each pixel into a first preset container to obtain a first target container including the R values of all pixels, placing the G value of each pixel into a second preset container to obtain a second target container including the G values of all pixels, placing the B value of each pixel into a third preset container to obtain a third target container including the B values of all pixels; comparing a first value corresponding to the first target container, a second value corresponding to the second target container, and a third value corresponding to the third target container, and determining the color corresponding to the target container as the target color, wherein the target container is a container ranked after n in terms of corresponding values among the first target container, the second target container, and the third target container, wherein n is a positive integer not greater than 3.
[0010] Optionally, the image to be encrypted includes n pixels, where n is a positive integer greater than 1; each of the n pixels includes: a first channel corresponding to R data, a second channel corresponding to G data, and a third channel corresponding to B data, where the R value in the first channel is represented by a first character string, the G value in the second channel is represented by a second character string, and the B value in the third channel is represented by a third character string, and the first character string, the second character string, and the third character string include: an 8-bit integer; embedding multiple data groups into a target color channel corresponding to a target color, including: traversing each pixel in the image to be encrypted, and for the i-th pixel, replacing the character at a preset position in the target character string with the i-th character in the data group arranged according to a preset order, where the target character string is a character string in the target color channel corresponding to the target color, and i is a positive integer not greater than n.
[0011] Optionally, if the length of the original information is within a fourth preset interval, the target container is the container with the last 1 corresponding to the numerical ranking among the first target container, the second target container, and the third target container; if the length of the original information is within a fifth preset interval, the target container is the container with the last 2 corresponding to the numerical ranking among the first target container, the second target container, and the third target container; if the length of the original information is within a sixth preset interval, the target container is the container with the last 3 corresponding to the numerical ranking among the first target container, the second target container, and the third target container.
[0012] Optionally, the formats of the target image include: PNG and JPEG.
[0013] According to another aspect of the embodiment of the present application, there is also provided an image processing method for improving the transmission security of a cloud desktop, which is applied to a cloud desktop environment, and includes: obtaining a target image encrypted according to the above-mentioned image processing method for improving the transmission security of a cloud desktop; obtaining a character string in a target color channel corresponding to a target color in the target image, and extracting binary data in the character string in the target color channel corresponding to the target color according to a preset position; determining a target information exchange code value corresponding to the binary data in the character string in the target color channel corresponding to the target color; converting the target information exchange code value into a character string according to a preset rule, and determining the original information based on the converted character string.
[0014] According to another aspect of the embodiment of the present application, there is also provided an image processing device for improving the transmission security of a cloud desktop, including: an acquisition module for acquiring an image to be encrypted, wherein the image to be encrypted is deployed in a cloud desktop environment, and the image to be encrypted includes: original information; an encryption module for encrypting the original information to obtain target binary data; a determination module for dividing the target binary data into multiple data groups, wherein the length of each data group is within a preset interval; and a generation module for embedding multiple data groups into a target color channel corresponding to a target color to generate an encrypted target image.
[0015] According to another aspect of the embodiment of the present application, a non-volatile storage medium is also provided, the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above image processing method for improving the security of cloud desktop transmission.
[0016] According to another aspect of the embodiments of the present application, an electronic device is also provided, including: a memory and a processor, the processor being used to run a program stored in the memory, wherein the above image processing method for improving the security of cloud desktop transmission is executed when the program is running.
[0017] According to another aspect of the embodiments of the present application, a computer program is further provided, wherein when the computer program is executed by a processor, the above-mentioned image processing method for improving the security of cloud desktop transmission is implemented.
[0018] According to another aspect of the embodiments of the present application, a computer program product is also provided, which includes a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned image processing method for improving the security of cloud desktop transmission is implemented.
[0019] In an embodiment of the present application, a method is adopted for obtaining an image to be encrypted, wherein the image to be encrypted is deployed in a cloud desktop environment, and the image to be encrypted includes: original information; encrypting the original information to obtain target binary data; dividing the target binary data into multiple data groups, wherein the length of each data group is within a preset interval; embedding the multiple data groups into a target color channel corresponding to the target color to generate an encrypted target image, so as to achieve the purpose of making the encrypted target image unable to be cracked by the correspondence between the pre-calculated hash value and the plaintext, thereby achieving the technical effect of improving the security of data transmission, and further solving the technical problem of affecting the security of data transmission due to the fact that the image encryption method of the related cloud desktop Web application can be cracked by the correspondence between the pre-calculated hash value and the plaintext. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 is a flow chart of an image processing method for improving cloud desktop transmission security according to an embodiment of the present application;
[0022] Figure 2 is a flow chart of another image processing method for improving cloud desktop transmission security according to an embodiment of the present application;
[0023] Figure 3 is a structural diagram of an image processing device for improving cloud desktop transmission security according to an embodiment of the present application;
[0024] Figure 4 It is a hardware structure block diagram of a computer terminal according to an image processing method for improving cloud desktop transmission security according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to an embodiment of the present application, a method embodiment of an image processing method for improving the security of cloud desktop transmission is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Figure 1 is a flow chart of an image processing method for improving the security of cloud desktop transmission according to an embodiment of the present application. The method is applied to a cloud desktop environment, such as Figure 1 As shown, the method includes the following steps.
[0029] Step S102, obtaining an image to be encrypted, wherein the image to be encrypted is deployed in a cloud desktop environment, and the image to be encrypted includes: original information.
[0030] The image to be encrypted is an image in a Web application deployed in a cloud desktop environment.
[0031] Web applications running in a cloud desktop environment often include a variety of functions and components, among which image processing may be an important aspect of these applications. The following are some types of images that may be used in web applications in a cloud desktop environment: 1. User interface elements: Web application interface elements, such as buttons, icons, toolbars, and menu items, often require images to enhance visual effects. 2. Product images: E-commerce websites or online stores need to display product images so that users can view the items they are interested in. 3. User avatars: Social platforms and forums may use user-uploaded avatars or automatically generated icons to represent users. 4. Charts and graphs: Data visualization tools and analytical dashboards use charts and graphs to display data, such as line charts, bar charts, pie charts, etc. 5. Advertising images: Many web applications contain advertisements, which often contain images to attract users' attention. 6. Background images: Some web applications use background images to create visually appealing page designs. 7. Multimedia content: News websites, blogs, or educational platforms may contain images as part of article or video content. 8. Interactive elements: Interactive features such as dragging, zooming, or rotating images may require processing images. 9. User-generated content: Some apps allow users to upload their own images, such as photo-sharing apps or social media. 10. Security-related images: Such as captcha images, used to verify that the user is a human and not a robot.
[0032] The original information includes: hidden information. For example, the original information includes: 1. Image metadata: Metadata is some additional information about the image, such as shooting time, camera model, image resolution, etc. When encrypting an image, these metadata can also be protected. 2. Compression information: Many image formats (such as JPEG, PNG, etc.) use compression algorithms to reduce file size. The compressed data can be protected during the encryption process to prevent unauthorized access. 3. Image content: The visual content in the image can include people, objects, scenes, etc. When encrypting an image, these contents can be hidden or protected to prevent unauthorized access. 4. Image watermark: A watermark is a method of embedding an image to identify the ownership of an image or prove the authenticity of an image. When encrypting an image, the watermark can be protected to prevent the watermark from being tampered with or deleted. 5. Image layering: Some image formats (such as PSD, TIFF, etc.) support layering, allowing users to edit images on different layers. During the encryption process, these layers can be protected to prevent unauthorized access. 6. Image annotation: Some image formats allow users to add annotations to images. When you encrypt an image, you can protect these annotations from unauthorized access. 7. Image Signature: Digital signature is a technique used to verify the authenticity and integrity of an image. During the encryption process, the image signature can be protected to ensure that the image has not been tampered with during transmission.
[0033] Step S104, encrypting the original information to obtain target binary data.
[0034] It should be noted that the encryption operation in step S104 is to prevent the hidden information in the image from being directly obtained after being cracked. Therefore, when step S104 is executed, even if the hidden information in the image is obtained, the information still consists of encrypted information, not original information.
[0035] Preferably, the developer can decide whether to encrypt the original information first and what encryption method to adopt according to the level of the original information to be encrypted.
[0036] Step S106, dividing the target binary data into a plurality of data groups, wherein the length of each data group is within a preset range.
[0037] Step S108, embedding the multiple data groups into a target color channel corresponding to the target color to generate an encrypted target image.
[0038] That is to say, for each data packet, select a suitable color channel for information hiding. Usually, red, green and blue channels can be selected as carriers of hidden information, and other channels can also be selected as needed.
[0039] The above-mentioned suitable colors depend on visual perception, image characteristics, and the capacity requirements of hidden information. Among them, visual perception: the human eye is most sensitive to green, and the red and blue channels are preferred because the red and blue channels are less sensitive to the human eye. Image characteristics: For images that mainly contain specific colors, such as a large area of blue sky, information can be hidden in the green and red channels with fewer main colors. For images such as burning clouds, information can be hidden in the green and blue channels with fewer main colors. The core is to hide information in a visually less important channel on the image to minimize the impact on the image. Information capacity requirements: If the information capacity is small, a visually less important channel can be selected for information hiding based on visual perception and image characteristics. If the capacity is large, information can be hidden in multiple channels, thereby reducing the amplitude of changes in each channel to minimize the impact on the image.
[0040] In summary, based on the size of the data group and the characteristics of the color channel, the best hiding scheme can be determined to ensure that the encrypted image has no visually obvious changes.
[0041] It can be understood that the target color is a color with less dominant color in the image to be encrypted, and the core of step S108 is to hide information on a visually less important channel in the image to minimize the impact on the image.
[0042] For example, if the image to be encrypted is an image of a large area of blue sky, the target colors are green and red; if the image to be encrypted is an image of a burning cloud, the target colors are green and blue.
[0043] According to step S108, the target color can be one color or multiple colors. Then, in step S106, the purpose of grouping the target binary data is to prevent one target color from being unable to carry all the target binary data.
[0044] According to the above steps, an image to be encrypted is obtained, wherein the image to be encrypted is deployed in a cloud desktop environment, and the image to be encrypted includes: original information; the original information is encrypted to obtain target binary data; the target binary data is divided into multiple data groups, wherein the length of each data group is within a preset interval; the multiple data groups are embedded in a target color channel corresponding to a target color to generate an encrypted target image, so that the encrypted target image cannot be cracked by the correspondence between a pre-calculated hash value and a plaintext, thereby achieving a technical effect of improving the security of data transmission.
[0045] According to some optional embodiments of the present application, the original information includes: multiple character strings.
[0046] The above string is a sequence consisting of letters, numbers, symbols or other characters.
[0047] Furthermore, step S104 can be implemented by the following method.
[0048] Step S1041, according to a preset rule, each character string in the original information is converted into a target information exchange code value to obtain a plurality of target information exchange code values.
[0049] For example, convert each string in the original information into the American Standard Code for Information Interchange (ASCII). ASCII is a character encoding standard used to represent text data. ASCII uses 7-bit binary numbers to represent each character, with a total of 128 different encoding values ranging from 0 to 127. These encoding values correspond to different characters, including letters, numbers, punctuation marks, and control characters. The following are some examples of commonly used ASCII values.
[0050] 1. Uppercase letter A: 65, 2. Lowercase letter a: 97, 3. Number 0: 48, 4. Space: 32, 5. Line feed: 10, 6. Carriage return: 13, 7. Tab: 9.
[0051] Step S1042, converting each of the multiple target information exchange code values into binary data to obtain multiple binary data.
[0052] For example, the ASCII value of the character 'B' is 66. Converting to binary (7-bit) gives: 1000010. Converting to binary (8-bit extended) gives: 01000010.
[0053] Step S1043, concatenate multiple binary data to obtain target binary data.
[0054] According to some other optional embodiments of the present application, dividing the target binary data into multiple data groups can be achieved by the following method: if the length of the original information is within a first preset interval, dividing the binary data into multiple data groups according to the preset length.
[0055] If the length of the original information is within a second preset interval, the binary data is divided into a plurality of data groups according to a preset byte sequence and / or a preset separator.
[0056] If the length of the original information is within the third preset interval, a random number within the preset interval is generated, the random number is used as the length of the data group, and the binary data is divided into a plurality of data groups.
[0057] It is worth explaining that this embodiment determines the importance level of the original information according to the length of the original information, that is, the longer the original information is, the higher its importance level is. The starting point (minimum endpoint) of the first preset interval is smaller than the starting point (minimum endpoint) of the second preset interval, and the starting point (minimum endpoint) of the second preset interval is smaller than the starting point (minimum endpoint) of the third preset interval.
[0058] If the length of the original information is within the first preset interval, its importance is low; if the length of the original information is within the second preset interval, its importance is medium; if the length of the original information is within the third preset interval, its importance is high. Specifically, the processing logic for the low level is: use fixed-length grouping, that is, group the binary data according to the set fixed length, such as 8 bits, 16 bits, etc., which has the advantage of being simple and clear and easy to implement. The processing logic for the medium level is: use content-based grouping, such as grouping according to special byte sequences or separators, which has the advantage of high flexibility and can be optimized according to data characteristics. The processing logic for the high level is: adopt random length grouping, for example, Math.random() can be used to randomly generate numbers to determine the length of each group, which has the advantage of increasing the uncertainty of grouping and improving security.
[0059] Among them, `Math.random()` is a built-in function in JavaScript that is used to generate pseudo-random floating-point numbers. This value is not truly random, but is generated based on a specific algorithm.
[0060] In some optional embodiments of the present application, before embedding multiple data groups into a target color channel corresponding to a target color and generating an encrypted target image, the following steps may also be performed.
[0061] The RGB value of each pixel in the image to be encrypted is obtained; the R value of each pixel is placed in a first preset container to obtain a first target container including the R values of all pixels, the G value of each pixel is placed in a second preset container to obtain a second target container including the G values of all pixels, and the B value of each pixel is placed in a third preset container to obtain a third target container including the B values of all pixels; a first value corresponding to the first target container, a second value corresponding to the second target container, and a third value corresponding to the third target container are compared, and a color corresponding to the target container is determined as a target color, wherein the target container is a container ranked after n corresponding to the value among the first target container, the second target container, and the third target container, wherein n is a positive integer not greater than 3.
[0062] Assume that the image to be encrypted includes 100,000 pixels. For each pixel, the value range of red is 0~255, the value range of green is 0~255, and the value range of blue is 0~255.
[0063] By placing the R value of each pixel into the first preset container, a first target container including 100,000 R values can be obtained; by placing the G value of each pixel into the second preset container, a second target container including 100,000 G values can be obtained; by placing the B value of each pixel into the third preset container, a third target container including 100,000 B values can be obtained.
[0064] Assume that the first value corresponding to the first target container is 7000000, the second value corresponding to the second target container is 8000000, and the third value corresponding to the third target container is 9000000. If the target container is the container with the last 1 corresponding value ranking among the first target container, the second target container, and the third target container, then the target container is the first target container; if the target container is the container with the last 2 corresponding values ranking among the first target container, the second target container, and the third target container, then the target containers are the first target container and the second target container.
[0065] It can be understood that the purpose of the above steps is to select the channel corresponding to the color with less dominant color in the image to be encrypted as the channel carrying data.
[0066] As some optional embodiments of the present application, the image to be encrypted includes n pixels, where n is a positive integer greater than 1; each of the n pixels includes: a first channel corresponding to R data, a second channel corresponding to G data, and a third channel corresponding to B data, where the R value in the first channel is represented by a first character string, the G value in the second channel is represented by a second character string, and the B value in the third channel is represented by a third character string, and the first character string, the second character string, and the third character string include: an 8-bit integer.
[0067] In other words, each pixel contains three channels: R, G, and B, and each channel can be represented by an 8-bit (1-byte) integer.
[0068] For example, if the R value of the first channel in a certain pixel is 150, the R value of the first channel can be represented by 10010110. If the G value of the second channel in a certain pixel is 200, the G value of the first channel can be represented by 11001000. If the B value of the third channel in a certain pixel is 50, the B value of the first channel can be represented by 11001000.
[0069] Furthermore, embedding multiple data groups into a target color channel corresponding to a target color can be achieved by the following method: traversing each pixel in the image to be encrypted, and for the i-th pixel, replacing the character at a preset position in the target string with the i-th character in the data group arranged according to a preset order, wherein the target string is a string in the target color channel corresponding to the target color, and i is a positive integer not greater than n.
[0070] Specifically, for the first pixel, the character at the preset position in the target string is replaced by the first character in the data group arranged according to a preset order, wherein the target string is a string in a target color channel corresponding to a target color; for the second pixel, the character at the preset position in the target string is replaced by the second character in the data group arranged according to a preset order; ...; for the 1000th pixel, the character at the preset position in the target string is replaced by the 1000th character in the data group arranged according to a preset order.
[0071] On the other hand, the character at a preset position in the target character string in the i-th pixel in the image to be encrypted may be replaced by the i-th character in the data group arranged in order from small to large.
[0072] For example, use the getImageData() method in JS Canvas to traverse each pixel of the image in turn. The encrypted binary data is embedded and replaced in a certain position in the selected channel value in turn. For example, the red channel value R of a pixel is 200, and its corresponding binary representation is 11001000. A binary information bit '1' can be hidden in this channel. If it is placed in the seventh position, it will be 11001010, and if it is placed in the last position, it will be 11001001. The specific placement position can be set by the developer.
[0073] Preferably, if the length of the original information is within a fourth preset interval, the target container is the container with the last 1 corresponding to the numerical ranking among the first target container, the second target container and the third target container; if the length of the original information is within a fifth preset interval, the target container is the container with the last 2 corresponding to the numerical ranking among the first target container, the second target container and the third target container; if the length of the original information is within a sixth preset interval, the target container is the container with the last 3 corresponding to the numerical ranking among the first target container, the second target container and the third target container.
[0074] The starting point of the fourth preset interval is smaller than the starting point of the fifth preset interval, and the starting point of the fifth preset interval is smaller than the starting point of the sixth preset interval.
[0075] It should be explained that whether to put the encrypted data into one channel, two channels or all channels is determined according to the capacity of the original information, wherein the capacity threshold of the original information can be set by the developer.
[0076] Preferably, the formats of the target image include: PNG and JPEG. It is understandable that the generated target image can be in common formats such as PNG, JPEG, etc. to ensure wide compatibility in the Web front end.
[0077] In summary, the method provided by this embodiment can greatly increase the difficulty of cracking and ensure the security and transmission efficiency of data. The method has high security and practicality and is suitable for various Web front-end application scenarios.
[0078] Figure 2 is a flowchart of another image processing method for improving the security of cloud desktop transmission according to an embodiment of the present application. Figure 2 As shown, the method includes the following steps.
[0079] Step S202, obtaining Figure 1 The target image is obtained by encrypting the image processing method shown to improve the security of cloud desktop transmission.
[0080] For example, the target image can be determined by the following method: obtaining an image to be encrypted, wherein the image to be encrypted includes: original information; encrypting the original information to obtain target binary data; dividing the target binary data into a plurality of data groups, wherein the length of each data group is within a preset interval; embedding the plurality of data groups into a target color channel corresponding to a target color, and generating an encrypted target image.
[0081] Preferably, the original information includes: multiple character strings; encrypting the original information to obtain target binary data includes: according to preset rules, converting each character string in the original information into a target information exchange code value to obtain multiple target information exchange code values; converting each target information exchange code value in the multiple target information exchange code values into binary data to obtain multiple binary data; splicing the multiple binary data to obtain target binary data. Preferably, dividing the target binary data into multiple data groups includes: if the length of the original information is within a first preset interval, dividing the binary data into multiple data groups according to the preset length; if the length of the original information is within a second preset interval, dividing the binary data into multiple data groups according to a preset byte sequence and / or a preset separator; if the length of the original information is within a third preset interval, generating a random number within the preset interval, using the random number as the length of the data group, and dividing the binary data into multiple data groups. Preferably, before a plurality of data groups are embedded in a target color channel corresponding to a target color and an encrypted target image is generated, the method further comprises: obtaining an RGB value of each pixel in the image to be encrypted; placing the R value of each pixel into a first preset container to obtain a first target container including the R values of all pixels, placing the G value of each pixel into a second preset container to obtain a second target container including the G values of all pixels, placing the B value of each pixel into a third preset container to obtain a third target container including the B values of all pixels; comparing a first value corresponding to the first target container, a second value corresponding to the second target container, and a third value corresponding to the third target container, and determining the color corresponding to the target container as the target color, wherein the target container is a container ranked after n in terms of corresponding values among the first target container, the second target container, and the third target container, wherein n is a positive integer not greater than 3. Preferably, the image to be encrypted includes n pixels, wherein n is a positive integer greater than 1; each of the n pixels includes: a first channel corresponding to R data, a second channel corresponding to G data, and a third channel corresponding to B data, wherein the R value in the first channel is represented by a first character string, the G value in the second channel is represented by a second character string, and the B value in the third channel is represented by a third character string, and the first character string, the second character string, and the third character string include: an 8-bit integer; embedding multiple data groups into a target color channel corresponding to a target color, including: traversing each pixel in the image to be encrypted, and for the i-th pixel, replacing the character at a preset position in the target character string with the i-th character in the data group arranged according to a preset order, wherein the target character string is a character string in the target color channel corresponding to the target color, and i is a positive integer not greater than n.Preferably, if the length of the original information is within the fourth preset interval, the target container is the container with the last 1 in the corresponding numerical ranking among the first target container, the second target container and the third target container; if the length of the original information is within the fifth preset interval, the target container is the container with the last 2 in the corresponding numerical ranking among the first target container, the second target container and the third target container; if the length of the original information is within the sixth preset interval, the target container is the container with the last 3 in the corresponding numerical ranking among the first target container, the second target container and the third target container. Preferably, the formats of the target image include: PNG and JPEG.
[0082] Step S204, obtaining a character string in a target color channel corresponding to a target color in a target image, and extracting binary data in the character string in the target color channel corresponding to the target color according to a preset position.
[0083] Step S206, determining a target information exchange code value corresponding to binary data in a character string in a target color channel corresponding to the target color.
[0084] Step S208, according to a preset rule, the target information exchange code value is converted into a character string, and the original information is determined according to the converted character string.
[0085] In other words, at the receiving end, decryption is performed by reading the color channels of the image and parsing the encrypted information hidden therein. The steps for parsing the encrypted information hidden therein are as follows.
[0086] First, use the getImageData method in Canvas to get the image data, which contains the RGB values of all pixels.
[0087] Secondly, convert the color channel value of each pixel into corresponding binary information.
[0088] Then, according to the previously encrypted rules, for example, the encrypted information is uniformly replaced with the seventh bit in the binary information in one or more channels, and the encrypted information is extracted.
[0089] Again, characters are constructed from the extracted binary data and finally converted into text, which is the previously hidden data (target binary data).
[0090] Finally, since the hidden data is encrypted data, it is decrypted according to the decryption key to obtain the original data before hiding.
[0091] In summary, according to the previously agreed rules and algorithms, the hidden binary data is converted back to the original information.
[0092] This application uses color channels to hide encrypted information, which is difficult to be identified and cracked by external attackers. The encryption and decryption process is simple and efficient, suitable for large-scale data transmission and processing. The generated image format is widely compatible with the Web front-end environment and can be integrated with existing systems.
[0093] Figure 3 is a structural diagram of an image processing device for improving cloud desktop transmission security according to an embodiment of the present application, such as Figure 3 As shown, the device includes.
[0094] The acquisition module 30 is used to acquire the image to be encrypted, wherein the image to be encrypted is deployed in a cloud desktop environment, and the image to be encrypted includes: original information.
[0095] The encryption module 32 is used to encrypt the original information to obtain target binary data.
[0096] The determination module 34 is used to divide the target binary data into a plurality of data groups, wherein the length of each data group is within a preset range.
[0097] The generating module 36 is used to embed the multiple data groups into the target color channel corresponding to the target color to generate an encrypted target image.
[0098] Optionally, the original information includes: multiple character strings; encrypting the original information to obtain target binary data includes the following steps: according to preset rules, converting each character string in the original information into a target information exchange code value to obtain multiple target information exchange code values; converting each target information exchange code value in the multiple target information exchange code values into binary data to obtain multiple binary data; splicing the multiple binary data to obtain the target binary data.
[0099] Optionally, the target binary data is divided into multiple data groups, including the following steps: if the length of the original information is within a first preset interval, the binary data is divided into multiple data groups according to the preset length; if the length of the original information is within a second preset interval, the binary data is divided into multiple data groups according to a preset byte sequence and / or a preset separator; if the length of the original information is within a third preset interval, a random number within the preset interval is generated, the random number is used as the length of the data group, and the binary data is divided into multiple data groups.
[0100] Optionally, before a plurality of data groups are embedded into a target color channel corresponding to a target color and an encrypted target image is generated, the following steps need to be performed: obtaining the RGB value of each pixel in the image to be encrypted; placing the R value of each pixel into a first preset container to obtain a first target container including the R values of all pixels, placing the G value of each pixel into a second preset container to obtain a second target container including the G values of all pixels, placing the B value of each pixel into a third preset container to obtain a third target container including the B values of all pixels; comparing a first value corresponding to the first target container, a second value corresponding to the second target container, and a third value corresponding to the third target container, and determining the color corresponding to the target container as the target color, wherein the target container is the container ranked after n corresponding to the values among the first target container, the second target container, and the third target container, wherein n is a positive integer not greater than 3.
[0101] Optionally, the image to be encrypted includes n pixels, where n is a positive integer greater than 1; each of the n pixels includes: a first channel corresponding to R data, a second channel corresponding to G data, and a third channel corresponding to B data, where the R value in the first channel is represented by a first character string, the G value in the second channel is represented by a second character string, and the B value in the third channel is represented by a third character string, and the first character string, the second character string, and the third character string include: an 8-bit integer; embedding multiple data groups into a target color channel corresponding to a target color includes the following steps: traversing each pixel in the image to be encrypted, and for the i-th pixel, replacing the character at a preset position in the target character string with the i-th character in the data group arranged according to a preset order, where the target character string is a character string in the target color channel corresponding to the target color, and i is a positive integer not greater than n.
[0102] Optionally, if the length of the original information is within a fourth preset interval, the target container is the container with the last 1 corresponding to the numerical ranking among the first target container, the second target container, and the third target container; if the length of the original information is within a fifth preset interval, the target container is the container with the last 2 corresponding to the numerical ranking among the first target container, the second target container, and the third target container; if the length of the original information is within a sixth preset interval, the target container is the container with the last 3 corresponding to the numerical ranking among the first target container, the second target container, and the third target container.
[0103] Optionally, the formats of the target image include: PNG and JPEG.
[0104] It should be noted that the above Figure 3Each module in the can be a program module (for example, a set of program instructions that implement a specific function) or a hardware module. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above modules is a processor, or the functions of each of the above modules are implemented by a processor.
[0105] It should be noted that Figure 3 The preferred implementation of the illustrated embodiment can be found in Figure 1 The relevant description of the illustrated embodiment will not be repeated here.
[0106] Figure 4 The hardware structure block diagram of a computer terminal for implementing an image processing method for improving the security of cloud desktop transmission is shown. Figure 4 As shown, the computer terminal 40 may include one or more (402a, 402b, ..., 402n are used to illustrate) processors 402 (the processor 402 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 404 for storing data, and a transmission module 406 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 4 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 4 More or fewer components as shown, or with Figure 4 Different configurations are shown.
[0107] It should be noted that the one or more processors 402 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 40. As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0108] The memory 404 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image processing method for improving the security of cloud desktop transmission in the embodiment of the present application. The processor 402 executes various functional applications and data processing by running the software programs and modules stored in the memory 404, that is, the image processing method for improving the security of cloud desktop transmission is realized. The memory 404 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 404 may further include a memory remotely arranged relative to the processor 402, and these remote memories may be connected to the computer terminal 40 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0109] The transmission module 406 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 40. In one example, the transmission module 406 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 406 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0110] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 40 .
[0111] It should be noted that, in some optional embodiments, the above Figure 4 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 4 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.
[0112] It should be noted that Figure 4 The computer terminal shown is used to execute Figure 1 The image processing method shown in the figure improves the security of cloud desktop transmission, so the relevant explanations in the execution method of the above command are also applicable to the electronic device and will not be repeated here.
[0113] An embodiment of the present application further provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned image processing method for improving the security of cloud desktop transmission.
[0114] A program for a non-volatile storage medium to perform the following functions: obtaining an image to be encrypted, wherein the image to be encrypted is deployed in a cloud desktop environment, and the image to be encrypted includes: original information; encrypting the original information to obtain target binary data; dividing the target binary data into a plurality of data groups, wherein the length of each data group is within a preset interval; embedding the plurality of data groups into a target color channel corresponding to a target color to generate an encrypted target image.
[0115] An embodiment of the present application also provides an electronic device, including: a memory and a processor, the processor being used to run a program stored in the memory, wherein the above-mentioned image processing method for improving the security of cloud desktop transmission is executed when the program is running.
[0116] The processor is used to run a program that performs the following functions: obtaining an image to be encrypted, wherein the image to be encrypted is deployed in a cloud desktop environment, and the image to be encrypted includes: original information; encrypting the original information to obtain target binary data; dividing the target binary data into multiple data groups, wherein the length of each data group is within a preset interval; embedding the multiple data groups into a target color channel corresponding to a target color to generate an encrypted target image.
[0117] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0118] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0119] In the above-mentioned embodiments of the present application, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary protection measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0120] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0122] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0124] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An image processing method for improving cloud desktop transmission security, characterized in that: Applied to cloud desktop environment, including: Acquire an image to be encrypted, wherein the image to be encrypted is deployed in a cloud desktop environment, the image to be encrypted includes: original information, the original information includes: multiple character strings, the image to be encrypted includes n pixels, wherein n is a positive integer greater than 1, each of the n pixels includes: a first channel corresponding to R data, a second channel corresponding to G data, and a third channel corresponding to B data, wherein the R value in the first channel is represented by a first character string, the G value in the second channel is represented by a second character string, and the B value in the third channel is represented by a third character string, and the first character string, the second character string, and the third character string include: an 8-bit integer; The original information is encrypted to obtain target binary data, including: according to a preset rule, each character string in the original information is converted into a target information exchange code value to obtain a plurality of target information exchange code values; each target information exchange code value in the plurality of target information exchange code values is converted into binary data to obtain a plurality of binary data; the plurality of binary data are concatenated to obtain the target binary data; Dividing the target binary data into a plurality of data groups, wherein the length of each data group is within a preset interval; Before embedding the multiple data groups into the target color channel corresponding to the target color to generate the encrypted target image, the method further includes: obtaining the RGB value of each pixel in the image to be encrypted; placing the R value of each pixel into a first preset container to obtain a first target container including the R values of all pixels, placing the G value of each pixel into a second preset container to obtain a second target container including the G values of all pixels, placing the B value of each pixel into a third preset container to obtain a third target container including the B values of all pixels; comparing the first value corresponding to the first target container, the second value corresponding to the second target container, and the third value corresponding to the third target container, and comparing the color values corresponding to the target containers Determine the target color, wherein the target container is the n containers with the corresponding numerical ranking among the first target container, the second target container and the third target container, wherein n is a positive integer not greater than 3; embed the multiple data groups into the target color channel corresponding to the target color to generate an encrypted target image, wherein embedding the multiple data groups into the target color channel corresponding to the target color comprises: traversing each pixel in the image to be encrypted, and for the i-th pixel, replacing the character at a preset position in the target string with the i-th character in the data group arranged according to a preset order, wherein the target string is the string in the target color channel corresponding to the target color, and i is a positive integer not greater than n.
2. The method according to claim 1, characterized in that Dividing the target binary data into a plurality of data groups, including: If the length of the original information is within a first preset interval, dividing the binary data into a plurality of data groups according to the preset length; If the length of the original information is within a second preset interval, dividing the binary data into a plurality of data groups according to a preset byte sequence and / or a preset separator; If the length of the original information is within a third preset interval, a random number within the preset interval is generated, the random number is used as the length of the data group, and the binary data is divided into a plurality of data groups.
3. The method according to claim 1, characterized in that include: If the length of the original information is within a fourth preset interval, the target container is the container with the last corresponding value ranking among the first target container, the second target container and the third target container; If the length of the original information is within a fifth preset interval, the target container is the last two containers with the corresponding values among the first target container, the second target container and the third target container; If the length of the original information is within a sixth preset interval, the target container is the last three containers in the corresponding numerical ranking among the first target container, the second target container and the third target container.
4. The method according to claim 1, characterized in that: The formats of the target image include: PNG and JPEG.
5. An image processing method for improving cloud desktop transmission security, characterized in that: Applied to cloud desktop environment, including: Acquire the target image obtained by encrypting the image processing method for improving cloud desktop transmission security according to any one of claims 1 to 4; Obtaining a character string in a target color channel corresponding to the target color in the target image, and extracting binary data in the character string in the target color channel corresponding to the target color according to a preset position; Determine a target information exchange code value corresponding to binary data in a character string in a target color channel corresponding to the target color; According to a preset rule, the target information exchange code value is converted into a character string, and the original information is determined based on the converted character string.
6. An image processing device for improving the security of cloud desktop transmission, characterized in that: include: An acquisition module is used to acquire an image to be encrypted, wherein the image to be encrypted is deployed in a cloud desktop environment, the image to be encrypted includes: original information, the original information includes: multiple character strings, the image to be encrypted includes n pixels, wherein n is a positive integer greater than 1, and each of the n pixels includes: a first channel corresponding to R data, a second channel corresponding to G data, and a third channel corresponding to B data, wherein the R value in the first channel is represented by a first character string, the G value in the second channel is represented by a second character string, and the B value in the third channel is represented by a third character string, and the first character string, the second character string, and the third character string include: an 8-bit integer; The encryption module is used to encrypt the original information to obtain target binary data, including: according to a preset rule, converting each character string in the original information into a target information exchange code value to obtain a plurality of target information exchange code values; converting each of the plurality of target information exchange code values into binary data to obtain a plurality of binary data; splicing the plurality of binary data to obtain the target binary data; A determination module, configured to divide the target binary data into a plurality of data groups, wherein the length of each data group is within a preset interval; The image processing device for improving the transmission security of the cloud desktop also includes: a comparison module, which is used to embed the multiple data groups into the target color channel corresponding to the target color, and before generating the encrypted target image, perform the following steps: obtain the RGB value of each pixel in the image to be encrypted; place the R value of each pixel into a first preset container to obtain a first target container including the R values of all pixels, place the G value of each pixel into a second preset container to obtain a second target container including the G values of all pixels, and place the B value of each pixel into a third preset container to obtain a third target container including the B values of all pixels; compare the first value corresponding to the first target container, the second value corresponding to the second target container, and the third value corresponding to the third target container, and determine the color corresponding to the target container as the target color, wherein the target container is the container with the last n corresponding values among the first target container, the second target container, and the third target container, wherein n is a positive integer not greater than 3; A generation module is used to embed the multiple data groups into a target color channel corresponding to a target color to generate an encrypted target image, wherein embedding the multiple data groups into a target color channel corresponding to a target color comprises: traversing each pixel in the image to be encrypted, and for the i-th pixel, replacing the character at a preset position in a target string with the i-th character in a data group arranged according to a preset order, wherein the target string is a string in the target color channel corresponding to the target color, and i is a positive integer not greater than n.
7. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein, when the program is running, the device where the non-volatile storage medium is located is controlled to execute the image processing method for improving the security of cloud desktop transmission as described in any one of claims 1 to 4 or the image processing method for improving the security of cloud desktop transmission as described in claim 5.
8. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein when the program is run, the image processing method for improving the security of cloud desktop transmission as described in any one of claims 1 to 4 or the image processing method for improving the security of cloud desktop transmission as described in claim 5 is executed.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image processing method for improving the cloud desktop transmission security described in any one of claims 1 to 4 or the image processing method for improving the cloud desktop transmission security described in claim 5 is implemented.
Citation Information
Patent Citations
Picture processing method, storage medium and computer terminal
CN114996663A
Image transmission method and device, electronic equipment and storage medium
CN116208719A
