File verification method and system

By calculating the feature identification information of the file in the printing device and the verification device, the problem of verification of consistency between the receiving file and the sending end of the printing device is solved, and timely identification and prevention of file tampering is realized.

CN119720241AActive Publication Date: 2025-03-28CHINA ELECTRONICS GREAT WALL CHANGSHA INFORMATION TECH +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411781874.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The prior art cannot effectively verify the consistency between the files received by the printing device and the original files sent by the sending end, resulting in difficulty in discovering and preventing file tampering in a timely manner.

Method used

After the printing device parses the received file, it calculates its unique feature identification information, and the verification device uses the same method to parse and calculates the feature identification information on the files sent by the sending end to perform consistency verification.

Benefits of technology

The consistency verification of the files received by the printing device and the files sent by the sending end is realized, and it can promptly identify whether the files have been tampered with during the transmission process, thereby preventing the spread of tampered information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720241A_ABST
    Figure CN119720241A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of network printing security, and provides a file verification method and system.The method comprises the steps that a printing device analyzes a file received from a sending end, calculates first feature identification information of the analyzed file and outputs the first feature identification information; and the verification device obtains the first feature identification information output by the printing device, analyzes the file sent by the sending end, calculates the second feature identification information of the analyzed file, and performs consistency verification on the file received by the printing device and the file sent by the sending end based on the first feature identification information and the second feature identification information. According to the application, consistency verification can be carried out on the file received by the printing equipment and the file sent by the sending end, the tampered file can be found in time, and tampered information is effectively prevented from spreading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of network printing security technology, and in particular, relates to a file verification method and system. Background Art

[0002] In the field of information security, it is crucial to ensure the integrity and consistency of documents and prevent them from being tampered with. For document protection, the widely adopted strategy is digital signature technology, which provides a strong guarantee for the credibility of documents after they pass through untrusted network environments. However, it is worth noting that even if a document is equipped with a digital signature, once it is presented in printed form, the original anti-counterfeiting mechanism is difficult to directly apply to paper documents, making it difficult to directly verify their authenticity.

[0003] When using computers and networks for daily work, we face potential security threats, especially from intruders with specific purposes. These intruders are often not only satisfied with large-scale damage to computer systems, but also tend to steal or tamper with sensitive data. Therefore, even if various security measures are taken to protect the security of data in electronic form, the risk of tampering when the data is converted to paper form (such as printing documents over the network) cannot be ignored.

[0004] As a key carrier of information transmission and expression, the accuracy of text is of vital importance. In formal documents such as contracts and orders, even minor tampering, such as changes in punctuation or adjustments in position, can cause huge distortions in meaning, leading to immeasurable consequences. Therefore, in printing scenarios involving important information, in order to prevent any form of tampering or replacement, it is crucial to verify the consistency between the file received by the printing device and the original file (the file sent). However, there is currently a lack of methods to verify the consistency between the content (including format) of the file received by the printing device and the original file, making it impossible to detect tampering with the file in a timely manner, resulting in the spread of tampered information. Summary of the invention

[0005] The embodiments of the present application provide a file verification method and system, which can solve the problem that it is impossible to verify the consistency between the file received by the printing device and the original file sent by the sending end.

[0006] In a first aspect, an embodiment of the present application provides a file verification method, which is applied to a printing device, comprising:

[0007] The printing device parses the file received from the sending end to obtain a first parsed file;

[0008] The printing device calculates first feature identification information of the first parsed file, where the first feature identification information uniquely corresponds to the content of the first parsed file;

[0009] The printing device outputs the first feature identification information so that the verification device can parse the file sent by the sender to obtain a second parsed file and calculate the second feature identification information of the second parsed file, and then verify the consistency of the file received by the printing device and the file sent by the sender based on the first feature identification information and the second feature identification information.

[0010] In some embodiments, the printing device calculates the first feature identification information of the first parsed file, including:

[0011] The printing device generates a random number n;

[0012] The first feature identification information is calculated based on the random number n and the data of the first parsed file.

[0013] In some embodiments, the first feature identification information is a hash value of the first parsed file, and the first feature identification information is calculated based on the random number n and the data of the first parsed file, including:

[0014] The printing device determines the number of data bits k required to print a line;

[0015] Divide the data of the first parsed file into m sub-data in units of the number of data bits contained in n lines, P is the total number of data bits in the first parsed file;

[0016] The hash value calculation formula of the first parsed file is: θ m =f(θ m-1 +p(n m ));

[0017] Among them, θ m is the hash value of the first parsed file, f() is the hash function, p(n m ) is the mth sub-data, and “+” indicates data concatenation.

[0018] In some embodiments, the method further includes: the printing device encrypting the first feature identification information, including:

[0019] The encryption formula is: D B =g(n+θ m ), where D B is the first encrypted feature identification information, g() is the encryption function, θ m It is the first characteristic identification information of the first parsed file, and “+” indicates data concatenation.

[0020] In a second aspect, the present application also provides a file verification method, which is applied to a verification device, and the method comprises:

[0021] The verification device obtains first feature identification information; the first feature identification information uniquely corresponds to the content of a first parsed file, and the first parsed file is obtained by the printing device parsing a file received from a sending end;

[0022] The verification device parses the file sent by the sending end to obtain a second parsed file;

[0023] The verification device calculates second feature identification information of the second parsed file;

[0024] The verification device performs consistency verification on the file received by the printing device and the file sent by the sending end based on the first feature identification information and the second feature identification information.

[0025] In some embodiments, the verification device calculates the second feature identification information of the second parsed file, including:

[0026] The verification device obtains the random number n of the first feature identification information calculated by the printing device;

[0027] The second feature identification information is calculated based on the random number n and the data of the second parsed file.

[0028] In some embodiments, the verification device performs consistency verification on the file received by the printing device and the file sent by the sending end based on the first feature identification information and the second feature identification information, including:

[0029] The verification device compares the character at the preset position in the first feature identification information with the character at the same preset position in the second feature identification information;

[0030] If they are the same, it is determined that the file received by the printing device is consistent with the file sent by the sending end; otherwise, it is determined that the file received by the printing device is inconsistent with the file sent by the sending end.

[0031] In some embodiments, when the first feature identification information is encrypted information, the verification device obtaining the random number n calculated by the printing device for the first feature identification information includes:

[0032] The first characteristic identification information is decrypted using a decryption method corresponding to the first characteristic identification information encrypted by the printing device to obtain a random number n.

[0033] In some embodiments, the method further comprises:

[0034] The second feature identification information is encrypted using the same encryption algorithm as that used by the printing device to encrypt the first feature identification information, thereby obtaining encrypted second feature identification information.

[0035] In some embodiments, performing consistency verification on the electronic file received by the printing device and the electronic file sent by the sending end based on the first feature identification information and the second feature identification information includes:

[0036] The verification device compares the character at the preset position in the encrypted first feature identification information with the character at the same preset position in the encrypted second feature identification information;

[0037] If they are the same, it is determined that the file received by the printing device is consistent with the file sent by the sending end; otherwise, it is determined that the file received by the printing device is inconsistent with the file sent by the sending end.

[0038] In a third aspect, the present application also provides a document verification system, the system comprising a printing device and a verification device;

[0039] The printing device is used to perform the following steps:

[0040] Parsing a file received from a sending end to obtain a first parsed file;

[0041] Calculating first feature identification information of the first parsed file, where the first feature identification information uniquely corresponds to the content of the first parsed file;

[0042] Outputting the first feature identification information;

[0043] The calibration equipment is used to perform the following steps:

[0044] Parsing the file sent by the sending end to obtain a second parsed file;

[0045] Calculating second feature identification information of a second parsed file;

[0046] Based on the first feature identification information and the second feature identification information, consistency verification is performed on the file received by the printing device and the file sent by the sending end.

[0047] The above solution of the present application has the following beneficial effects:

[0048] In an embodiment of the present application, after the printing device parses the file to be printed into printable file data, the printing device calculates the feature identification information of the file data based on the unique pixel information of the file data, and at the same time, the verification device parses and calculates the file sent by the sender in the same manner to obtain the file feature identification information sent by the sender, and by comparing the feature identification information obtained by the verification device with the feature identification information obtained by the printing device, the consistency verification of the file received by the printing device and the file sent by the sender is achieved, thereby effectively identifying whether the original file sent by the sender has been tampered with during the transmission process, and timely discovering the tampered file, effectively preventing the spread of the tampered information.

[0049] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 A flowchart of a file verification method provided in one embodiment of the present application;

[0052] Figure 2 A flowchart of a file consistency verification process provided by an embodiment of the present application;

[0053] Figure 3 A schematic diagram of the structure of a file verification system provided in one embodiment of the present application. DETAILED DESCRIPTION

[0054] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0055] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0056] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0057] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0058] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0059] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0060] As an indispensable device in the modern office environment, the internal structure of the printer is similar to that of a computer, equipped with a processor, memory, and running a specific operating system. However, compared with computers, printers often lack sufficient protection software, which makes them particularly vulnerable to security threats. The communication characteristics of the printer determine that it needs to frequently transmit file data, which makes it very easy to become a target of attackers in this process. Therefore, we must face up to the security risks of the printer and strengthen its protection measures to ensure the safe execution of the printing task. In view of this, the present application is based on such a technical concept: based on the printer's file parsing and processing, for the unique pixel information of the processed file, construct feature identification information that uniquely corresponds to the file data content. If the source file sent to the printer by the user end through the PC or other terminal device is not tampered with during the transmission process, the feature identification information before and after the file processing should be consistent, otherwise, it can be considered that the file has been tampered with during the transmission process. Based on this, it is possible to accurately determine whether the paper document output by the printer maintains the content and format that are completely consistent with the source file sent by the sender, thereby effectively preventing the risk of tampering and replacement.

[0061] Specifically, in response to the current problem that it is impossible to verify the consistency between the file received by the printing device and the original file sent by the sender, an embodiment of the present application provides a file verification method. According to the method, after the printing device parses the file to be printed into printable file data, the printing device calculates the feature identification information of the file data based on the unique pixel information of the file data. At the same time, the verification device adopts the same method to parse and calculate the original file sent by the sender to obtain the feature identification information. By comparing the feature identification information obtained by the verification device with the feature identification information obtained by the printing device, the consistency of the file received by the printing device and the file sent by the sender is verified, thereby effectively identifying whether the file has been tampered with during the transmission process, and timely discovering the tampered file, effectively preventing the spread of the tampered information.

[0062] The file verification method provided by the present application is exemplarily described below in conjunction with specific embodiments.

[0063] like Figure 1 As shown, the file verification method applied to the printing device side includes the following steps:

[0064] Step 11: The printing device parses the file received from the sending end to obtain a first parsed file.

[0065] Parsing the received file in this step means that the printing device uses its own encoding conversion module (for example, converting image data into a bitmap through rasterization) to convert the received file into to-be-printed data (i.e., the first parsed file) that can be directly printed by the printing device. The first parsed file is data that can be directly printed by the printing device and has unique pixel information.

[0066] In some embodiments of the present application, the above-mentioned printing device can be any form of printer, such as a laser printer, an inkjet printer, etc.

[0067] Step 12: The printing device calculates first feature identification information of the first parsed file, where the first feature identification information uniquely corresponds to the content of the first parsed file.

[0068] The printing device may obtain feature identification information of the first parsed file, that is, first feature identification information, based on unique pixel information of the first parsed file.

[0069] Step 13: The printing device outputs the first characteristic identification information.

[0070] This step does not limit the way in which the printing device outputs the first feature identification information. Exemplarily, the printing device can output and display it through the printing device screen. The verification device mainly parses the file sent by the sender to obtain a second parsed file, calculates the second feature identification information of the second parsed file, and then verifies the consistency of the file parsed by the printing device and the file sent by the sender based on the first feature identification information and the second feature identification information.

[0071] The above-mentioned verification device will use the same algorithm as the printing device to parse the file sent by the sender and calculate the feature identification information for consistency verification.

[0072] Specifically, the parsing of the file sent by the sender by the verification device can also be implemented by means of a built-in encoding conversion module. The verification device and the printing device use the same encoding conversion module. The verification device uses its own encoding conversion module to parse the file sent by the sender to obtain a second parsed file and obtain the second characteristic identification information of the second parsed file. It should be noted that, since the present application is to implement consistency verification between the file sent by the sender and the file parsed by the printing device, the printing device and the verification device implement the file processing process in the same manner. For example, the printing device uses the same parsing method for the received file and the verification device uses the same parsing method for the file sent by the sender. For example, the same encoding conversion module can be built into the printing device and the verification device, and the verification device obtains the second characteristic identification information in the same manner as the printing device obtains the first characteristic identification information.

[0073] It can be understood that the first characteristic identification information is the characteristic identification information corresponding to the file after transmission, and the second characteristic identification information is the characteristic identification information of the file before transmission. If the file is not tampered with during the process of transmission from the user terminal device to the printing device for processing, the first characteristic identification information and the second characteristic identification information should be the same; on the contrary, if the file is tampered with during the process of transmission from the user terminal device to the printing device for processing, the first characteristic identification information and the second characteristic identification information are different. Based on this, by comparing the first characteristic identification information and the second characteristic identification information, the consistency verification of the file received by the printing device and the file on the sending end can be realized, so as to effectively identify whether the original file sent by the sending end has been tampered with during the transmission process, and timely discover the tampered file, and effectively prevent the spread of the tampered information.

[0074] The specific implementation process of calculating the first characteristic identification information of the parsed file by the printing device is exemplarily described below in conjunction with a specific embodiment.

[0075] In some embodiments of the present application, the specific implementation manner of calculating the first feature identification information by the printing device is:

[0076] The printing device generates a random number n; and calculates first feature identification information based on the random number n and data of the first parsed file.

[0077] In some embodiments of the present application, the first characteristic identification information may be a file hash value.

[0078] Specifically, taking the file hash value as an example, the process of the printing device calculating the first feature identification information is as follows:

[0079] The printing device determines the number of data bits k required to print one line; divides the data of the first parsed file into m sub-data based on the number of data bits contained in n lines, P is the total number of data bits in the first parsed file, For rounding up operation, when P cannot be divided by kn, the remaining data is the mth sub-data.

[0080] The hash value calculation formula of the first parsed file is: θ m =f(θ m-1 +p(n m ));

[0081] Among them, θ m is the hash value of the first parsed file, f() is the hash function, p(n m ) is the mth sub-data, and “+” indicates data concatenation. The hash value calculation formula of the first parsed file is an iterative formula, θ m-1 It can be understood as a hash value obtained by performing a hash calculation on the (m-1)th sub-data using a hash function.

[0082] In some embodiments, the printing device may have a built-in hash calculator (i.e., a file hash calculator). The function of the hash calculator is to monitor the pixel information to be printed by the printing device. After the printing device parses the print file, it performs hash calculation to form a hash value. Specifically, an independent chip may be set on the main control board of the printing device as a hash calculator for running file hash calculations. The chip may be a dedicated microcontroller unit (MCU) or a small core of a central processing unit (CPU). The file parsed by the printing device may be sent to the hash calculator and the laser control chip respectively through the main control board, or the main control board may send the parsed file data to the hash calculator, which is transparently transmitted to the laser control chip by the hash calculator to ensure that the data to be printed obtained by the hash calculator and the laser control chip are consistent, that is, the printed paper file is consistent with the file data for calculating the hash value.

[0083] The first parsed file is input into a hash calculator for hash calculation, and the output of the hash calculator is used as first feature identification information of the first parsed file.

[0084] To better understand the hash calculation process, an example is given below.

[0085] The first step is to print the file received by the device (denoted as A);

[0086] In the second step, file A is parsed by the printing device to form the data B to be printed (the first parsed file). For a clearer description, the format of B is assumed to be: Here we simply assume the rows and columns. The actual situation is determined by the print file size and resolution. It is also assumed that each number in the expression of B is a hexadecimal number, which represents the value of 0 or 1 for 8 consecutive (pixel) points. 0 represents no ink dots, and 1 represents printing ink dots.

[0087] It should be noted that when the printing device actually processes the file, it reads the file to be printed as an image, and then rasterizes it into a bitmap, forming a data stream composed of multiple 0s and 1s, which does not exist in the form of a row and column matrix. However, when printing, the user will select the type of paper to be printed, such as A3 or A4 paper. After the paper type is selected, the size of the paper is also determined. The printing device will determine the number of pixels (or data bits) to be printed in each row according to the size of the printing paper selected by the user and the printing resolution of the printing device, which is equivalent to determining the number of rows and columns of pixels to be printed on each printing medium. Therefore, the format of B in this example can be understood as a mathematical expression of the data stream in the printing process.

[0088] Based on the mathematical expression of rows and columns of B in this example, in data processing, the hash calculation process can perform hash calculation in units of rows (which can be multiple rows), or in units of columns (which can be multiple columns) or fixed matrix blocks.

[0089] Considering that the file is transmitted to the printing device in a data streaming manner, the hash calculation is performed in line units, which can be processed in real time. If the calculation is performed in columns, the printing device needs to cache the file data and then process the file data in columns, which will have higher requirements on the storage capacity of the printing device. The hash calculation performed in matrix blocks still has the problem of the storage capacity of the printing device, and at the same time, it will also increase the complexity of data processing. Preferably, the hash calculation in line units is adopted.

[0090] In the third step, after the hash calculator obtains the data B to be printed, it calculates the hash value.

[0091] Of course, the hash calculator can also calculate the hash value through the mirror data and discard the original data. Here, the content of the mirror file is consistent with the data content of the parsed file. The hash calculation process is as follows: the hash calculator first generates a random code n (that is, the random number n mentioned above), and the value of n is between 1 and 1024. Then, the n lines of data are hashed: f(p(n1)), where p(n1) means taking n lines of data starting from position n(1-1)+1, that is, taking n lines of data in the data B to be printed, and f() means calculating the hash value of the data. The implementation method of f() can be SM3 in the national secret algorithm, or other algorithms can be used, such as the fifth version of the message digest algorithm (MD5), the secure hash algorithm (SHA), the key-related hash operation message authentication code (HMAC), etc. Specifically, it can be obtained by calculating the formula for the hash value:

[0092] θ1=f(p(n1))

[0093] θ2=f(θ1+p(n2))

[0094] θ m =f(θ m-1 +p(n m ))

[0095] Among them, θ1 is a string of fixed length, n2 means taking n rows of data starting from row n(2-1)+1, (θ1+p(n2)) means merging and concatenating two segments of data, θ m is the hash value of file B output by the hash calculator, α+4 represents the total number of data bits of the data B to be printed in the second step, and m represents the number of data blocks after the file is split according to the random code n.

[0096] In order to accurately understand the data merging and splicing described in this embodiment, an example is given here, assuming that the data to be merged and spliced ​​is θ i =yuio, data block is The concatenated data is abcdefghyuio.

[0097] In some embodiments of the present application, after the first feature identification information (i.e., the hash value) is calculated, in order to improve the accuracy of consistency verification, the first feature identification information can also be encrypted by a printing device to obtain the encrypted first feature identification information. That is, the printing device encrypts the first feature identification information and outputs it. The encryption algorithm can be an elliptic curve public key cryptography algorithm (SM2), a block cipher algorithm (SM4), a block symmetric encryption algorithm (DES), a triple data encryption algorithm (3DES), etc.

[0098] Specifically, the encryption formula can be: B =g(n+θm ), where D B is the first encrypted feature identification information, g() is the encryption function (i.e., encryption algorithm), θ m is the first characteristic identification information of the first parsed file, "+" indicates data concatenation, and n is a random number. The encryption algorithm can be integrated in the MCU or CPU core, or it can be encrypted in a safer way using an encryption chip on the mainboard of the printing device.

[0099] The following is an exemplary description of the file verification method applied to the verification device side in conjunction with a specific embodiment.

[0100] like Figure 2 As shown, the file verification method applied to the verification device side includes the following steps:

[0101] Step 21: The verification device obtains the first characteristic identification information.

[0102] The first feature identification information uniquely corresponds to the first parsed file content, and the first feature identification information

[0103] The first parsed file is obtained by calculating the first parsed file by the printing device, and the first parsed file is obtained by the printing device parsing the file received from the sending end.

[0104] Step 22: The verification device parses the file sent by the sender to obtain a second parsed file;

[0105] Step 23: The verification device calculates second feature identification information of the second parsed file;

[0106] The method by which the verification device parses the file sent by the sender is the same as the method by which the printing device parses the received file. Parsing in this step refers to the verification device converting the file encoding sent by the sender into data that can be directly printed by the printing device, that is, the second parsed file. For example, the verification device can have a built-in encoding conversion module to convert (parse) the file encoding sent by the sender to obtain a second parsed file, and the verification device calculates the second feature identification information for the second parsed file. Among them, the verification device adopts the same file parsing method and file feature identification information calculation method as the printing device. The calculation process of the second feature identification information can refer to the calculation process of the aforementioned first feature identification information, which will not be repeated here.

[0107] It should be noted that the verification device side uses the same file parsing and file feature identification calculation method as the printing device side. It can be regarded as the verification device repeating the file processing process of the printing device. The difference is that the verification device processes the sent file, and the printing device processes the received file. If the sent and received files are consistent, and the same processing process is added, the file processing results should be consistent.

[0108] Step 24: The verification device performs consistency verification on the file received by the printing device and the file sent by the sending end based on the first feature identification information and the second feature identification information.

[0109] Among them, if the file has not been tampered with during the process of being transmitted from the user terminal device to the printing device for processing, the first feature identification information and the second feature identification information should be the same; otherwise, the first feature identification information and the second feature identification information are different. Based on this, the verification device can verify the consistency of the sending end file and the file processed by the printing device by comparing the first feature identification information and the second feature identification information, thereby effectively identifying whether the file has been tampered with during the transmission process, and timely discovering the tampered file, effectively preventing the spread of tampered information.

[0110] In some embodiments of the present application, the verification device obtains the second feature identification information in the same way as the printing device obtains the first feature identification information, that is, the second feature identification information may also be a file hash value. Since the random number n for calculating the first feature identification information is randomly generated by the printing device, when calculating the second feature identification information, the verification device needs to obtain the random number n used by the printing device to calculate the first feature identification information; and calculate the second feature identification information based on the random number n and the data of the second parsed file.

[0111] In some embodiments of the present application, the printing device may output a random number n while outputting the first feature identification information. Based on this, the verification device may directly obtain the random number n used to calculate the first feature identification information through the printing device, and calculate the second feature identification information based on the obtained random number n.

[0112] Exemplarily, the printing device can output the random number n and the first feature identification information through a hash calculator. It is particularly pointed out that the output form can be through the printing device screen, or a communication protocol with an output function connected to the main control interface of the printing device, which is used for reading by the web server of the printing device for user access, or connected to the USB interface of the device and read through a USB flash drive. In the case where the printing device outputs the first feature identification information and the random number n, the specific implementation method of the verification device to verify the consistency of the file parsed by the printing device and the file sent by the sender based on the first feature identification information and the second feature identification information is as follows: the verification device compares the characters at the preset position in the first feature identification information with the characters at the same preset position in the second feature identification information. If the characters at the preset position in the first feature identification information are the same as the characters at the same preset position in the second feature identification information, it is determined that the file parsed by the printing device is consistent with the electronic file sent by the sender. Otherwise, it is determined that the file parsed by the printing device is inconsistent with the electronic file sent by the sender. Among them, the characters at the preset position can be the last 6 digits of the feature identification information, or can be characters at other specified positions, and of course can also be characters at all positions.

[0113] In other embodiments of the present application, when the printing device outputs encrypted first feature identification information, and the verification device obtains that the first feature identification information output by the printing device is the encrypted first feature identification information, the verification device calculates the second feature identification information in the following manner: first, the encrypted first feature identification information is decrypted using a decryption method corresponding to the first feature identification information encrypted by the printing device, and the decryption obtains a random number n used by the printing device to calculate the first feature identification information; and then the second feature identification information is calculated based on the random number n.

[0114] In some embodiments of the present application, after the second feature identification information is calculated, in order to improve the accuracy of consistency verification, the file verification method further includes the following step of encrypting the second feature identification information: encrypting the second feature identification information using the same encryption algorithm as the printing device encrypting the first feature identification information to obtain the encrypted second feature identification information. The specific encryption algorithm refers to the process of encrypting the first feature identification information, which will not be repeated here.

[0115] In the case where the printing device outputs the encrypted first feature identification information and the verification device also encrypts the second feature identification information, the specific implementation method of verifying the consistency of the file parsed by the printing device and the file sent by the sender based on the first feature identification information and the second feature identification information is as follows: the verification device compares the characters at the preset position in the encrypted first feature identification information with the characters at the same preset position in the encrypted second feature identification information. If the characters at the preset position in the encrypted first feature identification information are the same as the characters at the same preset position in the encrypted second feature identification information, it is determined that the file parsed by the printing device and the file sent by the sender are consistent. Otherwise, it is determined that the file parsed by the printing device and the file sent by the sender are inconsistent. For example, the characters at the preset position can be the last 6 digits of the encrypted feature identification information, or characters at other specified positions, or of course, characters at all positions.

[0116] In some embodiments of the present application, the verification device may be a terminal device with computing functions, such as a personal computer.

[0117] The verification device can also be composed of a terminal device and an external device. For example, in some embodiments, in order to facilitate the verification device to parse the file sent by the sender and obtain the corresponding feature identification information, the external device can be used to solidify the encoding conversion module and hash calculator for file parsing. Specifically, the external device can be a USB device, which does not have a read and write function except a verification tool. Of course, in some optional examples, the external device can also solidify the encryption algorithm and encryption chip to encrypt the second feature identification information.

[0118] In summary, the embodiment of the present application uses a verification device to parse and calculate the file sent by the sender in the same manner as the printing device to obtain feature identification information, and compares the feature identification information obtained by the verification device with the feature identification information obtained by the printing device to achieve consistency verification of the file received by the printing device and the file sent by the sender, thereby effectively identifying whether the file sent by the sender has been tampered with during the transmission process, and promptly discovering the tampered file, effectively preventing the spread of tampered information.

[0119] After the above embodiments are described in detail on the printing device side and the verification device side, this application provides an example of the interaction process between the printing device and the verification device. Specifically, it includes:

[0120] Step A: The printing device parses the file received from the sending end to obtain a first parsed file;

[0121] Step B: The printing device calculates first feature identification information of the first parsed file, where the first feature identification information uniquely corresponds to the content of the first parsed file;

[0122] Step C: the printing device outputs the first feature identification information;

[0123] Step D: The verification device receives the first characteristic identification information;

[0124] Step E: parsing the file sent by the sending end to obtain a second parsed file;

[0125] Step F: Calculate the second feature identification information of the second parsed file;

[0126] Step G: Based on the first feature identification information and the second feature identification information, consistency verification is performed on the file received by the printing device and the file sent by the sending end.

[0127] The specific implementation of each step in this example can refer to the description of the above embodiment, which will not be repeated here.

[0128] The present application also provides a file verification system. The file verification system provided in an embodiment of the present application is exemplarily described below.

[0129] like Figure 3 As shown, the file verification system 300 provided in the embodiment of the present application includes a printing device 301 and a verification device 302.

[0130] The printing device 301 is mainly used to perform the following steps:

[0131] Parsing a file received from a sending end to obtain a first parsed file;

[0132] Calculating first feature identification information of the first parsed file, where the first feature identification information uniquely corresponds to the content of the first parsed file;

[0133] Outputting the first feature identification information;

[0134] The verification device 302 is mainly used to perform the following steps:

[0135] Parsing the file sent by the sending end to obtain a second parsed file;

[0136] Calculating second feature identification information of a second parsed file;

[0137] Based on the first feature identification information and the second feature identification information, consistency verification is performed on the file received by the printing device and the file sent by the sending end.

[0138] It should be noted that the process of the printing device and the verification device in the file verification system obtaining feature identification information, and comparing the first feature identification information and the second feature identification information to achieve consistency verification has been described in detail in the previous article, so these processes will not be repeated here.

[0139] It is worth mentioning that the verification device uses the same method as the printing device to parse the file and calculate the first characteristic identification information to parse the file sent by the sender and calculate the second characteristic identification information, and by comparing the characteristic identification information of the sender's file with the characteristic identification information of the file after parsing by the printing device, it realizes the consistency verification of the files at both ends of the sender and the receiver, thereby effectively identifying whether the original document has been tampered with during the transmission process, and timely discovering the tampered file, effectively preventing the spread of tampered information.

[0140] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A file verification method, characterized in that: The method comprises: The printing device parses the file received from the sending end to obtain a first parsed file; The printing device calculates first feature identification information of the first parsed file, where the first feature identification information uniquely corresponds to the content of the first parsed file; The printing device outputs the first feature identification information so that the verification device can parse the file sent by the sender to obtain a second parsed file and calculate the second feature identification information of the second parsed file, and then verify the consistency of the file received by the printing device and the file sent by the sender based on the first feature identification information and the second feature identification information.

2. The file verification method according to claim 1, characterized in that: The printing device calculates first feature identification information of the first parsed file, including: The printing device generates a random number n; The first feature identification information is calculated based on the random number n and the data of the first parsed file.

3. The file verification method according to claim 2, characterized in that: The first feature identification information is a hash value of the first parsed file, and the first feature identification information is calculated based on the random number n and the data of the first parsed file, including: The printing device determines the number of data bits k required to print a line; Divide the data of the first parsed file into m sub-data in units of the number of data bits contained in n lines, P is the total number of data bits in the first parsed file; The hash value calculation formula of the first parsed file is: θ m =f(θ m-1 +p(n m )); Among them, θ m is the hash value of the first parsed file, f() is the hash function, p(n m ) is the mth sub-data, and "+" indicates data concatenation.

4. The file verification method according to claim 2, characterized in that: Also includes: The printing device encrypts the first feature identification information, including: The encryption formula is: D B =g(n+θ m ), where D B is the first encrypted feature identification information, g() is the encryption function, θ m It is the first characteristic identification information of the first parsed file, and "+" indicates data splicing.

5. A file verification method, characterized in that: The method comprises: The verification device obtains first feature identification information; the first feature identification information uniquely corresponds to the content of a first parsed file, and the first parsed file is obtained by the printing device parsing a file received from a sending end; The verification device parses the file sent by the sending end to obtain a second parsed file; The verification device calculates second feature identification information of the second parsed file; The verification device performs consistency verification on the file received by the printing device and the file sent by the sending end based on the first feature identification information and the second feature identification information.

6. The file verification method according to claim 5, characterized in that: The verification device calculates the second feature identification information of the second parsed file, including: The verification device obtains the random number n of the first feature identification information calculated by the printing device; The second feature identification information is calculated based on the random number n and the data of the second parsed file by using the same algorithm as that used by the printing device to calculate the first feature identification information.

7. The file verification method according to any one of claims 5 or 6, characterized in that: The verification device performs consistency verification on the file received by the printing device and the file sent by the sending end based on the first feature identification information and the second feature identification information, including: The verification device compares the character at the preset position in the first feature identification information with the character at the same preset position in the second feature identification information; If they are the same, it is determined that the file received by the printing device is consistent with the file sent by the sending end; otherwise, it is determined that the file received by the printing device is inconsistent with the file sent by the sending end.

8. The file verification method according to claim 6, characterized in that: When the first characteristic identification information is encrypted information, the verification device obtains the random number n of the first characteristic identification information calculated by the printing device, including: The first characteristic identification information is decrypted using a decryption method corresponding to the first characteristic identification information encrypted by the printing device to obtain a random number n.

9. The file verification method according to claim 8, characterized in that: Also includes: The second feature identification information is encrypted using the same encryption algorithm as that used by the printing device to encrypt the first feature identification information, thereby obtaining encrypted second feature identification information.

10. The file verification method according to claim 9, characterized in that: The electronic file received by the printing device and the electronic file sent by the sending end are verified for consistency based on the first feature identification information and the second feature identification information, including: The verification device compares the character at the preset position in the encrypted first feature identification information with the character at the same preset position in the encrypted second feature identification information; If they are the same, it is determined that the file received by the printing device is consistent with the file sent by the sending end; otherwise, it is determined that the file received by the printing device is inconsistent with the file sent by the sending end.

11. A file verification system, characterized in that: The system includes a printing device and a verification device; The printing device is used to perform the following steps: Parsing a file received from a sending end to obtain a first parsed file; Calculating first feature identification information of the first parsed file, where the first feature identification information uniquely corresponds to the content of the first parsed file; Outputting the first feature identification information; The calibration equipment is used to perform the following steps: Parsing the file sent by the sending end to obtain a second parsed file; Calculating second feature identification information of a second parsed file; Based on the first feature identification information and the second feature identification information, consistency verification is performed on the file received by the printing device and the file sent by the sending end.

Citation Information

Patent Citations

  • File verification method and device

    CN110321734A

  • File printing method and device

    CN112445442A

  • File verification method and device and storage medium

    CN115733613A

  • File printing method and device and electronic equipment

    CN116048435A

  • Legitimacy protection of electronic document and a printed copy thereof

    CN1361960A