Digital signature electronic seal generation method based on block chain storage
By storing and managing electronic seals on the blockchain and combining digital signature technology, the problem of difficulty in achieving anti-counterfeiting functions in the existing technology is solved, and the safe, effective and habitual use of electronic seals is achieved.
Patent Information
- Application Number
- CN202411983064.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-31
AI Technical Summary
It is difficult for existing electronic seal technology to realize the anti-counterfeiting function of electronic seals while meeting physical documents and seal habits.
A digital signature electronic seal generation method based on blockchain storage is adopted, and user identification, electronic seal and data seal are stored through the management nodes and multiple blocks of the blockchain, and electronic seals are generated through digital signatures and seal surface images.
It realizes the anti-counterfeiting function of electronic seals, and at the same time meets the habits and experiences of physical documents and seals, ensuring the safety and effectiveness of electronic seals.
Smart Images

Figure CN119903557A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of seal technology, and in particular to a method for generating a digital signature electronic seal based on blockchain storage. Background Art
[0002] Electronic seal technology uses advanced digital technology to simulate traditional physical seals. Its management and usage methods are in line with the habits and experience of physical seals. The electronic documents stamped with it have the same appearance, the same validity and similar usage as paper documents stamped with physical seals.
[0003] For example, when displaying products at an exhibition, by displaying electronic documents stamped with electronic seals, the displayed electronic documents can be made to conform to the habits and experience of physical documents and seals. Summary of the invention
[0004] In order to solve one of the above-mentioned technical defects, the present application provides a method for generating a digital signature electronic seal based on blockchain storage.
[0005] The present application provides a method for generating a digital signature electronic seal based on blockchain storage, wherein the blockchain includes a management node and multiple blocks;
[0006] Among them, blocks correspond to users one by one; any block stores the user ID of the corresponding user through a head node, and stores the electronic seal and data seal of the corresponding user through a linked list connected to the head node; the electronic seal contains the digital signature of the corresponding user, and the digital signature is generated based on the seal surface image of the corresponding user; the data seal is generated based on the electronic seal;
[0007] The linked list of any block corresponds to the seal face image of the corresponding user one by one; the first node of any linked list of any block stores the corresponding seal face image and the identifier of the seal face image, the secondary node stores the electronic seal generated by the corresponding seal face image, and the other nodes correspond to the electronic data one by one; any other node of any linked list of any block stores a data seal and an electronic data identifier, and the data seal is generated according to the electronic seal stored in the secondary node of any linked list of any block and the corresponding electronic data, and the electronic data identifier is the identifier of the electronic data generating the data seal;
[0008] The method includes:
[0009] Acquire a first user identification of a first user, a first seal surface image, and an identification of the first seal surface image; wherein the seal surface image is a digitized image;
[0010] Sending the first user identifier to the management node, so that the management node determines whether the first block exists in the blockchain, and feeds back the first block determination result; wherein the head node of the first block stores the first user identifier;
[0011] If the first block determination result is that the first block does not exist, a first electronic seal is generated according to the first seal face image, and the first seal face image, the identifier of the first seal face image, and the first electronic seal are sent to the management node, so that the management node adds a new block in the blockchain, the block includes a head node and a linked list connected to the head node, the head node stores the first user identifier, the linked list includes two nodes, wherein the first node stores the first seal face image and the identifier of the first seal face image, and the secondary node stores the first electronic seal;
[0012] If the first block determination result is that the first block exists, the identifier of the first seal surface image is sent to the management node, so that the management node determines whether the first linked list exists in the first block in the blockchain, and feeds back the first linked list determination result; wherein the first node of the first linked list stores the identifier of the first seal surface image;
[0013] If the result of the first linked list determination is that the first linked list does not exist, a first electronic seal is generated according to the first seal face image, and the first seal face image, the identifier of the first seal face image, and the first electronic seal are sent to the management node, so that the management node adds a linked list in the first block, the linked list is connected to the head node of the first block, and the linked list includes two nodes, wherein the first node stores the first seal face image and the identifier of the first seal face image, and the second node stores the first electronic seal;
[0014] The step of generating a first electronic seal according to the first seal surface image includes:
[0015] Determine the attribute value of each pixel in the first seal surface image;
[0016] Determine a first summary according to the first user identifier and the attribute value of each pixel;
[0017] Concatenate a hash value of a preset minimum value and a public key of a device executing the method into a first key;
[0018] Encrypting the first summary using a first key to obtain a first digital signature;
[0019] A first electronic seal is generated according to the first digital signature and the first seal surface image.
[0020] The present application provides a method for generating a digital signature electronic seal based on blockchain storage, the blockchain including a management node and multiple blocks; wherein the block stores a user identifier through a head node, and stores an electronic seal and a data seal through a linked list; the method includes: obtaining a user identifier and a seal face image; if there is no block storing the user identifier in the blockchain, or if there is a block storing the user identifier, but the linked list of the block does not store the electronic seal generated by the seal face image, a digital signature is obtained according to the attribute values of each pixel in the user identifier and the seal face image, an electronic seal is generated according to the digital signature and the seal face image, and the management node is made to store the electronic seal in the blockchain. The method of the present application realizes the anti-counterfeiting of electronic seals through blockchain storage and digital signatures while satisfying the habits and experience of physical documents and seals. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 A schematic diagram of the structure of a blockchain provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of the structure of another blockchain provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of the structure of a block provided in an embodiment of the present application;
[0025] Figure 4 A schematic diagram of another block structure provided in an embodiment of the present application;
[0026] Figure 5 A schematic diagram of the structure of a linked list provided in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of data storage of a blockchain provided in an embodiment of the present application;
[0028] Figure 7 A flowchart of a method for generating a digital signature electronic seal based on blockchain storage is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0030] In the process of realizing this application, the inventor found that the electronic seal technology simulates the traditional physical seal with advanced digital technology, and its management and use methods are consistent with the habits and experience of physical seals. The electronic documents stamped with it have the same appearance, the same validity and similar use methods as the paper documents stamped with physical seals. For example, when displaying products at an exhibition, by displaying electronic documents stamped with electronic seals, the displayed electronic documents are consistent with the habits and experience of physical documents and seals.
[0031] In view of the above problems, a method for generating a digital signature electronic seal based on blockchain storage is provided in an embodiment of the present application, wherein the blockchain includes a management node and multiple blocks; wherein the block stores a user identifier through a head node, and stores an electronic seal and a data seal through a linked list; the method includes: obtaining a user identifier and a seal face image; if there is no block storing the user identifier in the blockchain, or if there is a block storing the user identifier, but the linked list of the block does not store an electronic seal generated by the seal face image, a digital signature is obtained according to the attribute values of each pixel in the user identifier and the seal face image, an electronic seal is generated according to the digital signature and the seal face image, and the management node is made to store the electronic seal in the blockchain. The method of the present application realizes the anti-counterfeiting of electronic seals through blockchain storage and digital signatures while satisfying the habits and experience of physical documents and seals.
[0032] This embodiment provides a method for generating a digital signature electronic seal based on blockchain storage, which is implemented based on blockchain. Figure 1 As shown, the blockchain includes a management node and multiple blocks.
[0033] 1. Management Node
[0034] The management node is used to communicate with the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment, and to search for data from the block through various smart contracts stored thereon and feedback the data.
[0035] For example, the management node obtains the user identification based on the communication with the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment, and then determines whether there is a block storing the user identification in the blockchain, and feeds back the block determination result.
[0036] For another example, the management node obtains the electronic seal based on the communication with the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment, and then stores the electronic seal in the blockchain.
[0037] For another example, the management node obtains the data seal based on the communication with the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment, and then stores the data seal in the blockchain.
[0038] 2. Block
[0039] Among them, blocks correspond to users one by one.
[0040] For example, if there are 3 users, the blockchain includes a management node and 3 blocks, such as Figure 2 As shown, block 1 corresponds to user 1, block 2 corresponds to user 2, and block 3 corresponds to user 3.
[0041] Each block includes a head node and at least one linked list. Any block stores the user ID of the corresponding user through a head node, and stores the electronic seal and data seal of the corresponding user through a linked list connected to the head node, such as Figure 3 shown.
[0042] The electronic seal contains the digital signature of the corresponding user, and the digital signature is generated based on the seal surface image of the corresponding user. The data seal is generated based on the electronic seal.
[0043] The linked list of any block corresponds to the seal face image of the corresponding user. For example, user 1 has 2 seals, each seal has a seal impression, so there will be two seal face images, each seal face image corresponds to a seal impression, that is, the seal face image is a digitized seal impression. Then the block 1 corresponding to user 1 will have a head node and 2 linked lists, linked list 1 corresponds to seal face image 1, and linked list 2 corresponds to seal face image 2. Figure 4 shown.
[0044] Each linked list includes at least the first node and the second node. In addition, it can also include other nodes, such as Figure 5 shown.
[0045] The first node of any linked list of any block stores the corresponding seal face image and the identifier of the seal face image, the second node stores the electronic seal generated by the corresponding seal face image, and the other nodes correspond one-to-one to the electronic data.
[0046] Any other node of any linked list of any block stores a data seal and an electronic data identifier, and the data seal is generated based on the electronic seal and corresponding electronic data stored in the secondary node of any linked list of any block, and the electronic data identifier is the identifier of the electronic data that generates the data seal.
[0047] The head node and each block storage content in the blockchain are as follows Figure 6 The head node stores the user ID of the user corresponding to the block, the first node of the linked list stores the corresponding seal face image and the seal face image ID, the secondary node stores the electronic seal generated by the corresponding seal face image, and other nodes store data seals and electronic data IDs.
[0048] Based on the above blockchain structure, the implementation process of the method for generating a digital signature electronic seal based on blockchain storage provided in this embodiment is as follows: Figure 7 shown.
[0049] 701. Obtain a first user identifier, a first seal surface image, and an identifier of the first seal surface image of a first user.
[0050] The seal surface image is a digital image, which is the trace left after the seal is fully and completely pressed through a medium (such as ink pad, colloid pigment, etc.) or directly on paper, fabric, mud and similar carriers (such as sealing wax), which is the opposite of the shape of the seal carving surface when viewed directly, that is, the seal imprint.
[0051] After obtaining the first seal face image, it is queried whether there is a seal face image identical to it among all the seal face images that have been processed (the existing image comparison method can be used to compare to determine whether there is a seal face image identical to it). If not, an identifier is assigned to it as the identifier of the first seal face image, and the first seal face image and the identifier of the first seal face image are stored. If there is, the identifier of the identical seal face image is obtained as the identifier of the first seal face image.
[0052] That is to say, the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment will maintain a corresponding relationship between a seal face image and its identification, and store all the seal face images and their identifications it has obtained.
[0053] Each seal surface image corresponds to a unique seal impression and also corresponds to a unique seal surface image identifier.
[0054] 702. Send the first user identifier to the management node, so that the management node determines whether the first block exists in the blockchain and feeds back the first block determination result.
[0055] The head node of the first block stores the first user identifier.
[0056] Since the head node of each block stores the user ID of the user corresponding to the block, it is possible to determine whether there is relevant information corresponding to the user in the blockchain by whether there is a block with the user ID. If the user has generated an electronic seal through the digital signature electronic seal generation method based on blockchain storage provided by this embodiment, there must be a corresponding block in the blockchain.
[0057] For example, the implementation process of step 702 is as follows:
[0058] 702-1, the device executing the method for generating a digital signature electronic seal based on blockchain storage provided in this embodiment sends a first user identifier to the management node.
[0059] 702-2, after receiving the first user identifier, the management node determines whether the first block exists in the blockchain through a smart contract.
[0060] For example, in a specific implementation, the head node of each block in the blockchain maintains a block-to-user identifier correspondence ledger, which stores the correspondence between all blocks in the blockchain and the user identifiers of their corresponding users. The management node uses intelligent partnership to enable each block to search the block-to-user identifier correspondence ledger it maintains to determine whether there is a block corresponding to the first user identifier. If the blocks corresponding to the first user identifier reported by all blocks are the same, then the first block determination result is that the first block exists, and the first block is the same block. If the blocks corresponding to the first user identifier reported by not all blocks are the same, then the first block determination result is that the first block does not exist.
[0061] 702-3, the management node feeds back the first block determination result to the device executing the digital signature electronic seal generation method based on blockchain storage provided in this embodiment.
[0062] 703. If the first block determination result is that the first block does not exist, a first electronic seal is generated according to the first seal face image, and the first seal face image, the identifier of the first seal face image and the first electronic seal are sent to the management node, so that the management node adds a new block in the blockchain, the block includes a head node and a linked list connected to the head node, the head node stores the first user identifier, the linked list includes two nodes, wherein the first node stores the first seal face image and the identifier of the first seal face image, and the second node stores the first electronic seal.
[0063] If the first block determination result is that the first block does not exist, it means that the first user is the user who generates an electronic seal for the first time through the digital signature electronic seal generation method based on blockchain storage provided by this embodiment. Therefore, a block corresponding to the first user will be added to the blockchain through step 703. The specific implementation process of step 703 is:
[0064] 703-1, a device that executes the method for generating a digital signature electronic seal based on blockchain storage provided in this embodiment generates a first electronic seal based on the first seal surface image.
[0065] The process of generating the first electronic seal according to the first seal surface image is as follows:
[0066] 801, determining the attribute value of each pixel in the first seal surface image.
[0067] The attribute value includes a valid value and an object value.
[0068] The implementation details of step 801 are as follows:
[0069] 801-1, identifying each object in the first seal surface image and determining the type of each object.
[0070] Among them, the type is text, number, and other.
[0071] The objects and types of the objects in the first seal surface image may be identified by using existing image recognition methods.
[0072] The object here is the valid content in the seal impression. For example, if the seal is a seal of the person's name XY, then the valid content in the seal impression is XY. The valid content here is also special color content (such as red content, or blue content, etc.), and the invalid content is white or transparent color. Then X is an object in the seal surface image, and Y is an object in the seal surface image.
[0073] Because the seal surface image is a seal imprint, each object can be identified by color, such as identifying objects composed of pixels of a special color (such as red), and then the type of the object can be identified by existing object recognition methods, such as numbers, text, or other non-digital and non-textual objects.
[0074] 801-2, determining the effective value of each pixel in the first seal surface image.
[0075] If any pixel point is a pixel point of valid content of the first seal surface image, the valid value of any pixel point is 1; if any pixel point is not a pixel point of valid content of the first seal surface image, the valid value of any pixel point is 0.
[0076] The effective value indicates whether the pixel point is a pixel point constituting the object. For example, for any pixel point i, if the color of the pixel point i is a special color (such as red), the pixel point i is determined to be a pixel point of the effective content of the first seal surface image, and the effective value of the pixel point i is 1. If the color of the pixel point i is not a special color (such as white or transparent), the pixel point i is determined not to be a pixel point of the effective content of the first seal surface image, and the effective value of the pixel point i is 0.
[0077] 801-3, determining the object value of each pixel in the first seal surface image.
[0078] Among them, if any pixel point is a pixel point of a text type object in the first seal surface image, the object value of any pixel point is 2; if any pixel point is a pixel point of a digital type object in the first seal surface image, the object value of any pixel point is 1; if any pixel point is a pixel point of other types of objects in the first seal surface image, the object value of any pixel point is 0.
[0079] The object value represents the type of the object constituted by the pixel point. For example, for any pixel point i, if the pixel point i is a pixel point in text, the pixel point i is determined to be a pixel point of a text type object in the first seal surface image, and the object value of the pixel point i is 2. If the pixel point i is a pixel point in a number, the pixel point i is determined to be a pixel point of a number type object in the first seal surface image, and the object value of the pixel point i is 1. If the pixel point i is a pixel point in neither a number nor text, the pixel point i is determined to be a pixel point of other types of objects in the first seal surface image, and the object value of the pixel point i is 0.
[0080] Because non-digital and non-text pixels can be pixels of valid content (such as pixels of flowers) or pixels of non-valid content (such as pixels of background), pixels with an object value of 0 can be pixels of valid content or pixels of non-valid content, and their valid values can be 0 or 1. Pixels with an object value of 1 or 2 are definitely pixels of valid content, and their valid values are definitely 1.
[0081] 802. Determine a first summary according to the first user identifier and the attribute value of each pixel.
[0082] Since the attribute value of each pixel includes a valid value and an object value, the first summary is determined according to the first user identifier and the attribute value (including the valid value and the object value) of each pixel in the first seal surface image in step 802. The process is as follows:
[0083] 802-1, determining a first registration time of a first user according to a first user identifier.
[0084] 802-2, starting from the right side of the first registration time, obtain the first digit of the rightmost position, the second digit of the second rightmost position, and the third digit of the third rightmost position.
[0085] For example, if the registration date is December 31, 2024, the format can be changed to 20241231, and the first digit of the rightmost position (i.e. 1), the second digit of the second right position (i.e. 3), and the third digit of the third right position (i.e. 2) are obtained.
[0086] 802-3, determine the first character that is the first digit to the left of the hash value of the first user identifier, determine the second character that is the second digit to the left of the hash value of the first user identifier, and determine the third character that is the third digit to the left of the hash value of the first user identifier.
[0087] If the hash value of the first user ID is ABCDE, then the first character at the first digit (i.e. 1) position to the left of ABCDE (i.e. A) (i.e. the character at 1 position from A in ABCDE is B), the second character at the second digit (i.e. 3) position to the left of ABCDE (i.e. A) (i.e. the character at 3 positions from A in ABCDE is D), and the third character at the third digit (i.e. 2) position to the left of ABCDE (i.e. A) (i.e. the character at 2 positions from A in ABCDE is C). Therefore, the first character is B, the second character is D, and the third character is C.
[0088] 802-4, determine that the first selected value is the decimal ASCII code value of the first character, determine that the second selected value is the decimal ASCII code value of the second character, and determine that the third selected value is the decimal ASCII code value of the third character.
[0089] For example, the first selected value is determined to be the decimal ASCII code value of the first character (i.e., B) (i.e., 66), the second selected value is determined to be the decimal ASCII code value of the second character (i.e., D) (i.e., 68), and the third selected value is determined to be the decimal ASCII code value of the third character (i.e., C) (i.e., 67).
[0090] 802-5, determine that the signature value of each pixel is the product of the effective value of each pixel and the object value.
[0091] For example, the signature value of any pixel i is the effective value of pixel i × the object value of pixel i.
[0092] Since any pixel has two valid values, 1 or 0, and three object values, 3, 2, or 1, the product of the valid value and the object value has four possibilities, 3, 2, 1, or 0.
[0093] The signature value of the pixel point of the valid content is 3, 2, or 1, and the signature value of the pixel point of the invalid area is 0.
[0094] 802-6. Determine the signature value of each pixel as the first summary.
[0095] If the seal surface image is a 1920×1080 image, it has 1920 columns of pixels and 1080 rows of pixels. The pixel in the upper left corner of the seal surface image can be numbered as 1, and the pixels in the first row can be numbered from left to right to obtain pixels numbered from 2 to 1920. Then, starting from the left side of the second row, numbering to the right, obtain pixels numbered from 1921 to 3840. Then, starting from the left side of the third row, numbering the pixels from left to right and from top to bottom until the pixel in the lower right corner of the seal surface image is reached, and then the pixels of the seal surface image are numbered.
[0096] Arrange the signature value of each pixel from small to large according to the label, and the arranged signature value sequence is the first summary.
[0097] 803, concatenate the preset minimum hash value and the public key of the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment into a first key.
[0098] Among them, the public key can be requested by the first user (or the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment) to the CA (Certificate Authority).
[0099] 804. Encrypt the first summary using a first key to obtain a first digital signature.
[0100] 805. Generate a first electronic seal according to the first digital signature and the first seal surface image.
[0101] The electronic seal includes image content and digital signature content. The implementation process of step 805 is:
[0102] 805-1, determining the signature value of each pixel in the first seal surface image according to the first summary.
[0103] The signature value of any pixel is determined according to the attribute value of any pixel, and the determination process is shown in step 801.
[0104] Because the first summary determined in step 802-6 is a sequence of signature values arranged by arranging the signature values of each pixel from small to large according to the number, the signature value of each pixel can be obtained by the number.
[0105] 805-2, all pixel points with a signature value of 2 in the first target row of the first seal surface image form a first pixel point set, all pixel points with a signature value of 1 in the second target row of the first seal surface image form a second pixel point set, and all pixel points with a signature value of 0 in the third target row of the first seal surface image form a third pixel point set.
[0106] The elements in any pixel set are arranged from small to large according to the pixel number. The pixels are numbered from left to right in each row and from top to bottom starting from the upper left corner of the first seal surface image. The first target row is the row whose number of rows in the first seal surface image is a multiple of the first selection value, the second target row is the row whose number of rows in the first seal surface image is a multiple of the second selection value, and the third target row is the row whose number of rows in the first seal surface image is a multiple of the third selection value.
[0107] For example, the seal surface image is a 1920×1080 image, which has 1920 columns of pixels and 1080 rows of pixels. In step 802-4, the first selection value is determined to be 66, the second selection value is 68, and the third selection value is 67. Then, the first target row is the row whose number of rows in the first seal surface image is a multiple of 66 (i.e., the 66th row, the 132nd row, the 198th row, ..., the 1056th row), the second target row is the row whose number of rows in the first seal surface image is a multiple of 68 (i.e., the 68th row, the 136th row, the 204th row, ..., the 1020th row), and the third target row is the row whose number of rows in the first seal surface image is a multiple of 67 (i.e., the 67th row, the 134th row, the 201st row, ..., the 1072th row).
[0108] In step 805-2, all pixel points with signature values of 2 in the 66th, 132nd, 198th, ..., 1056th lines of the first seal surface image are formed into a first pixel point set. All pixel points with signature values of 1 in the 68th, 136th, 204th, ..., 1020th lines of the first seal surface image are formed into a second pixel point set. All pixel points with signature values of 0 in the 67th, 134th, 201th, ..., 1072th lines of the first seal surface image are formed into a third pixel point set.
[0109] Among them, the elements in the first pixel point set, the second pixel point set, and the third pixel point set are arranged from small to large according to the pixel point label, so that each element in the first pixel point set, the second pixel point set, and the third pixel point set has two labels, one is the identifier of the element in the pixel point set, which is labeled in sequence by all the elements of the pixel point set, and the other is the pixel point label corresponding to the element in the first seal surface image, which is determined in step 802-5.
[0110] 805-3, the pixel points corresponding to the elements in the first pixel point set identified as multiples of the first selected value, the elements in the second pixel point set identified as multiples of the second selected value, and the elements in the third pixel point set identified as multiples of the third selected value in the first seal surface image are all determined as first target pixel points.
[0111] For example, determine the elements whose element identifiers (i.e., identifiers of elements in the pixel point set) in the first pixel point set are multiples of the first selected value (i.e., 66, 132, 198, ...) (i.e., the 66th element, 132nd element, 198th element, ... in the first pixel point set), determine the elements whose element identifiers (i.e., identifiers of elements in the pixel point set) in the second pixel point set are multiples of the second selected value (i.e., 68, 136, 204, ...) (i.e., the 68th element, 136th element, 204th element, ... in the second pixel point set), and determine the elements whose element identifiers (i.e., identifiers of elements in the pixel point set) in the third pixel point set are multiples of the third selected value (i.e., 67, 134, 201, ...) (i.e., the 68th element, 134th element, 201st element, ... in the third pixel point set).
[0112] The pixel points corresponding to the 66th element, the 132nd element, the 198th element, ... in the first pixel point set in the first seal surface image, the pixel points corresponding to the 68th element, the 136th element, the 204th element, ... in the second pixel point set in the first seal surface image, and the pixel points corresponding to the 68th element, the 134th element, the 201st element, ... in the third pixel point set in the first seal surface image are all determined as first target pixel points.
[0113] 805-4, update the pixel value of the first target pixel point with a pixel value of 0 to a preset minimum value, and update the pixel value of the first target pixel point with a non-zero pixel value to the pixel value minus 1, to form a first image.
[0114] The first image and the first seal surface image differ only in the pixel value of the first target pixel point, and the pixel values of other pixel points remain unchanged.
[0115] Wherein, the pixel value is the color value of the pixel point. If the valid content of the first seal surface image is a special color content (such as red content), then the pixel value is the value of the red channel of the pixel point. If the value of the red channel of any first target pixel point is 0 (that is, any first target pixel point is a pixel point with invalid content), the value of its red channel is updated to a preset minimum value. If the value of the red channel of any first target pixel point is not 0 (that is, any first target pixel point is a pixel point with valid content), the value of its red channel is updated to the current value -1.
[0116] In addition, since the seal surface image is a seal imprint, it is impossible to ensure that the colors of all valid contents are the same during the seal leaving process (for example, uneven distribution of ink will cause deviation in the red color of the valid content). Therefore, the values of the red channel of the pixels of each valid content in the seal surface image are not exactly the same (for example, the values of the red channel of all pixels of each valid content are 255), but will be different (for example, the value of the red channel of the pixels of the valid content is 255, some are 254, some are 250, etc.). In step 805-4, after the first target pixel whose red channel value is not 0 is updated to the current value -1, the update will not be easily noticed due to the difference in the red channel value of the seal surface image itself.
[0117] 805-5, determining the first image as the image content of the first electronic seal, and determining the first digital signature as the digital signature content of the first electronic seal.
[0118] Since in step 805-4, the pixel value of the first target pixel whose red channel value is not 0 is updated, it is not easy to be detected because of the difference in the red channel value of the seal surface image itself. Therefore, if the first electronic seal is stolen, the thief can only obtain some changed pixels through the minimum value of the image content of the first electronic seal (i.e., the first image), and cannot obtain all the changed pixels. However, the pixel with the minimum value is the background pixel, and the effective content cannot be restored after obtaining the pixel. Therefore, the image content of the first electronic seal itself has the function of simulating theft. At the same time, the first digital signature will also play the role of signature, further protecting the security of the electronic seal.
[0119] 703-2, the device executing the digital signature electronic seal generation method based on blockchain storage provided in this embodiment sends the first seal surface image, the identifier of the first seal surface image and the first electronic seal to the management node.
[0120] 703-3, after receiving the first seal surface image, the identifier of the first seal surface image and the first electronic seal, the management node adds a new block in the blockchain.
[0121] Among them, the newly added block includes a head node and a linked list connected to the head node, the head node stores the first user identification, the linked list includes two nodes, the first node stores the first seal face image and the identification of the first seal face image, and the secondary node stores the first electronic seal.
[0122] That is, after the management node receives the first seal face image, the identifier of the first seal face image and the first electronic seal, it adds a new block after the last block of the blockchain through the smart contract. The newly added block includes a head node (the head node stores the first user identifier) and a linked list connected to the head node (the linked list includes two nodes, where the first node stores the first seal face image and the identifier of the first seal face image, and the second node stores the first electronic seal).
[0123] 704. If the first block determination result is that the first block exists, the identifier of the first seal surface image is sent to the management node, so that the management node determines whether the first linked list exists in the first block in the blockchain, and feeds back the first linked list determination result.
[0124] The first node of the first linked list stores the identifier of the first seal surface image.
[0125] If the result of the first block determination is that the first block exists, it means that the first user has generated an electronic seal through the digital signature electronic seal generation method based on blockchain storage provided by this embodiment, then 1) the device executing the digital signature electronic seal generation method based on blockchain storage provided by this embodiment will send the identification of the first seal surface image to the management node. 2) After the management node obtains the identification of the first seal surface image, it determines through the smart contract whether there is a linked list (i.e., the first linked list) in which the identification of the first seal surface image is stored in the first node in the first block. 3) If the first block includes the first linked list, the management node will feedback the existence of the first linked list to the device executing the digital signature electronic seal generation method based on blockchain storage provided by this embodiment. If the first block does not include the first linked list, the management node will feedback the existence of the first linked list to the device executing the digital signature electronic seal generation method based on blockchain storage provided by this embodiment.
[0126] 705, if the first linked list determination result is that the first linked list exists, it means that the first user has generated the corresponding electronic seal through the digital signature electronic seal generation method based on blockchain storage provided by this embodiment, so it is no longer generated at this time, and the electronic seal generation process ends. If the first linked list determination result is that the first linked list does not exist, the first electronic seal is generated according to the first seal face image, and the first seal face image, the identifier of the first seal face image and the first electronic seal are sent to the management node, so that the management node adds a linked list in the first block, the linked list is connected to the head node of the first block, and the linked list includes two nodes, wherein the first node stores the first seal face image and the identifier of the first seal face image, and the second node stores the first electronic seal.
[0127] If the result of determining the first linked list is that the first linked list does not exist, it means that although the first user has generated an electronic seal by the method for generating a digital signature electronic seal based on blockchain storage provided by this embodiment, the electronic seal generated by the method does not correspond to the first seal surface image. This time, the electronic seal corresponding to the first seal surface image needs to be generated by the method for generating a digital signature electronic seal based on blockchain storage provided by this embodiment. The generation process is as follows:
[0128] 901. A device that executes the method for generating a digital signature electronic seal based on blockchain storage provided in this embodiment generates a first electronic seal according to a first seal surface image.
[0129] The process of generating the first electronic seal according to the first seal surface image in this step is the same as the process in step 703 - 1 , that is, it is implemented through steps 801 to 805 , and details can be found in steps 801 to 805 , which will not be described in detail here.
[0130] 902. The device executing the method for generating a digital signature electronic seal based on blockchain storage provided in this embodiment sends a first seal face image, an identifier of the first seal face image, and a first electronic seal to a management node.
[0131] 903, the management node adds a linked list in the first block, the linked list is connected to the head node of the first block, and the linked list includes two nodes, wherein the first node stores the first seal face image and the identifier of the first seal face image, and the second node stores the first electronic seal.
[0132] That is, after the management node receives the first seal face image, the identifier of the first seal face image, and the first electronic seal, since they exist in the block corresponding to the first user (i.e., the first block), it will not create a new block, but will create a new linked list under the first block to store the first electronic seal, that is, the management node adds a linked list in the first block through the smart contract, and the linked list is connected to the head node of the first block. The newly added linked list includes two nodes, of which the first node stores the first seal face image and the identifier of the first seal face image, and the second node stores the first electronic seal.
[0133] The above steps 701 to 705 realize the generation of an electronic seal. Whenever there is a new user, or a user has a new seal, a corresponding electronic seal can be generated through steps 701 to 705, and the generated electronic seal can be stored in the blockchain, which realizes the digitization of the seal while also realizing the anti-counterfeiting function of the seal.
[0134] After the electronic seal is generated, in order to further protect the security of the electronic seal, the electronic seal will be fine-tuned according to the different electronic data stamped with the electronic seal. In this way, based on the fine-tuned electronic seal, it can be obtained whether the electronic data currently stamped with the electronic seal is legal.
[0135] For example, if an electronic seal is to be stamped on a certain electronic data (such as an electronic product certificate), the examiner will confirm that the stamping is allowed, first determine the seal face image of the electronic seal, and then fine-tune the electronic seal corresponding to the seal face image of the electronic seal according to the electronic data, obtain the data seal corresponding to the electronic data, and save the data seal to the blockchain. After the examiner approves, the stamping personnel reads the corresponding data seal from the blockchain and stamps it.
[0136] The following first introduces the process of generating a data seal after approval, which is implemented through steps 1001 to 1005.
[0137] 1001. Obtain a first electronic data identifier of first electronic data and an identifier of a second seal surface image.
[0138] Among them, the first electronic data is the electronic data that needs to be stamped with an electronic seal and is awaiting approval.
[0139] All seal face images that the approver is entitled to use can be displayed to the approver based on the seal face images that the approver is entitled to use (the seal face images that the approver is entitled to use may include electronic seals generated by the approver, and may also include electronic seals generated by other users. The seal face images that the approver is entitled to use may be set by relevant personnel when the approver registers). After the approver selects a seal face image, the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment obtains the identification of the second seal face image based on the correspondence between the seal face image it maintains and its identification.
[0140] 1002, determining a second user identifier of a user to which the second seal surface image belongs.
[0141] For example, because the approver will know the information of the seal he is authorized to use, the approver will enter the identifier of the owner of the second seal face image when selecting the second seal face image. This step obtains the identifier of the owner of the second seal face image entered by the approver, that is, the second user identifier.
[0142] 1003, sending the second user identifier, the first electronic data identifier, and the identifier of the second seal face image to the management node, so that when the management node determines that the first other node does not exist in the blockchain, it will feedback the second electronic seal. The first other node is another node in the second linked list, and the first other node stores the first electronic data identifier. The second linked list is connected to the head node of the second block, the first node of the second linked list stores the identifier of the second seal face image, and the second node of the second linked list stores the second electronic seal. The head node of the second block stores the second user identifier.
[0143] In step 1003, the following steps can be performed:
[0144] 1003-1, the device executing the method for generating a digital signature electronic seal based on blockchain storage provided in this embodiment sends a second user identifier, a first electronic data identifier, and an identifier of a second seal surface image to a management node;
[0145] 1003-2, after the management node receives the second user identifier, the first electronic data identifier and the second seal face image identifier, when it determines that the first other node does not exist in the blockchain, it feeds back the second electronic seal to the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment.
[0146] The first other node is another node in the second linked list, and the first other node stores the first electronic data identifier. The second linked list is connected to the head node of the second block, the first node of the second linked list stores the identifier of the second seal face image, and the second node of the second linked list stores the second electronic seal. The head node of the second block stores the second user identifier.
[0147] Specifically, in step 1003-2, the management node implements the following process:
[0148] 1. The management node determines whether there is a block (ie, the second block) in which the head node stores the second user identifier.
[0149] The process of determining the second block is similar to the process of determining the first block in step 702, and reference is made to step 702, which will not be described in detail here.
[0150] 2. If the second block does not exist, it is determined that the user ID provided by the reviewer is wrong, either an error occurs in the reviewer's provision process, or the reviewer does not know the user ID (such as the reviewer has no right to conduct the review, or the reviewer's identity is stolen, etc.). At this time, for security reasons, the review process of the reviewer will be prohibited, and the management node will feedback relevant information of "data seal generation failure" to the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment, and exit the data seal generation process.
[0151] 3. If the second block exists, the management node executes the following steps:
[0152] 1) Determine whether there is a linked list (ie, the second linked list) whose first node stores the identifier of the second seal surface image among all the linked lists in the second block.
[0153] The process of determining the second linked list is similar to the process of determining the first linked list in step 704, and reference is made to step 704, which will not be described in detail here.
[0154] 2) If the second linked list does not exist, the electronic seal corresponding to the second seal face image is not stored in the blockchain. At this time, for security reasons, the reviewer's review process will be prohibited, and the relevant information of "data seal generation failure" will be fed back to the device that executes the digital signature electronic seal generation method based on blockchain storage provided by this embodiment, and the data seal generation process will be exited.
[0155] 3) If the second linked list exists, determine whether other nodes of the second linked list store the first electronic data identifier. If a certain other node of the second linked list (such as the first other node) stores the first electronic data identifier, it means that the electronic data's stamping request has been approved, and if the approval is passed, there is no need to repeat the approval, and the data seal generation process is terminated. If all other nodes of the second chain do not store the first electronic data identifier (that is, the first other node does not exist in the blockchain), it means that the electronic data has not been approved, then obtain the second electronic seal stored in the secondary node of the second linked list, and feedback the second electronic seal to the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment.
[0156] 1004. The device executing the method for generating a digital signature electronic seal based on blockchain storage provided in this embodiment generates a first data seal according to the first electronic data and the fed-back second electronic seal.
[0157] Since the electronic seal includes image content and digital signature content, step 1004 can be implemented by the following steps:
[0158] 1004-1, determining a first storage time of the first electronic data according to the first electronic data identifier.
[0159] 1004-2, the rightmost two bits in the first storage time form a fourth selection value.
[0160] For example, the first storage time of the first electronic data is September 21, 2022, and its format can be changed to 20220921, then the rightmost two digits (ie, 21) are obtained to form the fourth selection value (ie, the fourth selection value is 21).
[0161] 1004-3, determine a second summary of the first electronic data.
[0162] This step uses an existing summary generation method to obtain a second summary of the first electronic data, such as operating the first electronic data through a hash algorithm (SHA) to obtain a character string of fixed length, which is the second summary.
[0163] 1004-4, encrypt the second summary and the digital signature content of the second electronic seal using the first key to obtain a second digital signature.
[0164] Among them, the first key is the key obtained in step 803, that is, the key obtained by concatenating the preset minimum hash value and the public key of the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment.
[0165] 1004-5, generating a first digital seal according to the second digital signature, the fourth selected value and the image content of the second electronic seal.
[0166] Among them, the data seal includes image content and digital signature content.
[0167] The generation process of step 1004-5 is as follows:
[0168] 1. Extract the second image from the image content of the second electronic seal.
[0169] That is, the image content of the second electronic seal is extracted, and the image content is the second image.
[0170] 2. Determine the middle pixel point in the fourth target row in the second image as the second target pixel point.
[0171] The fourth target row is a row in the second image whose number of rows is a multiple of the fourth selection value.
[0172] For example, the second image is a 1920×1080 image, which has 1920 columns of pixels and 1080 rows of pixels. In step 1004-2, the fourth selection value is determined to be 21, so the fourth target row is a row in the second image whose number of rows is a multiple of 21 (i.e., row 21, row 42, row 63, ..., row 1071). The pixel point in the middle column of each fourth target row (i.e., pixel points in the 960th column, that is, the 960th pixel point from the left in each fourth target row) is the second target pixel point.
[0173] 3. Update the pixel value of the second target pixel point with a pixel value of 0 to a preset minimum value, and update the pixel value of the second target pixel point with a non-zero pixel value to the pixel value minus 1, to form a third image.
[0174] The third image is different from the second image only in the pixel value of the second target pixel point, and the pixel values of other pixels points are unchanged.
[0175] The pixel value is the color value of the pixel. If the valid content of the second image is a special color content (such as red content), the pixel value is the value of the red channel of the pixel. If the value of the red channel of any second target pixel is 0, the value of its red channel is updated to a preset minimum value. If the value of the red channel of any second target pixel is non-0 (that is, any first target pixel is a pixel with valid content), the value of its red channel is updated to the current value -1.
[0176] It should be noted that, because the second image is obtained from the corresponding seal surface image, the red channel value of any second target pixel point is 0. It is possible that the pixel value of the pixel point with the number in the seal surface image is 0, or it is possible that the pixel value of the pixel point with the number in the seal surface image is 1, and when the second image is obtained through the seal surface image, it is updated to the current value -1 and becomes 0. The red channel value of any second target pixel point is non-0. It is possible that the pixel value of the pixel point with the number in the seal surface image is non-0, or it is possible that the pixel value of the pixel point with the number in the seal surface image is updated to the current value -1 and becomes non-0 when the second image is obtained through the seal surface image.
[0177] 4. Determine the third image as the image content of the first data seal, and determine the second digital signature as the digital signature content of the first data seal.
[0178] Since the pixel value of the first target pixel point with a non-zero red channel value in the above 3 is not easily detected due to the difference in the red channel value of the seal surface image itself, if the first data seal is stolen, the thief can only obtain some of the changed pixels through the minimum value of the image content of the first data seal (i.e., the third image), and cannot obtain all the changed pixels, and cannot restore the valid content. Therefore, the image content of the first data seal itself has the function of simulating theft. At the same time, the second digital signature will also play a signature role, further protecting the security of the data seal.
[0179] 1005. The device executing the method for generating a digital signature electronic seal based on blockchain storage provided in this embodiment sends a first data seal to the management node.
[0180] 1006. The management node adds a node at the end of the second linked list, and stores the second data seal and the first electronic data identifier in the node.
[0181] The above steps 1001 to 1006 are the data seal generation process, which realizes the generation of digital seals. Whenever an electronic data needs to be stamped, the corresponding digital seal will be generated through steps 1001 to 1006, and the generated digital seal will be stored in the blockchain. Since each data seal is obtained based on the electronic seal and electronic data, even if the same electronic seal is used, different data seals will be obtained due to different electronic data, realizing the uniqueness of the data seal. Therefore, the above steps 1001 to 1006 realize the digitization of the seal, and also realize the approval and anti-counterfeiting functions of the seal use.
[0182] After the digital seal is generated, the electronic data can be stamped with the data seal. The following describes the process of reading the corresponding data seal from the blockchain for stamping:
[0183] 1101, obtaining the second electronic data to be stamped and the identification of the third seal surface image to be stamped.
[0184] The second electronic data is electronic data that needs to be stamped with an electronic seal.
[0185] The third seal surface image is the seal surface image of the electronic seal that needs to be stamped on the second electronic data.
[0186] All seal face images that the seal stamping person is entitled to use can be determined (the seal face images that are entitled to use may include electronic seals generated by them, and may also include electronic seals generated by other users. The seal face images that are entitled to use can be set by the relevant personnel when the seal stamping person registers), and all seal face images that the seal stamping person is entitled to use are displayed to the seal stamping person. When the seal stamping person selects a seal face image, the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment obtains the identification of the third seal face image according to the correspondence between the seal face image it maintains and its identification.
[0187] 1102. Determine a second electronic data identifier of the second electronic data.
[0188] 1103, determine the third user identifier of the user to which the third seal surface image belongs.
[0189] For example, because the person who stamps the seal will know the information of the seal he needs to stamp, the person who stamps the seal will input the identification of the owner of the third seal surface image when selecting the third seal surface image. This step is to obtain the identification of the owner of the third seal surface image entered by the person who stamps the seal, that is, the third user identification.
[0190] 1104, sending the third user identifier, the second electronic data identifier, and the identifier of the third seal face image to the management node, so that the management node determines and feeds back the second data seal in the blockchain.
[0191] The second data seal is stored in the second other node in the third linked list, and the second other node also stores the second electronic data identifier. The first node of the third linked list stores the identifier of the third seal face image. The head node connected to the third linked list stores the third user identifier.
[0192] In step 1104, the following steps can be performed:
[0193] 1104-1, the device executing the digital signature electronic seal generation method based on blockchain storage provided in this embodiment sends the third user identifier, the second electronic data identifier and the third seal surface image identifier to the management node.
[0194] 1104-2, after the management node receives the third user identifier, the second electronic data identifier and the identifier of the third seal surface image, when determining the second data seal in the blockchain, it feeds back the second data seal to the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment.
[0195] The second data seal is stored in the second other node in the third linked list, and the second other node also stores the second electronic data identifier. The first node of the third linked list stores the identifier of the third seal face image. The head node connected to the third linked list stores the third user identifier.
[0196] Specifically, in step 1104-2, the management node implements the following process:
[0197] 1. The management node determines whether there is a block (ie, the third block) in which the head node stores the third user identifier.
[0198] The process of determining the third block is similar to the process of determining the first block in step 702, and reference is made to step 702, which will not be described in detail here.
[0199] 2. If the third block does not exist, it is determined that the user ID provided by the reviewer is wrong. Either an error occurred in the process of providing the seal by the seal stamping person, or the seal stamping person does not know the user ID (such as the seal stamping person has no right to stamp the electronic seal, or the seal stamping person has been stolen, etc.). At this time, for safety reasons, the electronic seal stamping process of the seal stamping person will be prohibited, and the management node will feedback relevant information of "data seal acquisition failure" to the device executing the digital signature electronic seal generation method based on blockchain storage provided in this embodiment, and exit the electronic seal stamping process.
[0200] 3. If the third block exists, the management node executes the following steps:
[0201] 1) Determine whether there is a first node storing the identifier of the third seal face image in all the linked lists of the third block (ie, the third linked list).
[0202] The process of determining the third linked list is similar to the process of determining the first linked list in step 704, and reference is made to step 704, which will not be described in detail here.
[0203] 2) If the third linked list does not exist, the electronic seal corresponding to the third seal face image is not stored in the blockchain. At this time, for security reasons, the electronic seal stamping process of the person who stamps the seal will be prohibited, and the relevant information of "data seal acquisition failure" will be fed back to the device executing the digital signature electronic seal generation method based on blockchain storage provided in this embodiment, and the electronic seal stamping process will be exited.
[0204] 3) If there is a third linked list, determine whether other nodes of the third linked list store the second electronic data identifier. If a certain other node of the third linked list (such as the second other node) stores the second electronic data identifier, it means that the stamping request of the electronic data has been approved and approved. At this time, the second data seal stored in the second other node of the third linked list can be obtained, and the second data seal is fed back to the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment. If all other nodes of the second chain do not store the second electronic data identifier (that is, there is no second other node in the blockchain), it means that the electronic data has not been approved or has not been approved. At this time, for safety reasons, the electronic seal stamping process of the seal stamping personnel will be prohibited, and the relevant information of "data seal acquisition failure" will be fed back to the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment, and the electronic seal stamping process will be exited.
[0205] 1105 , determining a third seal corresponding to the third seal surface image according to the second data seal.
[0206] Since the data seal includes image content and digital signature content, and the digital signature content of the data seal is composed of the summary and the digital signature content of the electronic seal that generates the data seal, therefore, the implementation process of step 1105 is as follows:
[0207] 1105-1, concatenate the preset minimum hash value with the public key of the device executing the method to obtain a second key.
[0208] The key is obtained by concatenating the preset minimum hash value with the public key of the device that executes the digital signature electronic seal generation method based on blockchain storage provided in this embodiment.
[0209] 1105-2, decrypt the digital signature content of the second data seal using the second key to obtain the third summary and the digital signature content of the third electronic seal.
[0210] The second data seal is generated based on the third electronic seal.
[0211] 1105-3, if the third summary is the same as the summary of the second electronic data, it means that the data seal is incorrect. For security reasons, the electronic seal stamping process of the seal stamping person will be prohibited, and the electronic seal stamping process will be exited. If the third summary is the same as the summary of the second electronic data, the third seal is determined according to the digital signature content of the third electronic seal and the image content of the second data seal.
[0212] Since the digital signature of the electronic seal is obtained according to the signature value of each pixel in the seal surface image, the implementation process of step 1105-3 is as follows:
[0213] 1. Determine a second storage time of the second electronic data.
[0214] 2. The rightmost two bits of the second storage time form the fifth selection value.
[0215] This step is similar to step 1004 - 2 , and can be implemented by referring to step 1004 - 2 .
[0216] 3. Extracting a fourth image from the image content of the second data seal.
[0217] 4. Determine the middle pixel point in the fifth target row in the fourth image as the third target pixel point.
[0218] The fifth target row is a row in the fourth image whose number of rows is a multiple of the fifth selection value.
[0219] This step is similar to step 2 in step 1004-5, and can be implemented by referring to step 2 in step 1004-5.
[0220] 5. Update the pixel value of the third target pixel point whose pixel value is the preset minimum value to 0, and update the pixel value of the third target pixel point whose pixel value is not the preset minimum value to the pixel value plus 1, to form a fifth image.
[0221] This step is the inverse process of step 1004-5 in step 3. In step 1004-5 in step 3, the target pixel point with a pixel value of 0 will be updated to the preset minimum value, and the target pixel point with a pixel value not 0 will be updated to a pixel value of -1. Therefore, in this step, if the third target pixel point is the preset minimum value, if the third target pixel point is not the preset minimum value, it will be updated to a pixel value of +1 to achieve restoration. The restored fifth image is the image part of the corresponding electronic seal.
[0222] 6. Determine the second registration time of the third user based on the third user identifier.
[0223] 7. Starting from the right side of the second registration time, obtain the fourth digit from the rightmost position, the fifth digit from the second rightmost position, and the sixth digit from the third rightmost position.
[0224] This step is similar to step 802 - 2 , and can be implemented by referring to step 802 - 2 .
[0225] 8. Determine the fourth character that is four digits away from the left side of the hash value of the third user identifier, determine the fifth character that is five digits away from the left side of the hash value of the third user identifier, and determine the sixth character that is six digits away from the left side of the hash value of the third user identifier.
[0226] This step is similar to step 802 - 3 , and can be implemented by referring to step 802 - 3 .
[0227] 9. Determine the sixth selected value as the decimal ASCII code value of the fourth character, determine the seventh selected value as the decimal ASCII code value of the fifth character, and determine the eighth selected value as the decimal ASCII code value of the sixth character.
[0228] This step is similar to step 802 - 4 , and can be implemented by referring to step 802 - 4 .
[0229] 10. Decrypt the digital signature content of the third electronic seal using the second key to obtain the signature value of each pixel.
[0230] 11. According to the signature value of each pixel, all the pixels with a signature value of 2 in the sixth target row of the fifth image form a fourth pixel set, all the pixels with a signature value of 1 in the seventh target row of the fifth image form a fifth pixel set, and all the pixels with a signature value of 0 in the eighth target row of the fifth image form a sixth pixel set. Among them, the elements in any pixel set are arranged from small to large according to the pixel number. The pixels start from the upper left corner of the fifth image and are numbered in order from left to right in each row and from top to bottom. The sixth target row is the row in the fifth image whose number of rows is a multiple of the sixth selection value, the seventh target row is the row in the fifth image whose number of rows is a multiple of the seventh selection value, and the eighth target row is the row in the fifth image whose number of rows is a multiple of the eighth selection value.
[0231] This step is similar to step 805 - 2 , and can be implemented by referring to step 805 - 2 .
[0232] 12. The pixel points corresponding to the elements in the fourth pixel point set identified as multiples of the sixth selection value, the elements in the fifth pixel point set identified as multiples of the seventh selection value, and the elements in the sixth pixel point set identified as multiples of the eighth selection value in the fifth image are all determined as fourth target pixel points.
[0233] This step is similar to step 805 - 3 , and can be implemented by referring to step 805 - 3 .
[0234] 13. Update the pixel value of the fourth target pixel point whose pixel value is the preset minimum value to 0, and update the pixel value of the fourth target pixel point whose pixel value is not the preset minimum value to the pixel value plus 1, to form a third seal.
[0235] This step is the reverse process of step 805-4. In step 805-4, the target pixel point with a pixel value of 0 will be updated to a preset minimum value, and the target pixel point with a pixel value not 0 will be updated to a pixel value of -1. Therefore, in this step, if the fourth target pixel point is the preset minimum value, if the fourth target pixel point is not the preset minimum value, it will be updated to a pixel value of +1 to achieve restoration. The restored fifth image is the seal surface image of the image part of the corresponding electronic seal, that is, the third seal.
[0236] 1106. A third seal is stamped in the second electronic data.
[0237] For example, the data of the third seal is added to the second electronic data to form the second electronic data after stamping.
[0238] In addition, smart contracts that perform different functions may be the same or different, and this embodiment does not limit the content of the smart contracts.
[0239] The above steps 1101 to 1106 are the electronic seal stamping process, which realizes the process of stamping on electronic data. Whenever an electronic data needs to be stamped, it will be stamped through steps 1101 to 1106. Since the stamped seal is obtained from the blockchain, the unmodifiable nature of the blockchain ensures the accuracy of the obtained seal. In addition, what is obtained from the blockchain is not the seal itself, but the data seal obtained based on the seal. The generation process of the data seal ensures the legitimacy of this stamping behavior, and the authenticity of this stamping behavior is ensured by the data signature of the data seal. In the process of restoring the data seal to the electronic seal and then restoring the electronic seal to the seal surface image, there is no interaction of any other data. Only the device that generates the data seal will obtain the real relevant data. This restoration reduces the security risk of the seal surface image restoration process caused by other data interactions, and further ensures the security of the seal surface image.
[0240] The present embodiment provides a method for generating a digital signature electronic seal based on blockchain storage, the blockchain comprising a management node and multiple blocks; wherein the block stores a user identifier through a head node, and stores an electronic seal and a data seal through a linked list; the method comprises: obtaining a user identifier and a seal face image; if there is no block storing the user identifier in the blockchain, or if there is a block storing the user identifier, but the linked list of the block does not store an electronic seal generated by the seal face image, a digital signature is obtained according to the attribute values of each pixel point in the user identifier and the seal face image, an electronic seal is generated according to the digital signature and the seal face image, and the management node is made to store the electronic seal in the blockchain. The method of the present embodiment realizes the anti-counterfeiting of the electronic seal through blockchain storage and digital signature while satisfying the habits and experience of physical documents and seals.
[0241] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0242] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0243] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0244] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0245] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the feature. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0246] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0247] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for generating a digital signature electronic seal based on blockchain storage, characterized in that: The blockchain includes a management node and multiple blocks; Among them, blocks correspond to users one by one; any block stores the user identification of the corresponding user through a head node, and stores the electronic seal and data seal of the corresponding user through a linked list connected to the head node; the electronic seal contains the digital signature of the corresponding user, and the digital signature is generated according to the seal surface image of the corresponding user; the data seal is generated according to the electronic seal; The linked list of any block corresponds to the seal face image of the corresponding user one by one; the first node of any linked list of any block stores the corresponding seal face image and the identifier of the seal face image, the secondary node stores the electronic seal generated by the corresponding seal face image, and the other nodes correspond to the electronic data one by one; any other node of any linked list of any block stores a data seal and an electronic data identifier, and the data seal is generated according to the electronic seal stored in the secondary node of any linked list of any block and the corresponding electronic data, and the electronic data identifier is the identifier of the electronic data generating the data seal; The method comprises: Acquire a first user identification of a first user, a first seal surface image, and an identification of the first seal surface image; wherein the seal surface image is a digitized image; Sending the first user identifier to the management node, so that the management node determines whether the first block exists in the blockchain, and feeds back a determination result of the first block; wherein the head node of the first block stores the first user identifier; If the first block determination result is that the first block does not exist, a first electronic seal is generated according to the first seal face image, and the first seal face image, the identifier of the first seal face image, and the first electronic seal are sent to the management node, so that the management node adds a new block in the blockchain, the block includes a head node and a linked list connected to the head node, the head node stores the first user identifier, and the linked list includes two nodes, wherein the first node stores the first seal face image and the identifier of the first seal face image, and the secondary node stores the first electronic seal; If the first block determination result is that the first block exists, sending the identifier of the first seal surface image to the management node, so that the management node determines whether the first linked list exists in the first block in the blockchain, and feeds back the first linked list determination result; wherein the first node of the first linked list stores the identifier of the first seal surface image; If the first linked list determination result is that the first linked list does not exist, a first electronic seal is generated according to the first seal face image, and the first seal face image, the identifier of the first seal face image and the first electronic seal are sent to the management node, so that the management node adds a linked list in the first block, the linked list is connected to the head node of the first block, and the linked list includes two nodes, wherein the first node stores the first seal face image and the identifier of the first seal face image, and the second node stores the first electronic seal; The step of generating a first electronic seal according to the first seal surface image includes: Determining the attribute value of each pixel in the first seal surface image; Determine a first summary according to the first user identifier and the attribute value of each pixel; Concatenate a hash value of a preset minimum value and a public key of a device executing the method into a first key; Encrypt the first summary using the first key to obtain a first digital signature; A first electronic seal is generated according to the first digital signature and the first seal surface image.
2. The method according to claim 1, characterized in that The attribute value includes a valid value and an object value; The determining the attribute value of each pixel in the first seal surface image includes: Identify each object in the first seal surface image and determine the type of each object; the type is text, number, or other; Determine the effective value of each pixel in the first seal surface image; wherein, if any pixel is a pixel of effective content of the first seal surface image, the effective value of any pixel is 1, and if any pixel is not a pixel of effective content of the first seal surface image, the effective value of any pixel is 0; Determine the object value of each pixel point in the first seal surface image; wherein, if any pixel point is a pixel point of a text type object in the first seal surface image, the object value of any pixel point is 2; if any pixel point is a pixel point of a digital type object in the first seal surface image, the object value of any pixel point is 1; if any pixel point is a pixel point of other types of objects in the first seal surface image, the object value of any pixel point is 0.
3. The method according to claim 1, characterized in that The attribute value includes a valid value and an object value; The determining a first summary according to the first user identifier and the attribute value of each pixel point includes: Determining a first registration time of the first user according to the first user identifier; Starting from the right side of the first registration time, obtain the first digit of the rightmost position, the second digit of the second rightmost position, and the third digit of the third rightmost position; Determine a first character that is a first digit away from the left side of the hash value of the first user identifier, determine a second character that is a second digit away from the left side of the hash value of the first user identifier, and determine a third character that is a third digit away from the left side of the hash value of the first user identifier; Determine the first selected value as the decimal ASCII code value of the first character, determine the second selected value as the decimal ASCII code value of the second character, and determine the third selected value as the decimal ASCII code value of the third character; Determine that the signature value of each pixel is the product of the effective value of each pixel and the object value; The signature value of each pixel is determined as the first summary.
4. The method according to claim 1, characterized in that The electronic seal includes image content and digital signature content; Generating a first electronic seal according to the first digital signature and the first seal surface image includes: Determine the signature value of each pixel in the first seal surface image according to the first summary; wherein the signature value of any pixel is determined according to the attribute value of any pixel; All pixel points with a signature value of 2 in a first target row in the first seal surface image form a first pixel point set, all pixel points with a signature value of 1 in a second target row in the first seal surface image form a second pixel point set, and all pixel points with a signature value of 0 in a third target row in the first seal surface image form a third pixel point set; wherein, the elements in any pixel point set are arranged from small to large according to the pixel point number; the pixels are numbered in order from left to right in each row and from top to bottom, starting from the upper left corner of the first seal surface image; the first target row is the row whose number of rows in the first seal surface image is a multiple of the first selected value, the second target row is the row whose number of rows in the first seal surface image is a multiple of the second selected value, and the third target row is the row whose number of rows in the first seal surface image is a multiple of the third selected value; Determine the pixel points corresponding to the elements in the first pixel point set identified as multiples of the first selected value, the elements in the second pixel point set identified as multiples of the second selected value, and the elements in the third pixel point set identified as multiples of the third selected value in the first seal surface image as first target pixel points; The pixel value of the first target pixel point whose pixel value is 0 is updated to the preset minimum value, and the pixel value of the first target pixel point whose pixel value is not 0 is updated to the pixel value minus 1, so as to form a first image; The first image is determined as the image content of the first electronic seal, and the first digital signature is determined as the digital signature content of the first electronic seal.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining a first electronic data identifier of the first electronic data and an identifier of the second seal surface image; Determining a second user identifier of a user to which the second seal face image belongs; The second user identifier, the first electronic data identifier, and the identifier of the second seal face image are sent to the management node, so that when the management node determines that the first other node does not exist in the blockchain, the second electronic seal is fed back; wherein the first other node is another node in the second linked list, and the first other node stores the first electronic data identifier; the second linked list is connected to the head node of the second block, the first node of the second linked list stores the identifier of the second seal face image, and the secondary node of the second linked list stores the second electronic seal; the head node of the second block stores the second user identifier; Generate a first data seal according to the first electronic data and the fed-back second electronic seal; The first data seal is sent to the management node, so that the management node adds a node at the end of the second linked list, and stores the second data seal and the first electronic data identifier in the node.
6. The method according to claim 5, characterized in that The electronic seal includes image content and digital signature content; The step of generating a first data seal according to the first electronic data and the fed-back second electronic seal includes: determining a first storage time of the first electronic data according to the first electronic data identifier; The rightmost two bits in the first storage time form a fourth selected value; determining a second digest of the first electronic data; Encrypt the second summary and the digital signature content of the second electronic seal by using the first key to obtain a second digital signature; A first data seal is generated according to the second digital signature, the fourth selected value and the image content of the second electronic seal.
7. The method according to claim 6, characterized in that The data seal includes image content and digital signature content; Generating a first data seal according to the second digital signature, the fourth selected value and the image content of the second electronic seal comprises: extracting a second image from the image content of the second electronic seal; Determine a pixel point at a middle position in a fourth target row in the second image as a second target pixel point; wherein the fourth target row is a row in the second image whose number of rows is a multiple of a fourth selected value; The pixel value of the second target pixel point whose pixel value is 0 is updated to a preset minimum value, and the pixel value of the second target pixel point whose pixel value is not 0 is updated to the pixel value minus 1, so as to form a third image; The third image is determined as the image content of the first data seal, and the second digital signature is determined as the digital signature content of the first data seal.
8. The method according to claim 1, characterized in that The method further comprises: Acquire the second electronic data to be stamped and the identification of the third seal surface image to be stamped; Determining a second electronic data identifier of the second electronic data; Determine a third user identifier of the user to which the third seal face image belongs; Sending the third user identifier, the second electronic data identifier and the identifier of the third seal face image to the management node, so that the management node determines and feeds back the second data seal in the blockchain; wherein the second data seal is stored in the second other node in the third linked list, and the second other node also stores the second electronic data identifier; the first node of the third linked list stores the identifier of the third seal face image; the head node connected to the third linked list stores the third user identifier; determining a third seal corresponding to the third seal face image according to the second data seal; A third seal is stamped in the second electronic data.
9. The method according to claim 8, characterized in that The data seal includes image content and digital signature content, and the digital signature content of the data seal is composed of a summary and the digital signature content of the electronic seal that generates the data seal; The step of determining the third seal corresponding to the third seal surface image according to the second data seal comprises: Concatenate the hash value of the preset minimum value with the public key of the device executing the method to obtain a second key; Decrypting the digital signature content of the second data seal by using the second key to obtain the third summary and the digital signature content of the third electronic seal; wherein the second data seal is generated according to the third electronic seal; If the third summary is the same as the summary of the second electronic data, the third seal is determined according to the digital signature content of the third electronic seal and the image content of the second data seal.
10. The method according to claim 9, characterized in that The digital signature of the electronic seal is obtained according to the signature value of each pixel in the seal surface image; Determining the third seal according to the digital signature content of the third electronic seal and the image content of the second data seal includes: determining a second storage time of the second electronic data; The rightmost two bits in the second storage time form a fifth selection value; extracting a fourth image from the image content of the second data seal; Determine the pixel point at the middle position in the fifth target row in the fourth image as the third target pixel point; wherein the fifth target row is a row in the fourth image whose number of rows is a multiple of the fifth selection value; The pixel value of the third target pixel point whose pixel value is the preset minimum value is updated to 0, and the pixel value of the third target pixel point whose pixel value is not the preset minimum value is updated to the pixel value plus 1, so as to form a fifth image; Determining a second registration time of the third user according to the third user identifier; Starting from the right side of the second registration time, obtain the fourth digit at the rightmost position, the fifth digit at the second rightmost position, and the sixth digit at the third rightmost position; Determine the fourth character at the fourth digit to the left of the hash value of the third user identifier, determine the fifth character at the fifth digit to the left of the hash value of the third user identifier, and determine the sixth character at the sixth digit to the left of the hash value of the third user identifier; Determine the sixth selected value as the decimal ASCII code value of the fourth character, determine the seventh selected value as the decimal ASCII code value of the fifth character, and determine the eighth selected value as the decimal ASCII code value of the sixth character; The digital signature content of the third electronic seal is decrypted by the second key to obtain the signature value of each pixel; According to the signature value of each pixel point, all the pixel points with a signature value of 2 in the sixth target row of the fifth image form a fourth pixel point set, all the pixel points with a signature value of 1 in the seventh target row of the fifth image form a fifth pixel point set, and all the pixel points with a signature value of 0 in the eighth target row of the fifth image form a sixth pixel point set; wherein, the elements in any pixel point set are arranged from small to large according to the pixel point number; the pixels are numbered in sequence from left to right in each row and from top to bottom, starting from the upper left corner of the fifth image; the sixth target row is the row in the fifth image whose number of rows is a multiple of the sixth selection value, the seventh target row is the row in the fifth image whose number of rows is a multiple of the seventh selection value, and the eighth target row is the row in the fifth image whose number of rows is a multiple of the eighth selection value; Determine the pixel points corresponding to the elements in the fourth pixel point set identified as multiples of the sixth selected value, the elements in the fifth pixel point set identified as multiples of the seventh selected value, and the elements in the sixth pixel point set identified as multiples of the eighth selected value in the fifth image as fourth target pixel points; The pixel value of the fourth target pixel point whose pixel value is the preset minimum value is updated to 0, and the pixel value of the fourth target pixel point whose pixel value is not the preset minimum value is updated to the pixel value plus 1, so as to form a third seal.
Citation Information
Patent Citations
Electronic seal signing method and device based on block chain intelligent contract
CN109492983A
Seal registration method, verification method and anti-counterfeiting system based on block chain
CN111490870A
Digital seal using method and device based on block chain
CN114331437A
Electronic seal monitoring method and device based on block chain, equipment and medium
CN114662132A
Digital seal verification method and device based on block chain and electronic equipment
CN114925405A
Cited By
Encryption storage method and system of digital signature
CN122027174A