CN116150816A - File signature integrity verification method and device based on hash algorithm - Google Patents

File signature integrity verification method and device based on hash algorithm Download PDF

Info

Publication number
CN116150816A
CN116150816A CN202310016514.5A CN202310016514A CN116150816A CN 116150816 A CN116150816 A CN 116150816A CN 202310016514 A CN202310016514 A CN 202310016514A CN 116150816 A CN116150816 A CN 116150816A
Authority
CN
China
Prior art keywords
electronic
unique identification
electronic contract
signature
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310016514.5A
Other languages
Chinese (zh)
Inventor
周正杭
吴迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Youwei Technology Co ltd
Original Assignee
Xiamen Youwei 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 Xiamen Youwei Technology Co ltd filed Critical Xiamen Youwei Technology Co ltd
Priority to CN202310016514.5A priority Critical patent/CN116150816A/en
Publication of CN116150816A publication Critical patent/CN116150816A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The present disclosure relates to the field of file verification, and in particular, to a method and apparatus for verifying integrity of a file signature based on a hash algorithm. The method comprises the steps of carrying out hash algorithm conversion on an electronic signature to obtain a unique identification character string corresponding to the electronic signature, simultaneously analyzing the electronic contract, carrying out hash algorithm conversion on basic constituent elements of the acquired electronic contract, and obtaining a unique identification character string combination set; and comparing the converted unique identification character strings to confirm the integrity and correctness of the electronic signature in the electronic contract. By using the embodiment of the invention, the integrity and the correctness of the electronic signature in the electronic contract can be automatically checked, the checking accuracy is improved, and the checking time is shortened.

Description

File signature integrity verification method and device based on hash algorithm
Technical Field
The present disclosure relates to the field of file verification, and in particular, to a method and apparatus for verifying integrity of a file signature based on a hash algorithm.
Background
Currently, electronic contracts are increasingly used in business activities, and the number of transactions performed using electronic contracts is also continuously increasing. In the prior art, depending on manual verification, the missing of official seal or the wrong seal of the externally-transmitted seal file is caused by internal problems, and the electronic contract can not finish the sealing of the two parties according to the requirements, so that serious problems are generated.
What is needed is a method for verifying the integrity of a file signature, which is a problem to be solved in the prior art, how to provide automatic verification of the integrity of a file signed by an outer transmission sub-contract and improve the automatic verification capability of the file.
Disclosure of Invention
In order to solve the problem that in the prior art, electronic contract files fail to finish sealing of both sides according to requirements due to missing or wrong sealing of the electronic signature, the embodiment of the invention provides a file signature integrity checking method and device based on a hash algorithm, which can check the integrity and correctness of the electronic signature through a system, alarm and feed the failed electronic contract to an operator, and are used for solving the problem that the electronic contract in the prior art cannot be automatically checked.
In order to solve the technical problems, the specific technical scheme is as follows:
in one aspect, embodiments herein provide a hash algorithm-based file signature integrity verification method, comprising,
establishing corresponding relations between different types of electronic signatures and corresponding types of electronic contracts;
converting the electronic signatures of different types through a specified hash algorithm to generate first unique identification character strings corresponding to the electronic signatures of different types;
analyzing the electronic contract to be checked to obtain the type of the electronic contract to be checked and an image file of the electronic signature;
converting the specified hash algorithm on the image file of the electronic signature to generate a corresponding second unique identification character string;
determining a first unique identification character string corresponding to the electronic contract to be checked according to the type of the electronic contract to be checked;
and checking the difference between the second unique identification character string and the corresponding first unique identification character string.
Further, the different types of electronic signatures are electronic signatures which are added by a system mode in the electronic contract and further comprise,
company signature, department signature, personal signature, and contract signature.
Further, the specified hash algorithm includes,
MD5 algorithm, SHA128 algorithm.
Further, the MD5 algorithm in the hash algorithm further comprises,
the MD5 algorithm processes the input information in 512-bit packets, and each packet is further divided into 16 32-bit sub-packets, after which the electronic signature is output as the first unique identification string consisting of four 32-bit packets.
Further, the analyzing of the electronic contract to be verified further comprises,
obtaining the type of the electronic contract to be checked and the image file of the electronic signature, further comprising,
analyzing the electronic contract to be checked into a text file and an embedded file;
determining the type of the electronic contract to be checked according to the text content of the text file;
and converting the embedded file into an image file collection, wherein the image file collection comprises images of electronic signatures in the electronic contract.
Further, converting the embedded file into a collection of image files further comprises,
and carrying out the specified hash algorithm conversion processing on each image file in the image file collection to obtain a plurality of second unique identification character strings, and forming the second unique identification character string collection.
Further, the analysis of the electronic contract to be verified into text content and embedding the text content into a file further comprise,
and analyzing a pattern file in the electronic contract to be checked, wherein the pattern file comprises coordinate information of the position where the electronic signature of the electronic contract to be checked should be.
Further, said verifying the dissimilarity of said second unique identification string with said corresponding first unique identification string further comprises,
and comparing each second unique identification character string in the second unique identification character string set with the first unique identification character string corresponding to the electronic signature in the electronic contract to be checked, intercepting and alarming if the second unique identification character string set does not contain the first unique identification character string, and releasing and not intercepting if the second unique identification character string set contains the first unique identification character string.
Further, the analyzing the electronic contract to be checked to obtain the type of the electronic contract to be checked and the image file of the electronic signature further comprises,
acquiring coordinate information of the position where the electronic signature of the electronic contract to be checked should be;
and acquiring images at the corresponding positions of the electronic contract to be checked according to the coordinate information of the positions of the electronic signature.
On the other hand, the embodiment also provides a file signature integrity checking device based on a hash algorithm, which comprises,
the electronic signature configuration storage unit is used for establishing the corresponding relation between different types of electronic signatures and corresponding types of electronic contracts;
the electronic signature conversion unit is used for converting the electronic signatures of different types through a specified hash algorithm to generate first unique identification character strings corresponding to the electronic signatures of different types;
the electronic contract analysis unit to be verified is used for analyzing the electronic contract to be verified to obtain the type of the electronic contract to be verified and an image file of the electronic signature;
the electronic contract conversion unit is used for converting the appointed hash algorithm of the image file of the electronic signature to generate a corresponding second unique identification character string;
the character string determining unit is used for determining a first unique identification character string corresponding to the electronic contract to be verified according to the type of the electronic contract to be verified;
and the verification unit is used for verifying the difference between the second unique identification character string and the corresponding first unique identification character string.
By the method and the device, the problem that the signature of the externally-transmitted signature file is missing due to the internal problem or the signature is abnormal or missing due to the wrong signature can be avoided, the automatic correctness and integrity check of all the externally-transmitted electronic contract files can be ensured, and the accuracy of key electronic signature information and the validity of the externally-transmitted subcontract file are ensured; meanwhile, by automatic verification, the labor input cost of manual verification is greatly reduced.
Drawings
In order to more clearly illustrate the embodiments herein or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments herein and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic diagram of a system for checking the integrity of a file signature based on a hash algorithm according to an embodiment of the disclosure;
FIG. 2 is a flowchart of a method for checking the integrity of a file signature based on a hash algorithm according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of electronic contract resolution in embodiments herein;
FIG. 4 is a flow chart illustrating a verification system integrity verification process in an embodiment herein;
FIG. 5 is a schematic diagram illustrating a file signature integrity verification device based on a hash algorithm according to an embodiment of the disclosure;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure.
[ reference numerals description ]
101. A terminal;
102. a server;
701. electronic signature configuration storage unit
702. Electronic signature conversion unit
703. Electronic contract analysis unit to be checked
704. Electronic contract conversion unit
705. Character string determining unit
706. Verification unit
802. A computer device;
804. a processing device;
806. storing the resource;
808. a driving mechanism;
810. an input/output module;
812. an input device;
814. an output device;
816. a presentation device;
818. a graphical user interface;
820. a network interface;
822. a communication link;
824. a communication bus.
Detailed Description
The following description of the embodiments of the present disclosure will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the disclosure. All other embodiments, based on the embodiments herein, which a person of ordinary skill in the art would obtain without undue burden, are within the scope of protection herein.
It should be noted that the terms "first," "second," and the like in the description and claims herein and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or device.
Fig. 1 is a schematic diagram of a file signature integrity verification system based on a hash algorithm according to an embodiment of the present invention, which may include a terminal 101 and a server 102, where a communication connection is established between the terminal 101 and the server 102, so as to enable data interaction. The terminal 101 may input an electronic contract to be verified to the server 102, where the verified electronic contract includes files of multiple elements, such as text files, embedded files, and the like, each file is processed separately, the server 102 verifies the electronic contract to be verified to obtain a verification result, and sends the verification result to the terminal 101 for display or storage.
In this embodiment of the present disclosure, the server 102 may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN, content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms.
In an alternative embodiment, terminal 101 may include, but is not limited to, smart phones, desktop computers, tablet computers, notebook computers, smart speakers, digital assistants, augmented Reality (AR, augmented Reality)/Virtual Reality (VR) devices, smart wearable devices, and the like. Alternatively, the operating system running on the electronic device may include, but is not limited to, an android system, an IOS system, linux, windows, and the like.
It should be noted that, fig. 1 is only one application environment provided by the present disclosure, and in practical application, other application environments may also be included, which is not limited in the embodiment of the present invention.
In order to solve the problems existing in the prior art. The embodiment of the invention provides a file signature integrity verification method based on a hash algorithm, realizes automatic electronic signature verification, and solves the problem that an electronic contract in the prior art cannot be automatically verified. Fig. 2 is a flow chart illustrating a method for verifying the integrity of a file signature based on a hash algorithm according to an embodiment of the present disclosure, in which a process for verifying the integrity of a plurality of different types of electronic signatures is described, but may include more or fewer operation steps based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When a system or apparatus product in practice is executed, it may be executed sequentially or in parallel according to the method shown in the embodiments or the drawings. As shown in fig. 1 in particular, the method may be performed by the server 102, and may include:
step 201: establishing corresponding relations between different types of electronic signatures and corresponding types of electronic contracts;
step 202: converting the electronic signatures of different types through a specified hash algorithm to generate first unique identification character strings corresponding to the electronic signatures of different types;
step 203: analyzing the electronic contract to be checked to obtain the type of the electronic contract to be checked and an image file of the electronic signature;
step 204: performing the specified hash algorithm conversion on the image file of the electronic signature to generate a corresponding second unique identification character string;
step 205: determining a first unique identification character string corresponding to the electronic contract to be checked according to the type of the electronic contract to be checked;
step 206: checking the difference between the second unique identification character string and the corresponding first unique identification character string;
by the method, the problem that the signature of the externally-transmitted signature file is deleted or the signature of the externally-transmitted signature file is abnormal or deleted due to the fact that the public signature is deleted or the signature is wrongly signed due to the internal problem can be avoided, automatic correctness and integrity verification can be carried out on all the externally-transmitted electronic contract files, and accuracy of key electronic signature information and validity of the externally-transmitted subcontract files are guaranteed; meanwhile, by automatic verification, the labor input cost of manual verification is greatly reduced.
In embodiments herein, the type of electronic signature may include a company signature, a department signature, a personal signature, a contract signature, etc., and embodiments herein are not limited. The types of electronic contracts may include company-to-company electronic contracts, company-to-person electronic contracts, company statements, and the like, and embodiments of the present description are not limited. In this embodiment, the electronic contract may be an electronic version file written by a user based on a formulated electronic contract template and combined with actual business content, in order to ensure legal effectiveness of the electronic contract, a worker needs to sign an electronic signature on the electronic contract, in order to improve the form checking efficiency of the electronic contract, in this embodiment, a correspondence between different types of electronic signatures and corresponding types of electronic contracts is first established, for example, for a company signature, a correspondence between the company signature and the company electronic contract may be established, where the correspondence indicates that the electronic contract must include the type of electronic signature, and if not, it is indicated that the electronic contract does not have legal effectiveness.
In the embodiment, the automatic verification of the integrity of the electronic signature of the file is realized, a hash algorithm is selected to convert the image file of the electronic signature, the hash algorithm is an algorithm for mapping binary values with any length into shorter fixed-length binary values, the shorter fixed-length binary values are unique identification character strings, and if the image file has any variation, the generated unique identification character strings all generate different values, so that the integrity of the electronic signature can be verified by comparing the unique identification character strings obtained by the hash algorithm; and in combination with the actual requirement of the electronic contract document output in the business activity, whether the type of the electronic signature accords with the signature required by the type of the electronic contract is also required to be checked, in order to check the correctness of the electronic signature, the type of the electronic signature of a checking system is required to be set before the electronic contract document is checked, the electronic signature of different types required by the manual data input is named according to the type, and then the electronic signature of different types required by the electronic contract of each type is input.
And converting the electronic signatures of different types through a specified hash algorithm to generate first unique identification character strings corresponding to the electronic signatures of different types, and converting the image files of the electronic signatures through the specified hash algorithm to generate corresponding second unique identification character strings. It may be understood that, if the electronic contract to be checked includes an electronic signature of a corresponding type, the second unique identification string should be identical to the first unique identification string, so the embodiments herein determine the first unique identification string corresponding to the electronic contract to be checked according to the type of the electronic contract to be checked, that is, determine whether the electronic contract to be checked includes an electronic signature of a required type, and if the electronic signature type included in the electronic contract to be checked is identical to the electronic signature type of the type indicated in the correspondence, the second unique identification string corresponding to the image file of the electronic signature of the electronic contract to be checked should be identical to the first unique identification string of the electronic signature type corresponding to the electronic contract type.
Therefore, in this embodiment, whether the second unique identification string is identical to the first unique identification string is compared, and if so, it is indicated that the electronic signature type in the electronic contract to be verified is identical to the electronic signature type specified by the electronic contract of the type, that is, the electronic contract to be verified already includes the electronic signature of the specified type, and the electronic contract to be verified is verified to pass, otherwise, the verification is not passed.
In this embodiment, the second unique identification string may be compared to the first unique identification string, and if so, the verification passed. In addition, the second unique identification string may be compared with the corresponding first unique identification string by other methods, which is not limited in this embodiment.
In the embodiment, a hash algorithm is selected as a verification mode, and the main reason is that the calculation flow based on the hash algorithm can greatly save the system storage resources in terms of storage, so that the verification time consumption is reduced; the hash algorithm is only one-way encryption algorithm selected by the present disclosure, in practical application, the original file stream of the file can be used for comparison, but the length of the file stream is very large, and the efficiency is very affected no matter the system storage or the comparison work, and the present invention is not further described in the embodiment.
The binary value strings with any length are mapped into binary value strings with fixed lengths through the hash algorithm, so that the unique identification character strings are generated, the execution efficiency of the hash algorithm is high, the unique identification character strings can be quickly generated for longer texts, and the system storage efficiency and the comparison work efficiency are improved; meanwhile, the method is very sensitive to input data in file verification, even if the original data only modifies one Bit, the finally generated unique identification character strings are not identical, and the verification accuracy is ensured in the process of verifying the file; the hash algorithm specified further includes an MD5 algorithm and a SHA128 algorithm.
Preferably, according to one embodiment herein, the MD5 algorithm processes the input information in 512-bit packets, and each packet is further divided into 16 32-bit sub-packets, after which the electronic signature is output as the first unique identification string consisting of four 32-bit packets.
In this embodiment, the first unique identification string is four 32-bit packets, and the method for generating the second unique identification string may be four 32-bit packets, so that the four 32-bit packets of the first unique identification string and the four 32-bit packets of the second unique identification string may be compared, and if they are the same, the verification passes.
Selecting an MD5 algorithm as a hash algorithm for calculating unique identification character strings, carrying out irreversible character string transformation calculation based on the MD5 algorithm, processing input information by 512-bit packets, further dividing each packet into 16 32-bit sub-packets, and outputting the electronic signature as a first unique identification character string consisting of four 32-bit packets after processing; the unique identification character string calculated based on the MD5 algorithm has uniqueness, and the unique identification character string calculated by the MD5 algorithm has only one determined value for the same electronic signature no matter the number of times of calculation; storing the first identification character string as the first unique identification character string with the same type name as the electronic signature and the file extension of the first unique identification character string of which the file extension is md 5; a database named as electronic signature configuration is established, and first unique identification character strings corresponding to all different types of electronic signatures are stored in the database.
According to one embodiment herein, in order to verify whether an electronic signature included in an electronic contract to be verified is an electronic signature required for the contract, therefore, the type of electronic signature required for the electronic contract to be verified can also be determined by text content in the electronic contract to be verified. Specifically, as shown in fig. 3, the process of resolving the electronic contract to be verified to obtain the type of the electronic contract to be verified and the image file of the electronic signature further comprises,
step 301: analyzing the electronic contract to be checked into a text file and an embedded file;
step 302: determining the type of the electronic contract to be checked according to the text content in the text file;
step 303: and converting the embedded file into an image file collection, wherein the image file collection comprises images of electronic signatures in the electronic contract.
In this embodiment, the electronic contract to be verified is generally in PDF format, and basic constituent elements of the PDF file can be obtained by analyzing the PDF file, where the electronic contract is analyzed by inputting the PDF format electronic contract file with the electronic signature into the verification system; loading pdf electronic contract files into a memory through iceblue. Obtaining the content of each page in the pdf electronic contract file through the analysis of the pdf document; acquiring page objects of each page according to the content of each page of the pdf electronic contract file; each page of content is processed according to the file type, and further comprises a text file, an embedded file and a style file; the text file is all text contents in the PDF electronic contract, including the name of the electronic contract and the contract contents; the embedded files are all embedded contents in the PDF electronic contract, including trademark and electronic signature images; the style file is all style contents in the PDF electronic contract, including the format of the electronic contract and the position coordinates where the electronic signature should be.
In the embodiment, the obtained text file is analyzed to be all text contents in the PDF file, names of electronic contracts can appear in the text contents, and text contents such as types of required signatures in the electronic contracts; by identifying the text content, the contract type of the electronic contract file and the required electronic signature type can be obtained; calling a first unique identification character string of the required electronic signature from a database of the electronic signature configuration according to the type of the electronic contract and the required electronic signature; the first unique identification string is input to the verification system preparation and the second unique identification string of the electronic signature image file in step 303 is compared.
In this embodiment, the obtained embedded files are analyzed to be all the embedded picture contents in the PDF file, the embedded files are subjected to traversal and converted into image files, and an image collection of each page of embedded files is obtained, and since the embedded files possibly include a plurality of embedded files in different forms such as pictures, trademarks, electronic signatures and the like, the embedded files cannot be directly distinguished through the prior art, if the electronic signatures exist, the embedded files are captured in the form of image files in the image collection, so that all the embedded files in the electronic contract are subjected to transformation of a hash algorithm to generate the second unique identification character string collection, and if the image collection contains the electronic signature image, the second unique identification character string collection also contains the unique identification character string of the electronic signature.
Acquiring an image file collection of each embedded file through analysis; performing irreversible character string transformation calculation based on MD5 algorithm on the image file set to generate a second unique identification character string set; comparing the first unique identification character string of the required signature with a second unique identification character string set list of the embedded file in the electronic contract; outputting a verification result of the verification system through the comparison result; when the second unique identification character string set list contains the first unique identification character string of the required signature, the required signature in the electronic contract is proved to be correct and have integrity, and the electronic contract can enter the next stage for verification; when the second unique identification character string set does not contain the first unique identification character string or does not contain each first unique identification character string, the electronic signature in the electronic contract is proved to be incorrect or an integrity problem occurs, and the verification system intercepts and alarms to remind operators of processing.
In this embodiment, during the signing process of the actual electronic contract, different problems of signing by mistake or signing by mistake may also occur, so that after verifying the correctness and integrity of the signature, double verification of the correctness of the signature position is also required. For the position of the signature, the coordinate information of the electronic signature contained in the style file is required to be compared with the actual coordinate position of the electronic signature, and the purpose of the comparison is mainly to check whether the electronic signature is at the correct position in the electronic contract, if the situation that the electronic signature is capped at the wrong position occurs, an operator is required to perform two steps of deleting the electronic signature at the wrong position and capping the signature at the correct position.
The file obtained through pdf analysis also comprises the pattern file, wherein the pattern file comprises coordinate information of the position where the signature is required in the electronic contract, and the coordinate information of the position where the electronic signature is required is obtained through analysis of the pattern file; acquiring coordinate information of an actual position of an image file in an electronic contract, corresponding to a second unique identification character string which is identical to the first unique identification character string in the previous-stage verification; comparing the two position coordinate information, and if the position coordinate information is inconsistent with the actual position coordinate information, intercepting and alarming by a checking system to remind an operator of processing; if the coordinate information of the position to be in the position is completely consistent with the coordinate information of the actual position, the electronic contract can be output through verification.
In the present embodiment, as shown in fig. 4, a flowchart of the complete flow of the present embodiment,
step 401: recording an image file of the electronic signature, a category name of the electronic signature and a corresponding electronic contract in a verification system;
step 402: generating a first unique identification character string of each electronic signature based on a hash algorithm, and storing the first unique identification character string which is the same as the type name of the electronic signature into a database;
step 403: inputting the electronic contract file into a verification system and storing the electronic contract file into a memory;
step 404: analyzing the electronic contract file to obtain a text file, an embedded file and a style file in the file;
step 405: acquiring the type of the electronic contract through text identification text files;
step 406: carrying out a hash algorithm through the image file set embedded with the file to generate a second unique identification character string set;
step 407: acquiring position coordinate information of an electronic signature through a style file;
in step 405, step 406, step 407, three steps may be performed simultaneously.
Step 408: judging the type of the required electronic signature according to the type of the electronic contract obtained in the step 405, and calling the corresponding first unique identification character string;
step 409: comparing the second set of unique identification strings obtained in step 406 with the first unique identification string obtained in step 408;
in this step, if the second unique identification string contains the first unique identification string, it is determined that the calibration is successful, and step 410 is continued, and if the second unique identification string does not contain the first unique identification string, it is determined that the calibration is failed, and step 412 is directly performed;
step 410: acquiring coordinate information of the actual position of the unique identification character string corresponding to the first unique identification character string in the second unique identification character string set in step 409 in the electronic contract;
in this step, the obtained coordinate information of the actual position is the actual position of the electronic signature in the electronic contract, and this step is mainly used for avoiding the situation that the electronic signature may be capped to the wrong position in the capping process, and if this happens, an operator needs to delete the signature of the wrong position and cap the correct position.
Step 411: comparing the coordinate information of the position where the electronic signature should be located with the coordinate information of the actual position;
in this step, if the coordinate information of the location where the electronic signature should be located is the same as the coordinate information of the actual location, it is determined that the calibration is successful, step 414 is performed, and if the two coordinate information are different, it is determined that the calibration is failed, step 413 is performed.
Step 412: intercepting the electronic contract file;
in the step, the intercepted files are all not checked, and an operator is required to be informed of an alarm to check the electronic contract; as the received file is divided into the case of missing electronic signature and the case of incorrect electronic signature position and failure in verification, operators can be informed of various operations such as re-signing, deleting incorrect signature or moving signature of incorrect position by displaying the reasons of the two types of failure in verification.
Step 413: and releasing the electronic contract file.
In the step, the electronic signature in the electronic contract is checked for correctness, completeness and position correctness, the electronic signature can be judged to be a valid signature meeting the requirements of the electronic contract, and the electronic contract can be output to carry out the next business activity.
For example, in a business scenario, an electronic contract typically has a plurality of front parties, such as a first company and a second company, and after the first company needs to sign first, the electronic contract with the electronic seal of the first company is sent to the second company, and the second company seals the electronic seal of the second party, so that the electronic contract can be validated. However, in the actual system docking, because the internal system of the first company is adjusted or configured abnormally, the situation that the electronic signature of the first company is not capped or added into other wrong electronic signatures easily occurs, and the problematic electronic contract is transmitted to the second company for post-processing, so that the electronic contract cannot be stamped on both sides according to requirements, and serious problems are generated. Through the scheme of the verification system, the electronic signature which the A company should cover is accurately covered or not in the power transmission subcontract of the A company through the system, and the electronic signature can be transmitted to the B company for processing after the verification is passed, so that the transmission accuracy of the electronic contract file in the actual business is ensured, and the problems are avoided.
The embodiment also provides a file signature integrity checking device based on a hash algorithm, as shown in fig. 5, which comprises,
an electronic signature configuration storage unit 501, configured to establish correspondence between different types of electronic signatures and corresponding types of electronic contracts;
the electronic signature conversion unit 502 is configured to convert different types of electronic signatures through a specified hash algorithm, and generate first unique identification strings corresponding to the different types of electronic signatures;
the to-be-verified electronic contract analyzing unit 503 is configured to analyze the to-be-verified electronic contract to obtain a type of the to-be-verified electronic contract and an image file of the electronic signature;
an electronic contract conversion unit 504, configured to convert the specified hash algorithm for the image file of the electronic signature, and generate a corresponding second unique identification string;
a character string determining unit 505, configured to determine a first unique identification character string corresponding to the electronic contract to be verified according to the type of the electronic contract to be verified;
and a verification unit 506, configured to verify that the second unique identification string is different from the corresponding first unique identification string. Since the principle of the device for solving the problem is similar to that of the method, the implementation of the device can be referred to the implementation of the method, and the repetition is omitted.
Fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention, where the apparatus may be the computer device in this embodiment, and perform the method described above. The computer device 602 may include one or more processing devices 604, such as one or more Central Processing Units (CPUs), each of which may implement one or more hardware threads. The computer device 602 may also include any storage resources 606 for storing any kind of information such as code, settings, data, etc. For example, and without limitation, storage resources 606 may include any one or more of the following combinations: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any storage resource may store information using any technology. Further, any storage resource may provide volatile or non-volatile retention of information. Further, any storage resources may represent fixed or removable components of computer device 602. In one case, when the processing device 604 executes associated instructions stored in any storage resource or combination of storage resources, the computer device 602 may perform any of the operations of the associated instructions. The computer device 602 also includes one or more drive mechanisms 608, such as a hard disk drive mechanism, an optical disk drive mechanism, and the like, for interacting with any storage resources.
The computer device 602 may also include an input/output module 610 (I/O) for receiving various inputs (via an input device 612) and for providing various outputs (via an output device 614). One particular output mechanism may include a presentation device 616 and an associated Graphical User Interface (GUI) 618. In other embodiments, input/output module 610 (I/O), input device 612, and output device 614 may not be included, but may be implemented as a single computer device in a network. The computer device 602 may also include one or more network interfaces 620 for exchanging data with other devices via one or more communication links 622. One or more communication buses 624 couple the above-described components together.
The communication link 622 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the internet), a point-to-point connection, etc., or any combination thereof. Communication link 622 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
Corresponding to the method in fig. 2 to 4, the embodiments herein also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method described above.
Embodiments herein also provide a computer readable instruction wherein the program therein causes the processor to perform the method as shown in fig. 1 to 5 when the processor executes the instruction.
It should be understood that, in the various embodiments herein, the sequence number of each process described above does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments herein.
It should also be understood that in embodiments herein, the term "and/or" is merely one relationship that describes an associated object, meaning that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled players may use different methods to implement the described functionality for each particular application, but such implementation should not be considered beyond the scope of this document.
It will be clear to a person skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated here.
In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the elements may be selected according to actual needs to achieve the objectives of the embodiments herein.
In addition, each functional unit in the embodiments herein may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions herein are essentially or portions contributing to the prior art, or all or portions of the technical solutions may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments herein. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Specific examples are set forth herein to illustrate the principles and embodiments herein and are merely illustrative of the methods herein and their core ideas; meanwhile, as for the players of the art, there are variations in the specific embodiments and the application scope according to the ideas herein, and the contents of the present specification should not be construed as limitations herein in view of the above.

Claims (12)

1. A file signature integrity checking method based on a hash algorithm is characterized by comprising the following steps of,
establishing corresponding relations between different types of electronic signatures and corresponding types of electronic contracts;
converting the electronic signatures of different types through a specified hash algorithm to generate first unique identification character strings corresponding to the electronic signatures of different types;
analyzing the electronic contract to be checked to obtain the type of the electronic contract to be checked and an image file of the electronic signature;
performing the specified hash algorithm conversion on the image file of the electronic signature to generate a corresponding second unique identification character string;
determining a first unique identification character string corresponding to the electronic contract to be checked according to the type of the electronic contract to be checked;
and checking the difference between the second unique identification character string and the corresponding first unique identification character string.
2. The method of claim 1, wherein the different types of electronic signatures are systematically applied electronic signatures in an electronic contract, including company signatures, department signatures, personal signatures, contract signatures.
3. The method of claim 1, wherein the specified hash algorithm comprises an MD5 algorithm, SHA128 algorithm.
4. A method according to claim 3, wherein the MD5 algorithm processes the incoming information in 512-bit packets, and each packet is further divided into 16 32-bit sub-packets, after which the electronic signature is output as the first or second unique identification string of four 32-bit packets.
5. The method of claim 1, wherein resolving the electronic contract to be verified to obtain an image file of the type of the electronic contract to be verified and the electronic signature, further comprising,
analyzing the electronic contract to be checked into a text file and an embedded file;
determining the type of the electronic contract to be checked according to the text content in the text file;
and converting the embedded file into an image file collection, wherein the image file collection comprises images of electronic signatures in the electronic contract.
6. The method of claim 5, wherein converting the embedded file into a collection of video files further comprises,
and carrying out the specified hash algorithm conversion processing on each image file in the image file collection to obtain a plurality of second unique identification character strings, and forming the second unique identification character string collection.
7. The method of claim 6, wherein verifying the dissimilarity of the second unique identification string with the corresponding first unique identification string further comprises,
and comparing each second unique identification character string in the second unique identification character string set with the first unique identification character string corresponding to the type of the electronic contract to be checked, intercepting and alarming if the first unique identification character string is not contained in the second unique identification character string set, and releasing and not intercepting if the first unique identification character string is contained in the second unique identification character string set.
8. The method of claim 5, wherein parsing the electronic contract to be verified into text content and embedding the text content into a file further comprises parsing a style file in the electronic contract to be verified, the style file including coordinate information of an electronic signature location of the electronic contract to be verified.
9. The method of claim 8, wherein parsing the electronic contract to be verified to obtain an image file of the type and electronic signature of the electronic contract to be verified further comprises,
acquiring coordinate information of the position where the electronic signature of the electronic contract to be checked should be;
and acquiring an image of the electronic signature at the corresponding position of the electronic contract to be checked according to the coordinate information of the position of the electronic signature.
10. A file signature integrity checking device based on a hash algorithm is characterized by comprising,
the electronic signature configuration storage unit is used for establishing the corresponding relation between different types of electronic signatures and corresponding types of electronic contracts;
the electronic signature conversion unit is used for converting the electronic signatures of different types through a specified hash algorithm to generate first unique identification character strings corresponding to the electronic signatures of different types;
the electronic contract analysis unit to be verified is used for analyzing the electronic contract to be verified to obtain the type of the electronic contract to be verified and an image file of the electronic signature;
the electronic contract conversion unit is used for converting the appointed hash algorithm of the image file of the electronic signature to generate a corresponding second unique identification character string;
the character string determining unit is used for determining a first unique identification character string corresponding to the electronic contract to be verified according to the type of the electronic contract to be verified;
and the verification unit is used for verifying the difference between the second unique identification character string and the corresponding first unique identification character string.
11. A computer device comprising a memory, a processor, and a computer program stored on the memory, characterized in that the computer program, when being executed by the processor, performs the instructions of the method according to any one of claims 1 to 9.
12. A computer storage medium having stored thereon a computer program, which, when executed by a processor of a computer device, performs the instructions of the method according to any of claims 1 to 9.
CN202310016514.5A 2023-01-06 2023-01-06 File signature integrity verification method and device based on hash algorithm Pending CN116150816A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310016514.5A CN116150816A (en) 2023-01-06 2023-01-06 File signature integrity verification method and device based on hash algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310016514.5A CN116150816A (en) 2023-01-06 2023-01-06 File signature integrity verification method and device based on hash algorithm

Publications (1)

Publication Number Publication Date
CN116150816A true CN116150816A (en) 2023-05-23

Family

ID=86338313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310016514.5A Pending CN116150816A (en) 2023-01-06 2023-01-06 File signature integrity verification method and device based on hash algorithm

Country Status (1)

Country Link
CN (1) CN116150816A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117114719A (en) * 2023-10-24 2023-11-24 四川数智云链科技有限公司 Digital anti-counterfeiting method based on whole flow of supply chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117114719A (en) * 2023-10-24 2023-11-24 四川数智云链科技有限公司 Digital anti-counterfeiting method based on whole flow of supply chain
CN117114719B (en) * 2023-10-24 2024-02-09 四川数智云链科技有限公司 Digital anti-counterfeiting method based on whole flow of supply chain

Similar Documents

Publication Publication Date Title
US20080168425A1 (en) Software testing techniques for stack-based environments
CN111901327A (en) Cloud network vulnerability mining method and device, electronic equipment and medium
CN111163182A (en) Block chain-based device registration method and apparatus, electronic device, and storage medium
CN114500690B (en) Interface data processing method and device, electronic equipment and storage medium
CN111475376A (en) Method and device for processing test data, computer equipment and storage medium
CN111198797B (en) Operation monitoring method and device and operation analysis method and device
CN116150816A (en) File signature integrity verification method and device based on hash algorithm
CN111339551B (en) Data verification method and related device and equipment
CN112738249B (en) File uploading method, device, equipment and storage medium based on quantitative transaction
CN114282997A (en) Data processing method and device for financial institution and electronic equipment
CN111327680B (en) Authentication data synchronization method, device, system, computer equipment and storage medium
CN111142863B (en) Page generation method and device
CN111783119A (en) Form data security control method and device, electronic equipment and storage medium
US11693750B2 (en) Virtual device for providing test data
CN114531289A (en) System interaction method based on artificial intelligence and related equipment
US11349670B1 (en) Automated hash validation
CN112738175B (en) Request processing method and related equipment
CN108052842A (en) Storage, verification method and the device of signed data
CN114675989A (en) Data verification method and device, electronic equipment and storage medium
CN114301600B (en) Method, device and medium for improving HTTP message signature security
CN117171800B (en) Sensitive data identification method and device based on zero trust protection system
CN114079647B (en) Method, device, system and computing equipment for checking IP address record
CN114745216B (en) Dynamic access method and device
WO2024119962A1 (en) Method and apparatus for analyzing and managing api, and computing device
CN110865892A (en) Detection method and device for call interface, storage medium and electronic equipment

Legal Events

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