Disclosure of Invention
The applicant finds that the existing encryption mode is high in encryption cost or high in interpretation difficulty, so that the application field of the existing encryption mode is greatly limited, and the existing encryption mode cannot be particularly suitable for files with large encryption quantity such as medical orders and testimony orders.
In order to solve the technical problems, the application aims to provide a printing encryption method, a printer data acquisition and analysis method and a printing scanning device.
The technical scheme of the invention is as follows:
in one aspect of the present invention, there is provided a print encryption method, including the steps of: inputting a password and an electronic document to be encrypted; setting encryption symbols and the number thereof, interference symbols and the number thereof according to the input password and a preset password arrangement rule; adding each encrypted symbol and each interference symbol into the electronic document to be encrypted according to the digit of the input password, a preset symbol layout rule, the number of the encrypted symbols and the number of the interference symbols, and generating the electronic document to be printed; and outputting the electronic document to be printed.
Further, the encrypted symbol includes a shuttle shape, an equilateral triangle, and a circle; the interference symbols comprise fusiform, equilateral triangle, circle and S shape; the external rectangle of the fusiform is a square, and two tips of the fusiform are positioned on two opposite angular points of the external square; the external rectangle of the equilateral triangle is a square, the vertex of one corner of the equilateral triangle is positioned on one corner point of the square externally connected with the equilateral triangle, and the vertexes of the other two corners are respectively positioned on two edges of the externally connected square; the S-shaped external rectangle is non-square; the fusiform shape is a shape with two sharp ends and a wide middle part, and can also be understood as a three-dimensional effect formed by combining two cones together by using the bottom surfaces; setting encryption symbols and quantity, interference symbols and quantity according to the input password and a preset password arrangement rule, and specifically comprising the following steps: when the input password is a one-digit number, selecting an equilateral triangle as an encryption symbol, and S-shaped, shuttle-shaped and circular as interference symbols; when the input password is a two-digit number, selecting a shuttle shape and an equilateral triangle as encryption symbols, wherein the quantity of the equilateral triangle is the unit of the password, the quantity of the shuttle shape is the ten bits of the password, and the S shape and the circle are interference symbols; when the input password is three digits, selecting a shuttle shape, an equilateral triangle and a circle as encryption symbols, selecting the equilateral triangle as the unit of the encryption symbols, and selecting the circle as ten bits of the encryption symbols and the shuttle shape as hundred bits of the password; s-shaped is an interference symbol; the total number of the interference symbols is 0.5-1.2 times of the total number of the encryption symbols; wherein the password is greater than 2.
Further, the electronic document to be printed comprises an encryption area and a text area, and the text area and the encryption area are not overlapped.
Further, the preset symbol layout rule includes: determining the ratio of the distance between the two equilateral triangles with the largest distance in the transverse direction to the distance between the two equilateral triangles with the largest distance in the longitudinal direction according to the digit number of the password; when the password is a single digit, the ratio is between 0.8 and 1.2; when the password is a two-digit number, the ratio is between 1.8 and 2.2; when the password is three-digit, the ratio is between 2.8 and 3.2.
In another aspect of the present invention, a method for collecting and analyzing data of a printer is provided, including: acquiring an image of a document to be decrypted to obtain the image to be decrypted; identifying symbols in the image to be decrypted, and determining the digit of the password according to the identified symbols and a preset symbol layout rule; determining an encrypted symbol in the identified symbol according to the determined digit of the password, and counting the number of the encrypted symbols to obtain the password; and outputting the password and the image of the document part to be decrypted.
Further, determining an encrypted symbol in the identified symbol according to the determined digit of the password, and counting the number of the encrypted symbols to obtain the password, specifically comprising: when the determined password is a one-digit number, determining the equilateral triangle as an encryption symbol; counting the number of triangles with medium edges in the identified symbols to obtain a password; when the determined password is a two-digit number, determining that the shuttle shape and the equilateral triangles are encryption symbols, wherein the number of the equilateral triangles is the unit number of the password, and the number of the shuttle shape is the ten-digit number of the password; counting the number of triangles with equal edges in the identified symbols and the number of fusiform triangles to obtain a password; when the determined password is three digits, determining that a shuttle shape, an equilateral triangle and a circle are encryption symbols, wherein the equilateral triangle is the unit of the encryption symbols, the circle is ten bits of the encryption symbols, and the shuttle shape is hundred bits of the password; and counting the number of triangles with equal edges in the identified symbols, the number of circles and the number of shuttles to obtain the password.
Furthermore, an encryption area and a text area are arranged on the image to be decrypted, and the encrypted text area is not overlapped with the encryption area; identifying the symbol in the image to be decrypted specifically comprises: positioning an encryption area of the image to be decrypted; and identifying the encryption area of the image to be decrypted, and acquiring all symbols in the encryption area.
Further, determining the digit of the password according to the recognized symbol and a preset symbol layout rule specifically includes: determining the equilateral triangles closest to the upper, lower, left and right edges of the encryption area in the encryption area, and calculating the ratio of the distance between the left and right equilateral triangles to the distance between the upper and lower equilateral triangles; when the ratio is between 0.8 and 1.2, the password is a single digit; when the ratio is between 1.8 and 2.2, the password is a two-digit number; when the ratio is between 2.8 and 3.2, the password is three digits.
Further, identifying the symbol in the image to be decrypted further includes: acquiring the minimum circumscribed rectangle of each symbol, and judging whether each minimum circumscribed rectangle is a square or not; when the minimum circumscribed rectangle is not square, the symbol is S-shaped; when the minimum circumscribed rectangle is a square and the edge points of the symbol are positioned on two opposite corner points of the square, the symbol is in a fusiform shape; when the minimum circumscribed rectangle is a square, the symbol has three edge points positioned on the sides of the square, one edge point is positioned on one corner point of the square, and the other two edge points are respectively positioned on two sides of the square, the symbol is an equilateral triangle; when the minimum circumscribed rectangle is a square and the four edge points of the symbol are respectively located in the middle of the four sides of the square, the symbol is circular.
In a further aspect of the present invention, there is provided a print scanning apparatus comprising a processor and a memory, the memory having stored therein computer instructions for executing computer instructions stored in the memory, the apparatus implementing the steps of the method as claimed in any one of the above when the computer instructions are executed by the processor.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the following embodiments and accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
It should be noted that, in order to avoid obscuring the present invention with unnecessary details, only the structures and/or processing steps closely related to the scheme according to the present invention are shown in the drawings, and other details not so relevant to the present invention are omitted.
It should be emphasized that the term "comprises/comprising" when used herein, is taken to specify the presence of stated features, elements, steps or components, but does not preclude the presence or addition of one or more other features, elements, steps or components.
It should be noted that, in the present application, the embodiments and features of the embodiments may be combined with each other without conflict.
Fig. 1 is an exemplary flowchart of a print encryption method of the present application.
The application provides a printing encryption method, which comprises the following steps:
s11, inputting a password and the electronic document to be encrypted;
s12, setting encryption symbols and the number thereof, interference symbols and the number thereof according to the input password and a preset password arrangement rule;
s13, adding each encrypted symbol and each interference symbol into the electronic document to be encrypted according to the digit of the input password, a preset symbol layout rule, the number of the encrypted symbols and the number of the interference symbols, and generating the electronic document to be printed;
and S14, outputting the electronic document to be printed.
The electronic document to be encrypted can be an electronic document such as word and PDF obtained by directly editing the document by document editing software, or an electronic picture of the document obtained by photographing or scanning a document picture.
The printing encryption method provided by the invention converts the input password according to the preset symbol and rule into the encryption symbol and the interference symbol, attaches the converted encryption symbol and the interference symbol to the electronic document to be encrypted to form the encrypted electronic document to be printed, and prints the encrypted electronic document to be printed to obtain the encrypted paper document. The setting of the encryption symbol and the interference symbol increases the difficulty of deciphering, and effectively ensures the security of the file encrypted by the password. The encryption method does not destroy the substantial content of the document, the content in the electronic document to be encrypted is still displayed in the printed file in the state before encryption, and people cannot be influenced to look up the content on the paper document at any time. For the encrypted part, the encrypted file can display the corresponding password after being decoded, and an encrypter can know whether the document of the paper is replaced or not by judging whether the decoded password is consistent with the password during encryption or not. The method provided by the invention can realize the encryption of the document through the printer, and can effectively realize the encryption of the document for medical advice, will advice and the like which need to display the content of the document for people to read and prevent people from maliciously tampering with the replaced document.
In order to implement the above encryption method, it is necessary to select appropriate encryption symbols and interference symbols, and to set corresponding encryption rules according to the encryption symbols and the interference symbols. Any plane symbol which can be printed by the printer can be used as an encryption symbol or an interference symbol, and a plurality of preset password arrangement rules can be selected according to the selection of the encryption symbol and the interference symbol.
A set of encryption symbols, interference symbols and preset cipher arrangement rules that can implement the above encryption method are introduced below.
In this embodiment, the encrypted symbols include a shuttle shape, an equilateral triangle, and a circle; the interference symbols comprise fusiform, equilateral triangle, circle and S shape; the external rectangle of the fusiform is a square, and two tips of the fusiform are positioned on two opposite angular points of the external square; the external rectangle of the equilateral triangle is a square, the vertex of one corner of the equilateral triangle is positioned on one corner point of the square externally connected with the equilateral triangle, and the vertexes of the other two corners are respectively positioned on two edges of the externally connected square; the S-shaped external rectangle is non-square; the fusiform shape is a shape with two sharp ends and a wide middle part, and can also be understood as a three-dimensional effect formed by combining two cones together by using the bottom surfaces;
setting encryption symbols and quantity, interference symbols and quantity according to the input password and a preset password arrangement rule, and specifically comprising the following steps:
when the input password is a one-digit number, selecting an equilateral triangle as an encryption symbol, and S-shaped, shuttle-shaped and circular as interference symbols;
when the input password is a two-digit number, selecting a shuttle shape and an equilateral triangle as encryption symbols, wherein the quantity of the equilateral triangle is the unit of the password, the quantity of the shuttle shape is the ten bits of the password, and the S shape and the circle are interference symbols;
when the input password is three digits, selecting a shuttle shape, an equilateral triangle and a circle as encryption symbols, selecting the equilateral triangle as the unit of the encryption symbols, and selecting the circle as ten bits of the encryption symbols and the shuttle shape as hundred bits of the password; s-shaped is an interference symbol;
the total number of the interference symbols is 0.5-1.2 times of the total number of the encryption symbols;
wherein the password is greater than 2.
The fusiform shape is a shape with two sharp ends and a wide middle part, and can also be understood as an orthographic projection effect of a three-dimensional shape formed by combining two cones together by using a bottom surface.
The invention limits the length-width ratio of each encrypted symbol, the arrangement mode in the external rectangle, and the like, so that the difference among the symbols is larger, the difficulty in reading the shape of the symbol is reduced, and the shape of the symbol can be analyzed quickly and accurately.
The ranges of the selected encryption symbols and the interference symbols are crossed, and the password content can be accurately determined by combining with the corresponding preset password arrangement rule, so that the accuracy of the password is ensured. Meanwhile, the encryption symbol and the interference symbol are matched with the preset password arrangement rule, if the person who comprehensively knows the preset password arrangement rule cannot accurately determine the password, the deciphering difficulty of the encryption mode is increased, and the safety of the password-protected document is improved.
Of course, the interference symbol, the encryption symbol, and the preset password arrangement rule provided herein are only one selectable encryption manner, and other shapes may be selected as the encryption password or the interference password in practical use, and the corresponding preset password arrangement rule may also be freely combined, for example, when the input password is a one-digit number, a circle is used as the encryption symbol, and other symbols are used as the interference symbol, and a person skilled in the art may select the shape of the interference symbol, the shape of the encryption symbol, and the preset password arrangement rule according to actual needs, and details are not described here.
In the printing encryption method provided by the invention, in the encryption process of the document to be printed, the electronic document to be printed comprises an encryption area and a text area, and the text area is not overlapped with the encryption area. The text area is separated from the encryption area, and the reading of the encrypted printing file is not influenced.
In this embodiment, the above interference symbols, encryption symbols, and preset cipher arrangement rules are determined, and it is also necessary to determine how to arrange each symbol, and the preset symbol arrangement rules provided in this embodiment are described below, and include:
determining the ratio of the distance between the two equilateral triangles with the largest distance in the transverse direction to the distance between the two equilateral triangles with the largest distance in the longitudinal direction according to the digit number of the password;
when the password is a single digit, the ratio is between 0.8 and 1.2;
when the password is a two-digit number, the ratio is between 1.8 and 2.2;
when the password is three-digit, the ratio is between 2.8 and 3.2.
In this embodiment, the ratio of the distances refers to a maximum value of differences between abscissa values of right midpoints of minimum circumscribed rectangles in any two equilateral triangles, and a maximum value of differences between ordinate values of upper midpoints of minimum circumscribed rectangles in any two equilateral triangles.
The method for determining the number of the password bits according to the transverse-longitudinal distance ratio between the two symbols increases the applicability of the password, facilitates setting different symbol arrangement density degrees according to the complexity degree (number) of the password, and avoids the problem that the symbols cannot be accurately distinguished when being superposed together or the problem that all symbols are easily found due to overlarge symbol distribution range; meanwhile, the method for determining the number of the password according to the distance increases the difficulty of password decryption to a certain extent and increases the security of the password. The mode of determining the number of the password bits according to the specific symbol distance is matched with the encryption symbol, the encryption symbol and the preset password arrangement rule, so that the difficulty of password decryption is effectively increased, and the security of the encrypted file is improved; the matched encryption mode is matched with printing, and the set encryption area and the text area are printed on paper, so that malicious tampering or file replacement by others can be effectively prevented; and the common printing can realize the encryption of the document and the quick password reading and reading of the person who knows the encryption rule, thereby reducing the printing cost, reducing the password reading cost and effectively ensuring the applicability of the printing encryption method.
In order to further increase the security of the encryption mode and prevent the content from being added or deleted at the edge of the page after someone copies the encrypted printed document, the invention adopts the scheme that a plurality of encryption areas are arranged in the document, each encryption area is respectively positioned at the upper, lower, left and right edges of a text area, and the minimum distance between each encryption area and the edge of the text area corresponding to the encryption area is less than one character. In order to find the encryption area quickly to realize quick decryption, the size of the encryption symbol can be set according to the size of the main font in the text body, for example, for the font mainly including four, the size of the font with five or even smaller sizes can be used, the larger the size difference is, the more favorable the quick determination of the encryption area is, certainly, the encryption area can be completely printed, so that the maximum printing range of the printer is met when the encryption area is set, when the mark is added at the edge of the document, the mark needs to be set in the printing range of the printer, for example, the mark which needs A3 paper to be completely printed cannot be set at the edge of the A4 paper. This is the prior art and will not be described in detail herein.
In order to avoid that a plurality of passwords are read in an encrypted file and that the encrypted file is not determined to be the document encrypted password, the invention selects each encryption area to adopt the same password. In order to further increase the security of the encryption mode, the layout and placement modes of the encryption symbols and the interference symbols in each encryption area are not completely the same.
In order to make the arrangement of the encrypted symbols more regular and to facilitate reading, the encrypted symbols and the interference symbols may be selectively distributed in the encryption region in a row.
As shown in fig. 2, an exemplary flowchart of a printer data collection and analysis method provided by the present invention is provided, and the printer data analysis method can analyze a document with encrypted symbols. Especially, the document encrypted by the printing encryption method can be analyzed, and the document content and the password in the document can be rapidly identified by the printer data acquisition and analysis method provided by the invention, so that people can rapidly acquire the password in the encrypted document.
The invention also provides a printer data acquisition and analysis method, which comprises the following steps:
s21, acquiring the image of the document to be decrypted to obtain the image to be decrypted;
s22, identifying the symbol in the image to be decrypted, and determining the digit of the password according to the identified symbol and a preset symbol layout rule;
s23, determining the encrypted symbols in the identified symbols according to the determined digit of the password, and counting the number of the encrypted symbols to obtain the password;
s24, the password and the image of the document portion to be decrypted are output.
According to the printer data acquisition and analysis method provided by the invention, the document to be decrypted is scanned to obtain the image to be decrypted, and then the image to be decrypted is analyzed, so that the password of the document to be decrypted can be identified and analyzed.
In this embodiment, determining an encrypted symbol in the identified symbol according to the determined bit number of the password, and counting the number of the encrypted symbols to obtain the password specifically includes:
when the determined password is a one-digit number, determining the equilateral triangle as an encryption symbol; counting the number of triangles with medium edges in the identified symbols to obtain a password;
when the determined password is a two-digit number, determining that the shuttle shape and the equilateral triangles are encryption symbols, wherein the number of the equilateral triangles is the unit number of the password, and the number of the shuttle shape is the ten-digit number of the password; counting the number of triangles with equal edges in the identified symbols and the number of fusiform triangles to obtain a password;
when the determined password is three digits, determining that a shuttle shape, an equilateral triangle and a circle are encryption symbols, wherein the equilateral triangle is the unit of the encryption symbols, the circle is ten bits of the encryption symbols, and the shuttle shape is hundred bits of the password; and counting the number of triangles with equal edges in the identified symbols, the number of circles and the number of shuttles to obtain the password.
In this embodiment, an encryption region and a text region are arranged on the image to be decrypted, and the encryption region and the text region are not overlapped;
identifying the symbol in the image to be decrypted specifically comprises: positioning an encryption area of the image to be decrypted; and identifying the encryption area of the image to be decrypted, and acquiring all symbols in the encryption area.
In this embodiment, determining the digit of the password according to the recognized symbol and the preset symbol layout rule specifically includes:
determining the equilateral triangles closest to the edges of the encryption region, and calculating the ratio of the distance between the left and right equilateral triangles to the distance between the upper and lower equilateral triangles;
when the ratio is between 0.8 and 1.2, the password is a single digit;
when the ratio is between 1.8 and 2.2, the password is a two-digit number;
when the ratio is between 2.8 and 3.2, the password is three digits.
In practical implementation, the distance between the left and right equilateral triangles is the difference between the horizontal coordinates of the right middle points of the minimum circumscribed rectangles of the two equilateral triangles, and the distance between the upper and lower equilateral triangles is the difference between the vertical coordinates of the upper middle points of the minimum circumscribed rectangles of the two equilateral triangles.
The number of the cipher bits is determined according to the ratio of the distances during recognition, the method has the characteristics of accurate determined number of bits and small interference, and the accuracy of a recognition result is effectively guaranteed.
In this embodiment, identifying the symbol in the image to be decrypted further includes:
acquiring the minimum circumscribed rectangle of each symbol, and judging whether each minimum circumscribed rectangle is a square or not;
when the minimum circumscribed rectangle is not square, the symbol is S-shaped;
when the minimum circumscribed rectangle is a square and the edge points of the symbol are positioned on two opposite corner points of the square, the symbol is in a fusiform shape;
when the minimum circumscribed rectangle is a square, the symbol has three edge points positioned on the sides of the square, one edge point is positioned on one corner point of the square, and the other two edge points are respectively positioned on two sides of the square, the symbol is an equilateral triangle;
when the minimum circumscribed rectangle is a square and the four edge points of the symbol are respectively located in the middle of the four sides of the square, the symbol is circular.
Further, in this embodiment, whether the minimum circumscribed rectangle is a square is determined by comparing the numbers of the pixel points on the two adjacent sides of the minimum circumscribed rectangle, and when the difference between the numbers of the pixel points on the two adjacent sides of the minimum circumscribed rectangle is within a certain range (for example, less than 3 pixel points), it can be determined that the minimum circumscribed rectangle is a square, and then it is determined whether the symbol is S-shaped. For the symbol with the square minimum circumscribed rectangle, the symbol can be determined to be in a fusiform shape, an equilateral triangle shape or a circular shape by judging the placing mode of the symbol in the minimum circumscribed rectangle, and the method has the characteristics that the difference between the judgment standards of the symbols is large and the symbols are not easy to be confused, and effectively ensures the accuracy of the analysis result.
The invention can read the symbol with specific length-width ratio, with low identification difficulty, and rapid and accurate analysis of the shape of the symbol.
The printing encryption method and the printer data acquisition and analysis method provided by the invention can quickly encrypt the document, can also quickly acquire the password of the encrypted file through the printer, and can judge whether the encrypted file is falsified or replaced according to whether the analyzed password is consistent with the pre-stored password or not for the file in which the password is pre-stored. The file true and false auditor can realize encryption or document decryption through the functions of scanning, analyzing and the like of the printer without learning a special password reading mode, has the characteristic of simple encryption method, can set a software program for realizing the encryption or decryption analysis method on a special printer and can also be directly connected to an expansion interface of the printer, so that the encryption is more suitable for daily use.
When the printing encryption method and the printer data acquisition and analysis method provided by the invention are applied, a unique password can be set for each document to be printed, and when the decrypted password corresponds to the password of the prestored document, the document content is judged to be true; a password threshold value can also be set for a class of documents, and when the documents are in the class and the decrypted password is within the password threshold value, the document content is judged to be true. The encryption mode of the unique password is suitable for files with higher encryption requirements, and the encryption mode of the category and the password threshold is more suitable for the condition that the number of files to be encrypted is large.
Correspondingly, the invention also discloses a printing and scanning device, which comprises a processor and a memory, wherein the memory is stored with computer instructions, the processor is used for executing the computer instructions stored in the memory, and the device realizes the steps of the method when the computer instructions are executed by the processor.
The present invention also relates to a storage medium having stored thereon computer program code which, when executed, may implement various embodiments of the method of the present invention, which may be a tangible storage medium such as an optical disk, a U-disk, a floppy disk, a hard disk, etc.
Those of skill in the art will appreciate that the various illustrative components, systems, and methods described in connection with the embodiments disclosed herein may be implemented as hardware, software, or combinations of both. Whether this is done in hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Features that are described and/or illustrated with respect to one embodiment may be used in the same way or in a similar way in one or more other embodiments and/or in combination with or instead of the features of the other embodiments in the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the embodiment of the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.