CN117521605B - Electronic signature method and system for OFD format file - Google Patents

Electronic signature method and system for OFD format file Download PDF

Info

Publication number
CN117521605B
CN117521605B CN202410008436.9A CN202410008436A CN117521605B CN 117521605 B CN117521605 B CN 117521605B CN 202410008436 A CN202410008436 A CN 202410008436A CN 117521605 B CN117521605 B CN 117521605B
Authority
CN
China
Prior art keywords
electronic signature
candidate
dimensional matrix
matrix
ofd
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410008436.9A
Other languages
Chinese (zh)
Other versions
CN117521605A (en
Inventor
沙伏生
孙肖辉
庄玉龙
张伟
朱静宇
杨瑞钦
陆猛
郭尚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dianju Information Technology Co ltd
Original Assignee
Beijing Dianju Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dianju Information Technology Co ltd filed Critical Beijing Dianju Information Technology Co ltd
Priority to CN202410008436.9A priority Critical patent/CN117521605B/en
Publication of CN117521605A publication Critical patent/CN117521605A/en
Application granted granted Critical
Publication of CN117521605B publication Critical patent/CN117521605B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/14Fourier, Walsh or analogous domain transformations, e.g. Laplace, Hilbert, Karhunen-Loeve, transforms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Abstract

The invention relates to the technical field of user authentication, in particular to an electronic signature method and an electronic signature system for an OFD format file, wherein the method comprises the following steps: performing data conversion on the obtained OFD format file; performing Fourier transform on the initial two-dimensional matrix, and screening out a preset number of element positions from the frequency domain two-dimensional matrix; adding the electronic signature to the frequency domain two-dimensional matrix, moving the electronic signature, and performing inverse Fourier transform on the matrix when the electronic signature moves to each candidate position; determining a target deviation index corresponding to each candidate position; screening out a candidate position with the minimum target deviation index as a target position; and converting the signature matrix corresponding to the target position into an OFD format file with the electronic signature. The invention realizes the capping of the electronic signature of the OFD format file, thereby realizing the user authentication, improving the rationality of the setting of the electronic signature position and reducing the loss of the text information to a certain extent.

Description

Electronic signature method and system for OFD format file
Technical Field
The invention relates to the technical field of user authentication, in particular to an electronic signature method and an electronic signature system for an OFD format file.
Background
To ensure the validity and irremovable nature of the electronic signature, it is often necessary to establish the electronic signature in the frequency domain. Because the position of the electronic signature in the two-dimensional frequency domain often affects the information retention degree of the original file, the position selection of the electronic signature in the two-dimensional frequency domain is important. Currently, when an electronic signature is selected in a two-dimensional frequency domain, the following general method is adopted: taking the preset position as the position of the electronic signature in the two-dimensional frequency domain, and adding the electronic signature at the preset position.
However, when an electronic signature is added at a preset position, there are often the following technical problems:
because the preset position is often an electronic signature position set by a user based on subjective experience or randomly, the setting of the electronic signature position is often unreasonable, and after the electronic signature position is finally converted into an OFD format file, partial text information can be lost, so that the file content is incomplete.
Disclosure of Invention
The summary of the invention is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. The summary of the invention is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In order to solve the technical problem of text information loss caused by unreasonable setting of the electronic signature position, the invention provides an electronic signature method and an electronic signature system of an OFD format file.
In a first aspect, the present invention provides an electronic signature method for an OFD format file, where the method includes:
acquiring an OFD format file, and performing data conversion on the OFD format file to obtain an initial two-dimensional matrix;
performing Fourier transform on the initial two-dimensional matrix to obtain a frequency domain two-dimensional matrix, and screening a preset number of element positions from the frequency domain two-dimensional matrix according to the amplitude value to serve as candidate positions;
adding the electronic signature to a frequency domain two-dimensional matrix, moving the electronic signature, and performing inverse Fourier transform on the matrix when the electronic signature moves to each candidate position to obtain a signature matrix corresponding to each candidate position;
determining a target deviation index corresponding to each candidate position according to the initial two-dimensional matrix and the signature matrix corresponding to each candidate position;
screening candidate positions with the minimum target deviation index from all candidate positions to serve as target positions;
and converting the signature matrix corresponding to the target position into an OFD format file with the electronic signature.
Optionally, the selecting, according to the magnitude, a preset number of element positions from the frequency domain two-dimensional matrix as candidate positions includes:
screening out the element position with the minimum amplitude from the frequency domain two-dimensional matrix to be used as a reference position;
according to the reference position, carrying out target number wheel position screening on the frequency domain two-dimensional matrix to obtain target number candidate positions, wherein the target number is equal to the preset number minus one; each round of position screening includes: determining phase amplitude differences corresponding to each neighborhood position in a preset neighborhood corresponding to the mark position; determining a neighborhood position with the minimum phase amplitude difference in a preset neighborhood corresponding to the marking position as a candidate position; the marked position is the candidate position obtained by screening the reference position or the previous round of position;
the reference position is noted as a candidate position.
Optionally, determining the phase amplitude difference corresponding to each neighborhood position in the preset neighborhood corresponding to the marker position includes:
and determining the phase amplitude difference corresponding to the neighborhood position according to the phase difference and the amplitude difference between the mark position and the neighborhood position.
Optionally, the formula corresponding to the phase amplitude difference corresponding to the neighborhood position in the preset neighborhood corresponding to the marker position is:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Is the ith in the preset neighborhood corresponding to the marking positionPhase amplitude differences corresponding to the neighborhood positions; i is a sequence number of a neighborhood position in a preset neighborhood corresponding to the marking position; a is a preset weight coefficient, and the value range is [0,1 ]];/>Is the amplitude difference between the mark position and the i-th neighborhood position in the preset neighborhood corresponding to the mark position; />Is the phase difference between the marker position and the i-th neighborhood position in the corresponding preset neighborhood.
Optionally, the determining, according to the initial two-dimensional matrix and the signature matrix corresponding to each candidate position, the target deviation index corresponding to each candidate position includes:
determining an initial deviation index corresponding to the candidate position according to the initial two-dimensional matrix and all elements in the signature matrix corresponding to the candidate position;
and determining a target deviation index corresponding to the candidate position according to a preset positive coefficient and an initial deviation index corresponding to the candidate position.
Optionally, the formula corresponding to the initial deviation index corresponding to the candidate position is:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Is the initial deviation index corresponding to the j candidate position; j is the sequence number of the candidate location; h is the average value of all elements in the initial two-dimensional matrix; />Is the average value of all elements in the signature matrix corresponding to the jth candidate position; n is the number of elements in the initial two-dimensional matrix or signature matrix; />Is the b-th element in the initial two-dimensional matrix; />Is the b element in the signature matrix corresponding to the j candidate position; b is the sequence number of the element in the initial two-dimensional matrix or signature matrix.
Optionally, the determining, according to a preset positive coefficient and an initial deviation index corresponding to the candidate position, a target deviation index corresponding to the candidate position includes:
and determining the product of the preset positive coefficient and the initial deviation index corresponding to the candidate position as the target deviation index corresponding to the candidate position.
Optionally, the performing data conversion on the OFD layout file to obtain an initial two-dimensional matrix includes:
and extracting page contents of the OFD layout file through an OFD analysis library, rendering the page contents into a two-dimensional matrix, and determining the two-dimensional matrix obtained by rendering as an initial two-dimensional matrix.
Optionally, the converting the signature matrix corresponding to the target position into the OFD format file with the electronic signature includes:
and extracting the content in the signature matrix corresponding to the target position through optical character recognition, integrating the extracted content into an OFD document, and determining the finally integrated OFD document as an OFD format file with the electronic signature.
In a second aspect, the present invention provides an electronic signature system for an OFD format file, including a processor and a memory, where the processor is configured to process instructions stored in the memory to implement an electronic signature method for an OFD format file.
The invention has the following beneficial effects:
according to the electronic signature method for the OFD format file, the electronic signature of the OFD format file is capped, so that user identification is realized, the technical problem of text information loss caused by unreasonable setting of the electronic signature position is solved, the rationality of setting of the electronic signature position is improved, and the text information loss is reduced to a certain extent. Firstly, performing data conversion on the obtained OFD format file to obtain an initial two-dimensional matrix, and facilitating subsequent conversion to a frequency domain for analysis. Then, since the electronic signature is often capped in the frequency domain, fourier transformation is performed on the initial two-dimensional matrix to obtain the frequency domain two-dimensional matrix, so that the subsequent capping of the electronic signature can be facilitated. Secondly, because the magnitude is often related to the importance degree of the information, when a plurality of candidate positions are screened from the frequency domain two-dimensional matrix based on the magnitude, the selection of the position containing the important information can be avoided as far as possible, and the change of elements in the corresponding matrix caused by the embedding of the subsequent electronic signature can be as small as possible. Then, by comprehensively considering the initial two-dimensional matrix and the signature matrix corresponding to the candidate position, the target deviation index corresponding to the candidate position can be quantified, and the larger the target deviation index is, the larger the target deviation index tends to indicate that the larger the change of the data characteristics before and after the electronic signature is added to the candidate position is, the more likely the text information is lost is indicated, and the more unsuitable the candidate position is used as the embedding position of the electronic signature. Thus, the candidate location with the smallest target deviation index is often the relatively most appropriate embedded location for the electronic signature among all candidate locations. Finally, converting the signature matrix corresponding to the target position into an OFD format file with the electronic signature, and realizing the electronic signature of the OFD format file.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an electronic signature method of an OFD layout file according to the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the present invention to achieve the preset purpose, the following detailed description is given below of the specific implementation, structure, features and effects of the technical solution according to the present invention with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The invention provides an electronic signature method of an OFD format file, which comprises the following steps:
acquiring an OFD format file, and performing data conversion on the OFD format file to obtain an initial two-dimensional matrix;
performing Fourier transform on the initial two-dimensional matrix to obtain a frequency domain two-dimensional matrix, and screening out a preset number of element positions from the frequency domain two-dimensional matrix according to the amplitude value to serve as candidate positions;
adding the electronic signature to a frequency domain two-dimensional matrix, moving the electronic signature, and performing inverse Fourier transform on the matrix when the electronic signature moves to each candidate position to obtain a signature matrix corresponding to each candidate position;
determining a target deviation index corresponding to each candidate position according to the initial two-dimensional matrix and the signature matrix corresponding to each candidate position;
screening candidate positions with the minimum target deviation index from all candidate positions to serve as target positions;
and converting the signature matrix corresponding to the target position into an OFD format file with the electronic signature.
The following detailed development of each step is performed:
referring to fig. 1, a flow of some embodiments of an electronic signature method of an OFD layout file of the present invention is shown. The electronic signature method of the OFD format file comprises the following steps:
step S1, an OFD format file is obtained, and data conversion is carried out on the OFD format file to obtain an initial two-dimensional matrix.
In some embodiments, an office Document (OFD) layout file may be obtained, and the OFD layout file may be subjected to data conversion to obtain an initial two-dimensional matrix.
The OFD format file, also called OFD file, is an office document format, and can be used for storing and presenting electronic documents.
It should be noted that the signer may apply for a digital certificate and bind it with its own identity information, so as to ensure authenticity and non-repudiation of the signature. The verifier may use the root certificate issued by the trusted authority to verify the identity of the signer and the validity of the signature. The signer can digitally sign the OFD file using a digital certificate. The digital signature is a piece of data generated by encrypting the identity information of a signer and the hash value of the OFD file through a signature encryption algorithm, and is mainly used for guaranteeing the integrity and the authenticity of the OFD file. And embedding the digital signature into the OFD file to realize electronic signature. Wherein, the digital signature is also called public key digital signature or electronic signature. In order to ensure the effectiveness and irremovable property of the electronic signature, the document can be subjected to relevant frequency domain analysis, encryption of the electronic signature is further carried out on a frequency domain part, and the effectiveness and the irremovable property are increased, so that the obtained OFD format file is subjected to data conversion to obtain an initial two-dimensional matrix, subsequent conversion to the frequency domain can be conveniently carried out for analysis, subsequent comparison with the matrix added with the electronic signature can be conveniently carried out, subsequent judgment of the retention condition of the matrix added with the electronic signature on data in the initial two-dimensional matrix can be conveniently carried out, and further subsequent screening of a proper electronic signature embedding position can be conveniently carried out.
As an example, this step may include the steps of:
and step one, obtaining an OFD format file.
And secondly, extracting page contents of the OFD layout file through an OFD analysis library, rendering the page contents into a two-dimensional matrix, and determining the rendered two-dimensional matrix as an initial two-dimensional matrix.
For example, the content of the OFD layout file may be parsed using an OFD parsing library such as mutool or OFD2pdf, or the like, i.e., the page content and text of the OFD file may be extracted using the parsing library. For each page, a data processing library, such as an image processing library (PIL, python Imaging Library) or OpenCV, may be used to render the page content into two-dimensional matrix data, which typically requires combining text, graphics, and other elements into a two-dimensional matrix, which may be saved or loaded into memory for subsequent processing, the resulting two-dimensional matrix being the initial two-dimensional matrix.
And S2, carrying out Fourier transform on the initial two-dimensional matrix to obtain a frequency domain two-dimensional matrix, and screening out a preset number of element positions from the frequency domain two-dimensional matrix according to the amplitude value to serve as candidate positions.
In some embodiments, fourier transformation may be performed on the initial two-dimensional matrix to obtain a frequency-domain two-dimensional matrix, and a preset number of element positions are screened out from the frequency-domain two-dimensional matrix according to the amplitude as candidate positions.
The preset number may be a preset number. For example, the preset number may be 50. The element positions may be positions of elements in a frequency domain two-dimensional matrix.
It should be noted that, because the electronic signature is often capped in the frequency domain, fourier transformation is performed on the initial two-dimensional matrix to obtain the frequency domain two-dimensional matrix, so that the subsequent capping of the electronic signature can be facilitated. Secondly, because the magnitude is often related to the importance degree of the information, when a plurality of candidate positions are screened from the frequency domain two-dimensional matrix based on the magnitude, the selection of the position containing the important information can be avoided as far as possible, and the change of elements in the corresponding matrix caused by the embedding of the subsequent electronic signature can be as small as possible.
As an example, this step may include the steps of:
the first step is to carry out Fourier transform on the initial two-dimensional matrix to obtain a frequency domain two-dimensional matrix.
Wherein the fourier transform may be, but is not limited to: fast fourier transform (FFT, fast Fourier Transform).
For example, the initial two-dimensional matrix may be transformed into the frequency domain by FFT, and the resulting two-dimensional matrix is referred to as a frequency domain two-dimensional matrix.
And secondly, screening out the element position with the minimum amplitude from the frequency domain two-dimensional matrix to be used as a reference position.
It should be noted that, in order to ensure the reliability and irremovable property of the electronic signature, that is, after the electronic signature is added to the OFD format file, it can be ensured that the electronic signature is not removed by cutting and other methods. So, the two-dimensional FFT is selected to be converted into the frequency domain for analysis, and in order to ensure high retention of the original data, the high-frequency part with larger amplitude should be avoided to be modified as much as possible, because the high-frequency part often contains important information of the original data matrix. The low frequency portion of smaller amplitude may be selected for embedding of the electronic signature, as this tends to preserve the most of the original data features and has the least impact. The element position with the smallest amplitude is often located in the low frequency part, so that the element position with the smallest amplitude can be used as a candidate position of the electronic signature.
Thirdly, screening the positions of the target number of wheels on the frequency domain two-dimensional matrix according to the reference positions to obtain the candidate positions of the target number.
Wherein the target number is equal to the preset number minus one. The marking position can be the reference position or a candidate position obtained by the previous-round position screening. Each round of position screening may include the sub-steps of:
the first substep, determining the phase amplitude difference corresponding to each neighborhood position in the preset neighborhood corresponding to the mark position.
The preset neighborhood may be a preset neighborhood. For example, the preset neighborhood may be an eight neighborhood. The neighborhood location may be a location within a preset neighborhood. The marker location may be in the center of its corresponding preset neighborhood.
For example, according to the phase difference and the amplitude difference between the mark position and the neighborhood position, the formula for determining the phase amplitude difference corresponding to the neighborhood position may be:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Is the phase amplitude difference corresponding to the i-th neighborhood position in the preset neighborhood corresponding to the mark position. i is the sequence number of the neighborhood position in the preset neighborhood corresponding to the marking position. a is a preset weight coefficient, and the value range is [0,1 ]]E.g. a may be 0.7./>Is the amplitude difference between the marker position and the i-th neighborhood position in the corresponding preset neighborhood. />Is the phase difference between the marker position and the i-th neighborhood position in the corresponding preset neighborhood.
Note that, since the marker position is a candidate position obtained by screening the reference position or the previous-round position, and the reference position tends to be located in the low-frequency portion, the marker position tends to be located in or near the low-frequency portion. When (when)The smaller the phase amplitude difference between the i-th neighborhood position and the mark position is, the smaller the i-th neighborhood position is likely to be located in or near the low-frequency part, and the i-th neighborhood position is likely to be used as a candidate position of the electronic signature.
And a second substep, determining a neighborhood position with the minimum phase amplitude difference in a preset neighborhood corresponding to the mark position as a candidate position.
And fourthly, marking the reference positions as candidate positions, and obtaining a preset number of candidate positions altogether.
And S3, adding the electronic signature to the frequency domain two-dimensional matrix, moving the electronic signature, and performing inverse Fourier transform on the matrix when the electronic signature moves to each candidate position to obtain a signature matrix corresponding to each candidate position.
In some embodiments, the electronic signature may be added to a frequency domain two-dimensional matrix, the electronic signature is moved, and the matrix is inverse fourier transformed as the electronic signature is moved to each candidate location, resulting in a signature matrix corresponding to each candidate location.
Wherein the inverse fourier transform may be, but is not limited to: inverse FFT. When the geometric center of the electronic signature is located at a candidate location, the electronic signature may be considered to be moved to the candidate location. The method for acquiring the geometric center of the electronic signature can be as follows: and obtaining an external boundary of the electronic signature through a contour extraction algorithm, and obtaining a geometric center based on the boundary, wherein the geometric center is the geometric center of the electronic signature.
It should be noted that, the signature matrix corresponding to the candidate position is quantized, so that the degree of deviation between the corresponding signature matrix and the initial two-dimensional matrix when the electronic signature is added to the candidate position in the subsequent quantization and the retention condition of the corresponding signature matrix on the data information in the initial two-dimensional matrix can be facilitated.
As an example, an electronic signature to be capped may be added to a frequency-domain two-dimensional matrix, the electronic signature is moved, when the electronic signature is moved to a candidate position, the amplitude at the position where the electronic signature is located in the frequency-domain two-dimensional matrix is often changed, the changed frequency-domain two-dimensional matrix may be used as a new two-dimensional matrix, and inverse FFT may be performed on the obtained new two-dimensional matrix to obtain a two-dimensional matrix containing the electronic signature, and the two-dimensional matrix is recorded as a signature matrix corresponding to the candidate position.
And S4, determining a target deviation index corresponding to each candidate position according to the initial two-dimensional matrix and the signature matrix corresponding to each candidate position.
In some embodiments, the target deviation index corresponding to each candidate location may be determined according to the initial two-dimensional matrix and the signature matrix corresponding to each candidate location.
It should be noted that, by comprehensively considering the initial two-dimensional matrix and the signature matrix corresponding to the candidate position, the target deviation index corresponding to the candidate position can be quantified, and the larger the value of the target deviation index is, the larger the change of the data characteristics before and after the electronic signature is added to the candidate position is often caused, the larger the deviation degree between the signature matrix corresponding to the candidate position and the initial two-dimensional matrix is often caused, the smaller the retention degree of the signature matrix corresponding to the candidate position to the data information in the initial two-dimensional matrix is often caused, the more likely the text information is lost is often caused, and the more unsuitable the candidate position is used as the embedding position of the electronic signature.
As an example, this step may include the steps of:
the first step, according to all elements in the initial two-dimensional matrix and the signature matrix corresponding to the candidate position, determining a formula corresponding to the initial deviation index corresponding to the candidate position may be:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Is the initial deviation index corresponding to the j candidate position. j is the sequence number of the candidate location. H is the average of all elements in the initial two-dimensional matrix. />Is the mean of all elements in the signature matrix corresponding to the jth candidate position. n is the number of elements in the initial two-dimensional matrix or signature matrix. The number of elements in the initial two-dimensional matrix and the signature matrix may be equal. />Is initially two-dimensionalThe b-th element in the matrix. />Is the b-th element in the signature matrix corresponding to the j-th candidate position. b is the sequence number of the element in the initial two-dimensional matrix or signature matrix. For example, b may be a sequence number obtained by arranging elements in the matrix in the order from top to bottom and from left to right.
When the following is performedThe smaller the signature matrix corresponding to the jth candidate position is, the more similar the signature matrix is to the initial two-dimensional matrix, the greater the reservation degree of the signature matrix corresponding to the jth candidate position to data information in the initial two-dimensional matrix is, the less information such as text content is lost, and the jth candidate position can be used as an embedding position of an electronic signature.
And secondly, determining a target deviation index corresponding to the candidate position according to a preset positive coefficient and an initial deviation index corresponding to the candidate position.
For example, the formula for determining the product of the preset positive coefficient and the initial deviation index corresponding to the candidate position as the target deviation index corresponding to the candidate position may be:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Is the target deviation index corresponding to the j candidate position. k is a preset positive coefficient, that is, a preset positive coefficient, for example, k may be 2./>Is the initial deviation index corresponding to the j candidate position. j is the sequence number of the candidate location.
When the following is performedThe smaller the time, the less the information such as text content is lost, and the j candidate position can be used as the embedding position of the electronic signature. Thus, when->The smaller the time, the less the information such as text content is lost, and the j candidate position can be used as the embedding position of the electronic signature. And the initial deviation index is multiplied by a preset positive coefficient to realize the adjustment of the deviation index.
And S5, screening out the candidate position with the minimum target deviation index from all the candidate positions as a target position.
In some embodiments, the candidate position with the smallest target deviation index may be selected from all candidate positions as the target position.
It should be noted that, the candidate location with the smallest target deviation index is often the most suitable embedding location of the electronic signature among all candidate locations.
As an example, a candidate position where the target deviation index is smallest may be regarded as the target position.
And S6, converting the signature matrix corresponding to the target position into an OFD format file with the electronic signature.
In some embodiments, the signature matrix corresponding to the target position can be converted into an OFD format file with an electronic signature, so that the electronic signature of the OFD format file is capped.
As an example, the content in the signature matrix corresponding to the above target position may be extracted by optical character recognition, the extracted content is integrated into an OFD document, and the finally integrated OFD document is determined as an OFD layout file with an electronic signature.
It should be noted that, the signature matrix corresponding to the target position is obtained, and the frequency domain of the matrix contains the electronic signature information, and the authenticity and reliability of the initial two-dimensional matrix are reserved to a certain extent. Optical character recognition (OCR, optical Character Recognition) can be used to extract signature matrix text corresponding to the target location, and the extracted text and image content often need to be integrated into the OFD document. The OFD file supports text blocks, image blocks, and style information, and thus it is necessary to organize these data into the structure of the OFD file. The OFD file is a structured document based on XML, and an OFD document structure is created, and the OFD file comprises elements such as pages, text blocks, image blocks and the like. The above is integrated into an OFD document using an OFD generation tool or library. Some open source OFD generation libraries, such as goofd, ofdlib, etc., may be used for this purpose. So far, the original data is converted into an OFD format file, and the electronic signature is capped.
Based on the same inventive concept as the above method embodiments, the present invention provides an electronic signature system of an OFD format file, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the steps of an electronic signature method of an OFD format file.
In summary, compared with the electronic signature positions set by users based on subjective experience or randomly, the method comprehensively considers a plurality of indexes related to information retention conditions, such as amplitude, target deviation indexes and the like, so that the determination of the target positions in which the electronic signature is finally embedded is relatively objective, the rationality of setting the electronic signature positions is improved, and the loss of contents such as text information and the like is reduced to a certain extent.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention and are intended to be included within the scope of the invention.

Claims (8)

1. An electronic signature method of an OFD format file is characterized by comprising the following steps:
acquiring an OFD format file, and performing data conversion on the OFD format file to obtain an initial two-dimensional matrix;
performing Fourier transform on the initial two-dimensional matrix to obtain a frequency domain two-dimensional matrix, and screening a preset number of element positions from the frequency domain two-dimensional matrix according to the amplitude value to serve as candidate positions;
adding the electronic signature to a frequency domain two-dimensional matrix, moving the electronic signature, and performing inverse Fourier transform on the matrix when the electronic signature moves to each candidate position to obtain a signature matrix corresponding to each candidate position;
determining a target deviation index corresponding to each candidate position according to the initial two-dimensional matrix and the signature matrix corresponding to each candidate position;
screening candidate positions with the minimum target deviation index from all candidate positions to serve as target positions;
converting the signature matrix corresponding to the target position into an OFD format file with an electronic signature;
the determining the target deviation index corresponding to each candidate position according to the initial two-dimensional matrix and the signature matrix corresponding to each candidate position comprises the following steps:
determining an initial deviation index corresponding to the candidate position according to the initial two-dimensional matrix and all elements in the signature matrix corresponding to the candidate position;
determining a target deviation index corresponding to the candidate position according to a preset positive coefficient and an initial deviation index corresponding to the candidate position;
the formula corresponding to the initial deviation index corresponding to the candidate position is:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>Is the initial deviation index corresponding to the j candidate position; j is the order of candidate locationsA number; h is the average value of all elements in the initial two-dimensional matrix; />Is the average value of all elements in the signature matrix corresponding to the jth candidate position; n is the number of elements in the initial two-dimensional matrix or signature matrix; />Is the b-th element in the initial two-dimensional matrix; />Is the b element in the signature matrix corresponding to the j candidate position; b is the sequence number of the element in the initial two-dimensional matrix or signature matrix.
2. The method for electronic signature of an OFD layout file according to claim 1, wherein said selecting a preset number of element positions from said frequency domain two-dimensional matrix as candidate positions according to the magnitude comprises:
screening out the element position with the minimum amplitude from the frequency domain two-dimensional matrix to be used as a reference position;
according to the reference position, carrying out target number wheel position screening on the frequency domain two-dimensional matrix to obtain target number candidate positions, wherein the target number is equal to the preset number minus one; each round of position screening includes: determining phase amplitude differences corresponding to each neighborhood position in a preset neighborhood corresponding to the mark position; determining a neighborhood position with the minimum phase amplitude difference in a preset neighborhood corresponding to the marking position as a candidate position; the marked position is the candidate position obtained by screening the reference position or the previous round of position;
the reference position is noted as a candidate position.
3. The method for electronic signature of an OFD layout file according to claim 2, wherein determining the phase amplitude difference corresponding to each neighborhood position in the preset neighborhood corresponding to the marker position comprises:
and determining the phase amplitude difference corresponding to the neighborhood position according to the phase difference and the amplitude difference between the mark position and the neighborhood position.
4. The electronic signature method of an OFD layout file according to claim 3, wherein the formula corresponding to the phase amplitude difference corresponding to the neighborhood position in the preset neighborhood corresponding to the marking position is:
the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>The phase amplitude difference corresponding to the ith neighborhood position in the preset neighborhood corresponding to the marking position; i is a sequence number of a neighborhood position in a preset neighborhood corresponding to the marking position; a is a preset weight coefficient, and the value range is [0,1 ]];/>Is the amplitude difference between the mark position and the i-th neighborhood position in the preset neighborhood corresponding to the mark position; />Is the phase difference between the marker position and the i-th neighborhood position in the corresponding preset neighborhood.
5. The method for electronic signature of an OFD layout file according to claim 1, wherein determining the target deviation index corresponding to the candidate position according to the preset positive coefficient and the initial deviation index corresponding to the candidate position comprises:
and determining the product of the preset positive coefficient and the initial deviation index corresponding to the candidate position as the target deviation index corresponding to the candidate position.
6. The method for electronic signature of an OFD layout file according to claim 1, wherein the step of performing data conversion on the OFD layout file to obtain an initial two-dimensional matrix comprises:
and extracting page contents of the OFD layout file through an OFD analysis library, rendering the page contents into a two-dimensional matrix, and determining the two-dimensional matrix obtained by rendering as an initial two-dimensional matrix.
7. The method for electronic signature of an OFD format file according to claim 1, wherein the converting the signature matrix corresponding to the target position into the OFD format file with the electronic signature comprises:
and extracting the content in the signature matrix corresponding to the target position through optical character recognition, integrating the extracted content into an OFD document, and determining the finally integrated OFD document as an OFD format file with the electronic signature.
8. An electronic signature system for an OFD format file, comprising a processor and a memory, the processor being configured to process instructions stored in the memory to implement an electronic signature method for an OFD format file according to any one of claims 1-7.
CN202410008436.9A 2024-01-04 2024-01-04 Electronic signature method and system for OFD format file Active CN117521605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410008436.9A CN117521605B (en) 2024-01-04 2024-01-04 Electronic signature method and system for OFD format file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410008436.9A CN117521605B (en) 2024-01-04 2024-01-04 Electronic signature method and system for OFD format file

Publications (2)

Publication Number Publication Date
CN117521605A CN117521605A (en) 2024-02-06
CN117521605B true CN117521605B (en) 2024-03-15

Family

ID=89749767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410008436.9A Active CN117521605B (en) 2024-01-04 2024-01-04 Electronic signature method and system for OFD format file

Country Status (1)

Country Link
CN (1) CN117521605B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897776A (en) * 2020-06-22 2020-11-06 百望股份有限公司 OFD document processing method, electronic device and computer-readable storage medium
CN114330245A (en) * 2021-11-18 2022-04-12 上海二三四五网络科技有限公司 OFD document processing method and device
CN114821618A (en) * 2022-03-15 2022-07-29 百望股份有限公司 Analysis method for OFD reading software display effect
CN115328588A (en) * 2022-04-07 2022-11-11 百望股份有限公司 Method and system for rendering OFD (office file) based on browser front end
CN115641590A (en) * 2022-09-02 2023-01-24 福昕鲲鹏(北京)信息科技有限公司 Word rotation positioning method and system for OFD (office file) document and storage medium
CN115934653A (en) * 2023-01-04 2023-04-07 百望股份有限公司 Method and device for adding external OFD page content in OFD file
CN116402020A (en) * 2023-02-16 2023-07-07 福昕鲲鹏(北京)信息科技有限公司 Signature imaging processing method, system and storage medium based on OFD document

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2845498C (en) * 2011-10-19 2015-02-03 Knova Web Technologies Inc. Method for automatically tagging documents with matrix barcodes and providing access to a plurality of said document versions

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897776A (en) * 2020-06-22 2020-11-06 百望股份有限公司 OFD document processing method, electronic device and computer-readable storage medium
CN114330245A (en) * 2021-11-18 2022-04-12 上海二三四五网络科技有限公司 OFD document processing method and device
CN114821618A (en) * 2022-03-15 2022-07-29 百望股份有限公司 Analysis method for OFD reading software display effect
CN115328588A (en) * 2022-04-07 2022-11-11 百望股份有限公司 Method and system for rendering OFD (office file) based on browser front end
CN115641590A (en) * 2022-09-02 2023-01-24 福昕鲲鹏(北京)信息科技有限公司 Word rotation positioning method and system for OFD (office file) document and storage medium
CN115934653A (en) * 2023-01-04 2023-04-07 百望股份有限公司 Method and device for adding external OFD page content in OFD file
CN116402020A (en) * 2023-02-16 2023-07-07 福昕鲲鹏(北京)信息科技有限公司 Signature imaging processing method, system and storage medium based on OFD document

Also Published As

Publication number Publication date
CN117521605A (en) 2024-02-06

Similar Documents

Publication Publication Date Title
Bhattacharjee et al. Compression tolerant image authentication
Ahmad et al. An improved Quad and RDE-based medical data hiding method
CN102301395B (en) Feature amount selecting device
US10102439B2 (en) Document verification method and system
Rai et al. SVM based robust watermarking for enhanced medical image security
CN111738898B (en) Text digital watermark embedding/extracting method and device
CN111626124A (en) OCR image sample generation method, OCR image sample generation device, OCR image sample printing body verification equipment and OCR image sample printing body verification medium
CN116933222B (en) Three-dimensional model copyright authentication method and system based on zero watermark
JP2004112223A (en) Id card, id card generating apparatus, and id card reader
US20100053691A1 (en) Combining identity-linked images
CN117521605B (en) Electronic signature method and system for OFD format file
KR20070105528A (en) Method and apparatus for user authentication using face image
Botta et al. Fragile watermarking using Karhunen–Loève transform: the KLT-F approach
CN117648680A (en) Electronic signature format file generation method and system
US8290219B2 (en) Registration-free transforms for cancelable iris biometrics
Menendez-Ortiz et al. Self-recovery scheme for audio restoration after a content replacement attack
Karthik et al. Transparent hashing in the encrypted domain for privacy preserving image retrieval
Ahmad et al. Paper document authentication using print-scan resistant image hashing and public-key cryptography
US11522715B2 (en) Methods for processing and verifying a document
El-Bendary et al. An efficient hidden marking approach for forensic and contents verification of digital images
Lebcir et al. Robust blind watermarking approach against the compression for fingerprint image using 2D-DCT
Dey et al. Center-symmetric local binary pattern-based image authentication using local and global features vector
Botta et al. KL-F: Karhunen-Loève based fragile watermarking
CN113139210A (en) PDF document-based national secret electronic signature method and system
Lee et al. Optimal pixel-level self-repairing authentication method for grayscale images under a minimax criterion of distortion reduction

Legal Events

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