Confidential picture transmission method and system, terminal equipment and storage medium
By randomly cutting, rotating and encrypting the image, combined with the merging and drawing of coordinates and rotation information, the problem of insufficient security in traditional image transmission is solved, and high security and accurate recovery of data during transmission is achieved.
Patent Information
- Application Number
- CN202411454778.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-03
AI Technical Summary
Traditional image transmission methods have shortcomings in terms of security and privacy protection, and are easily intercepted or tampered during transmission, resulting in serious consequences.
By randomly cutting and rotating the original picture and encrypting it and transmitting it, the coordinates and rotation information of the sub-picture are recorded to merge and draw the original picture, ensuring the security of the data during transmission.
Enhance information security, prevent unauthorized access, reduce stitching distortion, ensure the recovery of the original image quality, making it difficult to restore the original image even if some data is intercepted.
Smart Images

Figure CN119254767A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of picture transmission, and in particular to a confidential picture transmission method, system, terminal equipment and storage medium. Background Art
[0002] With the rapid development of Internet technology, data security and privacy protection have become particularly important. In the process of data transmission, especially in scenarios involving sensitive or confidential information, how to ensure the security of data during transmission and storage has become an urgent problem to be solved. For multimedia data such as pictures, due to their intuitiveness and easy dissemination, their security during transmission is particularly important.
[0003] The traditional way of transmitting pictures is to send the picture files directly over the network. Although this method is simple and direct, it has obvious shortcomings in terms of security and privacy protection. Once the picture is intercepted or tampered with during the transmission process, it will cause serious consequences. Therefore, a transmission method that can effectively protect the security of the picture content is needed. Summary of the invention
[0004] In view of the above-mentioned defects, the purpose of the present invention is to propose a confidential image transmission method, system, terminal device and storage medium, which aims to cut and rotate the image and transmit it after encryption to ensure that the image data is not stolen or tampered with during the transmission process.
[0005] To achieve this object, the present invention adopts the following technical solutions:
[0006] A confidential image transmission method, comprising:
[0007] Get the original image;
[0008] The original image is randomly cut into several sub-images within the size limit, and the coordinate information of each sub-image is recorded;
[0009] Perform independent rotation operation on each sub-image and record the rotation information of each sub-image;
[0010] After the sub-images are encrypted and transmitted, the sub-images are combined and drawn according to the coordinate information and the rotation information to obtain the original image.
[0011] Preferably, the original image is randomly cut into several sub-images within the size limit, and the coordinate information of each sub-image is recorded, including:
[0012] Take a point in the original image as the plane coordinate system;
[0013] Select two random numbers within the size limit as the width and height of the sub-image, and select the cutting origin coordinates of the sub-image in the plane coordinate system;
[0014] The original image is cut according to the cutting origin coordinates, width and height of the sub-images until the original image is cut into several sub-images.
[0015] Furthermore, if the cut image has an edge smaller than the lower limit of the size limit range, it is determined whether the sum of the width or height smaller than the lower limit and the width or height of the sub-image to be cut is greater than the upper limit of the size limit range;
[0016] If yes, then translate the coordinates of the cutting origin of the sub-image until there is no edge of the cut image that is smaller than the lower limit of the size limit range;
[0017] If not, add the width or height that is less than the lower limit to the width or height of the sub-image to be cut.
[0018] Preferably, the size restriction range includes a width size range and a height size range, the lower limit values of the width size range and the height size range are 1 / 10 of the width or height of the original image, respectively, and the upper limit values of the width size range and the height size range are 1 / 2 of the width or height of the original image, respectively.
[0019] Preferably, the rotation information includes a rotation angle;
[0020] The rotation angle of each sub-image is different, and the rotation direction of each sub-image is the same.
[0021] Preferably, encryption of the sub-picture includes encrypting the sub-picture using an AES encryption algorithm.
[0022] Preferably, combining and drawing the sub-pictures according to the coordinate information and the rotation information includes:
[0023] Decode the encrypted sub-image into a binary string;
[0024] Use the AES decryption algorithm to decrypt the binary string corresponding to the sub-image;
[0025] Use the Blob object to encapsulate the decrypted binary string and create a temporary URL for the Blob object;
[0026] The sub-image is drawn on the canvas element based on the temporary URL, the coordinate information and the rotation information.
[0027] A confidential picture transmission system, comprising:
[0028] Image acquisition module, used to obtain original images;
[0029] The image cutting module is used to randomly cut the original image into several sub-images within the size limit and record the coordinate information of each sub-image;
[0030] The image rotation module is used to perform independent rotation operations on each sub-image and record the rotation information of each sub-image;
[0031] The picture display module is used to encrypt and transmit the sub-pictures, and then combine and draw the sub-pictures according to the coordinate information and the rotation information to obtain the original picture.
[0032] A terminal device comprises: a memory, a processor and a program stored in the memory and executable on the processor, wherein the program is configured to implement the steps of the confidential picture transmission method as described above.
[0033] A storage medium stores a confidential picture transmission program, and when the confidential picture transmission program is executed by a processor, the steps of the confidential picture transmission method described above are implemented.
[0034] One of the above technical solutions has the following advantages or beneficial effects:
[0035] By encrypting each sub-image, we can ensure that data cannot be accessed by unauthorized users during transmission, thereby enhancing information security. Random cutting according to size limits can prevent the generation of too many or too few small images. The right amount of sub-images can reduce the metadata overhead of each transmission, help to merge more accurately, reduce splicing distortion, and ensure the quality of the restored original image. The coordinates and rotation information of each sub-image are recorded to ensure that the sub-images can be accurately merged at the receiving end to restore the complete original image. Through random cutting and rotation, the structure of the original image is disrupted, and even if part of the data is intercepted, it is difficult for attackers to restore the original image. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0037] Figure 1 is a flow chart of a confidential picture transmission method provided by an embodiment of the present invention;
[0038] Figure 2 It is a cutting flow chart of the confidential picture transmission method provided by an embodiment of the present invention;
[0039] Figure 3 It is a structural diagram of a confidential picture transmission system provided by an embodiment of the present invention;
[0040] Figure 4 It is a structural schematic diagram of the cutting of the confidential picture transmission method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0042] In the present invention, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0043] With the rapid development of Internet technology, data security and privacy protection have become particularly important. In the process of data transmission, especially in scenarios involving sensitive or confidential information, how to ensure the security of data during transmission and storage has become an urgent problem to be solved. For multimedia data such as pictures, due to their intuitiveness and easy dissemination, their security during transmission is particularly important.
[0044] The traditional way of transmitting pictures is to send the picture files directly over the network. Although this method is simple and direct, it has obvious shortcomings in terms of security and privacy protection. Once the picture is intercepted or tampered with during the transmission process, it will cause serious consequences. Therefore, a transmission method that can effectively protect the security of the picture content is needed.
[0045] A preferred embodiment of the present invention is as follows Figure 1 As shown, a confidential picture transmission method includes the steps of:
[0046] S1: Get the original image;
[0047] S2: randomly cut the original image into several sub-images within the size limit, and record the coordinate information of each sub-image;
[0048] S3: Perform an independent rotation operation on each sub-image and record the rotation information of each sub-image;
[0049] S4: After the sub-images are encrypted and transmitted, the sub-images are combined and drawn according to the coordinate information and the rotation information to obtain the original image.
[0050] There are many scenarios for image transmission. Taking the interaction between the front-end and the back-end as an example, in step S1, the front-end page calls the image acquisition interface and sends a request to the back-end to obtain the image. After receiving the request, the back-end obtains the unprocessed original image from the database or storage space. In step S2, in some image transmission processes, the cutting of images will follow certain rules, but there will be security issues. For this, it is necessary to randomly cut the images. In the image transmission and merging process, processing too many small images may cause errors, such as loss, damage or sequence errors. It takes more time to merge many sub-images, especially when complex coordinates and rotation information are involved. It may cause delays. In order to avoid too many or too few small-sized images during cutting, a size limit range is set to limit the width and height of the cut image. The image formed after cutting needs to be combined and drawn later, so it is necessary to mark the coordinate information of each image, such as a sub-image information: {x: 0, y: 0, w: 20, h: 20}, which represent the horizontal coordinate, vertical coordinate, width and height of the cut respectively. In step S3, for each sub-image generated in step S2, the sub-image needs to be rotated. Before rotation, the rotation direction of each sub-image can be specified, and the rotation angle of each sub-image can be recorded. The rotation information of the sub-image can be added to the corresponding sub-image information, such as a certain sub-image information: {x: 0, y: 0, w: 20, h: 20, degrees: 30}. Finally, the information of steps S2 and S3 is unified and integrated into an array for easy transmission. In step S4, each sub-image is encrypted and the corresponding array is transmitted to the front end. The array contains the coordinate information and rotation information of each sub-image. After the front end decrypts the sub-image, the sub-image is combined and drawn into a complete original image using the coordinate information and rotation information corresponding to the sub-image.
[0051] This solution encrypts each sub-image to ensure that data cannot be accessed by unauthorized users during transmission, thereby enhancing information security. Random cutting according to size restrictions can prevent the generation of too many or too few small images. The right amount of sub-images can reduce the metadata overhead of each transmission, help to merge more accurately, reduce splicing distortion, and ensure the quality of the restored original image. The coordinates and rotation information of each sub-image are recorded to ensure that the sub-images can be accurately merged at the receiving end to restore the complete original image. Through random cutting and rotation, the structure of the original image is disrupted, and even if part of the data is intercepted, it is difficult for attackers to restore the original image.
[0052] Preferably, if Figure 2 As shown, randomly cutting the original image within the size limit to form several sub-images and recording the coordinate information of each sub-image includes the following steps:
[0053] S21: A point in the original image is used as a plane coordinate system;
[0054] S22: selecting two random numbers within the size limit as the width and height of the sub-image respectively, and selecting the cutting origin coordinates of the sub-image in the plane coordinate system;
[0055] S23: Cut the original image according to the cutting origin coordinates, width and height of the sub-images, until the original image is cut into a plurality of sub-images.
[0056] Specifically, in step S21, a point in the original image (such as the upper left corner or the center point) is selected as the origin (0,0) of the coordinate system, and the width and height of the image are mapped to the two-dimensional coordinate system for subsequent cutting operations. In step S22, two random integers are generated, representing the width and height of the sub-image, respectively. The width and height are randomly selected between the maximum and minimum values to ensure that too many or too few small images are not generated. For example, the maximum and minimum width and height of the sub-image are specified (such as 50px to 200px) to avoid cutting out too small or too large images. A random cutting origin is selected, which needs to be within the image boundary to ensure that the sub-image is completely within the original image, that is, the cutting origin coordinates (x, y) must meet the conditions: 0≤x≤original image width-sub-image width, 0≤y≤original image height-sub-image height. In step S23, a sub-image is extracted from the original image using the selected cutting origin coordinates, width and height, and the above steps are repeated until the image can no longer be cut. Different sub-images are generated through multiple random cuts to increase the diversity of sub-images and ensure the data security of images during transmission.
[0057] Furthermore, if the cut image has an edge smaller than the lower limit of the size limit range, it is determined whether the sum of the width or height smaller than the lower limit and the width or height of the sub-image to be cut is greater than the upper limit of the size limit range;
[0058] If yes, then translate the coordinates of the cutting origin of the sub-image until there is no edge of the cut image that is smaller than the lower limit of the size limit range;
[0059] If not, add the width or height that is less than the lower limit to the width or height of the sub-image to be cut.
[0060] Specifically, Figure 4As shown, the original image is a square image with a side length of 10 and a width size limit range of 2-5. The plane coordinate system is constructed with the upper left corner of the square image. The cutting origin is now set to (1, -1), the cutting width is 5, and the cutting height is 5. When the original image is cut according to these parameters, the cut image will have an edge with a width of 1, which is smaller than the lower limit of the size limit range. If the Figure 4 Adding the rectangle with a width of 1 on the left to the sub-image with a width of 5 and a height of 5 will result in a rectangle with a width of 6 and a height of 5. At this time, the width exceeds the upper limit of the size limit, so the sub-image's cutting origin coordinates need to be shifted to the right by 1, that is, (2,-1). Similarly, if the cutting origin is set to (1,-1), the cutting width is 4, and the cutting height is 5, Figure 4 The rectangle with a width of 1 on the left is added to the sub-image with a cutting width of 4 and a cutting height of 5 to form a sub-image with a width of 5 and a height of 5, which avoids the situation where the remaining sub-image after cutting does not meet the size limit set at the beginning.
[0061] In another embodiment, the size limitation range includes a width size range and a height size range, the lower limit values of the width size range and the height size range are 1 / 10 of the width or height of the original image, respectively, and the upper limit values of the width size range and the height size range are 1 / 2 of the width or height of the original image, respectively.
[0062] Preferably, the rotation information includes a rotation angle;
[0063] The rotation angle of each sub-image is different, and the rotation direction of each sub-image is the same.
[0064] Specifically, by rotating each sub-image at different angles, the image content can be effectively obfuscated, increasing the difficulty of analysis and interpretation, and improving data security. The same rotation direction ensures visual uniformity, allowing the receiver to more easily restore the image during decoding. Rotation at different angles can help disperse data transmission and reduce the risk of interception.
[0065] Preferably, encryption of the sub-picture includes encrypting the sub-picture using an AES encryption algorithm.
[0066] Among them, AES (Advanced Encryption Standard) is a widely used symmetric encryption algorithm that can effectively encrypt and decrypt data. The AES encryption algorithm ensures the security and confidentiality of data during transmission and storage through complex key management and encryption algorithms. Applying the AES encryption algorithm to the transmission of image data can significantly improve data security and prevent data from being stolen or tampered with during transmission.
[0067] Further, combining and drawing the sub-pictures according to the coordinate information and the rotation information includes:
[0068] Decode the encrypted sub-image into a binary string;
[0069] Use the AES decryption algorithm to decrypt the binary string corresponding to the sub-image;
[0070] Use the Blob object to encapsulate the decrypted binary string and create a temporary URL for the Blob object;
[0071] The sub-image is drawn on the canvas element based on the temporary URL, the coordinate information and the rotation information.
[0072] Specifically, the encrypted sub-image can be converted to Base64 encoding, where Base64 is a widely used binary-to-text encoding method that can convert any binary data into a text form consisting of 64 printable characters. This encoding method is particularly suitable for transmitting binary data in systems that can only process text content, such as email or certain types of network protocols. However, Base64 encoding itself does not provide encryption function, so using only Base64 encoding to transmit image data cannot guarantee data security. Decoding the encrypted sub-image into a binary string can ensure the integrity and accuracy of the data and avoid data loss or misinterpretation that may occur during the conversion process.
[0073] Since the sub-image is encrypted by the AES algorithm, the same key is used for encryption and decryption to ensure that only users holding the key can access the data. The Blob object can store binary data and make it accessible through a URL, so that the images sent from the backend can be easily processed and displayed in the page that needs to display the image. The URL generated by the URL.createObjectURL() method points to the Blob object, and the display page uses this URL to access the Blob data. The creation of the Blob object and the generation of a temporary URL make it easy to reference and display the processed image in the browser, avoiding the complexity of using binary data directly. Then create an Image object and assign the temporary URL to its src attribute. Then get the data in the Blob through the temporary URL, map the coordinate information, rotation information and several decrypted sub-images to the canvas, and the canvas displays the complete original image.
[0074] like Figure 3 As shown, a confidential picture transmission system comprises:
[0075] Image acquisition module, used to obtain original images;
[0076] The image cutting module is used to randomly cut the original image into several sub-images within the size limit and record the coordinate information of each sub-image;
[0077] The image rotation module is used to perform independent rotation operations on each sub-image and record the rotation information of each sub-image;
[0078] The picture display module is used to encrypt and transmit the sub-pictures, and then combine and draw the sub-pictures according to the coordinate information and the rotation information to obtain the original picture.
[0079] This embodiment implements a confidential image transmission method and implementation process. Please refer to the above embodiments and will not be described one by one here.
[0080] In addition, an embodiment of the present invention further proposes a terminal device, which includes a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program is configured to implement the steps of the confidential picture transmission method as described above.
[0081] Since the program is configured to implement the steps of the confidential picture transmission method as described above, the program at least has all the beneficial effects brought about by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0082] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a confidential picture transmission program is stored. When the confidential picture transmission program is executed by a processor, the steps of the confidential picture transmission method described above are implemented.
[0083] Since all the technical solutions of all the aforementioned embodiments are adopted when the confidential image transmission program is executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0084] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0085] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A confidential picture transmission method, characterized in that: include: Get the original image; The original image is randomly cut into several sub-images within the size limit, and the coordinate information of each sub-image is recorded; Perform independent rotation operation on each sub-image and record the rotation information of each sub-image; After the sub-images are encrypted and transmitted, the sub-images are combined and drawn according to the coordinate information and the rotation information to obtain the original image.
2. The confidential picture transmission method according to claim 1, characterized in that: The original image is randomly cut into several sub-images within the size limit, and the coordinate information of each sub-image is recorded, including: Take a point in the original image as the plane coordinate system; Select two random numbers within the size limit as the width and height of the sub-image, and select the cutting origin coordinates of the sub-image in the plane coordinate system; The original image is cut according to the cutting origin coordinates, width and height of the sub-images until the original image is cut into several sub-images.
3. The confidential picture transmission method according to claim 2, characterized in that: If the cut image has an edge smaller than the lower limit of the size limit range, determine whether the sum of the width or height smaller than the lower limit and the width or height of the sub-image to be cut is greater than the upper limit of the size limit range; If yes, then translate the coordinates of the cutting origin of the sub-image until there is no edge of the cut image that is smaller than the lower limit of the size limit range; If not, add the width or height that is less than the lower limit to the width or height of the sub-image to be cut.
4. The confidential picture transmission method according to claim 1, characterized in that: The size restriction range includes a width size range and a height size range. The lower limits of the width size range and the height size range are 1 / 10 of the width or height of the original image, respectively, and the upper limits of the width size range and the height size range are 1 / 2 of the width or height of the original image, respectively.
5. The confidential picture transmission method according to claim 1, characterized in that: The rotation information includes the rotation angle; The rotation angle of each sub-image is different, and the rotation direction of each sub-image is the same.
6. The confidential picture transmission method according to claim 1, characterized in that: The encryption of the sub-image includes encrypting the sub-image using an AES encryption algorithm.
7. The confidential picture transmission method according to claim 2, characterized in that: The sub-pictures are combined and drawn according to the coordinate information and the rotation information, including: Decode the encrypted sub-image into a binary string; Use the AES decryption algorithm to decrypt the binary string corresponding to the sub-image; Use the Blob object to encapsulate the decrypted binary string and create a temporary URL for the Blob object; The sub-image is drawn on the canvas element based on the temporary URL, the coordinate information and the rotation information.
8. A confidential picture transmission system, characterized in that: include: Image acquisition module, used to obtain original images; The image cutting module is used to randomly cut the original image into several sub-images within the size limit and record the coordinate information of each sub-image; The image rotation module is used to perform independent rotation operations on each sub-image and record the rotation information of each sub-image; The picture display module is used to encrypt and transmit the sub-pictures, and then combine and draw the sub-pictures according to the coordinate information and the rotation information to obtain the original picture.
9. A terminal device, characterized in that: The terminal device comprises: a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program is configured to implement the steps of the confidential picture transmission method described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a confidential picture transmission program, and when the confidential picture transmission program is executed by the processor, the steps of the confidential picture transmission method according to any one of claims 1 to 7 are implemented.
