CN113128245A - Method for generating and managing enterprise chain code - Google Patents

Method for generating and managing enterprise chain code Download PDF

Info

Publication number
CN113128245A
CN113128245A CN202110313692.5A CN202110313692A CN113128245A CN 113128245 A CN113128245 A CN 113128245A CN 202110313692 A CN202110313692 A CN 202110313692A CN 113128245 A CN113128245 A CN 113128245A
Authority
CN
China
Prior art keywords
code
enterprise
chain code
enterprise chain
scanning
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
CN202110313692.5A
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.)
Guangzhou Zhitou Chain Code Technology Co ltd
Original Assignee
Guangzhou Zhitou Chain Code Technology 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 Guangzhou Zhitou Chain Code Technology Co ltd filed Critical Guangzhou Zhitou Chain Code Technology Co ltd
Priority to CN202110313692.5A priority Critical patent/CN113128245A/en
Publication of CN113128245A publication Critical patent/CN113128245A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • 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/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates
    • 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/3247Cryptographic 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 involving digital signatures

Abstract

The invention provides a method for generating and managing an enterprise chain code, wherein the enterprise chain code is a scanning code of an enterprise identity established by a block chain and a two-dimensional code, and comprises the following steps: when a code scanning user requests to scan the enterprise chain code, the front end requests the back end for the generation parameter of the enterprise chain code, the back end inquires the corresponding public key information and updates the time, then digital signature is carried out, and meanwhile, a key value is returned to the front end of the enterprise chain code to be used as the generation parameter of the enterprise chain code, and the front end generates the enterprise chain code; after the code scanning user scans the enterprise chain code, the front end of the enterprise chain code requests a code scanning result, the rear end of the enterprise chain code returns a corresponding public key, the time and the digital signature are updated, the front end of the enterprise chain code splices a new link again and requests the rear end of the enterprise chain code, the rear end of the enterprise chain code verifies whether the digital signature is tampered, and if the digital signature passes the verification, the code scanning result of the enterprise chain code is returned. The enterprise chain code generated by the invention has timeliness, can reduce the risk of transmission and can prevent falsification.

Description

Method for generating and managing enterprise chain code
Technical Field
The invention relates to the field of block chains, in particular to a method for generating and managing an enterprise chain code.
Background
With the large-scale application of intelligent terminals (such as smart phones and code scanning guns), the two-dimensional codes used for bearing certain information are more and more in use scenes of identifying information and sharing information by scanning the two-dimensional codes, and great convenience is provided for users.
But also brings some problems in the use of the two-dimensional code: 1. the two-dimensional code is generated by forming a section of character string into a picture through a coding technology, and when the data volume of the character string for generating the two-dimensional code is too large, the pictures formed by coding are very dense and are difficult to identify quickly during code scanning; 2. two-dimensional code encoding technique is various, does not have formal legal regulation and industrial standard to unify and standardize, and data information has been revealed to a certain extent in many two-dimensional code generations, and anyone can resolve and take the data therein, has the potential safety hazard.
For enterprise users, because enterprises may need to display more contents, the required data volume is larger, and some information of enterprises needs to be kept secret more places and has higher requirements, the problems become more prominent when enterprise users use two-dimensional codes to perform enterprise popularization, access, login and the like.
Disclosure of Invention
The invention mainly aims to overcome the defects of the prior art and provide a method for generating and managing enterprise chain codes. The enterprise chain code is a registered scanning code of the enterprise identity established by the block chain and the two-dimensional code.
The purpose of the invention is realized by the following technical scheme:
a method for generating and managing an enterprise chain code comprises the following steps:
s1, after the code scanning user requests to scan the enterprise chain code, the enterprise chain code user presents the enterprise chain code to the code scanning user, the front end of the enterprise chain code requests the generation parameter of the enterprise chain code to the rear end, the rear end queries the corresponding public key information of the block chain according to the account address of the enterprise chain code user, updates time through a private key pair, and then digitally signs through the public key, the rear end of the enterprise chain code takes the module identification + UUID as a key value, and takes the public key, the update time and the digital signature as a value to be stored in a redis database, and simultaneously returns the key value to the front end of the enterprise chain code to be used as the generation parameter of the enterprise chain code, and the front end of the enterprise chain code splices and links according to the parameter returned by the rear end of the enterprise chain code to generate the enterprise chain code;
s2, after the code scanning user scans the enterprise chain code, the front end of the enterprise chain code requests a code scanning result to the rear end of the enterprise chain code, the rear end of the enterprise chain code inquires in a redis database according to parameters, a corresponding public key is returned, time and a digital signature are updated and returned to the front end of the enterprise chain code, the front end of the enterprise chain code re-splices a new link according to the returned data and requests the rear end of the enterprise chain code, the rear end of the enterprise chain code verifies whether the digital signature is tampered with a block chain according to the request parameters, if the verification is passed, the code scanning result of the enterprise chain code is returned, the code scanning result comprises an enterprise name card, and the front end of the enterprise chain code displays relevant enterprise information to the code scanning user.
The enterprise link code adopts a double-layer design, and comprises a code scanning layer and a translation layer; the code scanning layer is used for the same generation and analysis process as the common two-dimensional code, and the translation layer is used for carrying out a further encryption and decryption process on the two-dimensional code in the analysis process of the two-dimensional code; and when the code scanning is successful, the Key is used as a translation Key of the translation layer to obtain the final translation result.
The method comprises the steps that the generation and scanning of the common two-dimensional code are finished in one step, namely, a user can obtain a code scanning result after the code scanning is successful, and the enterprise chain code is added with one step on the basis of the original two-dimensional code; and the generation of enterprise chain code and sweep the sign indicating number all have certain difference with ordinary two-dimensional code.
The key value is set to be Token, when the Token is designed, the Token is stored in a redis database, the Token is used as the key, the actually translated address is stored in the redis database as the value, and when the Token is stored in the redis database as the key, the item prefix is added to prevent the key repetition of different items. The mode that the Token comes out from the code scanning layer and the Token serves as the unique identifier generated by the enterprise link code can ensure timeliness and can fail after a specified time, and meanwhile, the unique Token is ensured to be unique in the whole system and cannot be repeated with the tokens of other modules. Token serves as a key parameter for connecting the code scanning layer and the translation layer.
The timeliness of the enterprise chain code is divided into three stages: a code display stage, a code scanning stage and an execution stage; in the validity period of the code display stage, a client scans codes for obtaining results for unlimited times, and the client automatically updates tokens after the validity period so as to generate a new enterprise chain code; in the validity period of the code scanning stage, a client can scan the code only once to obtain a result, the token is invalidated, the result of scanning the code again is that the code scanning fails, and the token is overdue; in the execution phase, the result is executed after code scanning, namely the business card page displaying the business chain code, and in the execution phase, only the publicable content is displayed. The disclosure includes a business license, business information, and no display of the linked digital assets.
When the enterprise chain code is scanned by a special tool, the parameters of a tool user can be supplemented, and the permission of a code scanner for checking data is conveniently controlled; when a special enterprise chain code scanning tool is used for scanning codes, the user identification of a code scanner and the account address of a user are added, namely two more parameters are added in the code scanning process, and the two more parameters are only used as the record of the code scanner and do not participate in a translation layer.
The generation rule of the enterprise chain code adopts a generation mode of website, route and token. The method can improve the code scanning effect and reduce the content data volume of the enterprise chain code.
After the code scanning user scans the enterprise chain code, the public key, the updating time and the signature data signed by the ED25519 algorithm of the code scanned user can be obtained through the token. The ED25519 algorithm is used as a signature encryption algorithm of a block chain, the signature and verification performance is extremely high, the safety is extremely high, the signature data are small, the ED25519 algorithm is very suitable for being used as a signature verification algorithm of a two-dimensional code, and after a user scans the code, the user can enter a page of an enterprise business card after the rear end confirms that the signature data are correct, and credible information of the enterprise is displayed.
Compared with the prior art, the invention has the following advantages and beneficial effects:
1. the enterprise chain code can support third-party tools such as WeChat and the like to scan codes, and then a website is opened to display the enterprise business card. For example, tools of third parties such as WeChat scan codes, the tools have the function of analyzing the two-dimensional codes, and the tools are equivalent to only providing a link to enable the WeChat to jump after scanning the codes.
2. The enterprise chain code generated by the invention has timeliness and can reduce the risk of propagation. The invention adopts the redis database as the storage database of the enterprise chain code parameters, can ensure that the parameters of the enterprise chain code can be deleted after the specified time, and can not acquire the data.
3. The enterprise chain code can be tamper-proof, and even if the rule of the content of the enterprise chain code is known, the enterprise chain code cannot be generated in an external system. The enterprise chain code adopts a double-layer design and carries out digital signature based on public and private keys on the enterprise chain code data, an external system cannot acquire the translated enterprise chain code data, and the enterprise chain code data cannot be digitally signed without the public and private keys of a user.
4. When the special tool is used for scanning the code, the invention can supplement the parameters of the tool user and conveniently control the authority of the code scanner for checking the data. When a special enterprise chain code scanning tool is used for scanning codes, the user identification of a code scanner and the account address of a user can be newly added, namely two more parameters are added in the code scanning process and only used as the record of the code scanner.
5. The contents of the enterprise chain code of the present invention do not contain any value that can reflect the current amount of data, such as an enterprise table self-increment ID. The invention adopts unique identification code uuid, which is a unique non-repeated character string and does not contain any information reflecting the current data volume.
6. The two-dimensional code/bar code is time-efficient and effective at one time. The timeliness of the enterprise chain code is divided into three stages, namely a code display period, a code scanning period and an execution period, and the redis cache database is adopted in the process, so that the parameters of the enterprise chain code are guaranteed to be out of date after a certain time, the code scanning times are recorded in the using process of the enterprise chain code, the code is scanned for the first time after the effective time of the code display period is exceeded, and the code is scanned for only one time after the effective time of the code display period is exceeded.
7. The data volume of the content of the two-dimensional code cannot be too large, otherwise the code scanning effect is influenced. The method adopts a double-layer design, a code scanning layer takes a module identifier + UUID as a key value, a public key, updating time and a digital signature as a value to be stored in a redis database, wherein UUID is taken as token to generate the enterprise chain code, the token is taken as a parameter to translate the enterprise chain code in a translation layer, and finally a correct link is returned, and in the generation stage of the enterprise chain code, the token used by people is a short character string, so that the content data of the enterprise chain code is not excessively huge.
Drawings
Fig. 1 is a partial flowchart of a method for generating and managing an enterprise chain code according to the present invention, in which a process of scanning an enterprise chain code is requested by a code scanning user.
Fig. 2 is a partial flowchart of a method for generating and managing an enterprise chain code according to the present invention, in which the enterprise chain code is scanned for a code-scanning user.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but the present invention is not limited thereto.
A method for generating and managing an enterprise chain code comprises the following steps:
s1, as shown in FIG. 1, when a code scanning user requests to scan an enterprise chain code, the enterprise chain code user presents the enterprise chain code to the enterprise chain code, the front end of the enterprise chain code requests a generation parameter of the enterprise chain code to the rear end, the rear end queries public key information corresponding to the enterprise chain code according to an account address of the enterprise chain code user, updates time through a private key pair, and then digitally signs through the public key, the rear end of the enterprise chain code takes a module identifier and a UUID as key values, stores the public key, the update time and the digital signature as value values into a redis database, returns the key values to the front end of the enterprise chain code as a generation parameter of the enterprise chain code, and the front end of the enterprise chain code splices and links according to a parameter returned by the rear end of the enterprise chain code to generate the enterprise chain code;
s2, as shown in FIG. 2, after the code scanning user scans the enterprise chain code, the front end of the enterprise chain code requests the rear end of the enterprise chain code for a code scanning result, the rear end of the enterprise chain code inquires in a redis database according to the parameters, returns a corresponding public key, updates the time and the digital signature and returns the updated time and the digital signature to the front end of the enterprise chain code, the front end of the enterprise chain code re-splices a new link according to the returned data and requests the rear end of the enterprise chain code, the rear end of the enterprise chain code verifies whether the digital signature is tampered with in a block chain according to the requested parameters, and if the verification is passed, returns the code scanning result of the enterprise chain code, wherein the code scanning result comprises an enterprise business card, and the front end of the enterprise chain code displays relevant enterprise information.
The concrete description is as follows:
1. description of the aging
As shown in table 1, the timeliness of the enterprise chain code is divided into three stages, namely a code display stage, a code scanning stage and an execution stage. In the code display stage, the validity period of the enterprise chain code is one minute, in the minute, a client can scan the code for unlimited times to obtain a result, and after one minute, the client updates the token to generate a new enterprise chain code; in the code scanning stage, the validity period of the enterprise chain code is ten minutes, in the ten minutes, the client can scan the code once to obtain the result, the token is invalidated, the code scanning result is code scanning failure again, and the token is overdue; in the execution phase, the result is executed after code scanning, namely an enterprise business card page displaying the enterprise chain code, in the execution phase, only publicable contents such as a business license and business information are displayed, and the uplink digital assets are not displayed.
TABLE 1
Figure BDA0002990277520000061
2. Reference comparison of the ageing properties, as in Table 2
TABLE 2
Figure BDA0002990277520000062
Figure BDA0002990277520000071
3. Description of the design
The method comprises the steps that the generation and scanning of the common two-dimensional code are finished in one step, namely, a user can obtain a code scanning result after the code scanning is successful, and the enterprise chain code is added with one step on the basis of the original two-dimensional code; the generation and code scanning of the enterprise chain code are different from the common two-dimensional code to a certain extent;
when a code scanning user requests to scan a two-dimensional code, an enterprise chain code user presents the enterprise chain code to the two-dimensional code, the front end of the enterprise chain code requests the rear end of the enterprise chain code for generating parameters of the enterprise chain code, the rear end inquires corresponding public key information of a block chain according to an account address of the enterprise chain code user, updates time through a private key pair, digitally signs the public key, stores the rear end with a module identifier and a UUID as a key value and the public key, the update time and the digital signature as value values in a redis database, simultaneously returns the key value to the front end as a generating parameter of the two-dimensional code, and the front end splices and links according to the parameters returned by the rear end to generate the enterprise chain code;
after scanning the enterprise chain code, a code scanning user requests a code scanning result from the front end to the rear end of the enterprise chain code, the rear end inquires in a parameter redis database, returns a corresponding public key, updates time and a digital signature and returns the time and the digital signature to the front end, the front end splices a new link again according to returned data and requests the rear end, the rear end verifies whether the digital signature is falsified or not from the block chain according to the request parameter, if the verification is passed, the code scanning result of the enterprise chain code is returned, the code scanning result comprises information such as enterprise business cards and the like, and the front end of the enterprise chain code displays relevant enterprise information to the code scanning user;
the specific code scanning flow chart is shown in fig. 1.
4. Token design
Token is the unique identifier for generating two-dimensional code, and we need him to satisfy the following requirements: the timeliness is ensured, the failure is ensured after the specified time, the uniqueness is ensured in the whole system, the duplication with the token of other modules is ensured, therefore, when the token is designed, the token is stored in a redis database, the token serves as a key, the actually translated address serves as a value and is stored in the redis database, and when the token serves as a key and exists in the redis, an item prefix is required to be added to prevent the duplication of keys of different items.
5. Post-translation address design
(1) The parameters are as shown in Table 3.
TABLE 3
Figure BDA0002990277520000081
The parameters include update _ time, sign _ data, request _ user, request _ address and public _ key, all of which belong to translated parameters of the enterprise chain code, namely, the data stored as value in step S1, and the key value in step S1 is a parameter associating the code scanning layer and the translation layer, wherein the two parameters, i.e., request _ user and request _ address, are returned only when the code is scanned by using a special code scanning tool.
(2) Private key, public key, address
Generating a private key:
the generation of the private key can be realized by using a plurality of algorithms such as a random algorithm, SHA256 and the like. Generating the private key comprises the steps of:
1. a random number (a mathematical private key) of 256 bits is generated by using a random algorithm, and a byte array, namely a raw private key, is obtained as follows:
[17,236,24,183,207,250,207,180,108,87,224,39,189,99,246,85,138,120,236,78,228,233,41,192,124,109,156,104,235,66,194,24]
2. adding a Prefix (Prefix) of 3 bytes in front of the raw private key, then adding a Version number (Version) of 1 byte, and adding a padding bit (Fill) of 1 byte in the back to obtain a new byte array, as shown below:
[218,55,159,1,17,236,24,183,207,250,207,180,108,87,224,39,189,99,246,85,138,120,236,78,228,233,41,192,124,109,156,104,235,66,194,24,0]
3. performing SHA256 calculation twice on the byte array obtained in the step 2, and taking the first 4 bytes of the operation result to obtain a byte array of a check code (Checksum), as follows:
[30,19,80,117]
4. and connecting the byte array in the step 2 and the check code byte array in the step 3 together according to the sequence to obtain a new byte array, wherein the sequence is as follows:
[218,55,159,1,17,236,24,183,207,250,207,180,108,87,224,39,189,99,246,85,138,120,236,78,228,233,41,192,124,109,156,104,235,66,194,24,0,30,19,80,117]
5. base58 encoding the byte array generated in step 4 to obtain the character string starting with priv, namely the private key (private key), as follows:
the generation of the private key is completed by privbsGZFUORv8aXZbSGd3bwzZWFn3L5QKq74 RXAQYcmfXhZ 54CLr9 z.
And (3) generating a public key:
the generation of the public key is realized after the generation of the private key, and an ED25519 algorithm is used. Generating the public key comprises the steps of:
1. processing the raw private key by the ED25519 algorithm generates a 32-bit byte array, namely, a raw public key.
For example, the private key is:
privbsGZFUoRv8aXZbSGd3bwzZWFn3L5QKq74RXAQYcmfXhhZ54CLr9z,
its raw public key is as follows:
[21,118,76,208,23,224,218,117,50,113,250,38,205,82,148,81,162,27,130,83,208,1,240,212,54,18,225,158,198,50,87,10];
2. adding a Prefix (Prefix) of 1 byte to the front of the raw public key, and then adding a Version number (Version) of 1 byte to the front of the raw public key, a new byte array is obtained, as follows:
[176,1,21,118,76,208,23,224,218,117,50,113,250,38,205,82,148,81,162,27,130,83,208,1,240,212,54,18,225,158,198,50,87,10];
3. performing SHA256 calculation twice on the byte array in the step 2, and taking the first 4 bytes of the operation result to obtain a byte array of a check code (Checksum), as follows:
[116,171,22,107];
4. and connecting the byte array in the step 2 and the check code byte array in the step 3 together according to the sequence to obtain a new byte array, wherein the sequence is as follows:
[176,1,21,118,76,208,23,224,218,117,50,113,250,38,205,82,148,81,162,27,130,83,208,1,240,212,54,18,225,158,198,50,87,10,116,171,22,107]
5. carrying out 16-system coding on the byte array in the step 4 to obtain a 16-system character string, namely a public key (public key), as follows:
b00115764cd017e0da753271fa26cd529451a21b8253d001f0d43612e19ec632570a74ab166b;
the generation of the public key is completed.
Generating an address:
the address may be further algorithmically generated after the private key and the public key are generated. Generating the address comprises the steps of:
1. processing the raw private key by the ED25519 algorithm generates a 32-bit byte array, namely, a raw public key.
For example, the private key is:
privbsGZFUoRv8aXZbSGd3bwzZWFn3L5QKq74RXAQYcmfXhhZ54CLr9z,
its raw public key is as follows:
[21,118,76,208,23,224,218,117,50,113,250,38,205,82,148,81,162,27,130,83,208,1,240,212,54,18,225,158,198,50,87,10];
2. performing an SHA256 operation on the raw public key once, and taking the last 20 bytes of the operation result to obtain a byte array, as follows:
[173,148,59,51,183,193,55,160,1,133,247,80,65,13,67,190,164,114,18,220];
3. adding a Prefix (Prefix) of 2 bytes to the front of the byte array generated in the step 2, and then adding a Version number (Version) of 1 byte to obtain a new byte array, as shown below:
[5,53,1,173,148,59,51,183,193,55,160,1,133,247,80,65,13,67,190,164,114,18,220];
4. performing SHA256 calculation twice on the byte array in the step 3, and taking the first 4 bytes of the operation result to obtain a byte array of a check code (Checksum), as follows:
[167,127,34,35];
5. connecting the byte array in the step 3 and the check code byte array in the step 4 together according to the sequence to obtain a new byte array, as follows:
[1,86,1,173,148,59,51,183,193,55,160,1,133,247,80,65,13,67,190,164,114,18,220,167,127,34,35];
6. the byte array generated in step 5 is subjected to Base58 encoding to obtain a character string beginning with hp, namely an address (address), as follows:
hpQmWJrdYJP5CPKTbkQUqscwvTGaU44dord8;
this completes the generation of the address.
(3) Digital signature
The integrity of digitally signed documents is easily verified (no seal, no signature, and no handwriting expertise is required), and digital signatures are non-repudiatable (non-repudiatable).
In short, a digital signature is some data appended to a data unit or a cryptographic transformation performed on a data unit. Such data or transformations allow the recipient of the data unit to verify the source of the data unit and the integrity of the data unit and to protect the data against counterfeiting by a person (e.g., the recipient). Which is a method of signing a message in electronic form, a signed message being capable of being transmitted in a communication network. The digital signature can be obtained based on both a public key cryptosystem and a private key cryptosystem, and is mainly based on the public key cryptosystem. Including ordinary digital signatures and special digital signatures. Common digital signature algorithms include RSA, ElGamal, Fiat-Shamir, Guillou-Quisquarter, Schnorr, Ong-Schnorr-Shamir digital signature algorithm, Des/DSA, elliptic curve digital signature algorithm, finite automaton digital signature algorithm and the like. The special digital signature includes blind signature, proxy signature, group signature, undeniable signature, fair blind signature, threshold signature, signature with message recovery function, etc., and is closely related to a specific application environment. Obviously, the application of digital signatures is related to legal issues, and the federal government of the united states has established its own Digital Signature Standard (DSS) based on discrete logarithm problems over a finite field.
(4) Verification label
The sender firstly encrypts the original text by using a private key of the sender to obtain a digital signature, and then sends the original text and the digital signature to the receiver. The receiver decrypts the digital signature by using the public key of the sender, and finally compares the digital signature with the original text, and the digital signature technology can verify whether the original text of the file changes in the transmission process, so that the integrity, authenticity and non-repudiation of the transmitted electronic file are ensured.
6. Enterprise chain code display
(1) Display mode
The displayed content of the chain code comprises an enterprise name, an enterprise two-dimensional code and updating time, a user can quickly share the credible information of the enterprise by showing the two-dimensional code, and a code scanner can check the credible information of the enterprise after the code scanning is successful; the two-dimensional code generation adopts a generation mode of a website plus a token, and the token is formed by item prefix plus a UUID code and is used for ensuring that each token is unique. After a code scanner scans codes, a public key of the code scanner can be acquired through a token, time and signature data signed by an ED25519 algorithm are updated, the ED25519 algorithm is used as a signature encryption algorithm of a block chain, the signature and verification performance is extremely high, the safety is extremely high, the signature data is small, the two-dimensional code signature verification algorithm is very suitable for being used as a two-dimensional code signature verification algorithm, after a user scans the codes, the rear end confirms that the signature data is correct, the page of an enterprise business card can be entered, and credible information of the enterprise is displayed.
(2) Update frequency
The two-dimensional code display at the position has the update frequency of one time per minute
(3) The aging specification is as above.
(4) Third party tool (WeChat) code scanning
When the user scans the code using a third party tool. In order to reduce the propagation risk, the user security cannot be guaranteed due to the WeChat, when the code is scanned through the WeChat, the enterprise chain code only displays the business card information of the enterprise, and the chain code user can manage the external display information of the business card of the enterprise in chain code management.
(5) Code scanning professional tool (enterprise chain code)
When a user uses a professional tool, namely an enterprise chain code to scan a code, the user information of a current code scanning person can be acquired, so that the security is high, and the code scanning user can acquire the information of the current enterprise after successfully scanning the code, wherein the information comprises enterprise business cards, enterprise basic information, enterprise figures, operation conditions, business data, chain code information and credit information.
The BCS is a block chain service system, realizes the intermediate service of the butt joint of the upper layer application and the block chain, reduces the complex service reading of the access block chain, reduces the development difficulty and cost of the block chain access, and enriches the block chain information query.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (7)

1. A method for generating and managing enterprise chain codes is characterized by comprising the following steps in sequence:
s1, after the code scanning user requests to scan the enterprise chain code, the enterprise chain code user presents the enterprise chain code to the code scanning user, the front end of the enterprise chain code requests the generation parameter of the enterprise chain code to the rear end, the rear end queries the corresponding public key information of the block chain according to the account address of the enterprise chain code user, updates time through a private key pair, and then digitally signs through the public key, the rear end of the enterprise chain code takes the module identification + UUID as a key value, and takes the public key, the update time and the digital signature as a value to be stored in a redis database, and simultaneously returns the key value to the front end of the enterprise chain code to be used as the generation parameter of the enterprise chain code, and the front end of the enterprise chain code splices and links according to the parameter returned by the rear end of the enterprise chain code to generate the enterprise chain code;
s2, after the code scanning user scans the enterprise chain code, the front end of the enterprise chain code requests a code scanning result to the rear end of the enterprise chain code, the rear end of the enterprise chain code inquires in a redis database according to parameters, a corresponding public key is returned, time and a digital signature are updated and returned to the front end of the enterprise chain code, the front end of the enterprise chain code re-splices a new link according to returned data and requests the rear end of the enterprise chain code, the rear end of the enterprise chain code verifies whether the digital signature is tampered with a block chain according to the request parameters, and if the verification is passed, the front end of the enterprise chain code returns the code scanning result of the enterprise chain code and displays relevant enterprise information to the code scanning user.
2. The method for generating and managing enterprise chain code according to claim 1, wherein the enterprise chain code adopts a two-layer design, including a code scanning layer and a translation layer; the code scanning layer is used for the same generation and analysis process as the common two-dimensional code, and the translation layer is used for carrying out a further encryption and decryption process on the two-dimensional code in the analysis process of the two-dimensional code; and when the code scanning is successful, the Key is used as a translation Key of the translation layer to obtain the final translation result.
3. The method for generating and managing enterprise chain code according to claim 1, wherein the key value is set to Token, when Token is designed, Token is stored in a redis database, Token is used as key, the actually translated address is stored in the redis database as value, and when Token is stored in redis as key, item prefix is added to prevent the duplication of keys of different items.
4. The method for generating and managing enterprise chain code according to claim 1, wherein the timeliness of the enterprise chain code is divided into three stages: a code display stage, a code scanning stage and an execution stage; in the validity period of the code display stage, a client scans codes for obtaining results for unlimited times, and the client automatically updates tokens after the validity period so as to generate a new enterprise chain code; in the validity period of the code scanning stage, a client can scan the code only once to obtain a result, the token is invalidated, the result of scanning the code again is that the code scanning fails, and the token is overdue; in the execution phase, the result is executed after code scanning, namely the business card page displaying the business chain code, and in the execution phase, only the publicable content is displayed.
5. The method for generating and managing enterprise chain codes according to claim 1, wherein when the enterprise chain codes are scanned by a special tool, parameters of a tool user can be supplemented, and the permission of a code scanner for viewing data can be conveniently controlled; when a special enterprise chain code scanning tool is used for scanning codes, the user identification of a code scanner and the account address of a user are added, namely two more parameters are added in the code scanning process, and the two more parameters are only used as the record of the code scanner and do not participate in a translation layer.
6. The method for generating and managing the enterprise link code according to claim 1, wherein the rule for generating the enterprise link code is generated by using a website + route + token.
7. The method for generating and managing the enterprise chain code as claimed in claim 1, wherein the code scanning user can obtain the public key of the code scanned, the update time and the signature data signed by the ED25519 algorithm through the token after scanning the enterprise chain code.
CN202110313692.5A 2021-03-24 2021-03-24 Method for generating and managing enterprise chain code Pending CN113128245A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110313692.5A CN113128245A (en) 2021-03-24 2021-03-24 Method for generating and managing enterprise chain code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110313692.5A CN113128245A (en) 2021-03-24 2021-03-24 Method for generating and managing enterprise chain code

Publications (1)

Publication Number Publication Date
CN113128245A true CN113128245A (en) 2021-07-16

Family

ID=76774051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110313692.5A Pending CN113128245A (en) 2021-03-24 2021-03-24 Method for generating and managing enterprise chain code

Country Status (1)

Country Link
CN (1) CN113128245A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067378A (en) * 2012-12-26 2013-04-24 百度在线网络技术(北京)有限公司 Log-in control method and system based on two-dimension code
CN107704493A (en) * 2017-08-23 2018-02-16 中链科技有限公司 It is a kind of to be used to provide the method and system that product is traced to the source
CN110335051A (en) * 2019-07-03 2019-10-15 烟台市同翔网络科技有限责任公司 A kind of unique code publication of food labelling based on block chain major-minor chain technology and circulation source tracing method
CN111275419A (en) * 2020-01-17 2020-06-12 上海佩俪信息科技有限公司 Block chain wallet signature right confirming method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067378A (en) * 2012-12-26 2013-04-24 百度在线网络技术(北京)有限公司 Log-in control method and system based on two-dimension code
CN107704493A (en) * 2017-08-23 2018-02-16 中链科技有限公司 It is a kind of to be used to provide the method and system that product is traced to the source
CN110335051A (en) * 2019-07-03 2019-10-15 烟台市同翔网络科技有限责任公司 A kind of unique code publication of food labelling based on block chain major-minor chain technology and circulation source tracing method
CN111275419A (en) * 2020-01-17 2020-06-12 上海佩俪信息科技有限公司 Block chain wallet signature right confirming method, device and system

Similar Documents

Publication Publication Date Title
US11323272B2 (en) Electronic identification verification methods and systems with storage of certification records to a side chain
US7644280B2 (en) Method and system for linking certificates to signed files
CN1936780B (en) Information processing apparatus, verification processing apparatus, and control methods thereof
US6253323B1 (en) Object-based digital signatures
US8370916B2 (en) Digital receipt for a transaction
CN100593921C (en) Time stamp service system and checking server for time stamp information and computer software
CN1937492A (en) Information processing device and controlling method thereof
US7966492B1 (en) System and method for allowing an e-mail message recipient to authenticate the message
CN112801663B (en) Blockchain certification method, device, system, equipment and medium
CN101022339A (en) Electronic sign stamp identifying method combined with digital centifi cate and stamp
EP1171811A1 (en) System and method for document-driven processing of digitally-signed electronic documents
CN109614802B (en) Anti-quantum-computation signature method and signature system
CN106921496A (en) A kind of digital signature method and system
CN109560935B (en) Anti-quantum-computation signature method and signature system based on public asymmetric key pool
CN113128950B (en) Enterprise chain code service platform
CN108022194A (en) Law-enforcing recorder and its data safety processing method, server and system
CN107453874A (en) Digital sealing and its generation method, service request and offer method and electronic equipment
CN101060400B (en) Data generating device, data analysis device, control method and data processing system
CN105635070A (en) Anti-counterfeit method and system for digital file
CN112199721A (en) Authentication information processing method, device, equipment and storage medium
CN101090320A (en) Indentify authorization method for dectronic signature
CN108768975A (en) Support the data integrity verification method of key updating and third party's secret protection
US6757827B1 (en) Autonomously secured image data
CN110598433A (en) Anti-counterfeiting information processing method and device based on block chain
CN110569672A (en) efficient credible electronic signature system and method based on mobile equipment

Legal Events

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