Lightweight recoverable image data desensitization system and method

By using XOR-based pixel-level encryption and decryption algorithms and custom LSB information embedding and extraction algorithms in intelligent connected cars, the problems of privacy information protection and data recovery in intelligent connected cars are solved, and the lightweight and recoverable image data desensitization effect is achieved.

CN119743558APending Publication Date: 2025-04-01HUBEI UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411811436.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively protect private information in intelligent connected vehicles, and at the same time restore the original data when needed, especially in scenarios such as law and public security.

Method used

Using XOR-based pixel-level one-time encryption and decryption algorithm and custom LSB information embedding and extraction algorithm, the desensitization and recovery of image data are achieved through random key generation and the minimum significant bit embedding and extraction of image pixel points.

Benefits of technology

It realizes effective desensitization and recovery of image data, low computational complexity, fast speed and low power consumption, is suitable for implementation on low-resource devices, and simplifies key management, reducing implementation difficulty and storage overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743558A_ABST
    Figure CN119743558A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight recoverable image data desensitization system and method, and belongs to the technical field of data security. The image data desensitization system comprises an image reading and preprocessing module, a random key generation module, a pixel-level one-time pad encryption and decryption module based on XOR, an information embedding and extraction module of a user-defined LSB algorithm and an image storage module, and the image data desensitization method is realized based on the image data desensitization system. In the encryption and decryption process of an image cutting area, an algorithm based on exclusive-or operation is used, and encryption and decryption of an image are completed by selecting a key and image data to carry out pixel-by-pixel exclusive-or processing. According to the system and the method, the XOR-based pixel-level one-time pad encryption and decryption algorithm and the self-defined LSB information embedding and extraction algorithm are used, so that desensitization and recoverability of image data are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data security technology, and in particular to a lightweight and recoverable image data desensitization system and method. Background Art

[0002] Intelligent connected vehicles have become the strategic direction of the development of the automobile industry. The development of intelligent connected vehicles is an important strategic support for the transformation and upgrading of my country's automobile industry and the construction of a modern economic system. With the large-scale theft of privacy information of intelligent connected vehicles during the transmission process, ensuring the data security of intelligent connected vehicles has become an important issue that needs to be solved urgently. In order to meet the requirements of relevant laws and regulations, it is necessary to desensitize private information (such as license plates and faces). Image and video desensitization technology is a key link in privacy protection and data security. Traditional methods such as color block masking and mosaic processing are simple to operate and have significant effects, but they cannot achieve reversible recovery of data in scenarios involving law, public security, etc. where the originality of data needs to be retained, and it is difficult to meet actual needs. Therefore, it is of great significance to develop a lightweight and recoverable image data desensitization method that can effectively protect privacy information and restore the original data when necessary to ensure the data security of intelligent connected vehicles. Summary of the invention

[0003] The purpose of the present invention is to provide a lightweight and recoverable image data desensitization system and method, which uses a pixel-level one-time encryption and decryption algorithm based on XOR and a custom LSB information embedding and extraction algorithm to achieve desensitization and recoverability of image data.

[0004] To achieve the above objectives, the present invention provides a lightweight and restorable image data desensitization system, comprising:

[0005] Image reading and preprocessing module: reads image files from a predefined folder, extracts specific parameters from the image files, and crops the target area in the image that needs to be encrypted for protection or decrypted for recovery according to the specific parameters;

[0006] Random key generation module: sets the random number seed and generates a random key in the same format as the pixel value of the target area according to the size of the cropped image;

[0007] XOR-based pixel-level one-time pad encryption and decryption module: Using a randomly generated unique key, a bit-by-bit XOR operation is performed on the pixel values ​​in the corresponding target area image to achieve one-time pad encryption and decryption through bit-by-bit XOR operation;

[0008] Information embedding and extraction module of custom LSB algorithm: when encrypting, the specific parameter information is converted into binary form and embedded bit by bit into the least significant bit of the three RGB channels in the image pixel; when decrypting, the embedded specific parameter information is extracted;

[0009] Image saving module: stores the encrypted and decrypted images in a predefined folder according to the original naming format.

[0010] Preferably, the image file read from the predefined folder is in PNG format, and the specific parameters extracted from the image file are the image size required to be cropped in the image file that matches the algorithm.

[0011] Preferably, the random key generation module specifically includes: using seed to set a fixed seed value, and generating a random key that completely matches the pixel value dimension and format of the corresponding image target area according to the height, width, and number of color channels of each image after cropping.

[0012] Preferably, the XOR-based pixel-level one-time pad encryption and decryption module specifically includes:

[0013] During encryption, a randomly generated unique key is used to divide the pixel values ​​in each image by the number of color channels, and a bitwise XOR operation is performed with the key value of the corresponding image and corresponding position one by one. The formula is:

[0014]

[0015] In the formula, i and j represent the row and column index of the pixel; c represents the color channel index; image_array represents the pixel array of the image; key represents the encryption or decryption key;

[0016] encrypted_or_decrypted represents the encrypted or decrypted image pixel array;

[0017] When decrypting, the encryption action is repeated.

[0018] Preferably, the information embedding and extraction module of the custom LSB algorithm specifically includes:

[0019] During encryption, information embedding is performed to convert specific parameter information into a binary string. Starting from the pixel at the upper left corner of the image, the information is assigned bit by bit to the least significant bit of each pixel value in the three RGB channels of the image. The embedding process is expressed as:

[0020]

[0021] Where original_pixel_value represents the pixel value of the original image. represents a mask, which is used to clear the least significant bit of the original pixel; secret_bit represents a secret information to be embedded; new_pixel_value represents the new pixel value after the secret information is embedded; & represents the bitwise AND operator; 0x01 represents a mask, which is used to extract or set the least significant bit;

[0022] During decryption, an information extraction operation is performed to read binary data bit by bit from the least significant bit of the RGB three-channel value of each pixel in the embedded area, and the data is reassembled into the original parameter information. The extraction process is expressed as:

[0023] secret_bit=pixel_value&0x01;

[0024] Where pixel_value represents the pixel value of the image after embedding the secret information; 0x01 represents the mask used to extract the least significant bit; secret_bit represents one bit of the secret information extracted from the least significant bit of the pixel.

[0025] The present invention also provides a lightweight and restorable image data desensitization method, the steps comprising:

[0026] S1, obtaining an original image, converting the format of the original image, and placing the converted original image in a predefined folder;

[0027] S2, reading an image file from a predefined folder, extracting specific parameters in the image file, and cropping a target area in the image that needs to be encrypted for protection or decrypted for recovery according to the specific parameters;

[0028] S3, setting a random number seed, and generating a random key consistent with the pixel value format of the target area according to the size of the cropped image;

[0029] S4. Use the randomly generated unique key to encrypt the corresponding target area image, and use the customized LSB algorithm to embed the pixel point in the upper left corner of the image into the encrypted image bit by bit to complete the image data desensitization;

[0030] S5. From the encrypted image, the embedded information is extracted using a custom LSB algorithm. Based on the extracted embedded information, the inverse operation of the XOR operation is performed on each pixel value of the target area using the same random key as that used for encryption to restore the pixel value of the original image.

[0031] Therefore, the present invention adopts the above-mentioned lightweight and restorable image data desensitization system and method, which has the following beneficial effects:

[0032] (1) Using the XOR-based pixel-level one-time encryption and decryption algorithm and the customized LSB information embedding and extraction algorithm, the image data is desensitized and recoverable;

[0033] (2) The present invention is more lightweight and easier to implement on vehicle systems such as intelligent connected vehicles. By using an algorithm based on XOR operation in the encryption and decryption process of the image cropped area, the encryption and decryption of the image is completed by selecting a key and performing pixel-by-pixel XOR processing on the image data. The XOR operation has low computational complexity, fast computing speed, low power consumption, and is suitable for implementation on low-resource devices. In addition, the key generation simplifies the key management by setting a fixed random seed, further reducing the difficulty of algorithm implementation and storage overhead;

[0034] (3) The present invention adopts the least significant bit (LSB) data embedding method to hide data by replacing the least significant bit of image pixels, thus avoiding the complex encoding and decoding process and significantly reducing the demand for computing and storage resources;

[0035] (4) The present invention is almost lossless in image visual quality. At the same time, data embedding and extraction operations are simple and easy, do not rely on complex image processing algorithms, and are suitable for implementation in low-storage and low-computing environments.

[0036] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of embedding a custom LSB algorithm according to an embodiment of the present invention;

[0038] Figure 2 is a flow chart of a method according to an embodiment of the present invention;

[0039] Figure 3 A comparison diagram of different processing steps of an embodiment of the present invention;

[0040] Figure 4 It is a comparison diagram of different noise attacks in the embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0042] Example

[0043] The present invention provides a lightweight and recoverable image data desensitization system, comprising an image reading and preprocessing module, a random key generation module, an XOR-based pixel-level one-time encryption and decryption module, an information embedding and extraction module of a custom LSB algorithm, and an image saving module.

[0044] Image reading and preprocessing module: first read the image file from the predefined folder, then extract the specific parameters in the image file to the image file to match the algorithm to the required cropped image size and extract the specific parameters in the image file, and crop the target area in the image that needs to be encrypted for protection or decrypted for recovery according to the specific parameters. To ensure the resolution of the image and the accuracy and robustness of encryption and decryption, the image file in the predefined folder should be in PNG format.

[0045] Random key generation module: Set the random number seed and generate a random key in the same format as the pixel value of the target area according to the size of the cropped image. This random key not only ensures the strength of data desensitization, but also retains recoverability under specific conditions.

[0046] In this embodiment, seed is used to set a fixed seed value, and a random key that completely matches the dimension and format of the pixel value of the target area of ​​the corresponding image is generated according to the height, width, and number of color channels of each image after cropping.

[0047] XOR-based pixel-level one-time pad encryption and decryption module: Using a randomly generated unique key, a bit-by-bit exclusive OR (XOR) operation is performed on the pixel values ​​in the corresponding target area image, and one-time pad encryption and decryption is achieved through bit-by-bit exclusive OR operation.

[0048] In this embodiment, the XOR-based pixel-level one-time pad encryption and decryption module specifically includes:

[0049] During encryption, a randomly generated unique key is used to divide the pixel values ​​in each image by the number of color channels, and a bitwise XOR operation is performed with the key value of the corresponding image and corresponding position one by one. The formula is:

[0050]

[0051] In the formula, i and j represent the row and column index of the pixel; c represents the color channel index, usually 0 represents red, 1 represents green, and 2 represents blue; image_array represents the pixel array of the image; key represents the encryption or decryption key; encrypted_or_decrypted represents the encrypted or decrypted image pixel array;

[0052] When decrypting, the encryption action is repeated.

[0053] Information embedding and extraction module of custom LSB algorithm: when encrypting, the specific parameter information is converted into binary form and embedded bit by bit into the least significant bit of the three RGB channels in the image pixel; when decrypting, the embedded specific parameter information is extracted.

[0054] In this embodiment, the information embedding and extraction module of the custom LSB algorithm specifically includes:

[0055] During encryption, information embedding is performed to convert specific parameter information into a binary string. Starting from the pixel point at the upper left corner of the image, the information is assigned to the least significant bit of each pixel value in the three RGB channels of the image. The embedding process is as follows: Figure 1 As shown, the formula can be expressed as:

[0056]

[0057] Where original_pixel_value represents the pixel value of the original image, which is an 8-bit integer. represents a mask used to clear the least significant bit of the original pixel, that is, to set it to 0; secret_bit represents a secret information to be embedded (0 or 1); 0x01 represents a mask used to extract or set the least significant bit; new_pixel_value represents the new pixel value after embedding the secret information; & represents the bitwise AND operator.

[0058] During decryption, an information extraction operation is performed to read binary data bit by bit from the least significant bit of the RGB three-channel value of each pixel in the embedded area, and the data is reassembled into the original parameter information. The extraction process is expressed as:

[0059] secret_bit=pixel_value&0x01;

[0060] Where pixel_value represents the pixel value of the image after embedding the secret information, which is an 8-bit integer; 0x01 represents the mask used to extract the least significant bit; secret_bit represents one bit (0 or 1) of the secret information extracted from the least significant bit of the pixel.

[0061] Image saving module: stores the encrypted and decrypted images in a predefined folder according to the original naming format.

[0062] The present invention also provides a lightweight and restorable image data desensitization method, such as Figure 2 As shown, the steps include:

[0063] S1. First, obtain the original image captured by the camera, then convert the format of the original image to ensure that it is in PNG format, and place the converted original image in a predefined folder.

[0064] S2. Read an image file from a predefined folder, extract specific parameters in the image file, and crop a target area in the image that needs to be encrypted for protection or decrypted for recovery according to the specific parameters.

[0065] S3. Set a random number seed and generate a random key in the same format as the pixel value of the target area according to the size of the cropped image.

[0066] S4, using a randomly generated unique key, performing a bit-by-bit exclusive OR (XOR) operation on each pixel value of the corresponding target area image to achieve pixel-level one-time encryption, using a custom LSB algorithm to convert the specific parameter information extracted from the image into binary form, and embedding it bit by bit from the pixel point in the upper left corner of the image into the encrypted image to complete image data desensitization;

[0067] S5. From the encrypted image, use the custom LSB algorithm corresponding to the encryption to extract the embedded characteristic parameter information, locate the target area in the encrypted image based on the extracted characteristic parameter information, use the same random key as that used during encryption, perform the inverse operation of the XOR operation on each pixel value of the target area to restore the pixel value of the original image.

[0068] S6. After the encryption and decryption processing, except for the pixel value of the target area in the original image, other formats and parameters of the image remain unchanged and are output and stored in a predefined folder.

[0069] It should be noted that after desensitizing, the image can only be restored under specific conditions, such as scenarios where the public security organs are investigating evidence or insurance companies are investigating situations. Relevant personnel need to submit an application to the public security organs and only after the application is approved can they request decryption algorithms or permissions from relevant organizations or car companies, and then decrypt and restore the desensitized image or video to obtain the original image or video.

[0070] In order to verify the effectiveness and accuracy of the encryption and decryption method of the present invention, the driving images taken during driving are desensitized and restored. The comparison diagram is as follows: Figure 3 As shown, A is the original image; B is the encrypted image; C is the encrypted and embedded image; and D is the restored image. The restored image is basically consistent with the original image, which verifies the accuracy and effect of the XOR encryption and decryption and the custom LSB algorithm in the present invention.

[0071] In order to verify the robustness of the method of the present invention, Gaussian noise attack and salt and pepper noise attack are used, and the comparison diagram is as follows: Figure 4As shown, A is a Gaussian noise attack; B is a salt and pepper noise attack; C is an encrypted image; and D is an original image. It can be seen from the figure that the method of the present invention successfully protects the image content, and the encrypted image cannot show the characteristics of the original image, thereby improving security.

[0072] Therefore, the present invention adopts the above-mentioned lightweight and recoverable image data desensitization system and method, uses a pixel-level one-time encryption and decryption algorithm based on XOR and a custom LSB information embedding and extraction algorithm, to achieve desensitization and recoverability of image data, and the desensitized image cannot be recognized.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A lightweight and restorable image data desensitization system, characterized in that: include: Image reading and preprocessing module: reads image files from a predefined folder, extracts specific parameters from the image files, and crops the target area in the image that needs to be encrypted for protection or decrypted for recovery according to the specific parameters; Random key generation module: sets the random number seed and generates a random key in the same format as the pixel value of the target area according to the size of the cropped image; XOR-based pixel-level one-time pad encryption and decryption module: Using a randomly generated unique key, a bit-by-bit XOR operation is performed on the pixel values ​​in the corresponding target area image to achieve one-time pad encryption and decryption through bit-by-bit XOR operation; Information embedding and extraction module of custom LSB algorithm: when encrypting, the specific parameter information is converted into binary form and embedded bit by bit into the least significant bit of the three RGB channels in the image pixel; when decrypting, the embedded specific parameter information is extracted; Image saving module: stores the encrypted and decrypted images in a predefined folder according to the original naming format.

2. The lightweight and restorable image data desensitization system according to claim 1, characterized in that: The image files read from the predefined folder are in PNG format and the specific parameters in the image file are extracted to be the required cropped image size in the image file that matches the algorithm.

3. A lightweight and restorable image data desensitization system according to claim 2, characterized in that: The random key generation module specifically includes: using seed to set a fixed seed value, and generating a random key that completely matches the pixel value dimension and format of the corresponding image target area according to the height, width, and number of color channels of each image after cropping.

4. A lightweight and restorable image data desensitization system and method according to claim 3, characterized in that: The XOR-based pixel-level one-time pad encryption and decryption module specifically includes: During encryption, a randomly generated unique key is used to divide the pixel values ​​in each image by the number of color channels, and the pixel values ​​are XORed with the key values ​​of the corresponding image and corresponding position one by one. The formula is: In the formula, i and j represent the row and column index of the pixel; c represents the color channel index; image_array represents the pixel array of the image; key represents the encryption or decryption key; encrypted_or_decrypted represents the encrypted or decrypted image pixel array; When decrypting, the encryption action is repeated.

5. A lightweight and restorable image data desensitization system according to claim 4, characterized in that: The information embedding and extraction module of the custom LSB algorithm specifically includes: During encryption, information embedding is performed to convert specific parameter information into a binary string. Starting from the pixel at the upper left corner of the image, the information is assigned bit by bit to the least significant bit of each pixel value in the three RGB channels of the image. The embedding process is expressed as: Where original_pixel_value represents the pixel value of the original image. represents a mask, which is used to clear the least significant bit of the original pixel; secret_bit represents a secret information to be embedded; new_pixel_value represents the new pixel value after the secret information is embedded; & represents the bitwise AND operator; 0x01 represents a mask, which is used to extract or set the least significant bit; During decryption, an information extraction operation is performed to read binary data bit by bit from the least significant bit of the RGB three-channel value of each pixel in the embedded area, and the data is reassembled into the original parameter information. The extraction process is expressed as: secret_bit=pixel_value&0x01; Where pixel_value represents the pixel value of the image after embedding the secret information; 0x01 represents the mask used to extract the least significant bit; secret_bit represents one bit of the secret information extracted from the least significant bit of the pixel.

6. A lightweight and restorable image data desensitization method, using a lightweight and restorable image data desensitization system as described in any one of claims 1 to 5, characterized in that the steps include: S1, obtaining an original image, converting the format of the original image, and placing the converted original image in a predefined folder; S2, reading an image file from a predefined folder, extracting specific parameters in the image file, and cropping a target area in the image that needs to be encrypted for protection or decrypted for recovery according to the specific parameters; S3, setting a random number seed, and generating a random key consistent with the pixel value format of the target area according to the size of the cropped image; S4. Use the randomly generated unique key to encrypt the corresponding target area image, and use the customized LSB algorithm to embed the pixel point in the upper left corner of the image into the encrypted image bit by bit to complete the image data desensitization; S5. From the encrypted image, the embedded information is extracted using a custom LSB algorithm. Based on the extracted embedded information, the inverse operation of the XOR operation is performed on each pixel value of the target area using the same random key as that used for encryption to restore the pixel value of the original image.

Citation Information

Cited By

  • License plate detection and desensitization method fusing spatial correction and multi-scale attention mechanism

    CN121354085A