An electronic seal anti-counterfeiting method based on seal frame coding

By generating a stripe line code of alternating color and white on the border of the electronic seal and using a joint key to encrypt the information text, the problem of electronic seals being difficult to distinguish between authenticity and counterfeit after copying or scanning is solved, and the anti-copying effect is achieved.

CN114491667BActive Publication Date: 2025-09-23SHANGHAI YIGAO INFORMATION TECH CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210062851.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2025-09-23
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

After existing electronic seals are copied or scanned, it becomes very difficult to distinguish the authenticity of the seals, and existing anti-counterfeiting solutions cannot effectively prevent the destruction of seal information.

Method used

A coding method based on the seal border is adopted, and the information text is encrypted with a joint key to generate a stripe line code of alternating color and white. The stripe line code is drawn on the electronic seal border to generate an electronic seal image with a code, and the anti-copying effect is achieved through key decoding.

Benefits of technology

After the seal is copied or scanned, the encoded information is difficult to decode, which effectively prevents the destruction of the seal information and ensures the authenticity of the seal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491667B_ABST
    Figure CN114491667B_ABST
Patent Text Reader

Abstract

The present invention discloses an anti-counterfeiting coding method for an electronic seal frame, comprising the following steps: step 1. encrypting a plaintext information text using a key to generate an encrypted bit string, and then forming a coded binary string from the encrypted bit string; step 2. representing the coded binary string as a stripe row of alternating colors and white; and step 3. drawing the stripe row on the electronic seal frame to generate a coded electronic seal image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic seal anti-counterfeiting, and in particular to an electronic seal anti-counterfeiting method based on seal frame coding. Background Art

[0002] With the continuous development of e-commerce, more and more companies have adopted the practice of conducting business transactions through e-commerce. However, this development has also brought a series of problems, among which the anti-counterfeiting of electronic seals has become a focus of attention. Although existing electronic seals provide basic anti-counterfeiting solutions through conventional methods such as adding watermarks, it is very difficult to distinguish the authenticity of the seal when contracts and documents printed with the electronic seal are scanned and then printed or copied.

[0003] To this end, the present invention provides an electronic seal anti-counterfeiting method based on seal border coding. When a document containing a seal is copied or scanned and then printed again after being printed for the first time, the encrypted information contained in the seal will be destroyed, causing the decoding of the encrypted information to fail, thereby achieving the effect of preventing copying. Summary of the Invention

[0004] In order to achieve the purpose of the present invention, the following technical solutions are adopted:

[0005] An anti-counterfeiting coding method for an electronic seal frame comprises the following steps:

[0006] Step 1. Use the key to encrypt the plaintext information text to generate an encrypted bit string, and then form the encrypted bit string into a coded binary string;

[0007] Step 2. Represent the coded binary string as rows of alternating colored and white stripes;

[0008] Step 3. Draw the strip lines on the electronic seal border to generate an electronic seal image with a code.

[0009] The electronic seal frame anti-counterfeiting coding method, wherein: the key is a joint key, including a user key and a random key.

[0010] The electronic seal frame anti-counterfeiting coding method, wherein: the coded binary string includes 5 data fields, wherein data field A is a random key, data field B is a checksum of the random key, data field C is the number of characters in the information text, data field D is a checksum of data field E, and data field E is an encrypted bit string.

[0011] The electronic seal frame anti-counterfeiting coding method, wherein the strip line coding includes the following graphic elements: a narrow colored strip NL, representing a binary 0; a wide colored strip WL, representing a binary 1; a start character SS, the length of SS is much longer than NL and WL; a blank character SL, which is the space between NL, WL, and SS, and is white.

[0012] In the electronic seal frame anti-counterfeiting coding method, the coding structure of the strip line is as follows: it starts with SS, followed by a coded binary string or multiple cyclic coded binary strings.

[0013] The electronic seal border anti-counterfeiting coding method, wherein: before generating a stripe row, a bit 0 is added after every 4 bits of the coded binary string to form an extended coded string, and the coding structure of the stripe row is as follows: starting with SS, followed by multiple cyclic coded binary strings, and the coded binary strings are separated by wall symbols, and the wall symbol is represented by "01111110".

[0014] The electronic seal frame anti-counterfeiting coding method comprises the following steps: in step 1, a plurality of keys are used to encrypt a plain text information text to generate a plurality of encrypted bit strings, and then the encrypted bit strings are used to form a plurality of coded binary strings; in step 2, each coded binary string is represented as a stripe row of alternating color and white to form a stripe group; in step 3, the stripe row group is drawn on the electronic seal frame to generate a coded electronic seal image, wherein adjacent stripe rows in the stripe group are spaced a predetermined distance apart.

[0015] The electronic seal frame anti-counterfeiting coding method, wherein in step 2:

[0016] Assuming that the probability of 0 and 1 appearing in the strip is equal, the average width of 1 bit is:

[0017]

[0018] Where W NL 、W WL and W SL are the widths of the coded primitives NL, WL and SL respectively.

[0019] The electronic seal frame anti-counterfeiting coding method comprises the following steps: combining multiple stripe rows into a stripe group consisting of multiple rows, with a row spacing of LD, filling the gaps between the rows with red, and then performing a cyclic movement of random length on each row.

[0020] The electronic seal frame anti-counterfeiting coding method, wherein: assuming there are N rows of strips on the frame, the minimum width of the frame is:

[0021] W m (N) = N × H LH +(N+1)×H LD(2)

[0022] N is a natural number from 1 to 3, H LH and H LD They are line height and line spacing respectively.

[0023] The electronic seal frame anti-counterfeiting coding method, wherein step 3 includes sub-steps S1 to S6:

[0024] S1. Create a new image with the same graphics as the seal image in the seal template file, and set the background color to transparent. This image is called the seal base image.

[0025] S2. For each non-transparent pixel on the stamp base image, determine whether it is on the border. The determination method is as follows:

[0026] The equations of the inner and outer rings and the central ellipse of the seal image ellipse are expressed as

[0027] Where a, b>>|s|(3)

[0028] Equation (9) is an elliptic curve family with s as a parameter, a is the length of the major axis of the central ellipse, b is the length of the minor axis of the central ellipse, s is the distance between the major axis and minor axis of an ellipse in the elliptic curve family and the major axis and minor axis of the central ellipse respectively, (x c ,y c ) is the center coordinate of the ellipse; the curve when s=0 corresponds to the central ellipse, and (x, y) is the coordinate of each point on the ellipse border of the seal image;

[0029] For a given point coordinate (x, y) in the seal image, solve equation (9) to get s. If |s| ≤ w, it means that the point is on the seal border and w is the width of the seal border W. m half of (N),

[0030] If the point (x, y) is on the stamp border, proceed to the next step S3, otherwise repeat substep S2 for the next point;

[0031] S3. Find the point closest to the point on the central ellipse and determine the eccentricity angle of this closest point.

[0032] The equation of the ellipse is expressed in terms of the eccentricity angle as

[0033]

[0034] Where t is the eccentricity angle,

[0035] Then the distance from a point (x, y) outside the ellipse to the ellipse is expressed as

[0036]

[0037] Use numerical methods to find the eccentric angle t when D is the minimum value min(D) ;

[0038] S4. Calculate arc length from eccentric angle

[0039] The arc length from the right end point of the major axis of the central ellipse to the eccentric angle t in the clockwise direction is expressed as

[0040]

[0041] S5. For a point (x, y) on the seal border, calculate its coordinates (x′, y′) in the straight strip group according to equations (3) to (6), where the value of x′ is equal to the arc length S(t), and the value of y′ is equal to the distance s from the point (x, y) to the central ellipse; extract the color value of this point from the straight strip group and plot it on the point (x, y) of the seal base image;

[0042] Then return to sub-step S2 to process the next point of the seal base image until all points on the seal image have completed sub-step S2;

[0043] Step 4: Output the coded electronic seal image, which includes the frame containing the coded watermark and the rest of the seal.

[0044] Step 5. Print the coded seal image. In the seal application system, print the electronic seal image onto a paper document.

[0045] An anti-counterfeiting decryption method for an electronic seal frame comprises the following steps:

[0046] Step 1. Scan the seal portion of the document to obtain a seal scan image, wherein the seal is printed out by the seal image formed by one of the encoding methods described above;

[0047] Step 2. Identify the seal border;

[0048] Step 3. Stretch the border into strip rows or strip groups;

[0049] Step 4. Identify the bit sequence in the stripe row and obtain the encoded binary string;

[0050] Step 5. Decode with the key sequence to obtain the hidden string. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 (a) Schematic diagram of a seal image with a border code; (b) Schematic diagram of a partially enlarged image of the border code, where the black color in the figure represents the color of the seal, which should actually be red, blue, or purple;

[0052] Figure 2. Schematic diagram of the encoding and decoding process of the border code seal printing anti-counterfeiting technology;

[0053] Figure 3 .Schematic diagram of stripe row coding structure;

[0054] Figure 4 When the code pattern is aligned with the stamp border, the border appears as a jagged diagram.

[0055] Figure 5 .Schematic diagram of the inner and outer ellipse equations of the seal border;

[0056] Figure 6 . Schematic diagram of the correspondence between the straight (flattened) strip group and the strip group that is fully curved into an ellipse. DETAILED DESCRIPTION

[0057] The present invention is applied to seals with circular and elliptical frames. Figure 1-5 Specific embodiments of the present invention are described in detail.

[0058] like Figure 1 As shown, the code is arranged in a circular pattern along the border, with multiple rows from the inside out. The number of rows is determined by the width of the seal border, with a minimum of one and a maximum of three. Because the basic unit of the code is very small, only a few pixels, when copied or scanned and then printed, the dot matrix of the code unit will be rearranged, causing decoding failure, thus achieving the anti-copying effect.

[0059] like Figure 2 As shown, the electronic seal anti-counterfeiting method based on seal frame coding includes encryption and decryption, wherein encryption includes the following steps (see Figure 2 (E1 to E5):

[0060] Step 1. Use multiple different combined keys (CombKey) to encrypt the plaintext information text (InfoText) to generate multiple encrypted bit strings (EncodedBits), which are then further constructed into multiple coded binary strings (CodeString).

[0061] Each character in the plaintext InfoText occupies 6 bits and can represent 64 printable characters, including uppercase and lowercase letters, numbers, underscores, and spaces. The maximum length of the InfoText is 24 characters. Its content is user-defined and can be a group of numbers, a paragraph of text, or the unit name on a seal.

[0062] The combined key, CombKey, consists of a user key (UserKey) and a random key (RandomKey). The UserKey is a configuration item for the encoder and decoder. The decoder must use the same UserKey as the encoder to correctly decode. There are three UserKeys, corresponding to the three ring strips from the innermost to the outermost. The RandomKey is dynamically generated during encryption. Each user has a unique UserKey. Because of the RandomKey, even if the InfoText is the same, the encrypted bit string EncodedBits is completely different each time.

[0063] RandomKey and EncodeBits together form a coded binary string (CodeString). The coded binary string CodeString includes 5 data fields, as shown in Table 1. From the sum of the number of bits in each field, it can be seen that the total length of the coded binary string CodeString is a multiple of 4.

[0064] Data Domain Number of bits illustrate A 6 Random key B 2 Checksum of random key C 8 The number of characters in the information text (InfoText). The valid range is 1 to 24. D 8 Checksum of data field E E 4n EncodeBits, the number of bits is padded to an integer multiple of 4.

[0065] Table 1 CodeString data field definition

[0066] Step 2. First, represent each CodeString as a red and white stripe row, with the length of the stripe row exceeding the perimeter of the seal border. Then, multiple rows (1 to 3 rows) of stripe rows are parallely assembled into a stripe group, with the length of the assembled stripe group equal to the perimeter of the seal border.

[0067] Each stripe row consists of a colored bar (usually red, but also blue or purple, for ease of description, referred to as a red bar below) and a white bar arranged in sequence. The width of the white bar is fixed and is used to separate code points. The width of the red bar is divided into three categories: wide bar, narrow bar and start symbol. The colored bars and white bars of different widths are collectively referred to as graphic elements. The meaning of different graphic elements is shown in Table 2

[0068] Primitive Type Abbreviation Full name meaning Narrow strip NL narrow line Represents binary digit 0, red Wide strips WL wide line Represents binary digit 1, red Starting symbol SS start sign Represents the identification starting point of the ring strip, red blank SL space line The space between NL, WL, and SS is white. Line Height LH Line height Height of stripe row Line Spacing LD Line distance Stripe row spacing

[0069] Table 2 Meaning of the graphic elements that make up the stripe row

[0070] Before generating a stripe line, a 0 is appended after every four bits of the CodeString to form an extended code string (ExCodeString). This prevents more than four consecutive 1s from appearing in the ExCodeString. Therefore, "01111110" is used as a wall sign (WS) to separate the ExCodeStrings. Within a stripe line, the ExCodeString appears in a loop, separated by WS.

[0071] The encoding structure of a stripe row is as follows Figure 3 As shown in the figure, starting with SS, the ExCodeString is repeated multiple times until the total length of the stripe line equals the perimeter of the seal border. The excess is truncated and discarded. ExCodeStrings are separated by WS. An 8-bit random code is inserted between SS and the WS immediately adjacent to SS to obfuscate the fixed pattern formed by the SS and WS together.

[0072] Assuming that the probability of 0 and 1 appearing in the strip is equal, the average width of 1 bit is

[0073]

[0074] Where W NL 、W WL and W SL are the widths of the coded primitives NL, WL and SL respectively.

[0075] Multiple (1-3) stripe rows are combined into a multi-row stripe group with a row spacing of LD and red fill in the gaps between rows. Each row is then cyclically shifted by a random length to avoid fixed patterns caused by alignment of SS symbols in different rows.

[0076] The number of stripe rows in a stripe group depends on the width of the physical stamp border, which is at least 1 and at most 3. Suppose there are N stripe rows on the border. Then the minimum width of the border is:

[0077] W m (N) = N × H LH +(N+1)×H LD (14)

[0078] N is a natural number from 1 to 3, H LH and H LD They are line height and line spacing respectively.

[0079] Step 3. Draw the strip group on the electronic seal border to generate an electronic seal image with a code.

[0080] Draw a strip group on the seal border in a clockwise direction along the center line of the border. The strip group is a horizontal strip, and the coding patterns in it are all rectangular, while the seal border is a curve. Therefore, when drawing the strip group, the strip group needs to be partially deformed so that the horizontal and vertical edges of the coding pattern are aligned with the tangent and normal of the seal border respectively. This alignment operation theoretically turns the rectangle into a curved trapezoid. However, since the coding pattern is only a few pixels in size, its boundary appears jagged after the alignment operation. Figure 4 shown.

[0081] The process of generating a seal coded watermark seal image is to draw a strip group on the seal border. Circles and ellipses are common seal borders. Since the circle can be considered a special case of the ellipse, we only need to consider the ellipse generation algorithm. The premise of drawing the strip group on the elliptical border is that the seal image already exists and the parameters of the seal image border have been measured, including the center coordinates of the ellipse, the major and minor axes of the ellipse, and ensure that the seal image has been adjusted to the horizontal state. This seal image and related parameters are saved together in a configuration file, called a seal mold file. Based on the pre-prepared seal mold file, the seal containing the code can be drawn. It is divided into 6 sub-steps (S1 to S6).

[0082] S1. Create a new image with the same graphics as the stamp image in the stamp template file, except that the background is set to transparent. This image is called the stamp base image.

[0083] S2. For each non-transparent pixel on the seal base image, determine whether it is on the border.

[0084] The judgment method is as follows:

[0085] like Figure 5 , the equations of the inner and outer rings and the central ellipse of the seal image ellipse can be expressed as

[0086] Where a, b>>|s| (15)

[0087] Equation (15) is an elliptic curve family with s as a parameter, a is the length of the major axis of the central ellipse, b is the length of the minor axis of the central ellipse, s is the distance between the major axis and minor axis of an ellipse in the elliptic curve family and the major axis and minor axis of the central ellipse respectively, (x c ,y c ) are the coordinates of the center of the ellipse. The curve for s = 0 corresponds to the central ellipse. Once a and b are determined, any point on the plane can belong to an ellipse uniquely identified by s within the family of curves. (x, y) are the coordinates of each point on the elliptical border of the seal image.

[0088] For a given point coordinate (x, y) in the seal image, solve equation (15) to get s. If |s| ≤ w, it means that the point is on the seal border, where w is the width of the seal border W. m Half of (N).

[0089] If the point (x, y) is on the stamp border, proceed to the next step S3, otherwise repeat sub-step S2 for the next point.

[0090] S3. Find the point on the central ellipse that is closest to the point and determine the eccentricity angle of this closest point.

[0091] The equation of the ellipse is expressed in terms of the eccentricity angle as

[0092]

[0093] where t is the eccentricity angle.

[0094] Then the distance from a point (x, y) outside the ellipse to the ellipse is expressed as

[0095]

[0096] Use numerical methods to find the eccentric angle t when D is the minimum value min(D) .

[0097] S4. Calculate the arc length from the eccentric angle.

[0098] The arc length from the right end point of the major axis of the central ellipse to the eccentric angle t in the clockwise direction is expressed as

[0099]

[0100] S5. Figure 6 , the point (x, y) on the seal ellipse corresponds to the point (x′, y′) on the straight strip group. The value of x′ is equal to the arc length S(t), and the value of y′ is equal to the distance s from the point (x, y) to the central ellipse. Thus, for each point (x, y) on the seal border, the corresponding coordinates (x′, y′) on the straight strip group can be calculated according to equations (15) to (18). Then, the color value of the point (x′, y′) on the straight strip group is taken and plotted on the (x, y) point of the seal base image.

[0101] Then return to sub-step S2 to process the next point of the seal base image until all points on the seal image have completed sub-step S2.

[0102] Step 4. Output the coded electronic seal image, which includes the frame containing the coded watermark and the rest of the seal.

[0103] Step 5. Print the coded seal image. In the seal application system, print the electronic seal image onto a paper document.

[0104] Decryption consists of the following steps (see Figure 2 , D1 to D5):

[0105] Step 1. Scan the seal part of the document to obtain the seal scan image

[0106] Step 2. Automatically identify the seal border through image processing algorithms;

[0107] For the seal image, we first obtain the red part and filter out other colors (mainly black text). Then we use the skeleton generation algorithm to refine the red lines. Finally, we use the ellipse detection algorithm to automatically extract the parameters of the ellipse, including the center coordinates (x c ,y c ), the semi-major axis a, the semi-minor axis b, and the clockwise angle α between the semi-major axis and the horizontal line. Since the paper may be slightly misaligned during scanning, it is necessary to consider the small angle between the semi-major axis and the horizontal line when performing ellipse detection.

[0108] The ellipse detection algorithm can adopt the random Hough transform algorithm based on symmetric point search. This algorithm uses the geometric characteristics of the ellipse to reduce the five parameters of the ellipse to one dimension, thereby greatly reducing the amount of calculation.

[0109] Step 3. Stretch the border into strip groups;

[0110] Using the ellipse parameters obtained in step 2, expand the ellipse border into a stripe group. This process is the reverse process of drawing the stripe group to the border when generating the seal code watermark, and is specifically divided into several small steps (Q1 to Q3):

[0111] Q1. Rotate the scanned image counterclockwise by α to obtain a scanned image with the semi-major axis of the ellipse horizontal.

[0112] Q2. Construct a rectangular strip with a width equal to the perimeter of the central ellipse and a height equal to 2d. This strip will be used to store the flattened strip group. 2d is Figure 6 The width of the displayed stamp border.

[0113] Q3. Similar to S5, for each point (x′, y′) on the flattened strip group, the corresponding coordinates (x, y) on the scanned image can be calculated according to equations (15) to (18), and then the color value of the point (x, y) on the scanned image is taken and plotted on the point (x′, y′) of the flattened strip group.

[0114] Step 4. Identify the bit sequence in the stripe group and obtain the CodeString;

[0115] Split the stripe group into multiple stripe rows. For each stripe row, search for the SS flag from left to right. Then, horizontally shift the stripe row so that the SS flag is at the left end of the stripe row. Then, extract the CodeString for that stripe row according to the encoding rules.

[0116] Step 5. Decode the CodeString sequence in combination with the UserKey to obtain the hidden string.

[0117] The UserKey is obtained from the decoded configuration file. It must be the same UserKey used during encoding. The RandomKey and EncodedBits can be extracted from the CodeString. The RandomKey and UserKey are combined into a CombKey, and then the EncodedBits in the CodeString are decoded to obtain the InfoText. Because multiple CodeStrings can be extracted from a single stripe row, this makes the watermark resistant to localized defacement.

Claims

1. An anti-counterfeiting coding method for an electronic seal frame, characterized in that The steps include: Step 1. Use the key to encrypt the plaintext information text to generate an encrypted bit string, and then form the encrypted bit string into a coded binary string; Step 2. Represent the coded binary string as rows of alternating colored and white stripes. The width of the white stripes is fixed and is used to separate the code points. Combine multiple stripe rows into a multi-row stripe group with a row spacing of LD. Fill the gaps between the rows with red. Then, perform a cyclic shift of random length on each row. Step 3. Draw the stripe line on the electronic seal border to generate the coded electronic seal image; The electronic seal frame anti-counterfeiting coding method, wherein: the coded binary string includes 5 data fields, wherein data field A is a random key, data field B is a checksum of the random key, data field C is the number of characters in the information text, data field D is a checksum of data field E, and data field E is an encrypted bit string; The anti-counterfeiting coding method for the electronic seal frame, wherein the coding of the strip line includes the following graphic elements: a narrow colored strip NL, representing a binary 0; a wide colored strip WL, representing a binary 1; a start character SS, the length of SS being much longer than NL and WL; a blank character SL, which is the space between NL, WL, and SS, and is white; In step 3, a stripe group is drawn clockwise along the center line of the seal border. The stripe group is a horizontal strip. The coding pattern in it is a rectangle, while the seal border is a curve. When drawing the stripe group, the stripe group is partially deformed so that the horizontal and vertical edges of the coding pattern are aligned with the tangent and normal of the seal border respectively. The coding pattern is only a few pixels in size. After the alignment operation, its boundary appears jagged. Step 3 includes sub-steps S1 to S6: S1. Create a new image with the same graphics as the seal image in the seal template file, and set the background color to transparent. This image is called the seal base image. S2. For each non-transparent pixel on the stamp base map, determine whether it is on the border. If the point (x, y) is on the stamp border, proceed to the next step S3. Otherwise, repeat substep S2 for the next point. S3. Find the point on the central ellipse closest to the non-transparent pixel and determine the eccentricity angle of the closest point; S4. Calculate arc length from eccentric angle; S5. For a point (x, y) on the seal border, calculate its coordinates (x′, y′) in the straight strip group, where the value of x′ is equal to the arc length S(t), and the value of y′ is equal to the distance s from the point (x, y) to the central ellipse; extract the color value of this point from the straight strip group and plot it at point (x, y) on the seal base image; S6. Return to sub-step S2 and process the next point of the seal base image until all points on the seal image have completed sub-step S2.

2. The electronic seal frame anti-counterfeiting coding method according to claim 1, wherein: The key is a joint key, including a user key and a random key.

Citation Information

Patent Citations

  • Seal embedded information processing method, digital watermark extraction method and seal processing system

    CN111784554A