CN116055062A - Verification code generation method, verification code checking method and related equipment - Google Patents

Verification code generation method, verification code checking method and related equipment Download PDF

Info

Publication number
CN116055062A
CN116055062A CN202310065729.6A CN202310065729A CN116055062A CN 116055062 A CN116055062 A CN 116055062A CN 202310065729 A CN202310065729 A CN 202310065729A CN 116055062 A CN116055062 A CN 116055062A
Authority
CN
China
Prior art keywords
code
verification
verification code
combined
random
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
CN202310065729.6A
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.)
BOE Technology Group Co Ltd
Original Assignee
BOE Technology Group Co Ltd
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 BOE Technology Group Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202310065729.6A priority Critical patent/CN116055062A/en
Publication of CN116055062A publication Critical patent/CN116055062A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0863Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides a verification code generation method, a verification code checking method and related equipment; the verification code generation method comprises the following steps: randomly generating at least one random code by utilizing a hash algorithm; combining all random codes with a preset sequence code to obtain a combined code; and encrypting the combined code by using a preset private key to obtain a verification code, and displaying the verification code. The verification method of the verification code comprises the following steps: decrypting the verification code sent from the outside of the verification code checking end by using a preset private key to obtain a combined code, and determining a target sequence code from the combined code; checking whether the product sequence code which is the same as the target sequence code exists in a plurality of prestored product sequence codes; the verification code is determined to be valid in response to the presence of the same product sequence code as the target sequence code.

Description

Verification code generation method, verification code checking method and related equipment
Technical Field
The embodiment of the application relates to the technical field of product anti-counterfeiting, in particular to a verification code generation method, a verification code checking method and related equipment.
Background
The related verification code is often generated and verified in a way that the pre-generated verification code is stuck on a product in a way of sticking a label, and the verification code is sent to a verification code checking end by a user for checking, but the pre-generated verification code is easy to leak and is extremely easy to crack.
In the scheme of generating the verification code by the verification code generation mechanism built in the product, because a complex encryption mechanism is often required to be set, extra hardware is required to support the operation of the encryption mechanism.
Based on this, a scheme capable of dynamically generating verification codes and realizing the verification codes without adding complex algorithms is needed.
Disclosure of Invention
In view of the foregoing, an object of the present application is to provide a method for generating a verification code, a method for checking the verification code, and related devices.
Based on the above objects, the present application provides a method for generating a verification code, applied to a verification code generating end, the method comprising:
randomly generating at least one random code by utilizing a hash algorithm;
combining all random codes with a preset sequence code to obtain a combined code;
and encrypting the combined code by using a preset private key to obtain a verification code, and displaying the verification code.
Further, randomly generating at least one random code using a hash algorithm, comprising:
generating at least one multi-bit random number using a preset random number generator;
and mapping the random number by using a preset hash function to obtain a random code corresponding to the random number.
Further, combining all random codes with a preset sequence code to obtain a combined code, including:
and respectively taking the all random codes and the sequence codes as two fields of the combined code, and splicing to obtain the combined code.
Further, before obtaining the verification code, the method further comprises:
performing digital-to-analog conversion on the encrypted combined code to obtain a digital-to-analog conversion code;
and determining the digital-to-analog conversion code as the verification code.
Based on the same inventive concept, the application also provides a verification code checking method applied to a verification code checking terminal, wherein the method comprises the following steps:
decrypting the verification code sent from the outside of the verification code checking end by using a preset private key to obtain a combined code, and determining a target sequence code from the combined code;
checking whether the product sequence code which is the same as the target sequence code exists in a plurality of prestored product sequence codes;
the verification code is determined to be valid in response to the presence of the same product sequence code as the target sequence code.
Further, decrypting the verification code sent from the verification code checking terminal by using a preset private key comprises:
responsive to determining that the validation code is in the form of a digital analog conversion code;
performing analog-digital conversion on the verification code to obtain a combined code to be decrypted;
and decrypting the combined code to be decrypted.
Based on the same inventive concept, the present application further provides a verification code generating device, including: the device comprises a random code generation module, a combined code generation module and a verification code generation module;
wherein the random code generation module is configured to randomly generate at least one random code by using a hash algorithm;
the combined code generating module is configured to combine all random codes with a preset sequence code to obtain a combined code;
the verification code generation module is configured to encrypt the combined code by using a preset private key to obtain a verification code and display the verification code.
Based on the same inventive concept, the application also provides a verification code checking device, which comprises: the device comprises a standard sequence code analysis module, a checking module and a judging module;
the target sequence code analysis module is configured to decrypt the verification code sent from the outside of the verification code checking end by using a preset private key to obtain a combined code, and determine a target sequence code from the combined code;
the checking module is configured to check whether the product sequence code which is the same as the target sequence code exists in the prestored product sequence codes or not;
the decision module is configured to determine that the verification code is valid in response to the presence of a product sequence code that is the same as the target sequence code.
Based on the same inventive concept, the application also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the generation method of the verification code or the verification method of the verification code when executing the program.
Based on the same inventive concept, the present application also provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions for causing the computer to execute the generation method of the verification code or the verification method of the verification code as described above.
Based on the same inventive concept, the application also provides a display device, which comprises the verification code generation device or the electronic device, and the electronic device executes the verification code generation method.
From the above, it can be seen that, according to the method for generating the verification code, the method for checking the verification code and the related device provided by the present application, the verification code generating terminal is based on the generated random code, and based on the pre-written sequence code, the combination of the sequence code and the random code is comprehensively considered to bind and encrypt the sequence code and the random code, so as to obtain the encrypted verification code, and it can be seen that, because the random code is bound in the verification code, the verification codes generated by the verification code generating terminal are different each time; the verification code checking terminal can obtain a combined code by decrypting the verification code based on the received verification code, and determines a target sequence code forming the combined code from the combined code, thereby checking whether the target sequence code is true and effective.
Drawings
In order to more clearly illustrate the technical solutions of the present application or related art, the drawings that are required to be used in the description of the embodiments or related art will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort to those of ordinary skill in the art.
FIG. 1 is a schematic diagram of an anti-counterfeit verification process according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for generating verification codes according to an embodiment of the present application;
FIG. 3 is a flowchart of a verification code verification method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a verification code generating device according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a verification device structure of a verification code according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings.
It should be noted that unless otherwise defined, technical or scientific terms used in the embodiments of the present application should be given a general meaning as understood by one of ordinary skill in the art to which the present application belongs. The terms "first," "second," and the like, as used in the embodiments of the present application, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate relative positional relationships, which may also be changed when the absolute position of the object to be described is changed.
As described in the background section, the related method for generating the verification code and the method for checking the verification code are also difficult to meet the actual anti-counterfeiting requirement of the product.
The applicant finds that in the process of implementing the application, the related verification code generation and verification mode is often that the verification code is generated in advance, the verification code is pasted on a product in a label pasting mode, and the verification code is sent to a verification code verification end by a user for verification, so that the main problem of the mode is that: the pre-generated verification code is easy to leak, and is further cracked.
In some other schemes, the verification code may be generated by a verification code generation mechanism built into the product, but in such schemes it is often necessary to set a complex encryption mechanism, so that additional hardware is required to support the operation of the encryption mechanism.
Based on this, one or more embodiments in the present application provide a method for generating a verification code and a method for checking a verification code, which dynamically generate a verification code based on a verification code generating end integrating a sequence code, a random code generating mechanism and an encryption mechanism, and decrypt and check the verification code by the verification code checking end based on a stored sequence and a decoding mechanism, so as to complete an anti-counterfeit verification process for a product.
Embodiments of the present application are described in detail below with reference to the accompanying drawings.
In the embodiment of the present application, in the specific example shown in fig. 1, a verification code generating end is provided in a product, a sequence code, a random code generating mechanism and an encryption mechanism are integrated in the verification code generating end, and based on the integrated mechanism, a verification code about the sequence code of the product can be generated.
The produced product can be a display device such as a display screen, a spliced screen, or other products; and the generated verification code can be regarded as the anti-counterfeiting code of the product.
Further, as shown in fig. 1, in the production process of the product, the above sequence code may be pre-written into the product, and the sequence code may be pre-uploaded to the verification code checking end.
The verification code checking end can be a data system with an operation function, a database or the like.
Further, in the production process, the sequence code written into each product can be uploaded to the verification code checking end in advance.
As shown in fig. 1, a user may obtain a verification code of a product through a user device, and send the verification code to a verification code checking end for checking.
Specifically, the user equipment may be a communication device such as a mobile communication terminal, and the user may acquire the verification code by using the user equipment in a manner such as scanning or manual input, and send the verification code to the data system for the data system to check.
Based on the verification code, the verification code is generated through the product, the user obtains the verification code, and the verification code is checked, so that the anti-counterfeiting verification process of the product can be completed.
Referring to fig. 2, the method for generating the verification code according to one embodiment of the present application is applied to a verification code generating end, and specifically includes the following steps:
step S201, randomly generating at least one random code by utilizing a hash algorithm.
In an embodiment of the present application, each random number may be mapped to one random code based on at least one random number generated in the authentication code generation end.
Specifically, the verification code generating end may generate a multi-bit random number by using a built-in random number generator, and may generate one or more random numbers according to specific requirements.
Further, for each generated random number, a hash algorithm may be utilized to map it to a random code.
Specifically, any multi-bit random number is input to a hash function preset in the verification code generation end, namely, a hash function, and a hash value corresponding to the random number, namely, a hash value is obtained through operation of the hash function.
Further, the hash value corresponding to the random number obtained by the operation can be used as a random code corresponding to the random number corresponding to each random number generated by the verification code generation end.
It can be seen that if the verification code generating end generates a random number, a random code can be obtained according to the random number, and if the verification code generating end generates a plurality of random numbers, a plurality of random codes can be obtained according to the random number, and the random numbers generated by the random number generator each time are different, so that the random codes mapped each time are different through a hash function.
In a specific example, taking a spliced screen product in a display device as an example, an anti-counterfeiting code generating end is mounted in the spliced screen product, when the spliced screen product is started, a generating process of the anti-counterfeiting code can be automatically started, and a triggering instruction can be sent to the spliced screen product to trigger the generating process of the anti-counterfeiting code.
The anti-counterfeiting code may be regarded as the anti-counterfeiting code in the foregoing embodiment, and based on this, the anti-counterfeiting code generating end may be regarded as the anti-counterfeiting code generating end and may be used to generate the anti-counterfeiting code.
Further, after the generation process of the anti-counterfeiting code is started, the built-in anti-counterfeiting code generation end of the spliced screen product triggers the random code generator to generate at least one multi-bit random number.
Further, the anti-counterfeiting code generating end maps each random number by utilizing a built-in hash function, so that a random code corresponding to the random number is obtained.
Step S202, combining all random codes with preset sequence codes to obtain a combined code.
In the embodiment of the present application, the random code mapped in the foregoing step may be combined with the sequence code written in advance to the verification code generating end, so as to obtain a combined code.
Specifically, in some embodiments, the resulting random code may be used as one field, while the preset sequence code is used as another field.
Further, the verification code generating end can splice the two fields into a combined code corresponding to the random code and the sequence code.
When only one random code is generated in the above steps, the random code is used as a field, and when a plurality of random codes are generated in the above steps, the plurality of random codes can be spliced into a field, then the fields related to the plurality of random codes and the fields of the sequence codes are spliced, and a combined code corresponding to the plurality of random codes and the sequence codes is obtained.
In other embodiments, other ways of combining the random code and the sequence code may be employed.
Specifically, when only one random code is generated in the foregoing step, the random code and the sequence code may be subjected to a binary operation, and the result obtained after the operation may be used as a combined code corresponding to the random code and the sequence code.
Further, when a plurality of random codes are generated in the foregoing step, the plurality of random codes may be first spliced into one field, the field related to the plurality of random codes and the sequence code are subjected to a binary operation, and the result obtained after the operation is used as a combined code corresponding to the plurality of random codes and the sequence code.
In a specific example, taking the spliced screen product in the previous step as an example, when at least one random code is generated by the anti-counterfeiting code generating end, all the random codes can be spliced into one field.
Further, a unique serial number may be written for each spliced screen product during the production of the spliced screen product.
Based on this, the fields related to the random code obtained above can be combined with the sequence code to obtain a combined code in which the random code and the corresponding sequence code are bound.
Step 203, encrypt the combined code with a preset private key to obtain a verification code, and display the verification code.
In the embodiment of the application, based on the combined code obtained in the previous step, the combined code may be encrypted, and the encrypted combined code is used as the verification code, and the verification code is displayed to the user.
Specifically, a key for encryption may be preset at the verification code generating end, where the key may be, for example, a private key for a symmetric encryption mechanism.
Based on this, the authentication code obtained in the foregoing step may be encrypted by means of AES (Advanced Encryption Standard ) using a preset private key, and an encrypted combination code may be obtained.
In this embodiment, the encrypted combined code may be used as the verification code, and the verification code may be displayed to the user, so that the user may obtain the verification code by reading or scanning.
In some other embodiments, the encrypted combined code may be subjected to digital-to-analog conversion, and the DAC code (digital-to-analog conversion code) obtained after conversion is used as the verification code and displayed.
Specifically, the encrypted combination code may be input to a preset DAC (digital-to-analog signal conversion) chip, and the DAC chip may be used to perform digital-to-analog conversion on the encrypted combination code.
Further, after conversion, the DAC chip outputs a DAC code, and in this embodiment, the DAC code may be used as an authentication code and displayed to the user, so that the user may obtain the authentication code by reading or scanning.
In a specific example, taking the spliced screen product in the previous step as an example, a private key for encryption may be set in advance at the anti-counterfeiting code generating end.
Based on the combined code generated by the anti-counterfeiting code generating end, the private key can be utilized to carry out AES encryption on the combined code.
Further, the encrypted combined code is used as an anti-counterfeiting code, and the anti-counterfeiting code is displayed to a user, so that the user can obtain the anti-counterfeiting code in a reading or scanning mode.
In the spliced screen product, the encrypted combined code can be input into a DAC chip for digital-to-analog conversion, and after the conversion, the DAC code obtained by conversion is used as an anti-fake code for display.
Therefore, the method for generating the verification code according to the embodiment of the application is based on the generated random code and based on the pre-written sequence code, the combination of the sequence code and the random code is comprehensively considered, the sequence code and the random code are bound and encrypted, so that the encrypted verification code is obtained, and the verification code generated by the verification code generating end is different each time due to the fact that the random code is bound in the verification code.
Referring to fig. 3, a verification code checking method according to another embodiment of the present application includes the following steps:
step S301, decrypting the verification code sent from the outside of the verification code checking end by using a preset private key to obtain a combined code, and determining a target sequence code from the combined code;
in the embodiment of the application, the verification code checking terminal can receive the verification code sent to the verification code checking terminal from the outside, decrypt the verification code by using a preset private key to obtain a combined code, and determine a target sequence code needing to be checked from the combined code.
Specifically, in the production process of the product, when the sequence code is written into the product and the private key is set in the product, the sequence code and the private key can be uploaded to the verification code checking end for storage.
Further, when the user sends the verification code to the verification code checking terminal, based on the received verification code, the verification code can be decrypted by utilizing a pre-stored private key.
And during decryption, based on the AES encryption mode adopted in the steps, adopting a corresponding AES decryption mode at the verification code checking end to decrypt the verification code.
Further, after decryption, a combined code may be obtained.
In some other embodiments, when the verification code received by the verification code checking terminal is in the form of a DAC code, the DAC code needs to be subjected to analog-digital conversion, and a combination code to be decrypted is obtained after the conversion, and based on this, the combination code to be decrypted is decrypted in an AES decryption manner, and the combination code is obtained.
Based on the splicing mode in the previous step, the verification code checking terminal can distinguish two fields of the spliced combined code from the combined code and distinguish a target sequence code needing to be checked from the two fields.
It can be seen that the target sequence code corresponding to the verification code corresponds to a product with the verification code.
In a specific example, taking the spliced screen product and the data system in the foregoing embodiment as an example, in the production process of the spliced screen product, when a unique sequence code is written into the spliced screen product, the sequence code is uploaded to the data system at the same time; and when a private key is preset for the spliced screen product, the private key is also preset into the data system.
Further, the data system may receive the anti-counterfeit code sent from the user equipment, and decrypt the anti-counterfeit code using a preset private key.
When the anti-counterfeiting code is a DAC code, analog-digital signal conversion can be performed on the DAC code, a to-be-decrypted combined code is obtained, and based on the to-be-decrypted combined code is decrypted by using the preset private key.
Further, after decryption, a combined code corresponding to the anti-counterfeiting code can be obtained, and a target sequence code corresponding to the anti-counterfeiting code is determined from the combined code.
In this embodiment, the target sequence code corresponds to a spliced screen product with the anti-counterfeiting code.
Step S302, checking whether the product sequence codes which are the same as the target sequence codes exist in the prestored product sequence codes.
In the embodiment of the present application, the verification may be performed on the target serial code based on a plurality of product serial codes stored in advance at the verification code verification terminal.
Specifically, based on the product sequence code of all the products pre-stored in the verification code checking terminal, the target sequence code obtained in the previous step can be compared with each product sequence code, so as to check whether the product sequence code identical to the target sequence code exists in all the product sequence codes.
In a specific example, taking the spliced screen products and the data system in the previous steps as examples, the product sequence codes of each spliced screen product are pre-stored in the data system, and based on the product sequence codes, whether the product sequence codes which are the same as the target sequence codes exist can be compared in all the product sequence codes.
Step S303, in response to the existence of the product sequence code identical to the target sequence code, determining that the verification code is valid.
In the embodiment of the present application, based on the comparison result of the foregoing steps, it may be determined whether the verification code is valid.
Specifically, when the comparison result shows that the product sequence code which is the same as the target sequence code exists in the product sequence code prestored in the verification code checking end, the target sequence code is considered to be a real and effective sequence code, and the verification code corresponding to the target sequence code is determined to be an effective verification code, namely, the product generating the verification code is a genuine product.
Further, when the comparison result shows that the product sequence code which is the same as the target sequence code does not exist in the product sequence code prestored in the verification code checking end, the target sequence code is considered to be an invalid sequence code, and the verification code corresponding to the target sequence code is determined to be an invalid verification code, namely, the product generating the verification code is a fake product.
In a specific example, taking the spliced screen product and the data system in the previous step as an example, when the comparison result shows that the product sequence code which is the same as the target sequence code exists in the product sequence codes prestored in the data system, the target sequence code is considered to be a real and effective sequence code, and the anti-counterfeiting code corresponding to the target sequence code is determined to be an effective anti-counterfeiting code, that is, the spliced screen product for generating the anti-counterfeiting code is a genuine product.
Further, when the comparison result shows that the product sequence code which is the same as the target sequence code does not exist in the product sequence codes prestored in the data system, the target sequence code is considered to be an invalid sequence code, and the verification code corresponding to the target sequence code is determined to be an invalid anti-fake code, namely, a spliced screen product for generating the anti-fake code is a fake product.
Therefore, according to the verification code checking method, based on the received verification code, the verification code is decrypted, the combined code can be obtained, and the target sequence code forming the combined code is determined from the combined code, so that whether the target sequence code is truly effective or not is checked.
It should be noted that, the method of the embodiments of the present application may be performed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene, and is completed by mutually matching a plurality of devices. In the case of such a distributed scenario, one of the devices may perform only one or more steps of the methods of embodiments of the present application, which interact with each other to complete the methods.
It should be noted that some embodiments of the present application are described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Based on the same inventive concept, the embodiment of the application also provides a verification code generation device corresponding to the method of any embodiment.
Referring to fig. 4, the generation device of the verification code includes: a random code generation module 401, a combined code generation module 402, and a verification code generation module 403;
wherein the random code generation module 401 is configured to randomly generate at least one random code by using a hash algorithm;
the combined code generating module 402 is configured to combine all random codes with a preset sequence code to obtain a combined code;
the verification code generating module 403 is configured to encrypt the combined code with a preset private key, obtain a verification code, and display the verification code.
As an alternative embodiment, the random code generating module 401 is specifically configured to:
generating at least one multi-bit random number using a preset random number generator;
and mapping the random number by using a preset hash function to obtain a random code corresponding to the random number.
As an alternative embodiment, the combined code generating module 402 is specifically configured to:
and respectively taking the all random codes and the sequence codes as two fields of the combined code, and splicing to obtain the combined code.
As an alternative embodiment, the verification code generating module 403 is specifically configured to:
before obtaining the verification code, carrying out digital-to-analog conversion on the encrypted combined code to obtain a digital-to-analog conversion code;
and determining the digital-to-analog conversion code as the verification code.
Based on the same inventive concept, the embodiment of the application also provides a verification code checking device corresponding to the method of any embodiment.
Referring to fig. 5, the verification code checking device includes: a tag sequence code parsing module 501, a checking module 502 and a judging module 503;
the target sequence code analysis module 501 is configured to decrypt the verification code sent from the external verification code checking end by using a preset private key to obtain a combined code, and determine a target sequence code from the combined code;
the checking module 502 is configured to check whether a product sequence code identical to the target sequence code exists in a plurality of pre-stored product sequence codes;
the decision module 503 is configured to determine that the verification code is valid in response to the presence of the same product sequence code as the target sequence code.
As an alternative embodiment, the target sequence code parsing module 501 is specifically configured to:
responsive to determining that the validation code is in the form of a digital analog conversion code;
performing analog-digital conversion on the verification code to obtain a combined code to be decrypted;
and decrypting the combined code to be decrypted.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, the functions of each module may be implemented in the same piece or pieces of software and/or hardware when implementing the embodiments of the present application.
The device of the foregoing embodiment is configured to implement the corresponding method for generating the verification code or the method for checking the verification code in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein again.
Based on the same inventive concept, corresponding to the method of any embodiment, the embodiment of the application further provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor implements the method for generating the verification code or the method for checking the verification code according to any embodiment when executing the program.
Fig. 6 shows a more specific hardware architecture of an electronic device according to this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 implement communication connections therebetween within the device via a bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit ), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present application.
The Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 1020 may store an operating system and other application programs, and when the solutions provided by the embodiments of the present application are implemented in software or firmware, the relevant program code is stored in memory 1020 and invoked for execution by processor 1010.
The input/output interface 1030 is used to connect with an input/output module for inputting and outputting information. The input/output module may be configured as a component in a device (not shown in the figure) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1040 is used to connect communication modules (not shown) to enable communication interactions of the present device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 1050 includes a path for transferring information between components of the device (e.g., processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
It should be noted that although the above-described device only shows processor 1010, memory 1020, input/output interface 1030, communication interface 1040, and bus 1050, in an implementation, the device may include other components necessary to achieve proper operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present application, and not all the components shown in the drawings.
The device of the foregoing embodiment is configured to implement the corresponding method for generating the verification code or the method for checking the verification code in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein again.
Based on the same inventive concept, corresponding to the method of any embodiment described above, the present application further provides a vehicle, where the vehicle includes the generation device of the verification code or the electronic device, where the electronic device performs the generation method of the verification code as described above.
Based on the same inventive concept, corresponding to the method of any embodiment described above, the present application further provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the method of generating a verification code or the method of checking a verification code described in any embodiment described above.
The computer readable media of the present embodiments, including both permanent and non-permanent, removable and non-removable media, may be used to implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device.
The computer instructions stored in the storage medium of the foregoing embodiments are used to make the computer execute the method for generating the verification code or the method for checking the verification code according to any one of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which are not described herein.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of the application (including the claims) is limited to these examples; the technical features of the above embodiments or in the different embodiments may also be combined under the idea of the present application, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in details for the sake of brevity.
Additionally, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures, in order to simplify the illustration and discussion, and so as not to obscure the embodiments of the present application. Furthermore, the devices may be shown in block diagram form in order to avoid obscuring the embodiments of the present application, and this also takes into account the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform on which the embodiments of the present application are to be implemented (i.e., such specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the application, it should be apparent to one skilled in the art that embodiments of the application can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative in nature and not as restrictive.
While the present application has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of those embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
The embodiments of the present application are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Any omissions, modifications, equivalents, improvements, and the like, which are within the spirit and principles of the embodiments of the present application, are therefore intended to be included within the scope of the present application.

Claims (11)

1. The verification code generation method is characterized by being applied to a verification code generation end;
the method comprises the following steps:
randomly generating at least one random code by utilizing a hash algorithm;
combining all random codes with a preset sequence code to obtain a combined code;
and encrypting the combined code by using a preset private key to obtain a verification code, and displaying the verification code.
2. The method of claim 1, wherein the randomly generating at least one random code using a hashing algorithm comprises:
generating at least one multi-bit random number using a preset random number generator;
and mapping the random number by using a preset hash function to obtain a random code corresponding to the random number.
3. The method of claim 1, wherein combining all random codes with a preset sequence code to obtain a combined code comprises:
and respectively taking the all random codes and the sequence codes as two fields of the combined code, and splicing to obtain the combined code.
4. The method of claim 1, further comprising, prior to the obtaining the verification code:
performing digital-to-analog conversion on the encrypted combined code to obtain a digital-to-analog conversion code;
and determining the digital-to-analog conversion code as the verification code.
5. The verification method of the verification code is characterized by being applied to a verification code verification end;
the method comprises the following steps:
decrypting the verification code sent from the outside of the verification code checking end by using a preset private key to obtain a combined code, and determining a target sequence code from the combined code;
checking whether the product sequence code which is the same as the target sequence code exists in a plurality of prestored product sequence codes;
the verification code is determined to be valid in response to the presence of the same product sequence code as the target sequence code.
6. The method of claim 5, wherein decrypting the verification code sent externally from the verification code verification terminal using the preset private key comprises:
responsive to determining that the validation code is in the form of a digital analog conversion code;
performing analog-digital conversion on the verification code to obtain a combined code to be decrypted;
and decrypting the combined code to be decrypted.
7. A verification code generation apparatus, comprising: the device comprises a random code generation module, a combined code generation module and a verification code generation module;
wherein the random code generation module is configured to randomly generate at least one random code by using a hash algorithm;
the combined code generating module is configured to combine all random codes with a preset sequence code to obtain a combined code;
the verification code generation module is configured to encrypt the combined code by using a preset private key to obtain a verification code and display the verification code.
8. An inspection device for verification codes, comprising: the device comprises a standard sequence code analysis module, a checking module and a judging module;
the target sequence code analysis module is configured to decrypt the verification code sent from the outside of the verification code checking end by using a preset private key to obtain a combined code, and determine a target sequence code from the combined code;
the checking module is configured to check whether the product sequence code which is the same as the target sequence code exists in the prestored product sequence codes or not;
the decision module is configured to determine that the verification code is valid in response to the presence of a product sequence code that is the same as the target sequence code.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable by the processor, wherein the processor implements the method of any one of claims 1 to 4 or 5 to 6 when the computer program is executed.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 4 or 5 to 6.
11. A display device comprising the authentication code generating apparatus according to claim 7 or the electronic device according to claim 9.
CN202310065729.6A 2023-01-13 2023-01-13 Verification code generation method, verification code checking method and related equipment Pending CN116055062A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310065729.6A CN116055062A (en) 2023-01-13 2023-01-13 Verification code generation method, verification code checking method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310065729.6A CN116055062A (en) 2023-01-13 2023-01-13 Verification code generation method, verification code checking method and related equipment

Publications (1)

Publication Number Publication Date
CN116055062A true CN116055062A (en) 2023-05-02

Family

ID=86127117

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310065729.6A Pending CN116055062A (en) 2023-01-13 2023-01-13 Verification code generation method, verification code checking method and related equipment

Country Status (1)

Country Link
CN (1) CN116055062A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6442276B1 (en) * 1997-07-21 2002-08-27 Assure Systems, Inc. Verification of authenticity of goods by use of random numbers
WO2015161690A1 (en) * 2014-04-25 2015-10-29 天地融科技股份有限公司 Secure data interaction method and system
EP3193250A1 (en) * 2016-01-13 2017-07-19 Bayer Technology Services GmbH Random number based computer implemented solution for reliable identification of goods
CN113392418A (en) * 2021-06-30 2021-09-14 北京紫光展锐通信技术有限公司 Data deployment method and device, computer readable storage medium, deployment device and user side
WO2022055160A1 (en) * 2020-09-08 2022-03-17 주식회사 네모인사이트 System and method for certifying genuine product through dualization of identification code and security serial number
WO2022266845A1 (en) * 2021-06-22 2022-12-29 华为技术有限公司 Secure communication method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6442276B1 (en) * 1997-07-21 2002-08-27 Assure Systems, Inc. Verification of authenticity of goods by use of random numbers
WO2015161690A1 (en) * 2014-04-25 2015-10-29 天地融科技股份有限公司 Secure data interaction method and system
EP3193250A1 (en) * 2016-01-13 2017-07-19 Bayer Technology Services GmbH Random number based computer implemented solution for reliable identification of goods
WO2022055160A1 (en) * 2020-09-08 2022-03-17 주식회사 네모인사이트 System and method for certifying genuine product through dualization of identification code and security serial number
WO2022266845A1 (en) * 2021-06-22 2022-12-29 华为技术有限公司 Secure communication method and device
CN113392418A (en) * 2021-06-30 2021-09-14 北京紫光展锐通信技术有限公司 Data deployment method and device, computer readable storage medium, deployment device and user side

Similar Documents

Publication Publication Date Title
CN112291190A (en) Identity authentication method, terminal and server
CN107579962A (en) A kind of method and device of source code encryption and decryption
CN111538961B (en) Method, device, equipment and storage medium for activating software
CN111339536B (en) Data verification method and device based on secure execution environment
CN112256275B (en) Code confusion method, device, electronic equipment and medium
CN110232021A (en) The method and device of page test
CN111934873A (en) Bidding file encryption and decryption method and device
CN116055062A (en) Verification code generation method, verification code checking method and related equipment
CN108985109B (en) Data storage method and device
CN110968885A (en) Model training data storage method and device, electronic equipment and storage medium
CN114896621B (en) Application service acquisition method, encryption method, device and computer equipment
CN101324914B (en) Method and device for preventing piracy
CN113868691B (en) Authorized operation method and device of block chain based on cloud-native technology
CN111130791A (en) Data signature method, electronic device and computer readable storage medium
CN116205654A (en) Method, device, electronic equipment and storage medium for verifying transaction data
CN113515747B (en) Equipment upgrading method, device, equipment and storage medium
CN115525930A (en) Information transfer method, device and related equipment
CN110378140B (en) Method, device and system for verifying attribution of deep neural network model
CN114119003A (en) Method and device for realizing off-line payment service
CN111681014A (en) Product non-polar number identity authentication device, system and encryption transmission method
CN114697025B (en) Data encryption and decryption method and related equipment
CN117439766B (en) Medical data encryption transmission method and device, electronic equipment and storage medium
CN110046493A (en) A kind of data processing method, device, equipment and machine readable media
CN118133355B (en) Federal learning method based on identity-based homomorphic signature and related equipment
CN113613190A (en) Terminal security access unit, system and method

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