A robust 2d barcode steganography method based on path planning and pixel flipping

By employing path planning and pixel flipping methods, the contradiction between robustness and security in QR code steganography is resolved, achieving highly robust and secure QR code steganography that can adapt to information transmission in complex environments.

CN119272791BActive Publication Date: 2026-02-24NINGBO UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410695251.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2026-02-24
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

Existing QR code steganography methods struggle to balance robustness and information content, and the hidden information is easily detected, failing to meet the requirements of high security and high fault tolerance.

Method used

By employing path planning and pixel flipping methods, secret information is embedded in a QR code image. By simulating a computer mouse's path-finding algorithm in a maze, pixel flipping is performed when a suitable path cannot be found, ensuring the robustness and security of information transmission.

Benefits of technology

It achieves highly robust and secure QR code steganography, which can effectively transmit secret information without being detected, and utilizes the fault tolerance characteristics of QR codes to adapt to complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272791B_ABST
    Figure CN119272791B_ABST
Patent Text Reader

Abstract

The application discloses a robust two-dimensional code steganography method based on path planning and pixel flipping, which comprises two steps of secret information embedding and secret information extraction, wherein the secret information embedding comprises three steps of original two-dimensional code image generation, binary secret generation and secret-containing two-dimensional code image and key generation, and the secret information extraction comprises three steps of two-dimensional code image reconstruction, binary secret extraction and secret check decryption. The robust two-dimensional code steganography method based on path planning and pixel flipping utilizes the high fault tolerance of two-dimensional codes. Through the path planning algorithm simulating the way of a computer mouse in a two-dimensional code maze and the pixel flipping method, the method has the advantages of strong robustness, high security and non-easy detection, and can effectively transmit secret information by using two-dimensional code images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of QR code steganography, specifically relating to a robust QR code steganography method based on path planning and pixel flipping. Background Technology

[0002] Currently, QR code steganography methods can be categorized into transform domain and spatial domain hiding techniques. Transform domain hiding techniques first transform the QR code image to the frequency domain using various algorithms, primarily discrete cosine transform, discrete Fourier transform, and discrete wavelet transform, thereby modifying the frequency domain coefficients to achieve information hiding. Spatial domain hiding techniques mainly embed the hidden information into the redundant information of the image, such as LSB (Last-Side Block) and allowable error embedding techniques. Information hiding techniques based on QR codes should possess characteristics such as robustness, invisibility, unmeasurability, stability, and preservation of the original information. For information hiding techniques, robustness and the amount of embedded information are always a trade-off, requiring a certain degree of compromise.

[0003] The "Micromouse," a small, automated wheeled intelligent robot composed of an embedded microprocessor, sensors, and motors, is a type of robot designed for maze competitions. According to the rules of the Micromouse maze competition specified by the Institute of Electrical and Electronics Engineers (IEEE), the Micromouse must autonomously navigate different unknown mazes composed of 16×16 18cm×18cm cells, searching for information within the maze and finding a path from the starting point to the end point to quickly reach the finish line. The Micromouse is an embedded mobile robot capable of autonomously exploring unknown mazes and achieving shortest path sprints. To operate at high speed in narrow and complex mazes, the Micromouse requires high performance in control and decision-making, making it a long-standing research hotspot in the field of robotics. For the same maze, different path planning strategies lead to different path choices. If a QR code is considered a maze, given a starting point, an ending point, and a path-finding strategy, it will follow a definite path. Left and right turns along this path can be used to encode secret information. Therefore, this invention simulates the process of a Micromouse finding its destination in a maze and proposes a robust QR code steganography method based on path planning and pixel flipping. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a robust QR code steganography method based on path planning and pixel flipping, which has the advantages of strong robustness, high security and low detectability, and can effectively transmit secret information using QR code images.

[0005] The technical solution adopted by this invention to solve the above-mentioned technical problems is: a robust QR code steganography method based on path planning and pixel flipping, characterized by comprising the following steps:

[0006] S1, Embedded Secret Information

[0007] The secret information is hidden in the plaintext-generated QR code image using a watermark embedding algorithm, specifically involving three steps S1.1-S1.3:

[0008] S1.1 Generation of the original QR code image

[0009] Based on the plaintext information Msg provided by the user, an original QR code image Q with version v and fault tolerance rate e is generated according to standard GB / T 18284-2000. original The version v of the original QR code image ranges from 1 to 10, and the fault tolerance e includes three levels: "M", "Q", and "H".

[0010] Q original =G(Msg,v,e)(1)

[0011] S1.2, Binary Secret Generation

[0012] Based on the encrypted information s provided by the user, the character encoding mode m is used. c Generate a binary secret, then perform cyclic redundancy check on the generated binary secret to obtain the binary secret W to be embedded:

[0013] W = CRC(EC(s,m) c ))(2)

[0014] S1.3, Generation of encrypted QR code image and key

[0015] Based on the original QR code image Q original And the binary secret W to be embedded, using the path planning pattern m r Find a suitable path;

[0016] If the path is found successfully, output the encrypted QR code image Q. final And a key containing the starting point location information, the ending point location information, the character encoding mode, and the path planning mode:

[0017] Q final Key = EM(Q original ,W,m c ,m r (3)

[0018] If path finding fails, adjust the path planning mode, the version of the original QR code image, the fault tolerance rate of the original QR code image, and the value of the ciphertext encoding mode in sequence until path finding is successful.

[0019] If path finding still fails after adjusting the path planning mode, the version of the original QR code image, the fault tolerance rate of the original QR code image, and the value of the ciphertext encoding mode in turn, the original QR code image is flipped by a specified number of pixels, turning black pixels into white pixels or white pixels into black pixels, until the path finding is successful; if the number of flipped pixels reaches the specified number and a suitable path is still not found, the embedding of secret information fails and the method ends.

[0020] The specific pseudocode for step S1 above is shown below:

[0021]

[0022] S2, Secret Information Extraction

[0023] The watermark extraction algorithm is used to extract the hidden QR code in the image containing the watermark. final The secret information contained therein specifically includes three steps S2.1-S2.3:

[0024] S2.1, QR code image reconstruction

[0025] By scanning the encrypted QR code image Q final A QR code image C is captured, and pixel reconstruction is performed on the QR code image C to obtain a high-quality QR code image Q′:

[0026] Q′=R(C)(4)

[0027] S2.2 Binary Secret Extraction

[0028] The reconstructed QR code image Q′ is decoded using the key Key to extract the original binary secret W′. Specifically, the starting point location information, ending point location information, character encoding pattern, and path planning pattern are extracted from the key Key. Based on the path planning pattern, a path connecting the starting point and ending point is found, and the original binary secret W′ is reconstructed.

[0029] W′=DC(Q′,Key)(5)

[0030] S2.3, Secret Verification and Decryption

[0031] Cyclic redundancy check (CRC) is performed on the extracted binary secret W′ to obtain the corrected binary sequence. The corrected binary sequence is then decoded using the character encoding pattern in the key Key to restore the secret plaintext information S′, which is the ciphertext information s.

[0032] S′=EX(CRC(W ′ ),Key)(6)

[0033] The method has ended.

[0034] The specific pseudocode for step S2 above is shown below:

[0035]

[0036] Specifically, the pixel flipping strategy in step S1.3 is as follows: without affecting the normal reading of the QR code image, when a suitable path cannot be found, find the path that satisfies the longest substring, and flip the pixels near both ends of this path. The number of flipped pixels starts from 1, and is executed t times in each round. The number of flipped pixels in the next round is increased by 1, and this process continues for t times until a suitable path is found. If the number of flipped pixels reaches the specified number and a suitable path is still not found, the embedding of the secret information fails and the method ends.

[0037] Compared with existing technologies, this invention has the following advantages: This invention utilizes a robust QR code steganography method based on path planning and pixel flipping, taking advantage of the high fault tolerance of QR codes. By simulating a computer mouse navigating a "QR code maze" through path planning and flipping QR code pixels, it possesses advantages such as strong robustness, high security, and imperceptibility, enabling the effective transmission of secret information using QR code images. Attached Figure Description

[0038] Figure 1 This is a flowchart of the method of the present invention;

[0039] Figure 2 A flowchart of the steps for embedding secret information;

[0040] Figure 3 A flowchart for the secret verification and decryption steps;

[0041] Figure 4 This is a basic structural diagram of a QR code. Detailed Implementation

[0042] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0043] Example: A robust QR code steganography method based on path planning and pixel flipping, the overall method flow is as follows: Figure 1 As shown, the specific steps include:

[0044] S1. Embedding Secret Information (The flowchart for this step is shown below) Figure 2 (As shown)

[0045] The secret information is hidden in the plaintext-generated QR code image using a watermark embedding algorithm, specifically involving three steps S1.1-S1.3:

[0046] S1.1 Generation of the original QR code image

[0047] Based on the plaintext information Msg provided by the user, an original QR code image Q with version v and fault tolerance rate e is generated according to standard GB / T 18284-2000. original The version v of the original QR code image ranges from 1 to 10, and the fault tolerance e includes three levels: "M", "Q", and "H".

[0048] Q original =G(Msg,v,e)(1)

[0049] S1.2, Binary Secret Generation

[0050] Based on the encrypted information s provided by the user, the character encoding mode m is used. c Generate binary secret (user can configure character encoding mode m) c Then, a cyclic redundancy check is performed on the generated binary secret to obtain the binary secret W to be embedded. In this embodiment, the character encoding mode m is used. c Convert the user-provided encrypted information s into a binary bit string, character encoding mode m. c Including but not limited to existing encoding standards such as ISO / IEC 646 and Unicode:

[0051] W = CRC(EC(s,m) c ))(2)

[0052] S1.3, Generation of encrypted QR code image and key

[0053] Based on the original QR code image Q original And the binary secret W to be embedded, using the path planning pattern m r Find a suitable path;

[0054] If the path is found successfully, output the encrypted QR code image Q. final And a key containing the starting point location information, the ending point location information, the character encoding mode, and the path planning mode:

[0055] Q final Key = EM(Q original ,W,m c ,m r (3)

[0056] The path planning mode is user-customized. In this embodiment, the encrypted encoding mode is as follows: from the starting position to the ending position, a left turn is recorded as "1" and a right turn is recorded as "0". The path planning process is as follows: the original QR code image Q originalWhite pixels are considered channels, and black pixels are considered obstacles. A white pixel is randomly selected as the starting point. Starting from this starting point, a path that can encode the current bit string is found according to the currently selected path planning mode.

[0057] If path finding fails, adjust the path planning mode, the version of the original QR code image, the fault tolerance rate of the original QR code image, and the value of the ciphertext encoding mode in sequence until path finding is successful.

[0058] If path finding still fails after adjusting the path planning mode, the version of the original QR code image, the fault tolerance rate of the original QR code image, and the value of the ciphertext encoding mode in turn, then the original QR code image is flipped by a specified number of pixels, turning black pixels into white pixels or white pixels into black pixels, until the path finding is successful.

[0059] like Figure 4 As shown, a QR code consists of several different components, each containing specific information. These areas include positioning patterns, alignment patterns, timing modes, format information, encoded data, and version information. The position detection pattern, position detection pattern separator, and positioning pattern are used to locate the QR code; the position is fixed for each QR code, only the size varies. The correction pattern determines the specifications, and its number and position are also determined. The format information indicates the error correction level of the QR code, categorized as L, M, Q, and H. The version information refers to the QR code's specifications; there are 40 different matrix sizes for QR code symbols, ranging from 21x21 (version 1) to 177x177 (version 40), with each version adding four modules per side compared to the previous version. The data and error correction codewords are the actual stored QR code information; the error correction codewords are used to correct errors caused by QR code corruption.

[0060] To ensure the readability of the QR code and the concealment of information, the pixel flipping area is limited to the data and error correction codeword areas.

[0061] The pixel flipping strategy is as follows: without affecting the normal reading of the QR code image, when a suitable path cannot be found, the path that satisfies the longest substring is searched, and pixels are flipped near both ends of this path. The number of flipped pixels starts from 1, and is executed 50 times in each round. The number of flipped pixels is increased by 1 in the next round, and the process continues for another 50 times until a suitable path is found. If the number of flipped pixels reaches the user-specified threshold and a suitable path is still not found, the embedding of secret information fails, and the method ends.

[0062] S2. Extraction of Secret Information (The flowchart for this step is shown below) Figure 3 (As shown)

[0063] The watermark extraction algorithm is used to extract the hidden QR code in the image containing the watermark. final The secret information contained therein specifically includes three steps S2.1-S2.3:

[0064] S2.1, QR code image reconstruction

[0065] By scanning the encrypted QR code image Q final A QR code image C is captured. However, due to various factors affecting the captured QR code image C, unpredictable distortion may occur. To facilitate subsequent processing, pixel reconstruction is performed on the QR code image C to obtain a high-quality QR code image Q′.

[0066] Q′=R(C)(4)

[0067] Among them, a digital image processing method is used to reconstruct the pixels of the QR code image C. The digital image processing method includes, but is not limited to, one or more of the following methods: contrast and brightness adjustment, filtering and noise reduction, inverse binarization, erosion and dilation processing, Canny edge detection, Hough operator fitting of straight line, calculation of the coordinates of the four vertices of the QR code, and affine transformation using the vertex coordinates.

[0068] S2.2 Binary Secret Extraction

[0069] The reconstructed QR code image Q′ is decoded using the key Key to extract the original binary secret W′. Specifically, the starting point location information, ending point location information, character encoding pattern, and path planning pattern are extracted from the key Key. Based on the path planning pattern, a path connecting the starting point and ending point is found, and the original binary secret W′ is reconstructed.

[0070] W′=DC(Q′,Key)(5)

[0071] S2.3, Secret Verification and Decryption

[0072] Cyclic redundancy check (CRC) is performed on the extracted binary secret W′ to obtain the corrected binary sequence. The corrected binary sequence is then decoded using the character encoding pattern in the key Key to restore the secret plaintext information S′, which is the ciphertext information s.

[0073] S′=EX(CRC(W ′ ),Key)(6)

[0074] The method has ended.

Claims

1. A robust QR code steganography method based on path planning and pixel flipping, characterized in that, Includes the following steps: S1, Secret Information Embedding The secret information is hidden in the plaintext-generated QR code image using a watermark embedding algorithm, specifically involving three steps S1.1-S1.3: S1.1 Generation of the original QR code image Based on the plaintext message Msg provided by the user, the version generated according to standard GB / T 18284-2000 is as follows. The fault tolerance rate is Original QR code image The version of the original QR code image The value range is from 1 to 10, and the fault tolerance rate is... It includes three levels: "M", "Q", and "H". S1.2, Binary Secret Generation Based on the encrypted information provided by the user Use character encoding mode A binary secret is generated, and then a cyclic redundancy check is performed on the generated binary secret to obtain the binary secret to be embedded. : S1.3, Generation of encrypted QR code image and key Based on the original QR code image and the binary secret to be embedded Use path planning pattern Finding a suitable path, the path planning process is as follows: Original QR code image White pixels are considered channels, and black pixels are considered obstacles. A white pixel is randomly selected as the starting point. Starting from this starting point, a path that can encode the current bit string is found according to the currently selected path planning mode. If the path is found successfully, output the encrypted QR code image. And a key containing start and end point location information, character encoding mode, and path planning mode. : If path finding fails, adjust the path planning mode, the version of the original QR code image, the fault tolerance rate of the original QR code image, and the value of the ciphertext encoding mode in sequence until path finding is successful. If path finding still fails after adjusting the path planning mode, the version of the original QR code image, the fault tolerance rate of the original QR code image, and the value of the ciphertext encoding mode in turn, the original QR code image is flipped by a specified number of pixels, turning black pixels into white pixels or white pixels into black pixels, until the path finding is successful; if the number of flipped pixels reaches the specified number and a suitable path is still not found, the embedding of secret information fails and the method ends. S2, Secret Information Extraction Extract the hidden QR code image using a watermark extraction algorithm. The secret information contained therein specifically includes three steps S2.1-S2.3: S2.1, QR code image reconstruction Scan the encrypted QR code image Capture the QR code image QR code image Pixel reconstruction is performed to obtain a high-quality QR code image. : S2.2 Binary Secret Extraction Use key For the reconstructed QR code image Decode the data to extract the original binary secret. The specific process is as follows: from the key The starting point location information, ending point location information, character encoding pattern, and path planning pattern are extracted. Based on the path planning pattern, a path connecting the starting point and the ending point is found, and the original binary secret is restored. : S2.3, Secret Verification and Decryption Extracted binary secret Perform cyclic redundancy check to obtain the corrected binary sequence, and use the key. The character encoding pattern in the code decodes the corrected binary sequence to restore the secret plaintext information. This is encrypted information. : The method has ended.

2. The robust QR code steganography method based on path planning and pixel flipping according to claim 1, characterized in that, The pixel flipping strategy in step S1.3 is as follows: without affecting the normal reading of the QR code image, when a suitable path cannot be found, find the path that satisfies the longest substring, and flip the pixels near both ends of this path. The number of flipped pixels starts from 1, and is executed t times in each round. The number of flipped pixels in the next round is increased by 1, and this process continues for t times until a suitable path is found. If the number of flipped pixels reaches the specified number and a suitable path is still not found, the embedding of the secret information fails and the method ends.

Citation Information

Patent Citations

  • Method for hiding running coding of confidential information

    CN102315931A

  • Apparatus, method and program

    US20100202695A1