CN116828127B - Fingerprint encryption storage method combined with document data - Google Patents

Fingerprint encryption storage method combined with document data Download PDF

Info

Publication number
CN116828127B
CN116828127B CN202311100130.8A CN202311100130A CN116828127B CN 116828127 B CN116828127 B CN 116828127B CN 202311100130 A CN202311100130 A CN 202311100130A CN 116828127 B CN116828127 B CN 116828127B
Authority
CN
China
Prior art keywords
text block
block diagram
weight
data
fingerprint
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311100130.8A
Other languages
Chinese (zh)
Other versions
CN116828127A (en
Inventor
李超
范红达
张伟
庄玉龙
赵云
朱静宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dianju Information Technology Co ltd
Original Assignee
Beijing Dianju Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dianju Information Technology Co ltd filed Critical Beijing Dianju Information Technology Co ltd
Priority to CN202311100130.8A priority Critical patent/CN116828127B/en
Publication of CN116828127A publication Critical patent/CN116828127A/en
Application granted granted Critical
Publication of CN116828127B publication Critical patent/CN116828127B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32267Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image
    • H04N1/32272Encryption or ciphering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Bioethics (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The invention relates to the technical field of data encryption storage, in particular to a fingerprint encryption storage method combined with document data, which comprises the following steps: the method comprises the steps of obtaining document data and fingerprint data, respectively dividing the document data and the fingerprint data to obtain a text block diagram and a fingerprint binary data segment, setting a binary key array, obtaining the stroke direction of black pixel points in the text block diagram, obtaining the embeddability of each pixel point according to the stroke direction, obtaining the weight ratio of each position in a weight matrix according to the embeddability of each pixel point in all the text block diagrams and the pixel value, updating the weight matrix, embedding the fingerprint binary data segment into each text block diagram according to the binary key array and the weight matrix to obtain a primary encrypted document, and carrying out encryption storage and tamper-proof verification on the primary encrypted document. The invention prevents the document data from being tampered, ensures the integrity of the document data, and simultaneously has the least influence of the embedded fingerprint data on characters in the document data.

Description

Fingerprint encryption storage method combined with document data
Technical Field
The invention relates to the technical field of data encryption storage, in particular to a fingerprint encryption storage method combined with document data.
Background
When document data containing business secret or personal privacy information is stored, encryption is required to ensure confidentiality of the document data, and leakage of the business secret or personal privacy contained in the document data is prevented. Meanwhile, in order to prevent document data from being tampered with, a secret message needs to be embedded in the document data to ensure the integrity of the document data.
The document data can be regarded as a binary image, the pixel value of a pixel point in the binary image needs to be changed when the secret message is embedded in the binary image, the pixel value change possibly affects the structure of characters, the reading of the document data is affected, the embedding position is obvious, and the document data is easy to be perceived by an attacker, so that the secret message is cracked, the document data cannot be prevented from being tampered, and the integrity of the document data is difficult to be ensured.
Disclosure of Invention
The invention provides a fingerprint encryption storage method combined with document data, which aims to solve the existing problems.
The fingerprint encryption storage method combined with the document data adopts the following technical scheme:
one embodiment of the present invention provides a fingerprint encryption storage method in combination with document data, the method comprising the steps of:
acquiring document data and fingerprint data; respectively dividing the document data and the fingerprint data to obtain a text block diagram and a fingerprint binary data segment;
setting a binary key array;
acquiring the stroke direction of black pixel points in the text block diagrams, and acquiring the embeddability of each pixel point in each text block diagram according to the stroke direction;
setting an empty weight matrix, and acquiring the weight duty ratio of each position in the weight matrix according to the embeddability of each pixel point in all the text block diagrams and the pixel value; updating the weight matrix according to the weight ratio of each position in the weight matrix;
embedding corresponding fingerprint binary data segments into each text block diagram by utilizing a block hiding algorithm according to the binary key array and the weight matrix to obtain a primary encrypted document; encrypting the primary encrypted document to obtain a secondary encrypted document, and storing and tamper-proofing the secondary encrypted document.
Preferably, the dividing the document data and the fingerprint data to obtain the text block diagram and the fingerprint binary data segment includes the following specific steps:
preset side lengthDividing the document data into a plurality of +.>Image blocks of size, which will contain each of the black pixels +.>The large and small image blocks are respectively used as a text block diagram;
dividing fingerprint data into a plurality of lengthsEach binary sequence being taken as a fingerprint binary data segment, wherein +.>To round down the symbol.
Preferably, the step of obtaining the stroke direction of the black pixel point in the text block diagram, and obtaining the embeddability of each pixel point in each text block diagram according to the stroke direction includes the following specific steps:
the gradient direction of each black pixel point in each text block diagram is obtained by utilizing a Sobel operator, and the vertical direction of the gradient direction of each black pixel point is taken as the stroke direction of each black pixel point;
taking the nearest black pixel point which is away from each white pixel point in each text block diagram as a reference pixel point of each white pixel point; connecting each white pixel point with a corresponding reference pixel point, and taking the connecting line as a reference line segment of each white pixel point; acquiring the embeddability of each white pixel point in each text block diagram according to the reference line segment of each white pixel point and the stroke direction of the reference pixel point;
and acquiring the embeddability of each black pixel point in each text block diagram according to the number of the black pixel points in each black pixel point neighborhood in each text block diagram.
Preferably, the obtaining the embeddability of each white pixel point in each text block diagram according to the reference line segment of each white pixel point and the stroke direction of the reference pixel point includes the following specific steps:
wherein ,is->The +.f in the text block diagram>The embeddability of each white pixel point; />Is->The +.f in the text block diagram>The length of the reference line segment of each white pixel point; />Is->The +.f in the text block diagram>The direction angle of the reference line segment of each white pixel point; />Is->The +.f in the text block diagram>Reference pixel point of each white pixel pointIs the angle of the stroke direction; />Is->A set of lengths of reference line segments of all white pixel points in the individual text block diagrams;is a maximum function; />An exponential function with a natural constant as a base; />Is an absolute value sign.
Preferably, the obtaining the embeddability of each black pixel point in each text block diagram according to the number of black pixel points in each black pixel point neighborhood in each text block diagram includes the following specific steps:
and obtaining the ratio of the number of black pixel points contained in the eight neighborhood of each black pixel point in the text block diagram to 8, and carrying out negative correlation mapping on the ratio to obtain the embeddability of each black pixel point in the text block diagram.
Preferably, the step of obtaining the weight ratio of each position in the weight matrix according to the embeddability of each pixel point and the pixel value in all the text block diagrams includes the following specific steps:
wherein ,is the weight matrix +>The weight duty ratio of the individual positions; />Is->The +.f in the text block diagram>The embeddability of the individual pixel points; />The number of the text block diagrams; />Is an exponential function with a natural constant as a base; />Is->The +.f in the text block diagram>Pixel values of the individual pixel points; />Is a maximum function; />Is an absolute value sign.
Preferably, the updating the weight matrix according to the weight ratio of each position in the weight matrix includes the following specific steps:
acquiring a plurality of weight values and constructing a weight sequence; and filling each weight value in the weight sequence into each position in the weight matrix in turn according to the order of the weight ratio of each position in the weight matrix from small to large, so as to realize the updating of the weight matrix.
Preferably, the obtaining a plurality of weight values and constructing a weight sequence include the following specific steps:
will be 1 toEach integer within the range of-1 is taken as a weight value, wherein +.>The preset side length is set; will->As front->The number of times the seed weight value should appear in the weight matrix will +.>The number of times that the remaining weight values should appear in the weight matrix, wherein +.>To round down the symbol +_>Taking the rest symbols;
constructing a weight sequence according to the number of times that each weight value should appear in the weight matrix, wherein each element in the weight sequence is a weight value, the sequence of the elements in the weight sequence is arranged according to the sequence from small to large of the weight values, and the number of times that each weight value should appear in the weight matrix is the same as the number of times that each weight value should appear in the weight matrix.
Preferably, the storing and tamper-proof verification of the secondary encrypted document comprises the following specific steps:
storing the secondary encrypted document in a file server and a network isolated backup server, and storing the binary key array, the weight matrix and the fingerprint data on separate key devices;
when related personnel with document viewing authority need to view document data, decrypting the secondary encrypted document to obtain a primary encrypted document; extracting fingerprint binary data segments in each text block diagram of the primary encrypted document according to the binary key array and the weight matrix, and splicing all the extracted fingerprint binary data segments into a sequence to serve as extracted fingerprint data;
when the fingerprint data stored on the separate key device is different from the extracted fingerprint data, the document data is tampered with, and when the fingerprint data stored on the separate key device is the same as the extracted fingerprint data, the document data is not tampered with.
Preferably, the setting the binary key array includes the following specific steps:
obtaining a length by using a chaotic mapping methodEach value in the chaotic sequence is rounded to obtain a binary sequence, and a +.>Filling each element in the binary sequence into the two-dimensional matrix in turn to obtain a binary key array, wherein +_>Is a preset side length.
The technical scheme of the invention has the beneficial effects that: the invention obtains document data and fingerprint data, respectively divides the document data and the fingerprint data to obtain a text block diagram and a fingerprint binary data segment, sets a binary key array, obtains the stroke direction of black pixel points in the text block diagram, obtains the embeddability of each pixel point according to the stroke direction, obtains the weight ratio of each position in a weight matrix according to the embeddability of each pixel point and the pixel value in all the text block diagrams, updates the weight matrix, embeds the fingerprint binary data segment into each text block diagram according to the binary key array and the weight matrix to obtain a primary encrypted document, obtains the weight matrix according to the embeddability, ensures that the pixel value of the position having influence on a text structure is not changed when the fingerprint data is embedded, only changes the pixel value of the position having no influence on the text structure, and ensures that the document data after the fingerprint data is embedded is visually lossless. The invention not only prevents the document data from being tampered, ensures the integrity of the document data, but also minimizes the influence of the embedded fingerprint data on characters in the document data, and ensures the accuracy of the document data.
Drawings
In order to more clearly illustrate the embodiments of the invention 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, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart showing steps of a fingerprint encryption storage method combined with document data.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of specific implementation, structure, characteristics and effects of the fingerprint encryption storage method combined with document data according to the invention with reference to the attached drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the fingerprint encryption storage method combined with document data.
Referring to fig. 1, a flowchart of steps in a fingerprint encryption storage method combined with document data according to an embodiment of the present invention is shown, the method includes the following steps:
s001, acquiring document data and fingerprint data.
It should be noted that, the conversion of the confidential document into the picture format for storage can increase the difficulty of malicious tampering to a certain extent, and is beneficial to embedding fingerprint data as a confidential message in the following process. Therefore, the embodiment of the invention converts the confidential documents into the picture format for storage.
In the embodiment of the invention, the confidential document which is required to be stored in an encrypted way by the enterprise is converted into a picture format and used as document data. Specific: when the confidential document to be stored in an encrypted manner is a paper document, the paper document is scanned, and the scanned image is recorded as document data. When the confidential document to be stored in an encrypted manner is an electronic document, the electronic document is converted into an image and recorded as document data.
Note that, since a conventional document includes only white background and black text, the corresponding document data is a binary image. The embodiment of the invention embeds the fingerprint data into the document data which is the binary image.
In the embodiment of the invention, the fingerprint of the document security personnel is input to obtain the binary image of the fingerprint, the binary image of the fingerprint is unfolded according to the line to obtain a one-dimensional binary sequence, and the binary sequence is used as fingerprint data in order to facilitate the embedding of the fingerprint into the document data as a secret message.
Thus, document data and fingerprint data are acquired.
S002, respectively dividing the document data and the fingerprint data to obtain a text block diagram and a fingerprint binary data segment.
Note that, the blank part in the document data does not contain any information, and is not required to be protected, while the text in the document data contains important information of the document, and is required to be subjected to important protection. Therefore, fingerprint data needs to be embedded in the text part of the document data to prevent the text from being tampered, and in order to realize the embedding of the text part into the fingerprint data, the document data needs to be divided first to obtain a text block diagram in the document data. Since the document data is a binary image, the white area in the document data is the background of the document data, and the black area is the text in the document data, the text block diagram in the document data can be obtained according to the distribution of the pixels.
In an embodiment of the present invention, document data is divided intoA picture block of size, wherein->For the preset side length, the size of the single text in the document data is set according to the size of the single text, and in the embodiment of the invention, the text is replaced by +.>By way of example, embodiments of the invention are not particularly limited, wherein +.>Depending on the particular implementation. Each of the black pixel dots will be included +.>The image blocks of the size are respectively used as a text block diagram. In the process of dividing the document data, there is a problem that the image block size of a part of the image block at the boundary of the document data is insufficient +.>In order to ensure a smooth embedding of the subsequent fingerprint information, no matter how large these are +.>Whether black pixels are included in the image blocks, and the image blocks are not used as text block diagrams.
Thus, all text block diagrams in the document data are acquired.
It should be noted that, the purpose of the embodiment of the present invention is to embed fingerprint data for each text block diagram by using Tseng block hiding algorithm. The Tseng block concealment algorithm is a block concealment algorithm as proposed by Tseng et al in Tseng Y C, pan H K.Data timing in 2-Color Images [ J ]. IEEE Transactions on Computers,2002,51 (7): 873-890.
Since the size of the text block diagram is limited, the amount of data that can be embedded in the text block diagram is limited, and thus it is necessary to segment fingerprint data according to the amount of data that can be embedded in the text block diagram. The size of the text block diagram isThe amount of data that can be embedded is +.>, wherein />To round down the symbol. The amount of data that each text block diagram can embed is a well-known technology in Tseng block hiding algorithm, and in the embodiment of the present invention, detailed description is omitted.
In the embodiment of the invention, the fingerprint data is divided into a plurality of pieces of lengthIf the length of the last binary sequence of the division is less than + ->Then 0 is added at the end of the tube to make the length of the tube reach +.>. All lengths finally obtained areRespectively as a fingerprint binary data segment.
Thus, the division of fingerprint data is realized, and a plurality of fingerprint binary data segments are obtained.
S003, setting a binary key array.
It should be noted that, the Tseng block hiding algorithm adjusts the pixel values of the pixel points in the text block diagram, so that the exclusive or result of the text block diagram and the binary key array is the same as the result value after the weight matrix operation, which is the same as the decimal of the fingerprint data to be embedded, thereby achieving the purpose of embedding the fingerprint data, therefore, the binary key array needs to be set, and the size of the binary key array is the same as that of the text block diagram.
In the embodiment of the invention, a length is obtained by using a chaotic mapping methodThe chaotic mapping is a known technique, and detailed description thereof is omitted in the embodiment of the present invention. And rounding each numerical value in the chaotic sequence to obtain a binary sequence, wherein each numerical value in the chaotic sequence is a decimal value between 0 and 1.
Construction of a oneAnd filling each element in the binary sequence into the two-dimensional matrix in turn to obtain a two-dimensional matrix only comprising 0 and 1, and taking the two-dimensional matrix as a binary key array.
Thus, a binary key array is obtained. It should be noted that, the chaotic sequence obtained by using the chaotic mapping is irregular in numerical disorder, and the chaotic sequence is rounded to obtain the irregular distribution of 0 and 1 in the binary sequence, so that the distribution of 0 and 1 in the obtained binary key array is irregular. An attacker cannot guess to obtain the binary key array, and then cannot forge the secret message embedded in the text block diagram according to the binary key array.
S004, the embeddability of each pixel point in each text block diagram is obtained.
It should be noted that, by changing a small part of pixels in the binary image to embed the secret message, the binary image after embedding the secret message only changes a part of pixels compared with the binary image before embedding, so that the whole influence on the binary image is small. However, the text block diagram contains text information, and embedding data in the text block diagram may cause a change in text structure in the text block diagram, which affects text reading, so that pixels in the text block diagram, which affect the position of the text structure, should be avoided as much as possible when embedding data into the text block diagram.
For turning points in the characters and the middle of strokes in the characters, the embedded data can cause the strokes in the characters to be disconnected, and the characters are affected to read. For the blank space inside and around the text, embedding data may cause the text to have more strokes, causing text changes, for example, if embedding data in the blank space under the text "big" may cause the text "big" to become "too big". For example, for the word "text", embedding data on the left side of a horizontal direction of the word "text" can prolong the horizontal direction of the word "text", and the structure of the word "text" is not affected and is not visually perceived.
Therefore, the embeddability of each pixel point in each text block diagram can be obtained according to the character characteristics in each text block diagram, so that a weight matrix can be obtained according to the embeddability later, the pixel value of the position with influence on the text structure is not changed when the fingerprint data is embedded, the pixel value of the position with no influence on the text structure is only changed, and the document data after the fingerprint data is embedded is visually lossless.
In the embodiment of the invention, the following is the firstThe method for acquiring the embeddability of each pixel point in the text block image is illustrated by a text block diagram:
acquisition of the first Using Sobel operatorGradient direction of each black pixel point in each text block diagram. It should be noted that, the gradient direction of the pixel point in the binary image is the same as the gradient direction obtaining method of the pixel point in the gray level image, and detailed description is omitted in the embodiment of the present invention.
The black pixel points in the text block diagram are pixels on the text, the gradient direction of the black pixel points is perpendicular to the trend of the strokes, and if data is embedded at the tail end of the strokes along the direction of the strokes, the influence on the text is minimal. The embeddability of each white pixel point can be obtained according to the stroke direction of the black pixel point.
In the embodiment of the invention, the firstThe vertical direction of the gradient direction of each black pixel point in the individual text block diagram is taken as the stroke direction of each black pixel point. Get->And the nearest black pixel point which is away from each white pixel point in the character block diagram is used as a reference pixel point of each white pixel point. And connecting each white pixel point with a corresponding reference pixel point, and taking the connecting line as a reference line segment of each white pixel point.
Acquiring the first line segment according to the stroke direction of each white pixel point and the reference pixel pointEmbeddability of each white pixel in the individual text block map:
wherein ,is->The +.f in the text block diagram>The embeddability of each white pixel point; />Is->The +.f in the text block diagram>The length of the reference line segment of each white pixel point; />Is->The +.f in the text block diagram>The direction angle of the reference line segment of each white pixel point; />Is->The +.f in the text block diagram>An angle of a stroke direction of a reference pixel of the white pixels; />Is->A set of lengths of reference line segments of all white pixel points in the individual text block diagrams;is a maximum function; />An exponential function with a natural constant as a base; />Respond to->Distance advantage of individual white pixels, +.>Respond to->The angular disadvantage of the white pixel is that>The +.f in the text block diagram>The smaller the length of the reference line segment of the white pixel is +.>The closer the white pixel is to the text, #>The greater the distance advantage of the white pixel, if +.>The difference between the direction angle of the reference line segment of the white pixel point and the angle of the stroke direction of the reference pixel point is smaller>The reference line segment of the white pixel point is the extension of the stroke where the reference pixel point is located, at this time +.>The smaller the angular disadvantage of the white pixel, if at +.>The white pixel points are embedded with data, so that the structure of characters is not influenced, and the +.>The embeddability of each white pixel point is large; when->In the text block diagramThe smaller the length of the reference line segment of the white pixel is +.>The closer the white pixel is to the text, #>The greater the distance advantage of the white pixel, if +.>When the direction angle of the reference line segment of each white pixel point is greatly different from the angle of the stroke direction of the reference pixel point, the first part is>The angular disadvantage of the white pixels is greater, the +.>The reference line segment of each white pixel point is a line segment except the characters, the stroke difference of the characters is obvious, if at the +.>The white pixels are embedded with data, which causes more strokes of the text and changes the text, at this time +.>The embeddability of each white pixel point is small; when->The +.f in the text block diagram>The greater the length of the reference line segment of the white pixel point is +.>The farther the white pixel is from the text, if at +.>White pixel point embeddingData, th->The smaller the distance advantage of each white pixel point is, the more far from the text the embedded information is, the structure of the text is not affected, but the embedded information is obvious and is easy to be found by an attacker, at the moment +.>The embeddability of individual white pixels is poor. Therefore, the distance advantage is taken as a base, the angle disadvantage is taken as an index, and the embeddability of the white pixel point is obtained by utilizing the gamma conversion form.
Acquisition of the firstEmbeddability of each black pixel in the individual text block map:
is->The +.f in the text block diagram>The embeddability of the black pixel points; />Is->The +.f in the text block diagram>The number of black pixel points included in the field of the black pixel points; />With natural constantAn exponential function of the base; when->The fewer the number of black pixels included in the field of the black pixels, the +.>The more likely the black pixel is the branch of the character stroke, at which point +.>The positions of the black pixel points are embedded with data, so that the structure of characters is not influenced, and the first timeThe embeddability of the black pixel points is large; when->The more the number of black pixels included in the field of the black pixels, the +.>The more likely a black pixel is the middle or turning point of a text stroke, at which point +.>The black pixel positions are embedded with data, so that strokes of the characters are disconnected, the structure of the characters is influenced, and the first step is>The embeddability of each black pixel is small.
Thus far, obtain the firstThe embeddability of each pixel point in the individual text block diagrams. And similarly, obtaining the embeddability of each pixel point in each text block diagram.
S005, acquiring a weight matrix according to the embeddability of each pixel point in each text block diagram.
In the Tseng block hiding algorithm, the pixel values of the pixel points in the text block diagram are adjusted, so that the exclusive or result of the text block diagram and the binary key array is identical to the result value after the weight matrix operation, which is identical to the decimal of the fingerprint data to be embedded, and the purpose of embedding the fingerprint data is achieved. The weight of each position in the weight matrix is different, after the pixel values of different pixel points in the corresponding text block diagram are adjusted, the exclusive or result of the text block diagram and the binary key array is different from the change amount of the result value after the weight matrix operation, in order to ensure that the influence on characters is smaller after the pixel values of the pixel points are adjusted, the pixel points with large embeddability are required to be adjusted as much as possible, and the pixel points with small embeddability are not adjusted, so that the weight of each position of the weight matrix is set according to the embeddability of the pixel points of the same position in all the text block diagrams.
In the embodiment of the invention, a structure is constructedAnd taking the empty matrix with the size as a weight matrix. Acquiring the weight ratio of each position of the weight matrix:
wherein ,is the weight matrix +>The weight duty ratio of the individual positions; />Is->The +.f in the text block diagram>The embeddability of the individual pixel points; />The number of the text block diagrams; />Is an exponential function with a natural constant as a base; />Is->The +.f in the text block diagram>Pixel values of the individual pixel points; />Is a maximum function; />Is->Average embeddability of each pixel point in all text block diagrams, when the average embeddability is larger, the first ∈in each text block diagram>The influence on characters after the fingerprint data is embedded into the individual pixel points is small, and the pixel values of the pixel points in the character block diagram are adjusted in the Tseng block hiding algorithm, so that the exclusive OR result of the character block diagram and the binary key array is the same as the result value after the weight matrix operation, and the purpose of embedding the fingerprint data is achieved. When information is embedded into the text block diagram, when the pixel value of the corresponding pixel point in the text block diagram is adjusted at the position with larger weight in the weight matrix, the result value change amount after the exclusive or result of the text block diagram and the binary key array and the weight matrix operation is possibly overlarge, and the possibility of overstepping exists, so that the position with smaller weight in the weight matrix is preferentially adjusted in the text block diagramThe pixel value of the pixel point is corresponding to the pixel value, so that the larger the average embeddability is, the smaller the weight is given, so that the pixel value of the pixel point at the position with the large average embeddability is adjusted as soon as possible later, and the influence of embedded fingerprint data on characters is reduced; />Indicate->The duty ratio of each pixel point when the pixel value is 1 in all the text block diagrams is closer to +.>At the time->The pixel values 0 and 1 are uniformly distributed in all the text block diagrams, and the +.f. in each text block diagram is added at the moment>The adjustment of the pixel values of the individual pixels may bring about a better embedding effect, and at this time, a smaller weight is given to the corresponding position in the weight matrix, so that the +.>The pixel values of the individual pixels achieve the purpose of fingerprint embedding,is to avoid->A 0 results in a weight duty cycle of 0.
It should be noted that the weight matrix should contain weight values of 1 to 1-1 Co-Seed weight value, wherein->The side length of the text block diagram is also the side length of the weight matrix,the length of the fingerprint binary data segment divided for the fingerprint data. Since the size of the weight matrix is +.>Each weight value should be present in the weight matrix at least +.>Secondary, corresponding frontThe seed weight value should appear in the weight matrixThe remaining weight values should appear +.>Secondary, wherein->To round down the symbol +_>Is the remainder symbol.
In the embodiment of the invention, a weight sequence is constructed according to the number of times each weight value should appear in the weight matrix, each element in the weight sequence is a weight value, the sequence of the elements in the weight sequence is arranged according to the sequence from the small weight value to the large weight value, and the number of times each weight value in the weight sequence appears is the same as the number of times each weight value should appear in the weight matrix. For example, the number of the cells to be processed,when the corresponding weight value is 1 to +.>Front (front)The seed weights 1 and 2 should be present +.>The remaining weight values should appear +.>The corresponding weight sequence is {1,1,2,2,3,4,5,6,7}.
And filling each weight value in the weight sequence into each position in the weight matrix in turn according to the order of the weight ratio of each position in the weight matrix from small to large, so as to realize the updating of the weight matrix.
Thus, a weight matrix is obtained.
S006, embedding corresponding fingerprint binary data segments into each text block diagram according to the binary key array and the weight matrix, and obtaining the primary encrypted document.
And embedding a fingerprint binary data segment into each text block diagram according to the binary key array and the weight matrix by using the conventional Tseng block hiding algorithm, and replacing the text block diagram after embedding with the corresponding text block diagram before embedding in the document data to obtain the primary encrypted document.
Thus, embedding of the fingerprint binary data segment is realized, and the primary encrypted document is obtained. The primary encrypted document is visually indistinguishable from the document data, but the fingerprint data is hidden. Without knowing the binary key array and the weight matrix, an attacker cannot extract hidden fingerprint data.
S007, encrypting the primary encrypted document to obtain a secondary encrypted document.
To ensure confidentiality of document data, it is also necessary to encrypt the primary encrypted document. In the embodiment of the invention, the first-stage encrypted document is encrypted by using an AES encryption algorithm to obtain a second-stage encrypted document. It should be noted that, the embodiment of the invention does not limit the method for encrypting the primary encrypted document, only uses the AES encryption algorithm as an example for explanation, and the implementation personnel can select the method for encrypting the primary encrypted document according to the actual implementation situation.
Thus, a two-level encrypted document is obtained.
And S008, storing the secondary encrypted document.
The secondary encrypted document is stored in a file server and a network isolated backup server, and the binary key array, the weight matrix, and fingerprint data of the document security personnel are stored on a separate key device, such as a key management server.
When a related person with document viewing authority needs to view the document, the file server applies the binary key array, the weight matrix and fingerprint data of the document security personnel to the key management server, and decrypts the secondary encrypted document by using the encryption algorithm in the step S007 to obtain the primary encrypted document. And (3) segmenting the primary encrypted document by using the method in the step S002 to obtain a text block diagram.
And extracting the fingerprint binary data segments in each text block diagram by using a Tseng block hiding algorithm according to the binary key array and the weight matrix, and splicing the fingerprint binary data segments into fingerprint data.
And comparing the fingerprint data of the document security personnel with the extracted fingerprint data, and if the fingerprint data and the extracted fingerprint data are the same, providing the document data for relevant personnel with document viewing authority to view. If the two are different, the document data is tampered, at the moment, the document data is not trusted, at the moment, a document security personnel is reminded to carry out tamper tracing, and the document data which is not tampered is recovered from a backup server isolated by a network.
Through the steps, the encryption storage of the document data based on the fingerprint is completed.
According to the embodiment of the invention, the document data and the fingerprint data are respectively segmented to obtain a text block diagram and a fingerprint binary data segment, a binary key array is arranged, the stroke direction of black pixels in the text block diagram is obtained, the embeddability of each pixel is obtained according to the stroke direction, the weight ratio of each position in a weight matrix is obtained according to the embeddability of each pixel in all text block diagrams and the pixel value, the weight matrix is updated, the fingerprint binary data segment is embedded into each text block diagram according to the binary key array and the weight matrix, a first-level encrypted document is obtained, the weight matrix is obtained according to the embeddability, the condition that when the fingerprint data are embedded, the pixel value of the position which has no influence on the text structure is not changed is ensured, and the pixel value of the position which has no influence on the text structure is only changed, so that the document data after the fingerprint data are embedded are visually lossless is obtained. The invention not only prevents the document data from being tampered, ensures the integrity of the document data, but also minimizes the influence of the embedded fingerprint data on characters in the document data, and ensures the accuracy of the document data.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.

Claims (10)

1. A method of fingerprint encryption storage in combination with document data, the method comprising the steps of:
acquiring document data and fingerprint data; respectively dividing the document data and the fingerprint data to obtain a text block diagram and a fingerprint binary data segment;
setting a binary key array;
acquiring the stroke direction of black pixel points in the text block diagrams, and acquiring the embeddability of each pixel point in each text block diagram according to the stroke direction;
setting an empty weight matrix, and acquiring the weight duty ratio of each position in the weight matrix according to the embeddability of each pixel point in all the text block diagrams and the pixel value; updating the weight matrix according to the weight ratio of each position in the weight matrix;
embedding corresponding fingerprint binary data segments into each text block diagram by utilizing a block hiding algorithm according to the binary key array and the weight matrix to obtain a primary encrypted document; encrypting the primary encrypted document to obtain a secondary encrypted document, and storing and tamper-proofing the secondary encrypted document.
2. The method for storing the encrypted fingerprint data combined with the document data according to claim 1, wherein the steps of dividing the document data and the fingerprint data to obtain a text block diagram and a fingerprint binary data segment respectively include the following specific steps:
preset side lengthDividing the document data into a plurality of +.>Image blocks of size, which will contain each of the black pixels +.>The large and small image blocks are respectively used as a text block diagram;
dividing fingerprint data into a plurality of lengthsEach binary sequence being taken as a fingerprint binary data segment, wherein +.>To round down the symbol.
3. The method for storing encrypted fingerprints in combination with document data according to claim 1, wherein the step of obtaining the stroke direction of black pixels in the text block diagram and obtaining the embeddability of each pixel in each text block diagram according to the stroke direction comprises the following specific steps:
the gradient direction of each black pixel point in each text block diagram is obtained by utilizing a Sobel operator, and the vertical direction of the gradient direction of each black pixel point is taken as the stroke direction of each black pixel point;
taking the nearest black pixel point which is away from each white pixel point in each text block diagram as a reference pixel point of each white pixel point; connecting each white pixel point with a corresponding reference pixel point, and taking the connecting line as a reference line segment of each white pixel point; acquiring the embeddability of each white pixel point in each text block diagram according to the reference line segment of each white pixel point and the stroke direction of the reference pixel point;
and acquiring the embeddability of each black pixel point in each text block diagram according to the number of the black pixel points in each black pixel point neighborhood in each text block diagram.
4. A method for storing encrypted fingerprint data in combination with document data according to claim 3, wherein the step of obtaining the embeddability of each white pixel in each text block map according to the reference line segment of each white pixel and the stroke direction of the reference pixel comprises the following specific steps:
wherein ,is->The +.f in the text block diagram>The embeddability of each white pixel point; />Is->The +.f in the text block diagram>The length of the reference line segment of each white pixel point; />Is->The +.f in the text block diagram>The direction angle of the reference line segment of each white pixel point; />Is->The +.f in the text block diagram>An angle of a stroke direction of a reference pixel of the white pixels; />Is->A set of lengths of reference line segments of all white pixel points in the individual text block diagrams; />Is a maximum function; />An exponential function with a natural constant as a base; />Is an absolute value sign.
5. The method for storing encrypted fingerprints in combination with document data according to claim 3, wherein the step of obtaining the embeddability of each black pixel in each text block map according to the number of black pixels in each black pixel neighborhood in each text block map comprises the following specific steps:
and obtaining the ratio of the number of black pixel points contained in the eight neighborhood of each black pixel point in the text block diagram to 8, and carrying out negative correlation mapping on the ratio to obtain the embeddability of each black pixel point in the text block diagram.
6. The method for storing the fingerprint encryption combined with the document data according to claim 1, wherein the step of obtaining the weight duty ratio of each position in the weight matrix according to the embeddability of each pixel point in all the text block diagrams and the pixel value comprises the following specific steps:
wherein ,is the weight matrix +>The weight duty ratio of the individual positions; />Is->The +.f in the text block diagram>The embeddability of the individual pixel points; />The number of the text block diagrams; />Is an exponential function with a natural constant as a base; />Is->The +.f in the text block diagram>Pixel values of the individual pixel points; />Is a maximum function; />Is an absolute value sign.
7. The method for encrypting and storing fingerprint data in combination with document data according to claim 1, wherein the updating the weight matrix according to the weight ratio of each position in the weight matrix comprises the following specific steps:
acquiring a plurality of weight values and constructing a weight sequence; and filling each weight value in the weight sequence into each position in the weight matrix in turn according to the order of the weight ratio of each position in the weight matrix from small to large, so as to realize the updating of the weight matrix.
8. The method for storing and encrypting fingerprints in combination with document data according to claim 7, wherein the steps of obtaining a plurality of weight values and constructing a weight sequence include the steps of:
will be 1 toEach integer within the range of-1 is taken as a weight value, wherein +.>The preset side length is set; will->As front->The number of times the seed weight value should appear in the weight matrix will +.>The number of times that the remaining weight values should appear in the weight matrix, wherein +.>To round down the symbol +_>Taking the rest symbols;
constructing a weight sequence according to the number of times that each weight value should appear in the weight matrix, wherein each element in the weight sequence is a weight value, the sequence of the elements in the weight sequence is arranged according to the sequence from small to large of the weight values, and the number of times that each weight value should appear in the weight matrix is the same as the number of times that each weight value should appear in the weight matrix.
9. The method for storing and verifying the fingerprint encryption combined with the document data according to claim 1, wherein the steps of storing and verifying the secondary encrypted document are as follows:
storing the secondary encrypted document in a file server and a network isolated backup server, and storing the binary key array, the weight matrix and the fingerprint data on separate key devices;
when related personnel with document viewing authority need to view document data, decrypting the secondary encrypted document to obtain a primary encrypted document; extracting fingerprint binary data segments in each text block diagram of the primary encrypted document according to the binary key array and the weight matrix, and splicing all the extracted fingerprint binary data segments into a sequence to serve as extracted fingerprint data;
when the fingerprint data stored on the separate key device is different from the extracted fingerprint data, the document data is tampered with, and when the fingerprint data stored on the separate key device is the same as the extracted fingerprint data, the document data is not tampered with.
10. The method for storing encrypted fingerprints in combination with document data according to claim 1, wherein the step of setting the binary key array comprises the steps of:
obtaining a length by using a chaotic mapping methodEach value in the chaotic sequence is rounded to obtain a binary sequence, and a +.>Filling each element in the binary sequence into the two-dimensional matrix in turn to obtain a binary key array, wherein +_>Is a preset side length.
CN202311100130.8A 2023-08-30 2023-08-30 Fingerprint encryption storage method combined with document data Active CN116828127B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311100130.8A CN116828127B (en) 2023-08-30 2023-08-30 Fingerprint encryption storage method combined with document data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311100130.8A CN116828127B (en) 2023-08-30 2023-08-30 Fingerprint encryption storage method combined with document data

Publications (2)

Publication Number Publication Date
CN116828127A CN116828127A (en) 2023-09-29
CN116828127B true CN116828127B (en) 2023-10-27

Family

ID=88120685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311100130.8A Active CN116828127B (en) 2023-08-30 2023-08-30 Fingerprint encryption storage method combined with document data

Country Status (1)

Country Link
CN (1) CN116828127B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104361268A (en) * 2014-11-28 2015-02-18 广州视源电子科技股份有限公司 Watermark embedding and reading method, device and system
CN109840425A (en) * 2019-01-22 2019-06-04 北京数科网维技术有限责任公司 A kind of method and apparatus of file encryption
CN110955889A (en) * 2019-12-18 2020-04-03 合肥灵蓄信息技术有限公司 Electronic document tracing method based on digital fingerprints
CN111861846A (en) * 2020-07-10 2020-10-30 哈尔滨工业大学(深圳) Electronic document digital watermark processing method and system
CN115423063A (en) * 2022-10-08 2022-12-02 北京微点科学技术有限公司 Anti-copying shading anti-counterfeiting method and device based on micro dot codes

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100364326C (en) * 2005-12-01 2008-01-23 北京北大方正电子有限公司 Method and apparatus for embedding and detecting digital watermark in text file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104361268A (en) * 2014-11-28 2015-02-18 广州视源电子科技股份有限公司 Watermark embedding and reading method, device and system
CN109840425A (en) * 2019-01-22 2019-06-04 北京数科网维技术有限责任公司 A kind of method and apparatus of file encryption
CN110955889A (en) * 2019-12-18 2020-04-03 合肥灵蓄信息技术有限公司 Electronic document tracing method based on digital fingerprints
CN111861846A (en) * 2020-07-10 2020-10-30 哈尔滨工业大学(深圳) Electronic document digital watermark processing method and system
CN115423063A (en) * 2022-10-08 2022-12-02 北京微点科学技术有限公司 Anti-copying shading anti-counterfeiting method and device based on micro dot codes

Also Published As

Publication number Publication date
CN116828127A (en) 2023-09-29

Similar Documents

Publication Publication Date Title
Zhang et al. Robust coverless image steganography based on DCT and LDA topic classification
CN109767375B (en) Image watermark embedding and tracing method and system
CN107239713B (en) Sensitive content data information protection method and system
US20160055552A1 (en) Generating method, verifying method for electronic bill with anti-fake two dimension (2d) code and system for same
Arun et al. Design of image steganography using LSB XOR substitution method
US6775394B2 (en) Digital watermarking of binary document using halftoning
Al Hussien et al. Coverless image steganography based on optical mark recognition and machine learning
CN111738898B (en) Text digital watermark embedding/extracting method and device
Dobre et al. Authentication of JPEG Images on the Blockchain
CN115604401B (en) Traceable electronic seal encryption method
Chhajed et al. Applying decision tree for hiding data in binary images for secure and secret information flow
CN114880687A (en) Document security protection method and device, electronic equipment and storage medium
Kumar et al. A survey of recent advances in image steganography
CN114461988A (en) Image encryption method and device, image decryption method and device
WO2020237881A1 (en) Method and apparatus for injecting anti-counterfeit information, computer device, and storage medium
CN116776301B (en) Quick traceability management method for electronic seal
US6023511A (en) Cryptosystem for encrypting digital image or voice file
Alsaadi et al. Text steganography in font color of MS excel sheet
CN116828127B (en) Fingerprint encryption storage method combined with document data
KR20070076130A (en) Information embedding and extracting method for image authentification
CN114078071A (en) Image tracing method, device and medium
Das et al. Digital forensic enabled image authentication using least significant bit (lsb) with tamper localization based hash function
JP2009505133A (en) Data encryption and decryption method using pixels
CN115329293A (en) Data safety storage method of intelligent traditional Chinese medicine rehabilitation management system
Raj et al. A survey on reversible data hiding in encrypted image

Legal Events

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