Anti-counterfeiting two-dimensional code encryption method and device based on purchase contract
By embedding encrypted anti-counterfeiting QR codes in the procurement contract, the problems of easy loss, risk of forgery and low confidentiality of traditional contracts are solved, and high security and flexible storage of contracts are achieved.
Patent Information
- Application Number
- CN202411716622.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-29
AI Technical Summary
Traditional equipment procurement contracts lack anti-counterfeiting signs, which are prone to loss, difficulty in finding, complicated signing process, forged and tampered with risks, and are low confidentiality.
The anti-counterfeiting QR code encryption method based on the procurement contract is adopted, and the encrypted data is generated by entering the contract-related information and using the target encryption technology, embedded in the QR code, generating the anti-counterfeiting QR code, and embedding it into the electronic version of the contract.
It improves the security and confidentiality of the contract, prevents the contract text from being modified and forged, stores large amounts of information, saves space, fast reading speed, low cost and flexible.
Smart Images

Figure CN119903532A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data encryption technology, and in particular to an anti-counterfeiting two-dimensional code encryption method and device based on a procurement contract. Background Art
[0002] Traditional equipment procurement contracts lack anti-counterfeiting marks and have many inconveniences, such as paper contracts are easy to lose, difficult to find, cumbersome signing procedures, and the risk of being forged and tampered with. In addition, the relevant confidentiality is extremely low, and there is a risk of leakage. In daily work, contract signing and management often involve multiple links and multiple departments, which puts forward new requirements and challenges for the timeliness and security of contract circulation. QR codes have the characteristics of low cost, large capacity, strong encryption, high reading speed, and a variety of information types, making them an efficient way to query and transmit information.
[0003] In view of this, how to provide an anti-counterfeiting QR code encryption method based on procurement contracts so that users can enhance confidentiality, security and uniqueness during the contract signing and circulation process has become a technical problem that urgently needs to be solved. Summary of the invention
[0004] The embodiments of the present application provide an anti-counterfeiting QR code encryption method based on a procurement contract, an anti-counterfeiting QR code encryption device based on a procurement contract, an electronic setting and a computer storage medium, which are used to solve the problem of poor confidentiality in the current procurement contract signing and circulation process.
[0005] In a first aspect of an embodiment of the present application, a method for encrypting an anti-counterfeiting QR code based on a procurement contract is provided, which is applied to an encryption system end and includes:
[0006] Enter the basic information related to the contract, and use the target encryption technology to encrypt the original data corresponding to the target information carried in the basic information to generate encrypted data, wherein the original data includes encrypted text data and QR code size specification data;
[0007] The encrypted data is embedded in a QR code to generate an anti-counterfeiting QR code corresponding to the contract, and the generated anti-counterfeiting QR code is embedded in an electronic version of the contract to generate a target procurement contract, wherein the target procurement contract is verified by scanning the anti-counterfeiting QR code.
[0008] In a second aspect of the embodiment of the present application, there is provided an anti-counterfeiting two-dimensional code encryption device based on a purchase contract, which is applied to an encryption system end, and includes:
[0009] The first generating module is configured to input basic information related to the contract, and use target encryption technology to encrypt original data corresponding to target information carried in the basic information to generate encrypted data, wherein the original data includes encrypted text data and QR code size specification data;
[0010] The second generating module is configured to embed the encrypted data into a QR code, generate an anti-counterfeiting QR code corresponding to the contract, and embed the generated anti-counterfeiting QR code into an electronic version of the contract to generate a target procurement contract, wherein the target procurement contract is verified by scanning the anti-counterfeiting QR code.
[0011] In a third aspect of the embodiment of the present application, a method for encrypting an anti-counterfeiting QR code based on a procurement contract is provided, which is applied to a user end and includes:
[0012] The anti-counterfeiting QR code carried by the target procurement contract is scanned by a terminal to obtain the original data corresponding to the target procurement contract.
[0013] In a fourth aspect of the embodiments of the present application, there is provided an anti-counterfeiting two-dimensional code encryption device based on a purchase contract, which is applied to a user end and includes:
[0014] The acquisition module is configured to scan the anti-counterfeiting two-dimensional code carried by the target procurement contract through a terminal to acquire the original data corresponding to the target procurement contract.
[0015] According to a fifth aspect of an embodiment of the present application, there is provided a computing device, including:
[0016] Memory and processor;
[0017] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above-mentioned anti-counterfeiting two-dimensional code encryption method based on the procurement contract are implemented.
[0018] According to the sixth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned anti-counterfeiting QR code encryption method based on the procurement contract are implemented.
[0019] The present application provides an anti-counterfeiting QR code encryption method based on a procurement contract, which is applied to an encryption system end, and includes: entering basic information related to the contract, and using target encryption technology to encrypt original data corresponding to target information carried in the basic information to generate encrypted data, wherein the original data includes encrypted text data and QR code size specification data; embedding the encrypted data into a QR code to generate an anti-counterfeiting QR code corresponding to the contract, and embedding the generated anti-counterfeiting QR code into an electronic version of the contract to generate a target procurement contract, wherein the target procurement contract is verified by scanning the anti-counterfeiting QR code.
[0020] The anti-counterfeiting two-dimensional code encryption method based on the procurement contract provided by the embodiment of the present application can achieve the following beneficial effects: strong anti-counterfeiting and confidentiality. Using a two-dimensional code to identify relevant contract information can improve the security and confidentiality of the contract; using an encryption method to encrypt data can effectively prevent the contract text from being tampered with and forged. Large amount of information can be stored, saving space. A two-dimensional code can accommodate 1848 alphabetic characters or 2729 numeric characters, about 500 sub-word information, and this information capacity is dozens of times that of other barcodes, which can support information storage with a large amount of data. Fast reading speed, convenient and fast. Only by scanning the two-dimensional code information through an instrument and cooperating with a decryption tool, a large amount of contract information can be obtained, which greatly improves the speed and efficiency of recognition. Low cost, strong flexibility, low cost of making two-dimensional codes, large number of sets, and easy to make; at the same time, the shape and size of the two-dimensional code can be flexibly adjusted according to the area used for the contract text, which is very flexible.
[0021] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, which can be implemented in accordance with the contents of the specification, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0023] Figure 1 A flowchart of an anti-counterfeiting QR code encryption method based on a procurement contract applied to an encryption system end provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of the process of generating a QR code in an anti-counterfeiting QR code encryption method based on a purchase contract provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of the structure of an anti-counterfeiting QR code encryption device based on a procurement contract applied to an encryption system end provided in an embodiment of the present application;
[0026] Figure 4 A structural block diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0028] See also Figure 1 , Figure 1 The present invention provides a flowchart of an anti-counterfeiting QR code encryption method based on a procurement contract applied to an encryption system end. Figure 1 As shown, the specific steps include the following steps.
[0029] Step S102: input basic information related to the contract, and use target encryption technology to encrypt the original data corresponding to the target information carried in the basic information to generate encrypted data, wherein the original data includes encrypted text data and QR code size specification data;
[0030] Step S104: embed the encrypted data into a QR code to generate an anti-counterfeiting QR code corresponding to the contract, and embed the generated anti-counterfeiting QR code into an electronic version of the contract to generate a target procurement contract, wherein the target procurement contract is verified by scanning the anti-counterfeiting QR code.
[0031] In the embodiment of the present application, the target encryption technology is used to encrypt the original data corresponding to the target information carried in the basic information to generate encrypted data, including:
[0032] Using a symmetric encryption algorithm, encrypt the original data corresponding to the target information carried in the basic information to generate an original key, wherein the original key carries at least one set of encryption key and decryption key;
[0033] Processing the original key through a key expansion algorithm to generate at least two rounds of keys, wherein processing the original key includes processing the original key into a word sequence containing a plurality of target bytes;
[0034] Performing an XOR operation on the initial round key and the plaintext in the word sequence to generate a first result, and using the first result as an input for a first round of encryption;
[0035] Based on the key length corresponding to the initial round key, an encryption operation round is set, and the round function is repeatedly applied until the actual encryption operation round reaches the encryption operation round, thereby generating encrypted data.
[0036] Specifically, the step of setting an encryption operation round based on a key length corresponding to the initial round key, repeatedly applying a round function until an actual encryption operation round reaches the encryption operation round, and generating encrypted data includes:
[0037] Based on the key length corresponding to the initial round key, an encryption operation round is set, a round function is repeatedly applied, and in response to an actual encryption operation round that is less than the encryption operation round, a round function byte replacement operation, a round function row shift operation, a round function column confusion operation, and a round function round key addition operation are sequentially performed until the actual encryption operation round is not less than the encryption operation round, a final round function byte replacement operation is performed to generate initial encrypted data;
[0038] The round function row shift operation and the round function key addition operation are sequentially performed on the initial encrypted data to generate encrypted data, wherein the encrypted data is a data block of the same length as the original data and the encrypted data cannot be directly identified.
[0039] In the embodiment of the present application, the method of embedding the encrypted data into a QR code, generating an anti-counterfeiting QR code corresponding to the contract, and embedding the generated anti-counterfeiting QR code into an electronic version of the contract to generate a target procurement contract includes:
[0040] Introducing a one-dimensional / two-dimensional barcode image processing library, using a target encoding method, processing the encrypted text data and two-dimensional code size specification data carried in the original data, and generating a matrix model corresponding to the two-dimensional code;
[0041] Convert the matrix model corresponding to the QR code into an anti-counterfeiting QR code in a target format, and save the anti-counterfeiting QR code to a target file path, wherein the anti-counterfeiting QR code is a QR code image;
[0042] The anti-counterfeiting QR code is embedded into the electronic contract to generate the target procurement contract.
[0043] In an embodiment of the present application, the method further includes: sending the target procurement contract to a user terminal.
[0044] In addition, when applied to a user terminal, the method includes: scanning the anti-counterfeiting QR code carried by the target procurement contract through a terminal to obtain original data corresponding to the target procurement contract.
[0045] In another embodiment, the method further includes:
[0046] Scan the anti-counterfeiting QR code carried by the target procurement contract through the terminal, and obtain the electronic version of the contract related to the contract in the business software.
[0047] See also Figure 2 , Figure 2 A schematic diagram of the process of generating a QR code in an anti-counterfeiting QR code encryption method based on a purchase contract provided in an embodiment of the present application. Figure 2 As shown, the specific steps include the following steps.
[0048] Step S1: Input the contract data to be saved.
[0049] In actual applications, basic information related to the contract is entered into the system through a program.
[0050] Step S2: Extract unique data.
[0051] In practical applications, important information is extracted and encrypted.
[0052] Step S3: Encryption is performed using the AES encryption method.
[0053] In practical applications, AES symmetric encryption technology is used to encrypt the extracted data; AES (Advanced Encryption Standard) is a widely used symmetric encryption algorithm, and the encryption and decryption processes use the same secret key.
[0054] Step S4: Generate multiple secret keys through the key expansion algorithm.
[0055] In practical applications, key expansion. Based on the input 128-bit (16-byte) key, a key expansion algorithm is used to generate multiple round keys. Used in the subsequent encryption process. The key expansion algorithm expands the original key into a sequence of multiple 32-bit (4-byte) words, which will be used for subsequent round key addition operations.
[0056] Step S5: Initial round key addition.
[0057] In practical applications, the initial round key is added. Before the first round of encryption, the plaintext (data to be encrypted) is XORed with the first round key. This step is called initial round key addition, and its result will be used as the input of the first round of encryption.
[0058] Step S6: Set the encryption operation round according to the key length.
[0059] In practice, the round function is applied repeatedly, depending on the selected key length (10 rounds for AES-128). In AES-128, 10 rounds of encryption operations are performed.
[0060] Step S7: Determine whether i is less than 10.
[0061] In practical applications, the number of encryption operations is determined. When i<10, the relevant steps S8-S11 are looped. When i=10, the loop is exited and step S12 is executed.
[0062] Step S8: When i is less than 10, perform round function byte replacement.
[0063] In practical applications, the round function replaces bytes. The input bytes are replaced by a fixed S-box. The S-box is a predefined replacement table used to replace each byte with another byte.
[0064] Step S9: Execute round function row shift.
[0065] In practical applications, the round function shifts rows. The state matrix (the 4x4 byte matrix of input data) is shifted row by row. The specific shifting method varies according to the number of rows. Usually, the first row is not shifted, the second row is shifted left by one, the third row is shifted left by two, and the fourth row is shifted left by three.
[0066] Step S10: Execute round function sequence obfuscation.
[0067] In practice, the round function is column-confused. The state matrix is column-confused by multiplying it with a fixed matrix. This step is performed in all rounds except the last one.
[0068] Step S11: Execute round function round key addition.
[0069] In practical applications, the round function is round key plus. The round key is XORed with the state matrix. This step is performed in each round to further obfuscate the data.
[0070] Step S12: When i is not less than 10, perform round function byte replacement.
[0071] In practical applications, the last round of function byte replacement is performed.
[0072] Step S13: Execute round function row shift.
[0073] In practical applications, the last round does not perform round function column obfuscation; it directly performs last round function row shift.
[0074] Step S14: Execute round function and round key addition.
[0075] In practical applications, the final round function key is added.
[0076] Step S15: Output ciphertext.
[0077] In actual applications, the final encrypted ciphertext is output. The ciphertext is a data block of the same length as the original plaintext, but the content has been encrypted and cannot be directly identified.
[0078] Step S16: Generate a QR code using the encoder method of MultiFormatWriter.
[0079] In practical applications, ZXing (Zebra Crossing) dependency is introduced to generate the BrMatrix of the QR code using the encrypted text content in step (2), the height and width of the QR code to be generated, and the encode method of MultiFormatWriter.
[0080] Step S17: Convert to PNG format image.
[0081] In actual applications, the writeToPath method of MatrixTolmageWriter is used to convert the BitMatrix into a PNG format image and save it to the specified file path.
[0082] Step S18: Embedded into the contract.
[0083] In actual application, the generated QR code image is embedded into the contract.
[0084] Step S19: Scan and decrypt to obtain the plain text through a scanner.
[0085] In actual applications, users can use relevant scanning equipment to scan the QR code in the contract. The QR code processed by encryption technology will produce a string of garbled information if scanned normally. By scanning and decrypting the QR code using relevant decryption methods, important data related to the contract can be obtained.
[0086] Step S20: Obtain the electronic version of the contract.
[0087] In actual applications, the electronic version of the contract can also be directly queried in the business software by scanning the QR code.
[0088] The application of this method has the following beneficial effects: (1) Strong anti-counterfeiting and confidentiality. Using a two-dimensional code to identify relevant contract information can improve the security and confidentiality of the contract; using encryption methods to encrypt data can effectively prevent the contract text from being tampered with and forged. (2) Large amount of information can be stored, saving space. A two-dimensional code can hold 1848 alphabetic characters or 2729 numeric characters, about 500 sub-digit information. This information capacity is dozens of times that of other barcodes, and can support the storage of information with a large amount of data. (3) Fast reading speed, convenient and fast. Only by scanning the two-dimensional code information through an instrument and using a decryption tool, a large amount of contract information can be obtained, which greatly improves the speed and efficiency of recognition. (4) Low cost and strong flexibility. The production cost of the two-dimensional code is low, the quantity set is large, and it is easy to make. At the same time, the shape and size of the two-dimensional code can be flexibly adjusted according to the area used for the contract text, which is very flexible.
[0089] Corresponding to the above method embodiment, this specification also provides an anti-counterfeiting two-dimensional code encryption device embodiment based on a procurement contract, Figure 3 The schematic diagram of the structure of a purchase contract-based anti-counterfeiting two-dimensional code encryption device applied to the encryption system end provided in the embodiment of the present application. Figure 3 As shown, the device comprises:
[0090] The first generating module 302 is configured to input basic information related to the contract, and use target encryption technology to encrypt the original data corresponding to the target information carried in the basic information to generate encrypted data, wherein the original data includes encrypted text data and QR code size specification data;
[0091] The second generation module 304 is configured to embed the encrypted data into a QR code to generate an anti-counterfeiting QR code corresponding to the contract, and embed the generated anti-counterfeiting QR code into an electronic version of the contract to generate a target procurement contract, wherein the target procurement contract is verified by scanning the anti-counterfeiting QR code.
[0092] In an optional embodiment, the first generating module 302 is further configured to:
[0093] Using a symmetric encryption algorithm, encrypt the original data corresponding to the target information carried in the basic information to generate an original key, wherein the original key carries at least one set of encryption key and decryption key;
[0094] Processing the original key through a key expansion algorithm to generate at least two rounds of keys, wherein processing the original key includes processing the original key into a word sequence containing a plurality of target bytes;
[0095] Performing an XOR operation on the initial round key and the plaintext in the word sequence to generate a first result, and using the first result as an input for a first round of encryption;
[0096] Based on the key length corresponding to the initial round key, an encryption operation round is set, and the round function is repeatedly applied until the actual encryption operation round reaches the encryption operation round, thereby generating encrypted data.
[0097] In an optional embodiment, the first generating module 302 is further configured to:
[0098] Based on the key length corresponding to the initial round key, an encryption operation round is set, a round function is repeatedly applied, and in response to an actual encryption operation round that is less than the encryption operation round, a round function byte replacement operation, a round function row shift operation, a round function column confusion operation, and a round function round key addition operation are sequentially performed until the actual encryption operation round is not less than the encryption operation round, a final round function byte replacement operation is performed to generate initial encrypted data;
[0099] The round function row shift operation and the round function key addition operation are sequentially performed on the initial encrypted data to generate encrypted data, wherein the encrypted data is a data block of the same length as the original data and the encrypted data cannot be directly identified.
[0100] In an optional embodiment, the second generating module 304 is further configured to:
[0101] Introducing a one-dimensional / two-dimensional barcode image processing library, using a target encoding method, processing the encrypted text data and two-dimensional code size specification data carried in the original data, and generating a matrix model corresponding to the two-dimensional code;
[0102] Convert the matrix model corresponding to the QR code into an anti-counterfeiting QR code in a target format, and save the anti-counterfeiting QR code to a target file path, wherein the anti-counterfeiting QR code is a QR code image;
[0103] The anti-counterfeiting QR code is embedded into the electronic contract to generate the target procurement contract.
[0104] In an optional embodiment, the device is further configured to:
[0105] The sending module is configured to send the target procurement contract to the user end.
[0106] In addition, in the embodiment of the present application, an anti-counterfeiting QR code encryption device based on a purchase contract applied to a user terminal is also included, and the device includes:
[0107] The acquisition module is configured to scan the anti-counterfeiting two-dimensional code carried by the target procurement contract through a terminal to acquire the original data corresponding to the target procurement contract.
[0108] The application of this device has the following beneficial effects: (1) Strong anti-counterfeiting and confidentiality. Using a QR code to identify relevant contract information can improve the security and confidentiality of the contract; using encryption methods to encrypt data can effectively prevent the contract text from being tampered with and forged. (2) Large amount of information storage and space saving. A QR code can hold 1848 alphabetic characters or 2729 numeric characters, about 500 sub-digit information. This information capacity is dozens of times that of other barcodes, and can support the storage of information with a large amount of data. (3) Fast reading speed, convenient and fast. Only by scanning the QR code information through the instrument and using the decryption tool, a large amount of contract information can be obtained, which greatly improves the speed and efficiency of recognition. (4) Low cost and strong flexibility. The production cost of the QR code is low, the quantity set is large, and it is easy to make. At the same time, the shape and size of the QR code can be flexibly adjusted according to the use area of the contract text, which is very flexible.
[0109] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the anti-counterfeiting two-dimensional code encryption device based on the purchase contract, since it is basically similar to the embodiment of the anti-counterfeiting two-dimensional code encryption method based on the purchase contract, the description is relatively simple, and the relevant parts can be referred to the partial description of the embodiment of the anti-counterfeiting two-dimensional code encryption method based on the purchase contract.
[0110] Figure 4 This is a block diagram of a computing device provided in an embodiment of the present application. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.
[0111] The computing device 400 also includes an access device 440, which enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0112] In one embodiment of the present specification, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0113] The computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 400 may also be a mobile or stationary server.
[0114] Among them, the processor 420 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned anti-counterfeiting QR code encryption method based on the procurement contract.
[0115] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the anti-counterfeiting two-dimensional code encryption method embodiment based on the purchase contract, the description is relatively simple, and the relevant parts can be referred to the partial description of the anti-counterfeiting two-dimensional code encryption method embodiment based on the purchase contract.
[0116] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned anti-counterfeiting two-dimensional code encryption method based on a procurement contract.
[0117] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the anti-counterfeiting two-dimensional code encryption method embodiment based on the procurement contract, the description is relatively simple, and the relevant parts can be referred to the partial description of the anti-counterfeiting two-dimensional code encryption method embodiment based on the procurement contract.
[0118] An embodiment of the present specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is instructed to execute the steps of the above-mentioned anti-counterfeiting two-dimensional code encryption method based on a procurement contract.
[0119] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer program embodiment, since it is basically similar to the anti-counterfeiting two-dimensional code encryption method embodiment based on the purchase contract, the description is relatively simple, and the relevant parts can be referred to the partial description of the anti-counterfeiting two-dimensional code encryption method embodiment based on the purchase contract.
[0120] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0121] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0122] It should be noted that the above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of the present specification.
[0123] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0124] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. An anti-counterfeiting QR code encryption method based on a procurement contract, applied to an encryption system, characterized in that: include: Enter the basic information related to the contract, and use the target encryption technology to encrypt the original data corresponding to the target information carried in the basic information to generate encrypted data, wherein the original data includes encrypted text data and QR code size specification data; The encrypted data is embedded in a QR code to generate an anti-counterfeiting QR code corresponding to the contract, and the generated anti-counterfeiting QR code is embedded in an electronic version of the contract to generate a target procurement contract, wherein the target procurement contract is verified by scanning the anti-counterfeiting QR code.
2. The method according to claim 1, characterized in that The method of using the target encryption technology to encrypt the original data corresponding to the target information carried in the basic information to generate encrypted data includes: Using a symmetric encryption algorithm, encrypt the original data corresponding to the target information carried in the basic information to generate an original key, wherein the original key carries at least one set of encryption key and decryption key; Processing the original key through a key expansion algorithm to generate at least two rounds of keys, wherein processing the original key includes processing the original key into a word sequence containing a plurality of target bytes; Performing an XOR operation on the initial round key and the plaintext in the word sequence to generate a first result, and using the first result as an input for a first round of encryption; Based on the key length corresponding to the initial round key, an encryption operation round is set, and the round function is repeatedly applied until the actual encryption operation round reaches the encryption operation round, thereby generating encrypted data.
3. The method according to claim 2, characterized in that The step of setting an encryption operation round based on a key length corresponding to the initial round key, repeatedly applying a round function until an actual encryption operation round reaches the encryption operation round, and generating encrypted data includes: Based on the key length corresponding to the initial round key, an encryption operation round is set, a round function is repeatedly applied, and in response to an actual encryption operation round that is less than the encryption operation round, a round function byte replacement operation, a round function row shift operation, a round function column confusion operation, and a round function round key addition operation are sequentially performed until the actual encryption operation round is not less than the encryption operation round, a final round function byte replacement operation is performed to generate initial encrypted data; The round function row shift operation and the round function key addition operation are sequentially performed on the initial encrypted data to generate encrypted data, wherein the encrypted data is a data block of the same length as the original data and the encrypted data cannot be directly identified.
4. The method according to claim 1, characterized in that: The step of embedding the encrypted data into a QR code to generate an anti-counterfeiting QR code corresponding to the contract, and embedding the generated anti-counterfeiting QR code into an electronic version of the contract to generate a target procurement contract includes: Introducing a one-dimensional / two-dimensional barcode image processing library, using a target encoding method, processing the encrypted text data and two-dimensional code size specification data carried in the original data, and generating a matrix model corresponding to the two-dimensional code; Convert the matrix model corresponding to the QR code into an anti-counterfeiting QR code in a target format, and save the anti-counterfeiting QR code to a target file path, wherein the anti-counterfeiting QR code is a QR code image; The anti-counterfeiting QR code is embedded into the electronic contract to generate the target procurement contract.
5. The method according to claim 1, characterized in that The method further includes: sending the target procurement contract to a user terminal.
6. A method for encrypting an anti-counterfeit QR code based on a purchase contract, applied to a user end, characterized in that: include: The anti-counterfeiting QR code carried by the target procurement contract is scanned by a terminal to obtain the original data corresponding to the target procurement contract.
7. The method according to claim 6, characterized in that The method further comprises: Scan the anti-counterfeiting QR code carried by the target procurement contract through the terminal, and obtain the electronic version of the contract related to the contract in the business software.
8. An anti-counterfeiting QR code encryption device based on a purchase contract, applied to an encryption system, characterized in that: include: The first generating module is configured to input basic information related to the contract, and use target encryption technology to encrypt original data corresponding to target information carried in the basic information to generate encrypted data, wherein the original data includes encrypted text data and QR code size specification data; The second generating module is configured to embed the encrypted data into a QR code, generate an anti-counterfeiting QR code corresponding to the contract, and embed the generated anti-counterfeiting QR code into an electronic version of the contract to generate a target procurement contract, wherein the target procurement contract is verified by scanning the anti-counterfeiting QR code.
9. An anti-counterfeiting QR code encryption device based on a purchase contract, applied to a user end, characterized in that: include: The acquisition module is configured to scan the anti-counterfeiting two-dimensional code carried by the target procurement contract through a terminal to acquire the original data corresponding to the target procurement contract.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an implementation program for information transmission, and when the program is executed by a processor, the steps of the method as claimed in claim 7 are implemented.