CN110991589A - Two-dimensional code and encryption method thereof - Google Patents

Two-dimensional code and encryption method thereof Download PDF

Info

Publication number
CN110991589A
CN110991589A CN201911247006.8A CN201911247006A CN110991589A CN 110991589 A CN110991589 A CN 110991589A CN 201911247006 A CN201911247006 A CN 201911247006A CN 110991589 A CN110991589 A CN 110991589A
Authority
CN
China
Prior art keywords
code
sequence
dimensional code
encryption
curve
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911247006.8A
Other languages
Chinese (zh)
Inventor
李蕴光
郭瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201911247006.8A priority Critical patent/CN110991589A/en
Publication of CN110991589A publication Critical patent/CN110991589A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes

Abstract

The invention relates to a two-dimensional code and an encryption method thereof, which are based on a character string C ═ a1a2a3a4……an) A graph coding region generated according to a certain rule and an encryption curve L positioned on the graph coding region; the encryption curve L consists of a coordinate point (b)1,b2)、(b3,b4)、(b5,b6)……(bn‑1,bn) In which b is1b2b3......bn‑ 1bnI.e. the encrypted string C' ═ b1b2b3b4……bn) (ii) a The encrypted string C ═ b1b2b3b4……bn) By the string C ═ a1a2a3a4……an) Is encrypted by an encryption function of f(x). According to the scheme, curve information must be read out through corresponding code scanning equipment, and only through curve coordinate verification, the corresponding secret key can be called from the database to complete subsequent operation, so that the verification problem that the code scanning has the two-dimensional code with special purposes is well solved.

Description

Two-dimensional code and encryption method thereof
Technical Field
The invention relates to the field of two-dimensional codes, in particular to a two-dimensional code and an encryption method thereof.
Background
The two-dimensional Code is also called as a two-dimensional Bar Code, the most common form is QR Code, and QR is known as Quick Response, which is an ultra-popular coding mode on mobile equipment in recent years, and the two-dimensional Code can store more information and represent more data types than the traditional Bar Code Bar Code. The two-dimensional bar code/two-dimensional code (2-dimensional bar code) records data symbol information by using black and white alternate graphs which are distributed on a plane (two-dimensional direction) according to a certain rule by using a certain specific geometric figure; the concept of '0' and '1' bit stream which forms the internal logic base of computer is skillfully utilized in coding, a plurality of geometric shapes corresponding to binary system are used for representing literal numerical information, and the information is automatically read by an image input device or an optoelectronic scanning device so as to realize the automatic processing of the information: it has some commonality of barcode technology: each code system has its specific character set; each character occupies a certain width; has certain checking function and the like. Meanwhile, the method also has the function of automatically identifying information of different rows and processing the graph rotation change points. On day 3/8/2016, the payment clearing association issues a barcode payment service specification (solicitation for comments) to the payment institution, which specifies the security standards that the payment institution needs to comply with to conduct barcode services. The central row firstly officially acknowledges the two-dimensional code payment status after the payment of the two-dimensional code is called and stopped in 2014.
At present, the application of the two-dimension code is mature, the application range is wide, the stored amount information is rich, however, the two-dimension code applied to a specific platform is not only identified, and if the two-dimension code has other specific functions such as getting rewards, and the like, the common two-dimension code is adopted, so that misunderstanding can be caused. The existing two-dimensional code is generated by adopting a character string with a certain length according to a certain rule, and the corresponding character string can be read out on other standard code scanning equipment. The requirement of a special application scene can be met only by performing special encryption processing on a common two-dimensional code, and at present, all two-dimensional codes are not encrypted, and can be identified through a code scanning function, so that the technical problem which needs to be solved urgently is how to improve the two-dimensional code with the encryption function.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a two-dimensional code and an encryption method thereof.
The purpose of the invention is realized by the following technical scheme:
the utility model provides a two-dimensional code which characterized in that, this two-dimensional code includes:
based on the string C ═ a1a2a3a4……an) A graph coding region generated according to a certain rule and an encryption curve L positioned on the graph coding region;
the encryption curve L consists of a coordinate point (b)1,b2)、(b3,b4)、(b5,b6)……(bn-1,bn) In which b is1b2b3……bn-1bnI.e. the encrypted string C' ═ b1b2b3b4……bn);
The encrypted string C ═ b1b2b3b4……bn) By the string C ═ a1a2a3a4……an) Is encrypted by an encryption function of f(x)
In the invention, an encryption curve with encryption information is added on a traditional two-dimensional code, verification information of the curve is stored in code scanning equipment, when the two-dimensional code is scanned, the curve verification is firstly passed, and the information of the two-dimensional code can be normally read for subsequent operation after the verification is successful, so that the safety of the two-dimensional code in the using process is ensured, and the phenomenon of mistakenly scanning the code is avoided, wherein the encryption function is f(x)Is an arbitrary function, and the essence is to map the characters of the character string C one by one to obtainA new character, so that the encryption function is f(x)It is understood that any function known in the art.
Further, the encryption curve L consists of a coordinate point (b)1,b2)、(b3,b4)、(b5,b6)……(bn-1,bn) A smooth connection is formed. The smooth connection has the advantages of enhancing the readability of the curve and improving the success rate of curve verification.
Further, the encryption function is f(x)Is anTo bnA mapping function of, e.g. f(x)=kx2+ bx + c, where k ≠ 0, and b, c are arbitrary constants.
A two-dimensional code encryption method comprises the following steps:
s1: data analysis, namely determining the type of the coded character, converting the coded character into a character string C according to a corresponding character set, and determining the error correction level;
s2: encrypting the character string by an encryption function f(x)Encrypting to obtain an encrypted character string C';
s3: generating a graphic code, and generating a two-dimensional graphic code for the character string C according to a coding rule;
s4: generating an encryption curve, and taking continuous characters in the encryption character string C' as a group of coordinate points to obtain
Figure BDA0002307957160000021
A coordinate, where n is the number of characters of the encrypted string C', will be
Figure BDA0002307957160000022
The coordinates are smoothly connected to form an encryption curve L on the two-dimensional graphic code.
Further, in step S4, if n is an odd number, a composite point is generated, which is represented by (b)n-2,bn-1)、(bn-1,bn) And n represents the order of the characters b in the encrypted string C'.
Further, the method also comprises a two-dimensional code verification step, and the steps comprise the following flows:
s01: scanning the two-dimension code by using code scanning equipment;
s02: reading the curve L and verifying, if the contact ratio of the coordinate point on the curve L and the system verification curve L' exceeds a threshold value M, passing the verification, and entering the next step, otherwise, returning to the previous step;
s03: and identifying the two-dimensional code and reading data in the two-dimensional code.
Further, the verification curve L' is according to the encryption function f(x)=kx2+ bx + c generated standard curve.
Further, the value of the threshold M is greater than or equal to 70%.
Further, the step S3 includes:
s01: data encoding, converting the character string C into bit stream, and forming a data code word sequence C1 by using a code word every 8 bits;
s02: error correction coding, namely partitioning the data code word sequence C1 to obtain a plurality of partitioned code words C, generating error correction code words according to the error correction level and the partitioned code words C, and adding the error correction code words behind the data code word sequence to form a new sequence C2;
s03: constructing final data information, putting the sequence C2 into blocks according to the sequence under the condition that the specification is determined, blocking the data according to the specification, then calculating each block to obtain a corresponding error correction code word block, forming a sequence by the error correction code word blocks in sequence, and adding the sequence behind the data code word sequence C1 to form a complete sequence C3;
s04: constructing a matrix, putting the detection pattern, the separator, the positioning pattern, the correction pattern and the code word module into the matrix, and filling the complete sequence C3 in the area of the two-dimensional code matrix with the corresponding specification;
s05: the mask is used for using the mask graph in the coding area of the symbol, so that dark and light areas in the two-dimensional code graph can be distributed according to the optimal ratio;
s06: and the generated format and version information are put into the corresponding area.
Further, the step S01 includes:
s11: grouping, assuming that the character string C ═ a1a2a3a4……an) The number of characters is N, every 3 characters form a group to form a continuous group a1a2a3、a4a5a6、……an-2an-1anIf N is not a multiple of 3, the last group of characters is less than 3;
s12: converting into binary, and converting each group into binary codes;
s13: converting into a sequence, and sequentially arranging each group of binary codes to form a binary sequence;
s14: converting the character number into a binary system, and converting the character number N into the binary system to form a binary code of the character number;
s15: adding a mode indicator, adding a binary indicator, and then sequentially placing the binary indicator and the binary code of the character number in front of the binary sequence to form a data codeword sequence C1.
The invention has the beneficial effects that: the invention generates an encrypted sequence code according to the character string corresponding to the two-dimension code according to the functional relation on the basis of the original two-dimension code, then uses two continuous points of the encrypted sequence code as a coordinate point to form a plurality of coordinate points, and then forms an encrypted curve by smooth connection.
Drawings
FIG. 1 is a schematic diagram of a two-dimensional code according to the present invention;
fig. 2 is a schematic flow chart of encryption and decryption according to the present invention.
Detailed Description
The technical solution of the present invention is further described in detail with reference to the following specific examples, but the scope of the present invention is not limited to the following.
As shown in fig. 1, a two-dimensional code is characterized by comprising a character string C ═ a (a)1a2a3a4……an) A graph coding area generated according to a certain rule and an encryption curve L positioned on the graph coding area. The pattern code area shown in fig. 1 is a matrix type two-dimensional code, and besides, the pattern code area can adopt all the pattern code forms known at present. The two-dimensional code has a total of 40 sizes. The official call is Version. Version 1 is a 21 x 21 matrix, Version 2 is a 25 x 25 matrix, Version 3 is a 29 size, and each addition of one Version increases the size by 4, the formula is: (V-1) × 4+21(V is Version number) is highest Version 40, (40-1) × 4+21 is 177, so is highest square 177 x 177. All of the above dimensions can be used in this embodiment. Meanwhile, the two-dimensional bar code/two-dimensional code can be a stacked/row-type two-dimensional bar code or a matrix-type two-dimensional bar code. Representative row-by-row two-dimensional barcodes are Code 16K, Code 49, PDF417 and the like. The folding matrix type, short two-dimensional bar code (also called chessboard type two-dimensional bar code) is coded in a rectangular space by different distribution of black and white pixels in the matrix. Representative Matrix two-dimensional bar codes include Code One, Maxi Code, QRCode, Data Matrix, and the like. Among dozens of two-dimensional bar codes, PDF417 two-dimensional bar codes, Datamatrix two-dimensional bar codes, Maxicode two-dimensional bar codes, QR codes, Code 49, Code 16K, Code one and the like are commonly used, and besides the common two-dimensional bar codes, Vericode bar codes, CP bar codes, Codablock F bar codes, field codes, Ultracode bar codes and Aztec bar codes are also used. Therefore, the graphic coding region in the scheme is not limited to a certain form of two-dimensional code, and any known pattern or designed in the future can be applied to the scheme.
The encryption curve L is a curve distributed in the graph coding area, the coverage area of the encryption curve L can be any part of the graph coding area, the length of the encryption curve L is not limited, and even the encryption curve L can be a multi-turn spiral line which is not connected end to end, and the premise is that the normal reading of the graph coding area is interfered. More specifically, the encryption curve L consists of a coordinate point (b)1,b2)、(b3,b4)、(b5,b6)……(bn-1,bn) In which b is1b2b3……bn-1bnIs thatThe encrypted character string C ═ b1b2b3b4......bn) (ii) a The encrypted character string C ═ b1b2b3b4......bn) By the string C ═ a1a2a3a4......an) Is encrypted by an encryption function of f(x),f(x)This embodiment is not exhaustive, and is any function known in the art, such as a logarithmic function, a linear function, a quadratic function, and so on. To make this embodiment more concrete, in this embodiment, let f(x)=kx2+ bx + c, where k ≠ 0, b, c are arbitrary constants, where the cryptographic function is f(x)Is anTo bnThe mapping function of (2).
As a specific example, assuming that the character string C is 123456789, where k is 1, b is 1, and C is 1, there are:
f(x)=x2+ x +1, there are: f. of(1)=3、f(2)=7、f(3)=13、f(4)=21、f(5)=31、f(6)=43、f(7)=57、f(8)=73、f(9)91; the corresponding encrypted string C' 3713213143577391. The corresponding coordinate points are (3,7) (13,21), (31, 43), (57,73), (73,91), and since 9 characters in total are used to ensure that they form coordinate points, the coordinate coincidence is adopted when the number of characters is singular. The curve formed by connecting the points is the encryption curve L.
In the actual recognition process, the function f is obtained(x)The final result is influenced by different values of the parameters, so that a character with a longer digit is formed, the recognition difficulty is increased, and only one digit can be recognized in the two-dimensional code recognition process, so that two kinds of optimization designs are made in the embodiment to simplify the recognition. The solution is to make the individual characters of the character string C ═ 3713213143577391 into dots, i.e. similar to (3,7), (1,3), (2,1) … … (9,1), and then connect the dots to form the curve L. But this solution has another problem that it causes too many verification points. In response to the questionThe embodiment further optimizes the function, proposes a second scheme, and performs a function f(x)For example, the first bit, or the last or a fixed number of bits is taken, and if the fixed bit is missing, 0 is taken. For example, in the above example, take the function f(x)The first digit of (1) then has f(1)=3、f(2)=7、f(3)=1、f(4)=2、f(5)=3、f(6)=4、f(7)=5、f(8)=7、f(9)9, the corresponding encrypted character string C' 371234579 forms coordinate points of (3,7), (1,2), (3,4), (5,7), and (7,9), thereby reducing the number of verification points.
When connecting the points, the connection mode may be line segment connection or curve connection, and the encryption curve L in the present embodiment preferably includes a coordinate point (b)1,b2)、(b3,b4)、(b5,b6)……(bn-1,bn) A smooth connection is formed. The reason is that curve connection in the identification process can ensure that each point has an adjacent point with small position deviation, so that the identification success rate is increased, the identification equipment has poor precision, and if line segment identification is adopted, unique identification occurs in the identification process due to the absence of adjacent approximate points, and identification failure can be caused once errors occur.
The embodiment also provides a two-dimensional code encryption method, which comprises the following steps:
s1: data analysis, namely determining the type of the coded character, converting the coded character into a character string C according to a corresponding character set, and determining the error correction level; under the condition of a certain specification, the higher the error correction level is, the smaller the real data capacity is.
S2: encrypting the character string by an encryption function f(x)Encrypting to obtain an encrypted character string C';
s3: generating a graphic code, and generating a two-dimensional graphic code for the character string C according to a coding rule;
s4: generating an encryption curve, and taking continuous characters in the encryption character string C' as a group of coordinate points to obtain
Figure BDA0002307957160000051
A coordinate, where n is the number of characters of the encrypted string C', will be
Figure BDA0002307957160000061
The coordinates are smoothly connected to form an encryption curve L on the two-dimensional graphic code.
The step S1 and the step S3 belong to a design part of graph coding, and there are differences according to coding modes of different graph codes, and those skilled in the art will know that the step S1 and the step S3 can be reasonably adjusted according to different coding modes, and in this embodiment, a matrix two-dimensional code is taken as an example for explanation.
Correspondingly, the detailed step of step S3 includes:
s01: data encoding, converting the character string C into bit stream, and forming a data code word sequence C1 by using a code word every 8 bits; knowing this sequence of data code words the data content of the two-dimensional code is known. It comprises the following substeps:
s11: grouping, assuming that the character string C ═ a1a2a3a4......an) The number of characters is N, every 3 characters form a group to form a continuous group a1a2a3、a4a5a6、……an-2an-1anIf N is not a multiple of 3, the last group of characters is less than 3; assuming C is 01234567, then the packet is 01234567;
s12: converting into binary, and converting each group into binary code 012 → 0000001100-;
s13: converting into a sequence, and sequentially arranging each group of binary codes to form a binary sequence 000000110001010110011000011;
s14: converting the character number into a binary system, converting the character number N into the binary system to form a character number binary code, wherein N is 8 → 0000001000;
s15: the mode indicator is added, a binary indicator 0001 is added, and then the binary indicator and the character number binary code are sequentially placed in front of the binary sequence to form a data codeword sequence C1-00010000001000000000110001010110011000011. The basic method is consistent with the fact that the letters, Chinese, Japanese and the like are only different in grouping mode, mode and the like.
S02: error correction coding, namely partitioning the data code word sequence C1 to obtain a plurality of partitioned code words C, generating error correction code words according to the error correction level and the partitioned code words C, and adding the error correction code words behind the data code word sequence to form a new sequence C2; in the case of determining the two-dimensional code specification and the error correction level, the total number of codewords and the number of error correction codewords that can be accommodated by the two-dimensional code specification and the error correction level are determined, for example: version 10, error correction level H, can accommodate a total of 346 codewords, 224 error correction codewords. That is, approximately 1/3 codewords in the two-dimensional code region are redundant. For these 224 error correction codewords, it can correct 112 replacement errors (e.g. black-white inversion) or 224 data read errors (unreadable or undecodable), such that the error correction capacity is: 112/346%
S03: constructing final data information, putting the sequence C2 into blocks according to the sequence under the condition that the specification is determined, blocking the data according to the specification, then calculating each block to obtain a corresponding error correction code word block, forming a sequence by the error correction code word blocks in sequence, and adding the sequence behind the data code word sequence C1 to form a complete sequence C3; such as: d1, D12, D23, D35, D2, D13, D24, D36, … D11, D22, D33, D45, D34, D46, E1, E23, E45, E67, E2, E24, E46, E68, …
S04: and constructing a matrix, putting the detection pattern, the separator, the positioning pattern, the correction pattern and the code word module into the matrix, and filling the complete sequence C3 into the area of the two-dimensional code matrix with the corresponding specification. Wherein, the position detection figure separator, the positioning figure: the method is used for positioning the two-dimensional codes, and for each QR code, the position is fixed, and only the size and the specification are different;
and (3) correcting the pattern: specification determination, namely determining the number and the positions of the correction graphs;
format information: the error correction level of the two-dimensional code is represented and is divided into L, M, Q, H;
version information: that is, the two-dimensional code has a specification, and the QR code symbols have 40 matrices (generally black and white) in total, and each version has 4 blocks on each side of the symbol more than the previous version from 21 × 21 (version 1) to 177 × 177 (version 40).
Data and error correction code words: the two-dimensional code information which is actually stored, and an error correction code word (used for correcting errors caused by two-dimensional code damage).
S05: the mask is used for using the mask graph in the coding area of the symbol, so that dark and light areas in the two-dimensional code graph can be distributed according to the optimal ratio;
s06: and the generated format and version information are put into the corresponding area.
In the above process, that is, the QR code encoding process currently used, when encoding of other systems is used, the steps S1 and S3 may be replaced correspondingly.
As a preferred embodiment, in step S4, if n is odd, a composite point is generated, which is represented by (b)n-2,bn-1)、(bn-1,bn) N represents the order of the character b in the encrypted character string C ', and for example, in the above example, the encrypted character string C' is 371234579, and the coordinate points formed by these are (3,7), (1,2), (3,4), (5,7), and (7, 9).
As shown in fig. 2, the last embodiment further provides a two-dimensional code verification step, which includes the following steps:
s01: scanning the two-dimension code by using code scanning equipment;
s02: and reading and verifying the curve L, if the contact ratio of the coordinate point on the curve L and the system verification curve L' exceeds a threshold value M, passing the verification, and entering the next step, otherwise, returning to the previous step, wherein the value of the threshold value M is more than or equal to 70%. And (4) identifying coordinates on the curve, and when the number of coordinate points on the curve is identified to be more than or equal to 70% of all points, the verification is passed, and the system directly calls all coordinate compensation coordinate points of the corresponding curve from the database. When the number of coordinate points on the curve is identified to be less than 70% of all the points, the password is called from the database after the verification is passed, the button of the subsequent operation is activated, and the verification fails. The verification failure can only read the two-dimension code information, and the subsequent operation can not be carried out.
S03: and identifying the two-dimensional code and reading data in the two-dimensional code.
The verification curve L' referred to here is based on the cryptographic function f(x)=kx2The standard curve generated by + bx + c, and the coordinate points corresponding to the character strings are set in the bar code scanner in a calculation or pre-storage mode, so that the corresponding bar code scanner must be used to complete the identification of the two-dimensional code, and the traditional two-dimensional code scanner cannot identify the bar code.
The foregoing is illustrative of the preferred embodiments of this invention, and it is to be understood that the invention is not limited to the precise form disclosed herein and that various other combinations, modifications, and environments may be resorted to, falling within the scope of the concept as disclosed herein, either as described above or as apparent to those skilled in the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. The utility model provides a two-dimensional code which characterized in that, this two-dimensional code includes:
based on the string C ═ a1a2a3a4……an) A graph coding region generated according to a certain rule and an encryption curve L positioned on the graph coding region;
the encryption curve L consists of a coordinate point (b)1,b2)、(b3,b4)、(b5,b6)……(bn-1,bn) In which b is1b2b3……bn-1bnI.e. the encrypted string C' ═ b1b2b3b4……bn);
The encrypted string C ═ b1b2b3b4……bn) By the string C ═ a1a2a3a4……an) By means of an encryption function f(x)And (6) mapping.
2. A two-dimensional code according to claim 1, characterized in that said encryption curve L is composed of coordinate points (b)1,b2)、(b3,b4)、(b5,b6)……(bn-1,bn) A smooth connection is formed.
3. A two-dimensional code according to claim 2, characterized in that said encryption function f(x)Means anTo bnAnd satisfies f(x)=kx2+ bx + c, where k ≠ 0, and b, c are arbitrary constants.
4. A method for implementing the two-dimensional code encryption method of any one of claims 1-3, the method comprising one or more of the following steps:
s1: data analysis, namely determining the type of the coded character, converting the coded character into a character string C according to a corresponding character set, and determining the error correction level;
s2: encrypting the character string by using the encryption function f(x)Mapping to obtain an encrypted character string C';
s3: generating a graphic code, and generating a two-dimensional graphic code for the character string C according to a coding rule;
s4: generating an encryption curve, and taking continuous characters in the encryption character string C' as a group of coordinate points to obtain
Figure FDA0002307957150000011
A coordinate, where n is the number of characters of the encrypted string C', will be
Figure FDA0002307957150000012
The coordinates are smoothly connected to form an encryption curve L on the two-dimensional graphic code.
5. The two-dimensional code encryption method according to claim 4, wherein in step S4, if n is an odd number, a composite code is generatedA point, which is represented as (b)n-2,bn-1)、(bn-1,bn) And n represents the order of the characters b in the encrypted string C'.
6. The two-dimensional code encryption method according to claim 5, further comprising a two-dimensional code verification step, wherein the flow of the steps is as follows:
s01: scanning the two-dimension code by using code scanning equipment;
s02: reading the curve L and verifying, if the contact ratio of the coordinate point on the curve L and the system verification curve L' exceeds a threshold value M, passing the verification, and entering the next step, otherwise, returning to the previous step;
s03: and identifying the two-dimensional code and reading data in the two-dimensional code.
7. The two-dimensional code encryption method according to claim 6, wherein the verification curve L' is based on an encryption function f(x)=kx2+ bx + c generated standard curve.
8. The two-dimensional code encryption method according to claim 7, wherein the value of the threshold M is greater than or equal to 70%.
9. The two-dimensional code and the encryption method thereof according to claim 8, wherein the step S3 includes:
s01: data encoding, converting the character string C into bit stream, and forming a data code word sequence C1 by using a code word every 8 bits;
s02: error correction coding, namely partitioning the data codeword sequence C1 to obtain a plurality of partitioned codewords C, generating error correction codewords according to the error correction level and the partitioned codewords C, adding the error correction codewords behind the partitioned codewords C, and then arranging the error correction codewords in sequence to form a new sequence C2;
s03: constructing final data information, putting the sequence C2 into blocks according to the sequence under the condition that the specification is determined, blocking the data according to the specification, then calculating each block to obtain a corresponding error correction code word block, forming a sequence by the error correction code word blocks in sequence, and adding the sequence behind the data code word sequence C1 to form a complete sequence C3;
s04: constructing a matrix, putting the detection pattern, the separator, the positioning pattern, the correction pattern and the code word module into the matrix, and filling the complete sequence C3 in the area of the two-dimensional code matrix with the corresponding specification;
s05: the mask is used for using the mask graph in the coding area of the symbol, so that dark and light areas in the two-dimensional code graph can be distributed according to the optimal ratio;
s06: and the generated format and version information are put into the corresponding area.
10. The two-dimensional code and the encryption method thereof according to claim 9, wherein the step S01 includes:
s11: grouping, assuming that the character string C ═ a1a2a3a4……an) The number of characters is N, every 3 characters form a group to form a continuous group a1a2a3、a4a5a6、……an-2an-1anIf N is not a multiple of 3, the last group of characters is less than 3;
s12: converting into binary, and converting each group into binary codes;
s13: converting into a sequence, and sequentially arranging each group of binary codes to form a binary sequence;
s14: converting the character number into a binary system, and converting the character number N into the binary system to form a binary code of the character number;
s15: adding a mode indicator, adding a binary indicator, and then sequentially placing the binary indicator and the binary code of the character number in front of the binary sequence to form a data codeword sequence C1.
CN201911247006.8A 2019-12-09 2019-12-09 Two-dimensional code and encryption method thereof Pending CN110991589A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911247006.8A CN110991589A (en) 2019-12-09 2019-12-09 Two-dimensional code and encryption method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911247006.8A CN110991589A (en) 2019-12-09 2019-12-09 Two-dimensional code and encryption method thereof

Publications (1)

Publication Number Publication Date
CN110991589A true CN110991589A (en) 2020-04-10

Family

ID=70091101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911247006.8A Pending CN110991589A (en) 2019-12-09 2019-12-09 Two-dimensional code and encryption method thereof

Country Status (1)

Country Link
CN (1) CN110991589A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204755A (en) * 2021-04-20 2021-08-03 重庆工业职业技术学院 English data capture method for block chain big data security
CN113392664A (en) * 2021-06-22 2021-09-14 杭州沃朴物联科技有限公司 Anti-counterfeiting two-dimensional code generation method, anti-counterfeiting method and anti-counterfeiting device
CN116320200A (en) * 2023-05-23 2023-06-23 南京龟兔赛跑软件研究院有限公司 Multi-point fusion anti-cracking encryption method applied to two-dimensional code

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104376356A (en) * 2014-12-02 2015-02-25 合肥城市云数据中心有限公司 Two-dimensional code generating method with encryption function
CN106408065A (en) * 2016-09-05 2017-02-15 成都天钥科技有限公司 Two-dimensional code encoding method and apparatus
CA3090716A1 (en) * 2018-02-07 2019-08-15 Beijing Sankuai Online Technology Co., Ltd Two-dimensional code generation and identification

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104376356A (en) * 2014-12-02 2015-02-25 合肥城市云数据中心有限公司 Two-dimensional code generating method with encryption function
CN106408065A (en) * 2016-09-05 2017-02-15 成都天钥科技有限公司 Two-dimensional code encoding method and apparatus
CA3090716A1 (en) * 2018-02-07 2019-08-15 Beijing Sankuai Online Technology Co., Ltd Two-dimensional code generation and identification

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张灵凤;冯锋;黄恒;: "二维码技术的生成原理的分析与研究" *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204755A (en) * 2021-04-20 2021-08-03 重庆工业职业技术学院 English data capture method for block chain big data security
CN113392664A (en) * 2021-06-22 2021-09-14 杭州沃朴物联科技有限公司 Anti-counterfeiting two-dimensional code generation method, anti-counterfeiting method and anti-counterfeiting device
CN116320200A (en) * 2023-05-23 2023-06-23 南京龟兔赛跑软件研究院有限公司 Multi-point fusion anti-cracking encryption method applied to two-dimensional code
CN116320200B (en) * 2023-05-23 2023-08-11 南京龟兔赛跑软件研究院有限公司 Multi-point fusion anti-cracking encryption method applied to two-dimensional code

Similar Documents

Publication Publication Date Title
CN110991589A (en) Two-dimensional code and encryption method thereof
CN100369059C (en) Matrix type two-dimensional bar code and its encoding and decoding method
KR100414524B1 (en) Two-dimensional Code having superior decoding property which is possible to control the level of error correcting codes, and method for encoding and decoding the same
Kato et al. Pervasive 2D barcodes for camera phone applications
CN111539502B (en) Anti-counterfeiting two-dimensional code generation method and device, server and storage medium
AU2010234172B2 (en) Two-dimensional array code
EP2511853A2 (en) Dot pattern
CN101093553A (en) 2D code system, and identification method
US8360333B2 (en) HD barcode
CN103530669A (en) Data information two-dimensional code encoding method
CN111046996B (en) Color QR code generation and identification method
AU2010234173B2 (en) Two-dimensional array code
CN101281588A (en) Two-dimension bar code system being suitable for mobile application as well as encoding-decoding method thereof
CN107742089B (en) Method for automatically identifying two-dimensional code by using spreadsheet
CN101303742B (en) Microminiature Hanxin code and method for generating symbol thereof
US20060289661A1 (en) Bi-directional readable two-dimensional bar code system and its reading method
CN108734048A (en) Various dimensions Quick Response Code based on proprietary code generates and interpretation method
US20240086670A1 (en) Methods for constructing, generating, and reading dot-matrix code, dot-matrix code generating and reading terminals, and dot-matrix code system
Hara Development and popularization of QR code—Code development pursuing reading performance and market forming by open strategy—
KR20030085511A (en) 2d barcode card and its decoding method
CN100504912C (en) Two dimensional bar code symbol generation method
CN109325568B (en) Anti-counterfeiting two-dimensional code and modulation encryption method and identification system thereof
CN101833645A (en) Bar code decoding method based on code word combination
Qin et al. Optimal design of QR code encoding
CN116992902A (en) Service code material statistics method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination