CN111538969A - Document encryption method, document decryption device, electronic equipment and medium - Google Patents

Document encryption method, document decryption device, electronic equipment and medium Download PDF

Info

Publication number
CN111538969A
CN111538969A CN202010235203.4A CN202010235203A CN111538969A CN 111538969 A CN111538969 A CN 111538969A CN 202010235203 A CN202010235203 A CN 202010235203A CN 111538969 A CN111538969 A CN 111538969A
Authority
CN
China
Prior art keywords
encrypted
document
content
vector
decryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010235203.4A
Other languages
Chinese (zh)
Inventor
张小亮
王秀贞
戚纪纲
杨占金
其他发明人请求不公开姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Superred Technology Co Ltd
Original Assignee
Beijing Superred 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 Superred Technology Co Ltd filed Critical Beijing Superred Technology Co Ltd
Priority to CN202010235203.4A priority Critical patent/CN111538969A/en
Publication of CN111538969A publication Critical patent/CN111538969A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/32User authentication using biometric data, e.g. fingerprints, iris scans or voiceprints
    • 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
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Document Processing Apparatus (AREA)
  • Storage Device Security (AREA)

Abstract

The present disclosure relates to a document encryption method, a document decryption method, a document encryption apparatus, a document decryption apparatus, an electronic device, and a non-transitory computer-readable storage medium. The document encryption method comprises the following steps: acquiring a document to be encrypted and a plurality of content characters of the document to be encrypted; obtaining a content coding sequence of a document to be encrypted; acquiring an encrypted iris image; obtaining a key vector of a document to be encrypted through feature extraction; and obtaining an encrypted document based on the content coding sequence and the key vector. The document decryption method comprises the following steps: acquiring an encrypted document; acquiring a decrypted iris image; and obtaining a decryption vector according to the decrypted iris image, and further decrypting the encrypted document. By the method, the characteristics of uniqueness, high stability, strong anti-counterfeiting performance and the like of the iris are utilized, and the document to be encrypted is encrypted by combining the content of the document to be encrypted. The encrypted document can be decrypted uniquely, the possibility of document content leakage is reduced, and the information security of the encrypted document can be effectively guaranteed.

Description

Document encryption method, document decryption device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of data information processing technologies, and in particular, to a document encryption method, a document decryption method, a document encryption apparatus, a document decryption apparatus, an electronic device, and a non-transitory computer-readable storage medium.
Background
In the related art, with the continuous development of electronic information technology, most information is transmitted in the form of electronic documents. In order to secure document information, an encryption key of a document is often created in a keyed form, and the document to be kept secret is encrypted. But with such encryption methods, decryption can be performed as long as the correct decryption key is in possession. It is not possible to determine whether the person decrypting the document is the true reviewer of the document or a person with an undesirable attempt. An ill-intentioned person refers to by pirating the decryption key. For highly confidential files with targeted receivers, the method for transmitting the files cannot effectively prevent others from stealing the contents in the files to be encrypted, and has great threat to the security of the contents of the files.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a document encryption method, a document decryption method, a document encryption apparatus, a document decryption apparatus, an electronic device, and a non-transitory computer-readable storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a document encryption method, including: acquiring a document to be encrypted; acquiring a plurality of content characters of a document to be encrypted; based on each content character, obtaining a content coding sequence of the document to be encrypted through coding, wherein the content coding sequence is composed of content coding values corresponding to the content characters; acquiring an encrypted iris image; obtaining a key vector of a document to be encrypted through feature extraction according to the encrypted iris image; and encrypting the document to be encrypted based on the content coding sequence and the key vector to obtain the encrypted document.
In an embodiment, encrypting a document to be encrypted based on a content encoding sequence and a key vector to obtain an encrypted document includes: carrying out XOR operation on each content coding value in the content coding sequence and the key vector to determine the encryption numerical value of each content character; determining the encrypted display content of the document to be encrypted based on each encrypted numerical value; and obtaining an encrypted document according to the encrypted display content.
In another embodiment, determining the encrypted display content of the document to be encrypted based on the respective encryption values comprises: and determining the encrypted display content of the document to be encrypted according to the parity of each encrypted value.
In yet another embodiment, encrypting the display content comprises: first content, second content, and third content; determining the encrypted display content of the document to be encrypted according to the parity of each encrypted value, wherein the method comprises the following steps: if the content value is odd, displaying the encrypted display content of the document to be encrypted by adopting the first content; if the content value is an even number, the encrypted display content of the document to be encrypted is displayed by adopting the second content and the third content
In yet another embodiment, the third content includes a two-dimensional barcode.
In one embodiment, xoring each content encoding value in the content encoding sequence with the key vector to determine an encrypted value for each content character comprises: dividing the content encoding sequence into a plurality of sub-content encoding sequences according to the dimension of the key vector, wherein the sub-content encoding sequences at least comprise one content encoding value; and performing exclusive OR operation on each content code value in each sub-content code sequence and the key vector according to each sub-content code sequence to obtain the encrypted numerical value of each content character.
In another embodiment, obtaining a key vector of a document to be encrypted by feature extraction according to an encrypted iris image includes: preprocessing the encrypted iris image; carrying out feature extraction on the preprocessed encrypted iris image through a neural network to obtain a feature vector; and obtaining a key vector of the document to be encrypted according to the feature vector.
In another embodiment, obtaining a key vector of a document to be encrypted according to the feature vector includes: and correcting the characteristic vector to obtain a key vector and an error correction code of the document to be encrypted, wherein the error correction code is used for correcting the error when the encrypted document is decrypted.
According to a second aspect of the embodiments of the present disclosure, there is provided a document decryption method, including: acquiring an encrypted document, wherein the encrypted document is encrypted by adopting any one of the document encryption methods; acquiring a decrypted iris image; obtaining a decryption vector of the encrypted document through feature extraction according to the decrypted iris image; decrypting the encrypted document based on the decryption vector; if the decryption vector is consistent with the key vector of the encrypted document, the encrypted document is successfully decrypted to obtain the encrypted content of the encrypted document; if the decryption vector does not match the key vector of the encrypted document, the encrypted document decryption fails.
In one embodiment, the document decryption method further comprises: acquiring display content of the encrypted document; decrypting the encrypted document based on the decryption vector, comprising: obtaining an encrypted numerical sequence of the encrypted document according to the display content; and decrypting the encrypted document based on the encrypted numerical sequence and the decryption vector.
In another embodiment, decrypting the encrypted document based on the sequence of encrypted values and the decryption vector comprises: carrying out exclusive or operation on the decryption vector and the encryption numerical sequence to obtain a content coding sequence of the encrypted document; performing reverse encoding on the content encoding sequence to obtain a plurality of content characters of the encrypted document; the encrypted document is decrypted based on the plurality of content characters.
In another embodiment, decrypting the encrypted document based on the sequence of encrypted values and the decryption vector further comprises: dividing the encrypted numerical value sequence into a plurality of sub-encrypted numerical value sequences according to the dimension of the decryption vector, wherein the sub-encrypted numerical value sequences at least comprise one encrypted numerical value; carrying out XOR operation on the decryption vector and the encryption numerical sequence to obtain a content coding sequence of the encrypted document, wherein the XOR operation comprises the following steps: according to each sub-encryption numerical sequence, carrying out XOR operation on each encryption numerical value in each sub-encryption numerical sequence and the decryption vector to obtain a plurality of sub-content coding sequences of the encrypted document; and obtaining the content coding sequence of the encrypted document according to each sub-content coding sequence.
In one embodiment, obtaining a decryption vector of an encrypted document through feature extraction according to a decrypted iris image includes: preprocessing the decrypted iris image; performing feature extraction on the preprocessed decrypted iris image through a neural network to obtain an image feature vector; and obtaining a decryption vector of the encrypted document according to the image feature vector.
In another embodiment, the method for decrypting a document further comprises: acquiring an error correction code of the encrypted document; obtaining a decryption vector of the encrypted document according to the image feature vector, comprising: and carrying out error correction processing on the image feature vector based on the error correction code to obtain a decryption vector of the encrypted document.
In yet another embodiment, displaying content includes: a two-dimensional barcode.
According to a third aspect of the embodiments of the present disclosure, there is provided a document encryption apparatus including: the first acquisition module is used for acquiring a document to be encrypted, acquiring a plurality of content characters of the document to be encrypted and acquiring an encrypted iris image; the encoding module is used for obtaining a content encoding sequence of the document to be encrypted through encoding based on each content character, and the content encoding sequence is composed of a content encoding value corresponding to each content character; the characteristic extraction module is used for obtaining a key vector of the document to be encrypted through characteristic extraction according to the encrypted iris image; and the encryption module is used for encrypting the document to be encrypted based on the content coding sequence and the key vector to obtain the encrypted document.
In one embodiment, the encryption module encrypts the document to be encrypted based on the content coding sequence and the key vector in the following manner to obtain an encrypted document: carrying out XOR operation on each content coding value in the content coding sequence and the key vector to determine the encryption numerical value of each content character; determining the encrypted display content of the document to be encrypted based on each encrypted numerical value; and obtaining an encrypted document according to the encrypted display content.
In another embodiment, the encryption module determines the encrypted display content of the document to be encrypted based on the respective encrypted values in the following manner: and determining the encrypted display content of the document to be encrypted according to the parity of each encrypted value.
In yet another embodiment, encrypting the display content comprises: first content, second content, and third content; the encryption module determines the encrypted display content of the document to be encrypted according to the parity of each encrypted value in the following way: if the content value is odd, displaying the encrypted display content of the document to be encrypted by adopting the first content; and if the content value is an even number, displaying the encrypted display content of the document to be encrypted by adopting the second content and the third content.
In yet another embodiment, the third content includes a two-dimensional barcode.
In one embodiment, the encryption module performs an exclusive or operation on each content encoding value in the content encoding sequence and the key vector in the following manner to determine an encryption value of each content character: dividing the content encoding sequence into a plurality of sub-content encoding sequences according to the dimension of the key vector, wherein the sub-content encoding sequences at least comprise one content encoding value; and performing exclusive OR operation on each content code value in each content code sequence and the key vector according to each content code value sequence to obtain the encrypted numerical value of each content character.
In another embodiment, the feature extraction module obtains a key vector of the document to be encrypted by feature extraction according to the encrypted iris image in the following way: preprocessing the encrypted iris image; carrying out feature extraction on the preprocessed encrypted iris image through a neural network to obtain a feature vector; and obtaining a key vector of the document to be encrypted according to the feature vector.
In another embodiment, the encryption module obtains the key vector of the document to be encrypted according to the feature vector in the following way: and correcting the characteristic vector to obtain a key vector and an error correction code of the document to be encrypted, wherein the error correction code is used for correcting the error when the encrypted document is decrypted.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a document decryption apparatus including: the second acquisition module is used for acquiring an encrypted document and acquiring a decrypted iris image, wherein the encrypted document is encrypted by adopting any one of the document encryption methods; the extraction module is used for obtaining a decryption vector of the encrypted document through feature extraction according to the decrypted iris image; the decryption module is used for decrypting the encrypted document based on the decryption vector; if the decryption vector is consistent with the key vector of the encrypted document, the encrypted document is successfully decrypted to obtain the encrypted content of the encrypted document; if the decryption vector does not match the key vector of the encrypted document, the encrypted document decryption fails.
In an embodiment, the second obtaining module is further configured to: acquiring display content of the encrypted document; the decryption module decrypts the encrypted document based on the decryption vector in the following manner: obtaining an encrypted numerical sequence of the encrypted document according to the display content; and decrypting the encrypted document based on the encrypted numerical sequence and the decryption vector.
In another embodiment, the decryption module decrypts the encrypted document based on the sequence of encrypted values and the decryption vector in the following manner: carrying out exclusive or operation on the decryption vector and the encryption numerical sequence to obtain a content coding sequence of the encrypted document; performing reverse encoding on the content encoding sequence to obtain a plurality of content characters of the encrypted document; the encrypted document is decrypted based on the plurality of content characters.
In another embodiment, the decryption module further decrypts the encrypted document based on the sequence of encrypted values and the decryption vector by: dividing the encrypted numerical value sequence into a plurality of sub-encrypted numerical value sequences according to the dimension of the decryption vector, wherein the sub-encrypted numerical value sequences at least comprise one encrypted numerical value; the decryption module performs exclusive or operation on the decryption vector and the encrypted numerical sequence in the following way to obtain a content coding sequence of the encrypted document: according to each sub-encryption numerical sequence, carrying out XOR operation on each encryption numerical value in each sub-encryption numerical sequence and the decryption vector to obtain a plurality of sub-content coding sequences of the encrypted document; and obtaining the content coding sequence of the encrypted document according to each sub-content coding sequence.
In one embodiment, the extraction module obtains the decryption vector of the encrypted document through feature extraction according to the decrypted iris image by adopting the following method: preprocessing the decrypted iris image; performing feature extraction on the preprocessed decrypted iris image through a neural network to obtain an image feature vector; and obtaining a decryption vector of the encrypted document according to the image feature vector.
In another embodiment, the second obtaining module is further configured to: acquiring an error correction code of the encrypted document; the extraction module obtains a decryption vector of the encrypted document according to the image feature vector by adopting the following mode: and carrying out error correction processing on the image feature vector based on the error correction code to obtain a decryption vector of the encrypted document.
In yet another embodiment, displaying content includes: a two-dimensional barcode.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: executing any one of the above document encryption methods or executing any one of the above document decryption methods.
According to a sixth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by a processor, perform any one of the above-described document encryption methods or perform any one of the above-described document decryption methods.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: the characteristics of uniqueness, high stability, strong anti-counterfeiting performance and the like of the iris are utilized, and the document to be encrypted is encrypted by combining the content of the document to be encrypted. The encrypted document can only be decrypted through the decryption irises which are consistent with the encryption irises, the decryption way is unique, the security of document information can be effectively improved, the content in the document to be encrypted is effectively prevented from being stolen by other people, and therefore the information security of the encrypted document can be effectively guaranteed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram illustrating a method of encrypting a document according to an exemplary embodiment.
FIG. 2 is a schematic diagram illustrating an iris image according to an exemplary embodiment.
FIG. 3 is a schematic diagram illustrating a convolutional neural network structure, according to an exemplary embodiment.
FIG. 4 illustrates an encrypted document display content according to an exemplary embodiment.
FIG. 5 is a flowchart illustrating a method of decrypting a document according to an exemplary embodiment.
FIG. 6 is a flow diagram illustrating another method of document decryption in accordance with an exemplary embodiment.
FIG. 7 is a block diagram illustrating a document encryption apparatus in accordance with an exemplary embodiment.
FIG. 8 is a block diagram illustrating a document encryption apparatus in accordance with an exemplary embodiment.
FIG. 9 is a schematic diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It will be further understood that the terms "first," "second," and the like are used to describe various information and that such information should not be limited by these terms. These terms are only used to distinguish one type of information from another and do not denote a particular order or importance. Indeed, the terms "first," "second," and the like are fully interchangeable. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure.
FIG. 1 is a flowchart illustrating a document encryption method according to an exemplary embodiment, and as shown in FIG. 1, the document encryption method 10 includes the following steps S11 through S16.
In step S11, a document to be encrypted is acquired.
In the embodiment of the disclosure, the document to be encrypted is a document which needs to be encrypted, so as to protect the information security of the document content. The source of the document to be encrypted can be created locally or obtained in the cloud. The field to which the document to be encrypted relates is not limited.
In step S12, a plurality of content characters of a document to be encrypted is acquired.
In the embodiment of the disclosure, according to the obtained document to be encrypted, the content in the document to be encrypted is obtained, and a plurality of content characters are obtained. The obtained content characters may be all contents in the document to be encrypted, or may be contents corresponding to a part of paragraphs or sentences that need to be encrypted. The content characters may include: chinese, english, punctuation, etc. Due to the fact that the content characters of different documents are different, the content characters of the document to be encrypted are obtained, so that a unique content coding sequence can be obtained when the content characters of the content to be encrypted are coded, the different documents to be encrypted can be distinguished, the situation of mistaken decryption can be prevented when the documents are decrypted, and the safety of the content of the documents is improved.
In step S13, a content code sequence of the document to be encrypted is obtained by encoding based on each content character, the content code sequence being composed of a content code value corresponding to each content character.
In the embodiment of the disclosure, the obtained content characters are encoded according to a certain encoding mode, and according to a character set of the encoding mode, a numerical value matched between the content character and the character set of the encoding mode is obtained, so as to obtain a content encoding value corresponding to each content character. And arranging the content code values in sequence according to the positions of the content characters in the document to be encrypted to obtain a content code sequence of the document to be encrypted. Different document contents can adopt different coding forms, so that the coding is more targeted, the accuracy of coding the document to be encrypted can be improved, and the coding can be completed quickly. In an embodiment, when each content character in the document to be encrypted relates to a latin character, the content character can be encoded by using an ASCII encoding method to obtain a content encoding value corresponding to each content character. In another embodiment, when each content Character in the document to be encrypted relates to multiple types of content characters, the content characters may be encoded by using an encoding method of UTF-8 (8-bit, Universal charcter Set/UnicodeTransformation Format). The types may include: chinese characters, English, punctuation marks, etc. UTF-8 is a variable length character encoding for Unicode (Unicode). It can be used to represent any character in the Unicode standard, and the first byte in its code is still compatible with ASCII, so that the original software for processing ASCII characters can be used continuously without or after only a few modifications. By using UTF-8, various types of content characters can be encoded at the same time, which is helpful for rapidly obtaining a complete content encoding sequence of the content to be encrypted.
In step S14, an encrypted iris image is acquired.
In the embodiment of the disclosure, an encrypted iris image used for encrypting a document to be encrypted is acquired. As shown in fig. 2, the iris is the annular portion of the eye between the dark dead pupil and the white sclera. It contains many details of scattered points, filaments, coronaries, striations and crypts, and the iris is hardly changed from the development of the fetus to the whole life, and thus, the iris has uniqueness. The difficulty coefficient for changing the iris is large, and the iris cannot be copied or converted under the condition of no serious visual damage, so that the iris has high-strength anti-counterfeiting property. The file to be encrypted is encrypted by using the iris, so that the security of the file to be encrypted is highly guaranteed, and further, the content in the file to be encrypted can be effectively prevented from being stolen by other people. The encrypted iris image can be from an encryptor of the document to be encrypted or from a decryptor needing to decrypt the encrypted document, and the encrypted document is obtained after the document to be encrypted is encrypted.
In step S15, a key vector of the document to be encrypted is obtained by feature extraction based on the encrypted iris image.
In the embodiment of the disclosure, the obtained encrypted iris image is subjected to feature extraction, the feature information of the encrypted iris is extracted, the feature vector of the encrypted iris is obtained, and the key vector of the document to be encrypted is obtained. The encrypted iris has uniqueness and, therefore, the key vector also has uniqueness. The document to be encrypted is encrypted based on the key vector obtained by encrypting the iris image, so that the obtained encryption key has uniqueness and pertinence, the encryptor of the document to be encrypted can be distinguished, and further, the mistaken decryption can be effectively prevented.
In one embodiment, the encrypted iris image is preprocessed; carrying out feature extraction on the preprocessed encrypted iris image through a neural network to obtain a feature vector; and obtaining a key vector of the document to be encrypted according to the feature vector.
And preprocessing the encrypted iris image to make the image characteristic information of the encrypted iris image clearer. The pretreatment comprises the following steps: firstly, the obtained encrypted iris image is segmented to obtain an iris ring area. Secondly, in order to extract image features, the iris circular ring area is converted into a regular image, and the iris circular ring area is converted into an iris rectangular image through polar coordinate transformation. Finally, in order to improve the accuracy of extracting the feature vector of the encrypted iris image, the iris features of the iris image in different receptive fields are acquired, and the acquired iris rectangular image is subjected to an image enhancement technology to realize the diversity of the iris matrix image. The image enhancement comprises: adjusting the noise of the iris rectangular image through filtering; or adjusting the brightness of the rectangular image of the iris, etc. Inputting the preprocessed encrypted iris image into a convolutional neural network model for feature extraction to obtain a feature vector of the encrypted iris image, and taking the feature vector as a key vector of an encrypted document.
In another embodiment, the most important feature due to the encryption of the iris image is the textureAnd (4) extracting texture features by adopting a shallow convolutional neural network. In the related art, extracting iris features is performed by pooling feature images. However, since the pooling operation can compress and reduce the dimension of the feature image, it is easy to cause a certain loss to the feature image, and is not suitable for feature extraction of feature images such as iris images. Therefore, in order to fully extract the feature vector of the encrypted iris image, the pooling layer is replaced by the cavity convolution layer when the convolutional neural network is designed, and the characteristics of enlarging the receptive field, improving the image resolution and the like of the cavity convolution layer are utilized to accurately position the image feature of the encrypted iris image, so that the accuracy of the feature vector is improved. In one implementation scenario, as shown in fig. 3, the convolutional neural network includes four hole convolutions, the sizes of convolution kernels are all 3 × 3, the expansion coefficients of each layer of convolution are 1,2,4, and 3, the number of feature maps of each layer of convolution in the first three layers is 32, and the number of feature maps of the last layer is 128. The input image size of the network is 512 x 64, and after convolution operation, the size is unchanged. When training the convolutional neural network, the activation function selects Tanh, i.e., f (x) ═ 1-e-2x)/(1+e-2x) Wherein x is a training parameter. The objective function selects a ternary loss function, i.e.
Figure BDA0002430725440000081
Wherein N represents the logarithm of the input ternary data,
Figure BDA0002430725440000082
respectively representing the corresponding anchor point, positive and negative samples in the ith ternary batch of data; a represents the interval between the anchor point and the positive sample and between the anchor point and the negative sample; []+When the value in the parentheses is larger than 0, the value is taken, and otherwise 0 is taken. After training is finished, the obtained 128-dimensional feature map can be subjected to mean pooling, and the size of a convolution kernel is 64 × 512, so that a 128-dimensional feature vector is obtained.
In another embodiment, the feature vector is subjected to error correction to obtain a key vector and an error correction code of the document to be encrypted, wherein the error correction code is used for error correction when the encrypted document is decrypted.
Because the extraction of the characteristics of the encrypted iris image cannot be performed in hundreds and the characteristics of the iris image displayed in different receptive fields are different, the error correction processing is performed on the characteristic vector after the characteristic vector of the encrypted iris image is extracted. The characteristic vector is corrected, the tolerance range is expanded to supplement the vector which is possibly lost, so that when decryption is performed subsequently through the decryption vector of the decrypted iris image, correction can be performed through an error correcting code, the phenomenon that the error generated by extracting the characteristic of the decrypted iris image and the key vector due to different receptive fields is corrected, the accuracy of the decryption vector is improved, and rapid decryption is facilitated. Further, the tolerance is improved, for example: according to the requirement, a multi-dimensional vector is additionally added on the basis of the 128-dimensional feature vector. And taking the feature vector subjected to error correction as a key vector of the document to be encrypted so as to improve the accuracy of the feature vector and enhance the reliability of the key vector. In an implementation scenario, the obtained feature vector may be error correction coded by using Reed-Solomon code (Reed-Solomon coding), so that the obtained key has stronger robustness. In an implementation scenario, the feature vector of the encrypted iris image is 128-dimensional, after error correction processing, a 138-dimensional key vector is obtained, and the remaining 10-dimensional keys except for the 128-dimensional key vector area are error correction codes. When decryption error correction is performed, the image feature vector of the decrypted image is corrected by using the 10-dimensional error correction code, thereby improving the accuracy of the decrypted vector.
In step S16, the document to be encrypted is encrypted based on the content encoding sequence and the key vector, resulting in an encrypted document.
In the embodiment of the disclosure, the obtained content codes are combined with the obtained key vector to generate an encryption key with pertinence and directivity for the file to be encrypted, and then the file to be encrypted is encrypted, so that the obtained encrypted file can only be decrypted through a decryption iris which is consistent with the encrypted iris image. And the obtained encrypted document has more reliability in protecting the content safety.
In one embodiment, the content code values in the content code sequence are subjected to exclusive or operation with the key vector, and the encrypted numerical value of each content character is determined; determining the encrypted display content of the document to be encrypted based on each encrypted numerical value; and obtaining an encrypted document according to the encrypted display content.
The content encoding values obtained according to the specified encoding format are typically stored in an 8-bit, binary format. For example: the Chinese character "one", utf-8 corresponds to a value of 14989440, the binary system is: 111001001011100010000000, three bytes are stored, and eight bits and one byte are: E4B 880. And when the encrypted numerical value of each content character is determined, carrying out XOR operation on the content code value corresponding to each content character and the key vector in a binary system mode to obtain an encrypted vector. And converting the encrypted vector into a decimal system, namely, an encrypted numerical value. Each content character is replaced by an encrypted value by an exclusive or operation between the content code value and the key vector. And distinguishing different encrypted displays of different content characters according to the encrypted numerical value, further obtaining the encrypted display content of the document to be encrypted according to the encrypted display of each content character, and completing encryption. The encrypted document is displayed by the encrypted display content, so that the document can not be decrypted by people except the person corresponding to the decrypted iris image after being exposed outside, and the threat of document content disclosure is reduced.
In one embodiment, the encrypted display content of the document to be encrypted is determined based on the parity of each encrypted value. The encrypted display content includes: first content, second content, and third content.
And dividing each encrypted numerical value by 2 to obtain a quotient value and a remainder corresponding to each encrypted numerical value. And judging the parity of each encrypted numerical value according to the remainder. If the remainder is 1, the corresponding encrypted numerical value is an odd number, and the encrypted display content of the document to be encrypted is displayed by adopting the first content. And if the remainder is 0, the corresponding encrypted numerical value is an even number, and the encrypted display content of the document to be encrypted is displayed by adopting the second content and the third content. In one implementation scenario, the first content is: black blocks of the same size as the corresponding content characters. The second content is: a space of the same size as the corresponding content character. The third content may be presented in the form of a two-dimensional barcode. And when the current encrypted numerical value is an odd number, replacing the display by a black block with the same content character size corresponding to the encrypted numerical value. And when the current encrypted numerical value is an even number, displaying the content characters corresponding to the encrypted numerical value in blank. And arranging the quotient of each encrypted numerical value according to the display sequence of each content character, and storing the quotient into third content, so that the content characters specifically represented by each first content and each second content in the encrypted display content can be distinguished when in decryption. The third content can be displayed at any position in the document to be encrypted, and can also be displayed in a watermark mode. In an implementation scene, the two-dimensional bar code has the characteristics of large capacity of information storage, strong fault-tolerant capability, low manufacturing cost, easy operation and the like, so that the two-dimensional bar code is more convenient and faster to use. The display effect of the final encrypted document is shown in fig. 4.
In one embodiment, the content encoding sequence is divided into a plurality of sub-content encoding sequences according to the dimension of the key vector, and the sub-content encoding sequences at least comprise one content encoding value; and performing exclusive OR operation on each content code value in each content code sequence and the key vector according to each content code sequence to obtain the encrypted numerical value of each content character.
When the content characters of the text to be encrypted are excessive and the content coding sequence exceeds the dimension of the key vector, dividing the content coding sequence into a plurality of sub-content coding sequences according to the dimension of the key vector, wherein the sub-content coding sequences at least comprise one content coding value. For example: the key vector has a dimension of 128 and the sequence of content encoding numbers has a dimension of 400. According to the splitting of the dimension of the key vector, the content coding number sequence is split into three 128-dimension sub-content coding sequences and a 16-dimension sub-content coding sequence. And carrying out exclusive OR operation on the content code value corresponding to each content character in each sub-content code sequence and the key vector to obtain the encrypted numerical value of each content character. The encryption numbers of the content characters are obtained by grouping and carrying out XOR operation, which is beneficial to orderly conversion of the content characters, so that the possibility of missed conversion, wrong conversion and the like is avoided, and the encryption rate is accelerated.
According to the embodiment, the iris is combined with the content characters of the document to be encrypted according to the characteristics of uniqueness, strong anti-counterfeiting performance and the like of the iris to generate the targeted encrypted document, so that the content of the encrypted document can be effectively prevented from leaking, the information security of the document to be encrypted can be effectively improved, and the information security of the document to be encrypted can be guaranteed.
Based on the same conception, the embodiment of the disclosure also provides a document decryption method.
FIG. 5 is a flowchart illustrating a method of decrypting a document according to an exemplary embodiment. Referring to fig. 5, the document decryption method 20 includes the following steps S21 through S24.
In step S21, an encrypted document is acquired.
In the disclosed embodiment, an encrypted document that needs to be decrypted is obtained. The encrypted document is encrypted by adopting the document encryption method provided by the disclosure.
In step S22, a decrypted iris image is acquired.
In the embodiment of the present disclosure, a decrypted iris image for decrypting a current encrypted document is obtained, which is used to obtain a decryption vector, and determine whether the obtained encrypted document can be decrypted. The decrypted iris image can be obtained by the image acquisition equipment.
In step S23, a decryption vector of the encrypted document is obtained by feature extraction based on the decrypted iris image.
In the embodiment of the disclosure, feature extraction is performed on the obtained decrypted iris image, feature information of the decrypted iris is extracted, and a feature vector of the decrypted iris is obtained, that is, a decrypted vector of a document to be decrypted is obtained. Because the key vector is unique, only the decryption vector that matches it can successfully decrypt the contents of the encrypted document. By extracting the decryption vector, whether the feature vector of the decrypted iris image can be successfully decrypted or not is judged during decryption, and the encrypted document is prevented from being decrypted by others.
In one embodiment, the decrypted iris image is preprocessed in the same and processing mode as the encrypted iris image, so that the resolution of the decrypted iris image is improved, the accuracy of feature extraction is improved, accurate feature vectors can be obtained, and the accurate decrypted vectors can be obtained conveniently.
In another embodiment, an error correction code of an encrypted document is obtained; and correcting the image characteristic vector based on the error correction code to obtain a decryption vector of the encrypted document. The error correction code is obtained by correcting the error of the feature vector of the encrypted iris image when the encrypted document is encrypted. Because the characteristics of the iris image presented in different receptive fields are different, the error correction processing is carried out on the obtained image characteristic vector through an error correction code generated when the encryption document is encrypted, so that the errors caused by different receptive fields are reduced, the accuracy of the decrypted vector is further improved, and the quick decryption is facilitated. The error correction code may include: reed-solomon codes.
In step S24, the encrypted document is decrypted based on the decryption vector.
In the embodiment of the present disclosure, the encrypted document is decrypted according to the acquired decryption vector. If the decryption vector is consistent with the key vector of the encrypted document, the encrypted document can be successfully decrypted to obtain the original content of the encrypted document, and the current decryptor is a designated decryptor capable of acquiring the original content of the encrypted document. If the decryption vector does not match the key vector of the encrypted document, the original content of the encrypted document cannot be decrypted, the decryption of the encrypted document fails, and the current decryptor is not the designated decryptor of the encrypted document.
In one embodiment, before decrypting the encrypted document, the decryption vector is matched with the key vector in advance, and if the matching is successful, the encrypted document is continuously decrypted; and if the matching fails, stopping the decryption.
When the encrypted document is encrypted, the key vector of the encrypted iris image of the encrypted document is also stored together, and the corresponding relation between the key vector and the encrypted document is determined. In order to conveniently and quickly judge whether the current decryptor is the appointed decryptor of the encrypted document, before the encrypted document is decrypted, the obtained decryption vector is matched with the key vector of the encrypted document. If the matching is successful, the current decryptor is the appointed decryptor, and the encrypted document can be continuously decrypted. If the matching fails, the current decryptor is not the designated decryptor, the file is not decrypted without the right, and the encrypted document is stopped being decrypted. Through matching, the identity of a decryptor can be determined quickly, and the security of the decrypted and encrypted document is improved. In one implementation scenario, the correspondence between each key vector and the encrypted document may be distinguished according to the ID that created the encrypted document.
Through the embodiment, the iris image has uniqueness and anti-counterfeiting performance, the encrypted document is decrypted based on the characteristic vector of the decrypted iris image and combined with the display content of the encrypted document, whether the current decryptor is the correct decryptor or not is judged, the situation that people except the specified decryptor misunderstand the encrypted document is favorably prevented, and the document information safety of the encrypted document is favorably improved.
FIG. 6 is a flow diagram illustrating another method of document decryption in accordance with an exemplary embodiment. Referring to fig. 6, the document decryption method 30 includes the following steps S31 through S36.
In the present disclosure, the implementation of step S31 and steps S33 to S34 are the same as the implementation of step S21 to step S23 of the document decryption method 20, respectively, and are not repeated herein.
In step S31, an encrypted document is acquired.
In step S32, the display content of the encrypted document is acquired.
In the embodiment of the disclosure, the display content of the encrypted document is obtained, and is used for obtaining the encrypted numerical value sequence of the encrypted document, so that the encryption key of the encrypted document can be decrypted together with the obtained decrypted iris image, and the original content of the encrypted document can be obtained.
In step S33, a decrypted iris image is acquired.
In step S34, a decryption vector of the encrypted document is obtained by feature extraction based on the decrypted iris image.
In step S35, an encrypted numerical sequence of the encrypted document is obtained based on the display content.
In the disclosed embodiment, the display content of the encrypted document includes first content, second content, and third content. From the respective contents displayed, the encryption numerical sequence of the encrypted document can be determined. In one embodiment, the parity of each encrypted value of the encrypted document can be determined based on the first content. According to the second content, a remainder binary sequence formed by remainders between respective encrypted numerical values of the encrypted document and 2 can be obtained. Through the third content, a quotient value sequence formed by quotient values between the respective encrypted numerical values of the encrypted document and 2 can be obtained. And obtaining the encrypted numerical value corresponding to each original content character of the encrypted document according to the parity of each encrypted numerical value, and the remainder binary sequence and the quotient sequence between the parity of each encrypted numerical value and 2, and further obtaining the encrypted numerical value sequence. In one embodiment, the third content may include a two-dimensional barcode by which the quotient value sequence is stored.
In step S36, the encrypted document is decrypted based on the encrypted sequence of values and the decryption vector.
In the embodiment of the disclosure, the content coding sequence of the encrypted document can be obtained by combining the encrypted numerical sequence and the decryption vector. Each content encoding value in the content encoding sequence corresponds to a content character of the encrypted document. And reversely encoding each content encoding value to restore the content characters of the encrypted document and decrypt the encrypted document.
In one embodiment, the decryption vector and the encryption numerical sequence are subjected to exclusive or operation to obtain a content coding sequence of the encrypted document; performing reverse encoding on the content encoding sequence to obtain a plurality of content characters of the encrypted document; the encrypted document is decrypted based on the plurality of content characters.
And each encrypted value in the encrypted value sequence is decimal, each encrypted value is converted into binary, the binary and the decrypted vector are subjected to exclusive OR operation, each content coding matrix obtained by the exclusive OR result is converted into decimal, and a medium content coding sequence of the encrypted document is obtained. And performing inverse coding on each content coding value in the content coding sequence, and restoring content characters corresponding to the content coding values. The encoding form of the reverse encoding is the same as that of the content encoding value obtained by encoding the content characters.
In another embodiment, the sequence of encrypted numbers is divided into a plurality of sub-sequences of encrypted numbers according to the dimension of the decryption vector, the sub-sequences of encrypted numbers including at least one encrypted number; according to each sub-encryption number sequence, carrying out XOR operation on each encryption number in each sub-encryption number sequence and the decryption vector to obtain a plurality of sub-content coding sequences of the encrypted document; and obtaining the content coding sequence of the encrypted document according to each sub-content coding sequence.
When the encrypted number sequence is too long and exceeds the dimension of the decryption vector, the encrypted number sequence is divided into a plurality of sub-encrypted number sequences, so that the XOR operation with the decryption vector is facilitated. For example: the dimension of the decryption vector is 128 and the dimension of the sequence of encrypted numbers is 400. According to the decryption vector dimension splitting, the encrypted number sequence is split into three 128-dimension sub-encrypted number sequences and a 16-dimension sub-encrypted number sequence. And when the XOR operation is carried out, carrying out the XOR operation on each sub-encryption number sequence and the decryption vector according to the sequence of each encryption number in the encryption number sequence to obtain each sub-content coding sequence corresponding to each sub-encryption number sequence, and further obtain the content coding sequence of the encrypted document. The XOR operation is performed through grouping, which is beneficial to avoiding the possibility of generating miss-forwarding, error-forwarding and the like, and further quickening the encryption rate.
Based on the same conception, the embodiment of the disclosure also provides a document encryption device.
It is to be understood that the document encryption device and/or the document decryption device provided by the embodiments of the present disclosure include hardware structures and/or software modules for performing the respective functions in order to implement the above functions. The disclosed embodiments can be implemented in hardware or a combination of hardware and computer software, in combination with the exemplary elements and algorithm steps disclosed in the disclosed embodiments. Whether a function is performed as hardware or computer software drives hardware 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 disclosure.
FIG. 7 is a block diagram illustrating a document encryption apparatus according to an example embodiment. Referring to fig. 7, the document encryption apparatus 100 includes: a first acquisition module 110, an encoding module 120, a feature extraction module 130, and an encryption module 140.
The first obtaining module 110 is configured to obtain a document to be encrypted, obtain a plurality of content characters of the document to be encrypted, and obtain an encrypted iris image.
And the encoding module 120 is configured to obtain a content encoding sequence of the document to be encrypted through encoding based on each content character, where the content encoding sequence is composed of a content encoding value corresponding to each content character.
And the feature extraction module 130 is configured to obtain a key vector of the document to be encrypted through feature extraction according to the encrypted iris image.
And the encryption module 140 is configured to encrypt the document to be encrypted based on the content coding sequence and the key vector to obtain an encrypted document.
In an embodiment, the encryption module 140 encrypts the document to be encrypted based on the content encoding sequence and the key vector in the following manner to obtain an encrypted document: carrying out XOR operation on each content coding value in the content coding sequence and the key vector to determine the encryption numerical value of each content character; determining the encrypted display content of the document to be encrypted based on each encrypted numerical value; and obtaining an encrypted document according to the encrypted display content.
In another embodiment, the encryption module 140 determines the encrypted display content of the document to be encrypted based on the respective encryption values in the following manner: and determining the encrypted display content of the document to be encrypted according to the parity of each encrypted value.
In yet another embodiment, encrypting the display content comprises: first content, second content, and third content; the encryption module 140 determines the encrypted display content of the document to be encrypted according to the parity of each encrypted value in the following manner: if the content value is odd, displaying the encrypted display content of the document to be encrypted by adopting the first content; and if the content value is an even number, displaying the encrypted display content of the document to be encrypted by adopting the second content and the third content.
In yet another embodiment, the third content includes a two-dimensional barcode.
In one embodiment, the encryption module 140 performs an exclusive-or operation on each content encoding value in the content encoding sequence and the key vector to determine an encryption value of each content character by: dividing the content encoding sequence into a plurality of sub-content encoding sequences according to the dimension of the key vector, wherein the sub-content encoding sequences at least comprise one content encoding value; and performing exclusive OR operation on each content code value in each sub-content code sequence and the key vector according to each sub-content code sequence to obtain the encrypted numerical value of each content character.
In another embodiment, the feature extraction module 130 obtains a key vector of the document to be encrypted through feature extraction according to the encrypted iris image in the following manner: preprocessing the encrypted iris image; carrying out feature extraction on the preprocessed encrypted iris image through a neural network to obtain a feature vector; and obtaining a key vector of the document to be encrypted according to the feature vector.
In another embodiment, the encryption module 140 obtains a key vector of the document to be encrypted according to the feature vector in the following manner: and correcting the characteristic vector to obtain a key vector and an error correction code of the document to be encrypted, wherein the error correction code is used for correcting the error when the encrypted document is decrypted.
Based on the same conception, the embodiment of the disclosure also provides a document decryption device.
FIG. 8 is a block diagram illustrating a document decryption device according to an example embodiment. Referring to fig. 8, the document decryption apparatus 200 includes: a second acquisition module 210, an extraction module 220 and a decryption module 230.
The second obtaining module 210 is configured to obtain an encrypted document and obtain a decrypted iris image, where the encrypted document is encrypted by using any one of the above-mentioned document encryption methods.
And the extraction module 220 is configured to obtain a decryption vector of the encrypted document through feature extraction according to the decrypted iris image.
A decryption module 230 for decrypting the encrypted document based on the decryption vector; if the decryption vector is consistent with the key vector of the encrypted document, the encrypted document is successfully decrypted to obtain the encrypted content of the encrypted document; if the decryption vector does not match the key vector of the encrypted document, the encrypted document decryption fails.
In an embodiment, the second obtaining module 210 is further configured to: acquiring display content of the encrypted document; the decryption module 230 decrypts the encrypted document based on the decryption vector in the following manner: obtaining an encrypted numerical sequence of the encrypted document according to the display content; and decrypting the encrypted document based on the encrypted numerical sequence and the decryption vector.
In another embodiment, the decryption module 230 decrypts the encrypted document based on the sequence of encrypted values and the decryption vector in the following manner: carrying out exclusive or operation on the decryption vector and the encryption numerical sequence to obtain a content coding sequence of the encrypted document; performing inverse coding on the content coding value sequence to obtain a plurality of content characters of the encrypted document; the encrypted document is decrypted based on the plurality of content characters.
In yet another embodiment, the decryption module 230 further decrypts the encrypted document based on the sequence of encrypted values and the decryption vector in the following manner: dividing the encrypted numerical value sequence into a plurality of sub-encrypted numerical value sequences according to the dimension of the decryption vector, wherein the sub-encrypted numerical value sequences at least comprise one encrypted numerical value; the decryption module 230 performs xor operation on the decryption vector and the encrypted numerical sequence to obtain the content coding sequence of the encrypted document by the following method: according to each sub-encryption numerical sequence, carrying out XOR operation on each encryption numerical value in each sub-encryption numerical sequence and the decryption vector to obtain a plurality of sub-content coding sequences of the encrypted document; and obtaining the content coding sequence of the encrypted document according to each sub-content coding sequence.
In an embodiment, the extraction module 220 obtains the decryption vector of the encrypted document through feature extraction according to the decrypted iris image in the following manner: preprocessing the decrypted iris image; performing feature extraction on the preprocessed decrypted iris image through a neural network to obtain an image feature vector; and obtaining a decryption vector of the encrypted document according to the image feature vector.
In another embodiment, the second obtaining module 210 is further configured to: acquiring an error correction code of the encrypted document; the extracting module 220 obtains a decryption vector of the encrypted document according to the image feature vector by the following method, including: and carrying out error correction processing on the image feature vector based on the error correction code to obtain a decryption vector of the encrypted document.
In yet another embodiment, displaying content includes: a two-dimensional barcode.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
As shown in fig. 9, one embodiment of the invention provides an electronic device 300. The electronic device 300 includes a memory 310, a processor 320, and an Input/Output (I/O) interface 330. The memory 310 is used for storing instructions. And a processor 320 for calling the instructions stored in the memory 310 to execute any one of the document encryption methods or any one of the text decryption methods according to the embodiments of the present invention. The processor 320 is connected to the memory 310 and the I/O interface 330, respectively, for example, via a bus system and/or other connection mechanism (not shown). The memory 310 may be used to store programs and data, including programs for knowledge-based language model training or text classification involved in embodiments of the present invention, and the processor 320 executes various functional applications and data processing of the electronic device 300 by executing the programs stored in the memory 310.
In an embodiment of the present invention, the processor 320 may be implemented in at least one hardware form of a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), and the processor 320 may be one or a combination of a Central Processing Unit (CPU) or other Processing units with data Processing capability and/or instruction execution capability.
Memory 310 in embodiments of the present invention may comprise one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile Memory may include, for example, Random Access Memory (RAM), cache Memory (cache), and/or the like. The nonvolatile Memory may include, for example, a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk Drive (HDD), a Solid-State Drive (SSD), or the like.
In the embodiment of the present invention, the I/O interface 330 may be used to receive input instructions (e.g., numeric or character information, and generate key signal inputs related to user settings and function control of the electronic device 300, etc.), and may also output various information (e.g., images or sounds, etc.) to the outside. The I/O interface 330 may comprise one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, a touch panel, and the like.
A non-transitory computer readable storage medium having instructions stored thereon that, when executed by a processor of a mobile terminal, enable the mobile terminal to perform any of the above-described document encryption methods or to perform any of the above-described text decryption methods.
It is further understood that the use of "a plurality" in this disclosure means two or more, as other terms are analogous. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. The singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It is further to be understood that while operations are depicted in the drawings in a particular order, this is not to be understood as requiring that such operations be performed in the particular order shown or in serial order, or that all illustrated operations be performed, to achieve desirable results. In certain environments, multitasking and parallel processing may be advantageous.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (32)

1. A method for encrypting a document, the method comprising:
acquiring a document to be encrypted;
acquiring a plurality of content characters of the document to be encrypted;
based on each content character, obtaining a content coding sequence of the document to be encrypted through coding, wherein the content coding sequence is composed of content coding values corresponding to each content character;
acquiring an encrypted iris image;
obtaining a key vector of the document to be encrypted through feature extraction according to the encrypted iris image;
and encrypting the document to be encrypted based on the content coding sequence and the key vector to obtain an encrypted document.
2. The document encryption method according to claim 1,
the encrypting the document to be encrypted based on the content coding sequence and the key vector to obtain an encrypted document comprises:
performing exclusive-or operation on each content coding value in the content coding sequence and the key vector to determine an encryption numerical value of each content character;
determining the encrypted display content of the document to be encrypted based on each encrypted numerical value;
and obtaining an encrypted document according to the encrypted display content.
3. The document encryption method according to claim 2, wherein said determining the encrypted display content of the document to be encrypted based on each of the encrypted numerical values comprises:
and determining the encrypted display content of the document to be encrypted according to the parity of each encrypted numerical value.
4. The document encryption method according to claim 3,
the encrypted display content includes: first content, second content, and third content;
determining the encrypted display content of the document to be encrypted according to the parity of each encrypted numerical value, wherein the determining comprises the following steps:
if the content value is odd, displaying the encrypted display content of the document to be encrypted by adopting the first content;
and if the content numerical value is an even number, displaying the encrypted display content of the document to be encrypted by adopting the second content and the third content.
5. The document encryption method according to claim 4, wherein the third content includes a two-dimensional barcode.
6. The method of claim 3, wherein said xoring each of said content encoding values in said content encoding sequence with said key vector to determine an encrypted value for each of said content characters comprises:
dividing the content encoding sequence into a plurality of sub-content encoding sequences according to the dimension of the key vector, wherein the sub-content encoding sequences at least comprise one content encoding value;
and according to each sub-content coding sequence, carrying out XOR operation on each content coding value in each sub-content coding sequence and the key vector to obtain an encrypted numerical value of each content character.
7. The document encryption method according to claim 5 or 6, wherein obtaining the key vector of the document to be encrypted by feature extraction according to the encrypted iris image comprises:
preprocessing the encrypted iris image;
performing feature extraction on the preprocessed encrypted iris image through a neural network to obtain a feature vector;
and obtaining a key vector of the document to be encrypted according to the feature vector.
8. The document encryption method according to claim 7, wherein the obtaining the key vector of the document to be encrypted according to the feature vector comprises:
and correcting the characteristic vector to obtain a key vector and an error correction code of the document to be encrypted, wherein the error correction code is used for correcting errors when the encrypted document is decrypted.
9. A document decryption method, characterized in that the document decryption method comprises:
obtaining an encrypted document, wherein the encrypted document is encrypted by adopting the document encryption method of any one of the claims 1-8;
acquiring a decrypted iris image;
obtaining a decryption vector of the encrypted document through feature extraction according to the decrypted iris image;
decrypting the encrypted document based on the decryption vector;
if the decryption vector is consistent with the key vector of the encrypted document, the encrypted document is successfully decrypted to obtain the encrypted content of the encrypted document;
and if the decryption vector does not accord with the key vector of the encrypted document, the encrypted document is decrypted unsuccessfully.
10. The document decryption method of claim 9,
the document decryption method further comprises: acquiring display content of the encrypted document;
the decrypting the encrypted document based on the decryption vector includes:
obtaining an encrypted numerical sequence of the encrypted document according to the display content;
decrypting the encrypted document based on the sequence of encrypted values and the decryption vector.
11. The document decryption method of claim 10, wherein decrypting the encrypted document based on the sequence of encrypted values and the decryption vector comprises:
carrying out exclusive or operation on the decryption vector and the encrypted numerical value sequence to obtain a content coding sequence of the encrypted document;
performing reverse encoding on the content encoding sequence to obtain a plurality of content characters of the encrypted document;
decrypting the encrypted document based on the plurality of content characters.
12. The document decryption method of claim 11, wherein decrypting the encrypted document based on the sequence of encrypted values and the decryption vector further comprises:
dividing the encrypted numerical value sequence into a plurality of sub-encrypted numerical value sequences according to the dimension of the decryption vector, wherein the sub-encrypted numerical value sequences at least comprise one encrypted numerical value;
performing an exclusive or operation on the decryption vector and the encrypted numerical sequence to obtain a content coding value sequence of the encrypted document, including:
according to each sub-encryption numerical value sequence, carrying out XOR operation on each encryption numerical value in each sub-encryption numerical value sequence and the decryption vector to obtain a plurality of sub-content coding sequences of the encrypted document;
and obtaining the content coding sequence of the encrypted document according to each sub-content coding sequence.
13. The document decryption method according to claim 11 or 12, wherein obtaining the decryption vector of the encrypted document by feature extraction based on the decrypted iris image comprises:
preprocessing the decrypted iris image;
performing feature extraction on the preprocessed decrypted iris image through a neural network to obtain an image feature vector;
and obtaining a decryption vector of the encrypted document according to the image feature vector.
14. The document decryption method of claim 13,
the document decryption method further comprises:
acquiring an error correction code of the encrypted document;
the obtaining of the decryption vector of the encrypted document according to the image feature vector includes:
and correcting the image characteristic vector by error based on the error correction code to obtain a decryption vector of the encrypted document.
15. The document decryption method of claim 14, wherein the displaying the content comprises: a two-dimensional barcode.
16. A document encryption apparatus, characterized in that the document encryption apparatus comprises:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a document to be encrypted, acquiring a plurality of content characters of the document to be encrypted and acquiring an encrypted iris image;
the encoding module is used for obtaining a content encoding sequence of the document to be encrypted through encoding based on each content character, and the content encoding sequence is composed of content encoding values corresponding to each content character;
the characteristic extraction module is used for obtaining a key vector of the document to be encrypted through characteristic extraction according to the encrypted iris image;
and the encryption module is used for encrypting the document to be encrypted based on the content coding sequence and the key vector to obtain an encrypted document.
17. The document encryption apparatus according to claim 16,
the encryption module encrypts the document to be encrypted based on the content coding sequence and the key vector in the following way to obtain an encrypted document:
performing exclusive-or operation on each content coding value in the content coding sequence and the key vector to determine an encryption numerical value of each content character;
determining the encrypted display content of the document to be encrypted based on each encrypted numerical value;
and obtaining an encrypted document according to the encrypted display content.
18. The document encryption apparatus according to claim 17, wherein said encryption module determines the encrypted display content of the document to be encrypted based on each of said encrypted numerical values in the following manner:
and determining the encrypted display content of the document to be encrypted according to the parity of each encrypted numerical value.
19. The document encryption apparatus according to claim 18,
the encrypted display content includes: first content, second content, and third content;
the encryption module determines the encrypted display content of the document to be encrypted according to the parity of each encrypted numerical value in the following way:
if the content value is odd, displaying the encrypted display content of the document to be encrypted by adopting the first content;
and if the content numerical value is an even number, displaying the encrypted display content of the document to be encrypted by adopting the second content and the third content.
20. The document encryption apparatus according to claim 19, wherein the third content comprises a two-dimensional barcode.
21. The document encryption apparatus according to claim 18, wherein said encryption module performs an exclusive-or operation on each of said content encoding values in said content encoding sequence and said key vector to determine an encrypted value of each of said content characters by:
dividing the content encoding sequence into a plurality of sub-content encoding sequences according to the dimension of the key vector, wherein the sub-content encoding sequences at least comprise one content encoding value;
and according to each sub-content coding sequence, carrying out XOR operation on each content coding value in each sub-content coding sequence and the key vector to obtain an encrypted numerical value of each content character.
22. The document encryption device according to claim 20 or 21, wherein the feature extraction module obtains the key vector of the document to be encrypted by feature extraction according to the encrypted iris image in the following manner:
preprocessing the encrypted iris image;
performing feature extraction on the preprocessed encrypted iris image through a neural network to obtain a feature vector;
and obtaining a key vector of the document to be encrypted according to the feature vector.
23. The document encryption apparatus according to claim 22, wherein the encryption module obtains the key vector of the document to be encrypted from the feature vector in the following manner:
and correcting the characteristic vector to obtain a key vector and an error correction code of the document to be encrypted, wherein the error correction code is used for correcting errors when the encrypted document is decrypted.
24. A document decryption apparatus, characterized by comprising:
a second obtaining module, configured to obtain an encrypted document and obtain a decrypted iris image, where the encrypted document is encrypted by using the document encryption apparatus according to any one of claims 1 to 8;
the extraction module is used for obtaining a decryption vector of the encrypted document through feature extraction according to the decrypted iris image;
a decryption module for decrypting the encrypted document based on the decryption vector;
if the decryption vector is consistent with the key vector of the encrypted document, the encrypted document is successfully decrypted to obtain the encrypted content of the encrypted document;
and if the decryption vector does not accord with the key vector of the encrypted document, the encrypted document is decrypted unsuccessfully.
25. The document decryption apparatus according to claim 24,
the second obtaining module is further configured to: acquiring display content of the encrypted document;
the decryption module decrypts the encrypted document based on the decryption vector in the following manner:
obtaining an encrypted numerical sequence of the encrypted document according to the display content;
decrypting the encrypted document based on the sequence of encrypted values and the decryption vector.
26. The document decryption device of claim 25, wherein the decryption module decrypts the encrypted document based on the sequence of encrypted values and the decryption vector by:
carrying out exclusive or operation on the decryption vector and the encrypted numerical value sequence to obtain a content coding sequence of the encrypted document;
performing reverse encoding on the content encoding sequence to obtain a plurality of content characters of the encrypted document;
decrypting the encrypted document based on the plurality of content characters.
27. The document decryption method of claim 26, wherein the decryption module further decrypts the encrypted document based on the sequence of encrypted values and the decryption vector by:
dividing the encrypted numerical value sequence into a plurality of sub-encrypted numerical value sequences according to the dimension of the decryption vector, wherein the sub-encrypted numerical value sequences at least comprise one encrypted numerical value;
the decryption module performs exclusive or operation on the decryption vector and the encrypted numerical sequence in the following way to obtain a content coding sequence of the encrypted document:
according to each sub-encryption numerical value sequence, carrying out XOR operation on each encryption numerical value in each sub-encryption numerical value sequence and the decryption vector to obtain a plurality of sub-content coding sequences of the encrypted document;
and obtaining the content coding sequence of the encrypted document according to each sub-content coding sequence.
28. The document decryption apparatus according to claim 26 or 27, wherein the extraction module obtains the decryption vector of the encrypted document by feature extraction from the decrypted iris image in the following manner:
preprocessing the decrypted iris image;
performing feature extraction on the preprocessed decrypted iris image through a neural network to obtain an image feature vector;
and obtaining a decryption vector of the encrypted document according to the image feature vector.
29. The document decryption device according to claim 28,
the second obtaining module is further configured to: acquiring an error correction code of the encrypted document;
the extraction module obtains a decryption vector of the encrypted document according to the image feature vector by adopting the following mode:
and carrying out error correction processing on the image feature vector based on the error correction code to obtain a decryption vector of the encrypted document.
30. The document decryption device of claim 29, wherein the display content comprises: a two-dimensional barcode.
31. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: performing the document encryption method of any one of claims 1-8 or performing the document decryption method of any one of claims 9-15.
32. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by a processor, perform the document encryption method of any one of claims 1-8 or perform the document decryption method of any one of claims 9-15.
CN202010235203.4A 2020-03-30 2020-03-30 Document encryption method, document decryption device, electronic equipment and medium Pending CN111538969A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010235203.4A CN111538969A (en) 2020-03-30 2020-03-30 Document encryption method, document decryption device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010235203.4A CN111538969A (en) 2020-03-30 2020-03-30 Document encryption method, document decryption device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN111538969A true CN111538969A (en) 2020-08-14

Family

ID=71974836

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010235203.4A Pending CN111538969A (en) 2020-03-30 2020-03-30 Document encryption method, document decryption device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN111538969A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114340113A (en) * 2021-12-30 2022-04-12 智马达汽车有限公司 Information processing method and device based on vehicle light
CN114726655A (en) * 2022-06-07 2022-07-08 深圳市永达电子信息股份有限公司 Character set encryption method based on digital certificate identity authentication
CN116383860A (en) * 2023-06-06 2023-07-04 北京点聚信息技术有限公司 Document data encryption method based on cloud computing
CN116561813A (en) * 2023-07-12 2023-08-08 中汇丰(北京)科技有限公司 Safety management system applied to archive information

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006004378A (en) * 2004-06-21 2006-01-05 Gijutsu Transfer Service:Kk Two-dimensional code, two-dimensional code forming device and method, and two-dimensional code reading device and method
US20110142230A1 (en) * 2003-02-07 2011-06-16 Britesmart Llc Real-time data encryption
CN104518865A (en) * 2014-12-12 2015-04-15 南京邮电大学 Data encryption method based on password book
CN105337742A (en) * 2015-11-18 2016-02-17 哈尔滨工业大学 LFSR (Linear Feedback Shift Register) file encryption and decryption methods based on human face image features and GPS (Global Position System) information
CN105447405A (en) * 2015-11-09 2016-03-30 南京以太安全技术有限公司 Document encryption/decryption method and apparatus based on iris recognition and authentication
CN106850215A (en) * 2017-03-17 2017-06-13 武汉虹识技术有限公司 Data encryption, decryption method and device
CN107330395A (en) * 2017-06-27 2017-11-07 中国矿业大学 A kind of iris image encryption method based on convolutional neural networks
CN107944290A (en) * 2017-11-14 2018-04-20 武汉理工大学 A kind of iris templates guard method based on partial ordering
CN108833379A (en) * 2018-05-31 2018-11-16 中国工商银行股份有限公司 A kind of data encryption and transmission method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110142230A1 (en) * 2003-02-07 2011-06-16 Britesmart Llc Real-time data encryption
JP2006004378A (en) * 2004-06-21 2006-01-05 Gijutsu Transfer Service:Kk Two-dimensional code, two-dimensional code forming device and method, and two-dimensional code reading device and method
CN104518865A (en) * 2014-12-12 2015-04-15 南京邮电大学 Data encryption method based on password book
CN105447405A (en) * 2015-11-09 2016-03-30 南京以太安全技术有限公司 Document encryption/decryption method and apparatus based on iris recognition and authentication
CN105337742A (en) * 2015-11-18 2016-02-17 哈尔滨工业大学 LFSR (Linear Feedback Shift Register) file encryption and decryption methods based on human face image features and GPS (Global Position System) information
CN106850215A (en) * 2017-03-17 2017-06-13 武汉虹识技术有限公司 Data encryption, decryption method and device
CN107330395A (en) * 2017-06-27 2017-11-07 中国矿业大学 A kind of iris image encryption method based on convolutional neural networks
CN107944290A (en) * 2017-11-14 2018-04-20 武汉理工大学 A kind of iris templates guard method based on partial ordering
CN108833379A (en) * 2018-05-31 2018-11-16 中国工商银行股份有限公司 A kind of data encryption and transmission method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
席振元: "数据通信与计算机网络", 《煤炭工业出版社》, pages: 241 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114340113A (en) * 2021-12-30 2022-04-12 智马达汽车有限公司 Information processing method and device based on vehicle light
CN114340113B (en) * 2021-12-30 2023-10-13 浙江智马达智能科技有限公司 Information processing method and device based on vehicle lamplight
CN114726655A (en) * 2022-06-07 2022-07-08 深圳市永达电子信息股份有限公司 Character set encryption method based on digital certificate identity authentication
CN116383860A (en) * 2023-06-06 2023-07-04 北京点聚信息技术有限公司 Document data encryption method based on cloud computing
CN116383860B (en) * 2023-06-06 2023-08-04 北京点聚信息技术有限公司 Document data encryption method based on cloud computing
CN116561813A (en) * 2023-07-12 2023-08-08 中汇丰(北京)科技有限公司 Safety management system applied to archive information
CN116561813B (en) * 2023-07-12 2023-09-26 中汇丰(北京)科技有限公司 Safety management system applied to archive information

Similar Documents

Publication Publication Date Title
CN111538969A (en) Document encryption method, document decryption device, electronic equipment and medium
CN105471575B (en) Information encryption and decryption method and device
Cao et al. High capacity reversible data hiding in encrypted images by patch-level sparse representation
US10755375B2 (en) Systems and methods for steganography based on text fonts
CN107492064B (en) Image encryption method based on memristor chaos system, elementary cellular automata and compressed sensing
CN105634732A (en) Ciphertext domain multi-bit reversible information hiding method
CN110968847A (en) File watermark hiding and analyzing method, device, equipment and storage medium
CN112948895A (en) Data watermark embedding method, watermark tracing method and device
CN112860933B (en) Ciphertext image retrieval method, device, terminal equipment and storage medium
Gui et al. Steganalysis of LSB matching based on local binary patterns
CN109672804B (en) Image encryption and decryption method and system
Zin Message embedding in PNG file using LSB steganographic technique
CN113988242A (en) Multi-region-based anti-counterfeiting code generation and verification method, system, equipment and medium
Chinniyan et al. Image Steganography Using Deep Neural Networks.
CN111669477A (en) Image processing method, system, device, equipment and computer storage medium
Li et al. Block mapping and dual-matrix-based watermarking for image authentication with self-recovery capability
CN117150532B (en) Data security guarantee method, device, equipment and readable storage medium
CN111669273B (en) Encryption method based on cellular automaton theory
KR102522109B1 (en) Apparatus for cryptanalysis using generative adversarial networks and mehtod thereof
CN115310114B (en) Small program user data processing method
CN111324897B (en) Image encryption method and device and image decryption method and device
CN116566584B (en) Programmable controller communication method based on Henon chaotic system encryption
Walidaniy et al. Improvement of PSNR by Using Shannon-Fano Compression Technique in AES-LSB StegoCrypto
Sulfi et al. A Secure Watermarking Based Image Integrity Verification in IoMT
Matveev et al. Iris-based biometric cryptosystem

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
CB02 Change of applicant information

Address after: 100081 room 701, floor 7, Fuhai international port, Haidian District, Beijing

Applicant after: Beijing wanlihong Technology Co.,Ltd.

Address before: 100081 1504, floor 15, Fuhai international port, Daliushu Road, Haidian District, Beijing

Applicant before: BEIJING SUPERRED TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information