• Today, very often, a QR code is used to mark various information. It is a two-dimensional bar code consisting of black and white squares. Each square is a 1 (or 0) bit of information. This code is easy to decipher using a smartphone with a special application. However, in some cases, you can read the QR code manually.

    First of all, in order to start storming a code, it is necessary to figure out exactly how encryption occurs. There are several types of data coding:

    • numeric (digits 0-9);
    • alpha-numeric (digits 0-9, letters AZ, special characters: space, $% * + - / :);
    • bit;
    • Kanji (files are packed in 13 bits);

    How to decipher a QR code?

    All information in the code is divided into blocks. They can be divided into 4 types:

    1. the detection area, that is, the transforming module (large, distinct squares located at the corners of the code, inside which there is another black square). This area does not carry useful information in terms of data decryption;
    2. system information. It consists of two data bands, which are duplicated by 2 times (a total of 4 bands located on the side, right and bottom of the detection units);
    3. code version information.The maximum amount of data that can be encrypted depends on the version of the code. The higher the version, the more difficult it is to decrypt the data manually. Sometimes this is simply not advisable. With the increase in the version, the number of blocks in the code will be more. That is, between the converting modules at the edges of the space will be filled denser;
    4. directly data.

    Step 1.

    Of interest, in terms of decoding information, is only one line of system code. It is located immediately below the left upper transducer module. There is 5 bits of information.

    Now we need to remember the binary number system and write the data in this line. So, we look at the line (the line ends under the left upper transforming module) and write 0 in empty space and 1 in the filled. We are only interested in the first 5 bits of information. Thus, we get a string of 5 digits (for example 10111).

    Step 2.

    Now apply the mask to the system information. A mask is an additional way to protect information. It looks like: 101010000010010. Since we work with only 5 bits of information, we reduce the mask accordingly. We leave the first 5 digits and get 10101. Now we apply the mask to our 5 bits using the exclusive or (XOR) operation.

    For example: 10111 XOR 10101 = 00010

    The resulting data line is divided into 2 parts. The first 2 digits are the level of error correction. In the table below you can see their types.

    L 01
    M 00
    Q 11
    H 10

    The remaining 3 digits determine the type of mask. Possible masks are shown below:

    Mask number If the formula is correct for the lines / section below, switch to the new bit
    000 (i + j) mod 2 = 0
    001 i mod 2 = 0
    010 j mod 3 = 0
    011 (i + j) mod 3 = 0
    100 ((i div 2) + (j div 3)) mod 2 = 0
    101 ((i j) mod 2 + (i j) mod 3) mod 2 = 0
    110 ((i j) mod 2 + (i j) mod 3) mod 2 = 0

    where i is a string, j is a section.

    Step 3.

    QR code

    Go to the header data in the code. The header is in the lower right corner. Mentally select a rectangle 2 × 12, which is located on the right edge and pointing up. Remember its location, we need it with the direct reading of the data.

    Now we define the data mode. For this, we again use the binary system. We descend to the base of our imaginary rectangle and write 0 in white and 1 in black cells, moving the snake from bottom to top, from right to left. For the title, we only need to process the 4 × 4 area. We get a string of 4 digits.

    For example: 0100

    The list of possible modes is given below:

    ECI 0111
    Numeric 0001
    Alphanumeric 0010
    8-bit (byte) 0100
    Kanji 1000
    Structured addition 0011

    0101 (1st position)

    1001 (2nd position)


    So, the line with figures given in an example corresponds to data from 8 bits.Regardless of the resulting data type, you must again apply a mask to them. The mask in this case will be for each type of its own. For example, for an 8-bit data type, it will be 0000, for a numerical one - 0110. You can calculate a mask using the above formulas.

    Again, apply the mask to the calculated data using the XOR operator.

    For example 0100 XOR 0000 = 0100

    Step 4.

    Getting to read the data. The data is recorded in our 2 × 12 rectangular area, starting from the 3rd line (the first 2 lines are the data header). We read the lines from bottom to top. So, translate into binary code the remaining area of ​​the rectangle. We move snake from right to left. We get a series of 20 digits. Apply the mask using the XOR operator. For an 8-bit data type, the full mask will be 0000 0000 0000 0000 0000 000000, for numerical, 0001 1000 0110 0001 1000. (We calculate the mask using the above formulas).

    Now we define the mode of reading data in the table below:

    Numeric 10 bits / 4 bits
    Alphanumeric 9 bits
    8-bit (byte) 8 bit

    This means that for an 8-bit data type, we separate the first 8 digits, and for a numeric one, for example, 10. We translate the resulting series of numbers into a decimal system. The resulting number is the number of data packets. If we get 1, it means that 1 character is encrypted. It can be decrypted by transferring from the binary system the next 4 digits in the remaining row.

    If the received number of packets is greater than 1, then proceed to further decryption. To do this, go to reading the next column. Mentally select the 2 × 12 area to the left of the first selected rectangle. We translate it into a binary code using the same snake principle. For the resulting series of digits we apply the mask, calculated using the above formulas, using the XOR operator. Next, to decipher a number of digits, we divide it into a group of 8, 9, or 10 numbers (read from right to left), depending on the read mode (the table is presented above). We translate each group from a binary system. For numerical values, we use the translation in the decimal system. For translating 8-bit data, we use the ASCII code table.

    Related news

    How to tie a hat boy
    How to think correctly
    How to make a fill
    Make-up fans earn more
    How to get rid of slouch