Method for generating document vector electronic seal based on digital signature

By constructing sentence and paragraph importance indexes and generating highly random k values ​​that are strongly bound to the file, the low security problem caused by the pseudo-randomness of the k value in the existing technology is solved, and the security and uniqueness of the vector electronic seal are improved.

CN120429885BActive Publication Date: 2025-09-19北京点聚信息技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510918714.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-09-19
Estimated Expiration
2045-07-04

AI Technical Summary

Technical Problem

When generating vector electronic seals, the existing technology does not fully consider the pseudo-randomness of the k value, resulting in low security of the digital signature and easy deduction of the private key, which affects the security of the vector electronic seal.

Method used

By constructing the sentence importance index and paragraph importance index, combining the file content characteristics to generate a highly random k value, using the elliptic curve digital signature algorithm to generate a random k value strongly bound to the file, and combining it with user information to generate a vector electronic seal.

Benefits of technology

It improves the security of vector electronic seals, ensures that the digital signature private key cannot be deduced, prevents information leakage and tampering, and enhances the uniqueness and authority of the file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429885B_ABST
    Figure CN120429885B_ABST
Patent Text Reader

Abstract

The present application relates to the field of information security protection technology, and specifically to a method for generating a vector electronic seal for a document based on a digital signature. The method comprises: obtaining an electronic contract to be signed and its user information sequence, as well as multiple historical electronic contracts; obtaining a sentence importance index for each sentence based on the importance of each sentence; obtaining a paragraph importance index for each paragraph based on the number and discreteness of the amount data in each paragraph, the number of date data, the difference in semantic similarity between each paragraph and adjacent paragraphs, and the average level of sentence importance indexes for all sentences in each paragraph, and obtaining an encryption key weight for each paragraph based on the difference between each paragraph and each paragraph in historical electronic contracts; obtaining a k value for an elliptic curve digital signature algorithm based on the encryption key weights and user information sequence of all paragraphs in the electronic contract to be signed. The present application improves the security of the vector electronic seal by obtaining a k value that is strongly bound to the content of the electronic contract to be signed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security protection technology, and in particular to a method for generating a document vector electronic seal based on a digital signature. Background Art

[0002] A digital signature is a security authentication method based on asymmetric encryption technology. Its core is to generate a unique cryptographic identifier for file contents using the sender's private key. This identifier not only verifies whether the file has been tampered with during transmission, but also confirms the signer's identity. Digital signature technology generates a unique hash value based on the file content and embeds this hash value into a vector seal, making each seal unique. This prevents tampering, forgery, and information leakage, ensuring the authority and authenticity of the electronic seal. Therefore, generating a vector seal based on the document information to be signed and combining digital signature technology can effectively enhance the security of electronic seals and documents, preventing information leakage and tampering.

[0003] As a mainstream digital signature method, the elliptic curve digital signature (ECDSA) algorithm is widely used due to its advantages such as short key length, high computational efficiency, and fast signature verification speed. In the process of generating digital signatures, a random parameter k needs to be generated for each signature. However, since secure random numbers are not easy to generate, there is a possibility of generating pseudo-random numbers. Therefore, if the generation of k is not random enough or is reused in different signatures, the private key can be easily deduced, thereby reducing the security of the digital signature. When generating vector electronic seals through the ECDSA algorithm, existing technologies usually only use a generator to randomly generate k values, and do not generate random k values ​​that are strongly bound to the file content based on the file's structural characteristics. This can easily lead to the reuse or prediction of k values, resulting in low security of the file's digital signature, which in turn affects the security of the vector electronic seal. Summary of the Invention

[0004] In order to solve the above technical problems, this application provides a method for generating a document vector electronic seal based on digital signature to solve the existing problems.

[0005] The digital signature-based electronic seal generation method of this application adopts the following technical solutions:

[0006] One embodiment of the present application provides a method for generating a document vector electronic seal based on a digital signature, the method comprising the following steps:

[0007] Obtain the electronic contract to be signed and its user information sequence, as well as multiple historical electronic contracts;

[0008] Obtaining the TF-IDF value of each word in the electronic contract to be signed; classifying all words in the electronic contract to be signed into important words and unimportant words; obtaining the first product of each sentence based on the average and maximum TF-IDF values ​​of all words in each sentence, and combining the distance of each word in each sentence from all important words and all unimportant words to obtain the sentence importance index of each sentence;

[0009] Obtain date data and amount data in the electronic contract to be signed; obtain the first sum of each paragraph based on the proportion of the number of amount data in each paragraph to the total number of amount data in the electronic contract to be signed and the degree of dispersion of all amount data in each paragraph, and obtain the paragraph importance index of each paragraph based on the difference in semantic similarity between each paragraph and adjacent paragraphs, the proportion of the number of date data in each paragraph to the total number of date data in the electronic contract to be signed, and the average level of sentence importance index of all sentences in each paragraph, and obtain the encryption key weight of each paragraph in the electronic contract to be signed based on the degree of dispersion and the average level of the maximum value of the similarity between each paragraph in the electronic contract to be signed and all paragraphs in historical electronic contracts;

[0010] According to the encryption key weights of all paragraphs in the electronic contract to be signed and the user information sequence, the characteristic hash value and file hash value of the electronic contract to be signed are obtained, and then the k value of the elliptic curve digital signature algorithm is obtained.

[0011] Preferably, the specific process of dividing all words in the electronic contract to be signed into important words and unimportant words is: all words in the electronic contract to be signed whose TF-IDF values ​​are greater than or equal to a preset segmentation threshold are recorded as important words, and the remaining words are recorded as unimportant words.

[0012] Preferably, the first product of each sentence refers to the product of the mean and maximum TF-IDF values ​​of all words in each sentence.

[0013] Preferably, the calculation formula for the sentence importance index of each sentence is: Where, is the statement importance index of the vth statement, is the first product of the vth statement, is the first ratio of the i-th word in the v-th sentence, and r is the total number of words in the v-th sentence; wherein, the calculation process of the first ratio of the i-th word is: record the average of the normalized Google distances between the i-th word and all important words as m1, record the average of the normalized Google distances between the i-th word and all non-important words as m2, and record the ratio of m2 to m1 as the first ratio of the i-th word.

[0014] Preferably, the process of obtaining the first sum value of each paragraph is: calculating the ratio of the number of amount data in each paragraph to the number of all amount data in the electronic contract to be signed, as well as the degree of dispersion of all amount data in each paragraph, and recording the sum of the ratio and the degree of dispersion as the first sum value of each paragraph.

[0015] Preferably, the calculation formula for the paragraph importance index of each paragraph is: Where, is the paragraph importance index of the u-th paragraph, is the mean of the sentence importance indexes of all sentences in the u-th paragraph, is the ratio of the number of date data in the u-th paragraph to the number of all date data in the electronic contract to be signed, is the first sum value of the u-th paragraph, is the first difference of the u-th paragraph, is a preset constant; wherein, the process of obtaining the first difference value of the u-th paragraph is: respectively calculating the Jaccard similarity between the u-th paragraph and the u-1-th paragraph, and between the u-th paragraph and the u+1-th paragraph, and recording the absolute difference between the two Jaccard similarities as the first difference value of the u-th paragraph.

[0016] Preferably, the process of obtaining the encryption key weight of each paragraph in the electronic contract to be signed is:

[0017] Obtaining a second ratio of each paragraph in the electronic contract to be signed based on the degree of dispersion and average of the maximum value of the similarity between each paragraph in the electronic contract to be signed and all paragraphs in each historical electronic contract;

[0018] The product of the paragraph importance index of each paragraph in the electronic contract to be signed and the second ratio is used as the encryption key weight of each paragraph in the electronic contract to be signed.

[0019] Preferably, the process of obtaining the second ratio of each paragraph in the electronic contract to be signed is: calculating the Jaccard similarity between a single paragraph in the electronic contract to be signed and each paragraph in a single historical electronic contract, and recording the maximum value of all Jaccard similarities as the paragraph similarity between the single paragraph in the electronic contract to be signed and the single historical electronic contract; calculating the dispersion and mean of the paragraph similarities between each paragraph in the electronic contract to be signed and all historical electronic contracts, and recording the ratio of the dispersion to the mean as the second ratio of each paragraph in the electronic contract to be signed.

[0020] Preferably, the specific process of obtaining the characteristic hash value and file hash value of the electronic contract to be signed is: arranging the encryption key weights of each paragraph in the electronic contract to be signed according to the arrangement order of each paragraph to obtain the encryption key sequence of the electronic contract to be signed; splicing the encryption key sequence of the electronic contract to be signed with the user information sequence, and converting the spliced ​​sequence into a binary code sequence through UTF-8 encoding technology; using the binary code sequence and the electronic contract to be signed as inputs of the hash function respectively to obtain the characteristic hash value and file hash value of the electronic contract to be signed.

[0021] Preferably, the specific process of obtaining the k value of the elliptic curve digital signature algorithm is: using the characteristic hash value of the electronic contract to be signed and the file hash value as the entropy source, using the user's private key as the HMAC key, and performing HMAC-SHA256 operation to generate a mixed entropy source; inputting the mixed entropy source into a pseudo-random number generator to output a random byte stream; converting the random byte stream into a decimal integer, and using the integer to take the remainder n, and taking the value after adding 1 to the obtained remainder as the k value of the elliptic curve digital signature algorithm; wherein n is the order of the elliptic curve digital signature algorithm.

[0022] This application has at least the following beneficial effects:

[0023] This application addresses the problem that the existing technology does not fully consider the pseudo-randomness of the k value, which leads to security risks in the vector electronic seal of the document. By constructing a sentence importance index, it can reflect the semantic relevance of each sentence to the overall theme of the document, thereby providing data support for the evaluation of the importance of subsequent paragraphs; by constructing a paragraph importance index, it can reflect the comprehensive importance of the coherence between each paragraph and the context; by constructing an encryption key weight to reflect the personalized characteristics of each paragraph and its security value as a random number entropy source, it can effectively generate a high random k value that is strongly bound to the file, thereby ensuring that the digital signature private key cannot be deduced and the uniqueness of the vector electronic seal, thereby improving the security of the vector electronic seal. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0025] Figure 1 A flowchart of the steps of the method for generating a document vector electronic seal based on a digital signature provided in this application;

[0026] Figure 2Flowchart for obtaining the encryption key weights of each paragraph in the electronic contract to be signed provided by this application. Detailed implementation manners

[0027] In order to further elaborate on the technical means and effects adopted by this application to achieve the intended invention purpose, the following combines the accompanying drawings and preferred embodiments to elaborate in detail on the specific implementation manners, structures, features and effects of the method for generating a digital signature-based file vector electronic seal proposed according to this application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs.

[0029] The following specifically describes the specific solution of the method for generating a digital signature-based file vector electronic seal provided by this application with reference to the accompanying drawings.

[0030] A method for generating a digital signature-based file vector electronic seal provided by an embodiment of this application. Specifically, the following method for generating a digital signature-based file vector electronic seal is provided. Please refer to Figure 1 , and the method includes the following steps:

[0031] Step 1: Obtain the electronic contract to be signed and its user information sequence, as well as multiple historical electronic contracts.

[0032] This application takes the electronic lease contract to be signed as an example for the generation process of the vector electronic seal. Obtain the electronic lease contract to be signed (hereinafter referred to as 'electronic contract to be signed') and N historical electronic contracts. Remove punctuation marks and meaningless characters such as 'de', 'a' in the electronic contract to be signed and historical electronic contracts through a regular matching algorithm, and then segment all electronic contracts through a word segmentation tool. In this embodiment, N is taken as 30. It should be noted that: the N historical electronic contracts can be different types of electronic contracts, such as houses, electronic products, and household goods.

[0033] In addition, obtain the identity identification information of the user in the electronic contract to be signed, such as name, gender, mobile phone number, address information, and construct a user information sequence based on this.

[0034] Step 2: Obtain the TF-IDF value of each word in the electronic contract to be signed; divide all words in the electronic contract to be signed into important words and unimportant words; obtain the first product of each sentence based on the average level and maximum value of the TF-IDF values ​​of all words in each sentence, and combine the distance of each word in each sentence with all important words and all unimportant words to obtain the sentence importance index of each sentence.

[0035] To generate a random k value tied to the document based on its content, semantic analysis of the electronic contract is necessary. Each statement in an electronic contract contributes to the overall meaning of the contract, but the degree of influence varies. For example, statements concerning key content such as the lease amount and liability for breach of contract are of higher importance, while transitional statements or background descriptions are of lower importance. Therefore, a significance analysis of each statement can be performed to provide data support for the subsequent generation of the k value, thereby generating a unique vector electronic seal.

[0036] Take the sentence in Article V of the electronic contract to be signed as an example for analysis.

[0037] First, we can analyze whether the sentence in Article V is consistent with the subject matter that the entire electronic contract intends to express, thereby preliminarily analyzing the semantic importance of the sentence in Article V in the document.

[0038] The TF-IDF algorithm uses all the words in the electronic contract to be signed as input. The output of the TF-IDF algorithm is the TF-IDF value corresponding to each word in the electronic contract to be signed. The larger the TF-IDF value of a word, the more likely it is to be a keyword in the electronic contract. The TF-IDF algorithm is well known and will not be described in detail here.

[0039] The first product for sentence v is the product of the mean and maximum TF-IDF values ​​of all words in sentence v. This first product takes into account the maximum and average criticality of the words in sentence v. A larger value indicates greater importance of sentence v in the electronic contract.

[0040] Furthermore, the TF-IDF values ​​of all words in the electronic contract to be signed are used as input to the Otsu threshold method. The output of the Otsu threshold method is the segmentation threshold, which is recorded as the preset segmentation threshold. All words in the electronic contract to be signed with a TF-IDF value greater than or equal to the preset segmentation threshold are recorded as important words, and the remaining words are recorded as unimportant words. The Otsu threshold method can distinguish the importance of all words in the electronic contract to be signed, thereby providing data support for subsequent analysis of the importance of sentences.

[0041] Taking the i-th word in the v-th sentence of the electronic contract to be signed as an example, let m1 be the mean of the normalized Google distances between the i-th word and all important words, m2 be the mean of the normalized Google distances between the i-th word and all unimportant words, and let m2 be the ratio of m2 to m1 be the first ratio of the i-th word. Normalized Google distance can calculate the semantic similarity between two words. A smaller distance indicates a higher degree of co-occurrence and a higher degree of semantic consistency. Therefore, the first ratio can reflect the difference in semantic similarity between the i-th word and important and unimportant words. A larger value indicates that the semantic similarity between the i-th word and important words in the electronic contract is far greater than that between the i-th word and unimportant words, and the i-th word is closer to the semantic content of the electronic contract. Normalized Google distance is a well-known technique and will not be discussed in detail here.

[0042] As a preferred embodiment, the sentence importance index of each sentence is obtained based on the first product of each sentence, as well as the distance between each word in each sentence and all important words and the distance between each word and all non-important words, to characterize the degree of matching between each sentence and the semantic content of the electronic contract to be signed.

[0043] In this embodiment, the sentence importance index of the vth sentence is recorded as , its specific expression is: Where, is the statement importance index of the vth statement, is the first product of the vth statement, is the first ratio of the i-th word in the v-th sentence, and r is the total number of words in the v-th sentence.

[0044] The sentence importance index can reflect the degree of matching between the sentence in clause v and the semantic content of the electronic contract to be signed. The larger the value, the greater the importance of clause v in the electronic contract to be signed.

[0045] Step 3: Obtain the date data and amount data in the electronic contract to be signed; obtain the first sum value of each paragraph based on the proportion of the number of amount data in each paragraph in the total number of amount data in the electronic contract to be signed and the degree of dispersion of all amount data in each paragraph, and obtain the paragraph importance index of each paragraph in combination with the difference in semantic similarity between each paragraph and the adjacent paragraphs, the proportion of the number of date data in each paragraph in the total number of date data in the electronic contract to be signed, and the average level of sentence importance index of all sentences in each paragraph, and obtain the encryption key weight of each paragraph in the electronic contract to be signed in combination with the degree of dispersion and the average level of the maximum value of the similarity between each paragraph in the electronic contract to be signed and all paragraphs in each historical electronic contract.

[0046] Furthermore, electronic contracts often contain a large number of sentences, and a paragraph is a collection of interrelated sentences, often carrying a relatively complete sub-topic or clause. Therefore, evaluating the importance of paragraphs can capture the semantic continuity and discourse logic across sentences, thereby more comprehensively capturing the distribution characteristics of key content in electronic contracts, and then generating a hash value that is more consistent with the document content, and thus generating a vector electronic seal.

[0047] Take the u-th paragraph in the electronic contract to be signed as an example for analysis.

[0048] We can further analyze whether the u-th paragraph is a transitional paragraph by analyzing the degree of content relevance between the u-th paragraph and the context. Since the core content of the same topic is consistent, adjacent paragraphs in the same topic will have more common vocabulary.

[0049] Calculate the Jaccard similarity between the u-th paragraph and the u-1-th paragraph, and between the u-th paragraph and the u+1-th paragraph, and record the absolute difference between the two Jaccard similarities as the first difference of the u-th paragraph. The first difference reflects the degree of connection between paragraphs. A larger value means that the u-th paragraph has a significant difference in content relevance to the context, and the more likely it is a transitional paragraph, the lower its importance. It should be noted that if the u-th paragraph is at the beginning and end of the electronic contract, and only one side has paragraphs, then the first difference of the u-th paragraph is equal to the first difference of the paragraph adjacent to the u-th paragraph.

[0050] Furthermore, in electronic lease contracts, amount and time are two key parameters. Amount directly affects the economic value of the contract and the distribution of benefits between the two parties, while time influences the execution schedule and the duration of the fulfillment of rights and obligations. Therefore, the importance of a paragraph can be further assessed by analyzing the richness of numerical information within the paragraph.

[0051] Using Python's date parsing function, dateparser.parse(), we retrieve all date data from the electronic contract to be signed. Using regular expressions, we retrieve all monetary amounts from the electronic contract to be signed and convert them to lowercase numbers for output (for example, if we input: transaction amount ¥5,000, down payment ¥1,000, liquidated damages ¥1,000; the output is 5,000, 5,000, 1,000, 1,000). The dateparser.parse() function and regular expressions are well-known techniques and will not be further described here.

[0052] Calculate the ratio (t1) of the number of monetary amounts in the u-th paragraph to the total number of monetary amounts in the electronic contract to be signed, as well as the degree of dispersion (t2) across all monetary amounts in the u-th paragraph. The sum of the ratio (t1) and the degree of dispersion (t2) is recorded as the first sum of the u-th paragraph. The ratio (t1) reflects the proportion of monetary amounts in the u-th paragraph in the electronic contract; the degree of dispersion (t2) reflects the inconsistency of the monetary amounts in the u-th paragraph. Higher inconsistencies indicate greater discrepancies in the amounts involved in the u-th paragraph, and are more likely to involve multiple payment nodes, expense items, or complex financial arrangements. A larger first sum indicates that the u-th paragraph contains both richer and more complex monetary content within the entire electronic contract, and therefore more important.

[0053] As a preferred implementation, based on the first sum and first difference of each paragraph, the proportion of the number of date data in each paragraph in the total number of date data in the electronic contract to be signed, and the average level of the sentence importance index of all sentences in each paragraph, the paragraph importance index of each paragraph is obtained to characterize the relative importance of each paragraph in the entire electronic contract to be signed.

[0054] In this embodiment, the paragraph importance index of the u-th paragraph is recorded as , its specific expression is: Where, is the paragraph importance index of the u-th paragraph, is the mean of the sentence importance indexes of all sentences in the u-th paragraph, is the ratio of the number of date data in the u-th paragraph to the number of all date data in the electronic contract to be signed, is the first sum value of the u-th paragraph, is the first difference of the u-th paragraph, It is a preset constant. In order to avoid the denominator being 0, its value range is [0.001, 0.01]. In this embodiment, it is 0.005. The implementer can choose the value at his own discretion.

[0055] It can reflect the relative importance of the time-related content of the u-th paragraph in the electronic contract to be signed. It can reflect the relative importance of the u-th paragraph in the entire electronic contract to be signed. The larger the value, the more important the u-th paragraph is compared with other paragraphs. Therefore, when generating the k value of the digital signature and the vector electronic seal based on the file content, it is more necessary to consider the content of the u-th paragraph.

[0056] Furthermore, since electronic lease contracts vary in type and format, and different types of electronic contracts carry different meanings, paragraph u in the electronic contract to be signed can be compared with the content in other electronic lease contracts. If paragraph u's semantics are highly consistent with, or appear in, multiple contracts, then it is more likely that paragraph u is a common template clause, and its importance should be reduced. Conversely, if paragraph u's content is more personalized, then its importance should be increased.

[0057] Take the qth historical electronic contract as an example.

[0058] The Jaccard similarity between the u-th paragraph in the electronic contract to be signed and each paragraph in the q-th historical electronic contract is calculated sequentially. The maximum value of all Jaccard similarities is recorded as the paragraph similarity between the u-th paragraph and the q-th historical electronic contract. Paragraph similarity can reflect the semantic similarity or overlap between the u-th paragraph and the q-th historical electronic contract.

[0059] Similarly, we obtain the paragraph similarity between the u-th paragraph and all historical electronic contracts. We calculate the dispersion and mean of all paragraph similarities, and record the ratio of the dispersion to the mean as the second ratio for the u-th paragraph in the electronic contract to be signed. A larger second ratio indicates a greater difference between all paragraph similarities and a lower overall paragraph similarity, reflecting a lower degree of semantic overlap between the u-th paragraph and the majority of electronic contracts, and thus indicating a more personalized content in the u-th paragraph.

[0060] The product of the paragraph importance index of the u-th paragraph and the second ratio is recorded as the encryption key weight of the u-th paragraph. The encryption key weight can comprehensively reflect the importance of the u-th paragraph in the electronic contract to be signed. The larger the value, the more important the content reflected in the u-th paragraph. The flowchart for obtaining the encryption key weight of each paragraph in the electronic contract to be signed is as follows: Figure 2 shown.

[0061] Step 4: Based on the encryption key weights of all paragraphs in the electronic contract to be signed and the user information sequence, obtain the characteristic hash value and file hash value of the electronic contract to be signed, and then obtain the k value of the elliptic curve digital signature algorithm.

[0062] The encryption key weights of each paragraph in the electronic contract to be signed are arranged in the order of the paragraphs to obtain the encryption key sequence for the electronic contract to be signed. The encryption key sequence is concatenated with the user information sequence. Because the concatenated sequence contains numbers and Chinese characters, it is converted into a binary encoding sequence using UTF-8 encoding technology. Sequence concatenation and encoding conversion are well-known techniques and will not be further described here.

[0063] The binary code sequence is used as input to a hash function, and the output is a characteristic hash value of the electronic contract to be signed. This value combines the content distribution characteristics of the electronic contract to be signed with user information. The electronic contract to be signed is used as input to a hash function, and the output is a file hash value of the electronic contract to be signed. Hash functions are not limited to SHA-256, SHA-1, MD5, etc.; this embodiment uses the SHA-256 function.

[0064] The signature hash value of the electronic contract to be signed and the hash value of the document are used as entropy sources. Using the user's private key as the HMAC key, an HMAC-SHA256 operation is performed to generate a mixed entropy source. This entropy source is input into the HMAC_DRBG pseudorandom number generator (compliant with NIST SP 800-90A), which outputs a high-strength random byte stream. This byte stream is converted to a decimal integer and the remainder of this integer is calculated with respect to n. The remainder has a value range of [0, n-1]. The value k, which is added by 1, is used to obtain the document-bound k value mapped to the interval [1, n]. Here, n is the order of the ECDSA algorithm.

[0065] Compared to random numbers generated by conventional generators, the k value in this application combines both file characteristics and user private key information. Without knowing the private key, attackers cannot derive k, effectively mitigating the security risks of pseudo-random numbers. Furthermore, the k value is strongly bound to the contract content and user identity. Even if the content or user identity changes slightly, k will be different. Even if an attacker obtains multiple signatures, it will be difficult to infer the private key by analyzing the k value. This improves the security of subsequent digital signatures, ensures the uniqueness of vector electronic seals, and protects electronic contracts from tampering.

[0066] The ECDSA algorithm takes the private key, k value, and the hash value of the electronic contract to be signed as input, and the algorithm outputs the digital signature of the user's corresponding electronic contract to be signed. After obtaining the digital signature, the digital signature and the characteristic hash value of the electronic contract are encoded into the coordinates of the vector electronic seal graphic path through digital watermarking technology, thereby generating a unique vector electronic seal that contains both the digital signature and the characteristic hash value, thereby ensuring the security of the file and the vector electronic seal.

[0067] Signature verification: When the recipient receives the electronic contract and vector electronic seal, signature verification is required, that is, the vector electronic seal is verified using the public key of the sender's signature user: the overall integrity of the file and the user's identity information are verified based on the digital signature, and the file is verified whether it has been tampered with based on the characteristic hash value, thereby preventing the risk of user signature denial and electronic contract tampering.

[0068] It should be noted that the order in which the embodiments of the present application are presented is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. Furthermore, the foregoing descriptions of specific embodiments of this specification are provided. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential sequence shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0069] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0070] The above-described embodiments are only used to illustrate the technical solutions of the present application, and not to limit them. Modifications to the technical solutions described in the aforementioned embodiments, or equivalent replacements of some of the technical features therein, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A method for generating a document vector electronic seal based on a digital signature, characterized in that: The method comprises the following steps: Obtain the electronic contract to be signed and its user information sequence, as well as multiple historical electronic contracts; Obtaining the TF-IDF value of each word in the electronic contract to be signed; classifying all words in the electronic contract to be signed into important words and unimportant words; multiplying the average and maximum TF-IDF values ​​of all words in each sentence as the first product of each sentence, and combining the distance of each word in each sentence from all important words and all unimportant words to obtain the sentence importance index of each sentence; Obtain date data and amount data in the electronic contract to be signed; obtain the first sum of each paragraph based on the proportion of the number of amount data in each paragraph to the total number of amount data in the electronic contract to be signed and the degree of dispersion of all amount data in each paragraph, and obtain the paragraph importance index of each paragraph based on the difference in semantic similarity between each paragraph and adjacent paragraphs, the proportion of the number of date data in each paragraph to the total number of date data in the electronic contract to be signed, and the average level of sentence importance index of all sentences in each paragraph, and obtain the encryption key weight of each paragraph in the electronic contract to be signed based on the degree of dispersion and the average level of the maximum value of the similarity between each paragraph in the electronic contract to be signed and all paragraphs in historical electronic contracts; According to the encryption key weights of all paragraphs in the electronic contract to be signed and the user information sequence, the characteristic hash value and file hash value of the electronic contract to be signed are obtained, and then the k value of the elliptic curve digital signature algorithm is obtained; The calculation formula of the sentence importance index of each sentence is: Where, is the statement importance index of the vth statement, is the first product of the vth statement, is the first ratio of the i-th word in the v-th sentence, and r is the total number of words in the v-th sentence; wherein, the calculation process of the first ratio of the i-th word is: record the average of the normalized Google distances between the i-th word and all important words as m1, record the average of the normalized Google distances between the i-th word and all non-important words as m2, and record the ratio of m2 to m1 as the first ratio of the i-th word.

2. The method for generating a document vector electronic seal based on a digital signature as claimed in claim 1, wherein: The specific process of dividing all the words in the electronic contract to be signed into important words and unimportant words is: all words in the electronic contract to be signed whose TF-IDF values ​​are greater than or equal to a preset segmentation threshold are recorded as important words, and the remaining words are recorded as unimportant words.

3. The method for generating a document vector electronic seal based on a digital signature as claimed in claim 1, wherein: The process of obtaining the first sum value of each paragraph is: calculating the ratio of the number of amount data in each paragraph to the number of all amount data in the electronic contract to be signed, as well as the degree of dispersion of all amount data in each paragraph, and recording the sum of the ratio and the degree of dispersion as the first sum value of each paragraph.

4. The method for generating a document vector electronic seal based on a digital signature as claimed in claim 1, wherein: The calculation formula of the paragraph importance index of each paragraph is: Where, is the paragraph importance index of the u-th paragraph, is the mean of the sentence importance indexes of all sentences in the u-th paragraph, is the ratio of the number of date data in the u-th paragraph to the number of all date data in the electronic contract to be signed, is the first sum value of the u-th paragraph, is the first difference of the u-th paragraph, is a preset constant; wherein, the process of obtaining the first difference value of the u-th paragraph is: respectively calculating the Jaccard similarity between the u-th paragraph and the u-1-th paragraph, and between the u-th paragraph and the u+1-th paragraph, and recording the absolute difference between the two Jaccard similarities as the first difference value of the u-th paragraph.

5. The method for generating a document vector electronic seal based on a digital signature as claimed in claim 1, wherein: The process of obtaining the encryption key weight of each paragraph in the electronic contract to be signed is as follows: Obtaining a second ratio of each paragraph in the electronic contract to be signed based on the degree of dispersion and average of the maximum value of the similarity between each paragraph in the electronic contract to be signed and all paragraphs in each historical electronic contract; The product of the paragraph importance index of each paragraph in the electronic contract to be signed and the second ratio is used as the encryption key weight of each paragraph in the electronic contract to be signed.

6. The method for generating a document vector electronic seal based on a digital signature as claimed in claim 5, wherein: The process of obtaining the second ratio of each paragraph in the electronic contract to be signed is as follows: calculating the Jaccard similarity between a single paragraph in the electronic contract to be signed and each paragraph in a single historical electronic contract, and recording the maximum value of all Jaccard similarities as the paragraph similarity between the single paragraph in the electronic contract to be signed and the single historical electronic contract; calculating the dispersion and mean of the paragraph similarities between each paragraph in the electronic contract to be signed and all historical electronic contracts, and recording the ratio of the dispersion to the mean as the second ratio of each paragraph in the electronic contract to be signed.

7. The method for generating a document vector electronic seal based on a digital signature as claimed in claim 1, wherein: The specific process of obtaining the characteristic hash value and file hash value of the electronic contract to be signed is as follows: arranging the encryption key weights of each paragraph in the electronic contract to be signed according to the arrangement order of each paragraph to obtain the encryption key sequence of the electronic contract to be signed; splicing the encryption key sequence of the electronic contract to be signed with the user information sequence, and converting the spliced ​​sequence into a binary code sequence through UTF-8 encoding technology; using the binary code sequence and the electronic contract to be signed as inputs of the hash function respectively, to obtain the characteristic hash value and file hash value of the electronic contract to be signed.

8. The method for generating a document vector electronic seal based on a digital signature as claimed in claim 1, wherein: The specific process of obtaining the k value of the elliptic curve digital signature algorithm is as follows: using the characteristic hash value of the electronic contract to be signed and the file hash value as entropy sources, using the user's private key as the HMAC key, and performing an HMAC-SHA256 operation to generate a mixed entropy source; inputting the mixed entropy source into a pseudo-random number generator to output a random byte stream; converting the random byte stream into a decimal integer, and using the integer to take the remainder n, and adding 1 to the obtained remainder as the k value of the elliptic curve digital signature algorithm; wherein n is the order of the elliptic curve digital signature algorithm.

Citation Information

Patent Citations

  • Identity-based electronic signature implementation method and device

    CN104579661A

  • Contract confirmation method and device, electronic equipment and storage medium

    CN110069594A