CN115001666A - Image local encryption algorithm based on bit plane template XOR - Google Patents

Image local encryption algorithm based on bit plane template XOR Download PDF

Info

Publication number
CN115001666A
CN115001666A CN202210929803.XA CN202210929803A CN115001666A CN 115001666 A CN115001666 A CN 115001666A CN 202210929803 A CN202210929803 A CN 202210929803A CN 115001666 A CN115001666 A CN 115001666A
Authority
CN
China
Prior art keywords
matrix
image
template
encrypted
generating
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
CN202210929803.XA
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.)
Hubei Micropattern Technology Development Co ltd
Original Assignee
Hubei Micropattern Technology Development 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 Hubei Micropattern Technology Development Co ltd filed Critical Hubei Micropattern Technology Development Co ltd
Priority to CN202210929803.XA priority Critical patent/CN115001666A/en
Publication of CN115001666A publication Critical patent/CN115001666A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • 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

Abstract

An image local encryption algorithm based on bit plane template exclusive OR comprises the following steps: step 1: acquiring a BMP image to be encrypted; and 2, step: generating a mark matrix, and generating the mark matrix according to pixels related to the content to be encrypted of the BMP image; and step 3: generating a template matrix, generating a random binary matrix by using the key K, and carrying out and operation on the random binary matrix and the mark matrix to obtain a corresponding template matrix; and 4, step 4: and generating an encrypted image space domain matrix, and performing XOR operation on the encrypted image space domain matrix and the bit plane by using the template matrix to obtain the encrypted image space domain matrix to finish encryption. The invention respectively carries out template matrix encryption on RGB three color component images of the color BMP image, and the three component images are merged and stored as the BMP image which is the final encrypted image. The third party can not decrypt the image content without the template matrix, the safety factor is high, and the encryption and decryption transportation efficiency is high.

Description

Image local encryption algorithm based on bit plane template XOR
Technical Field
The invention relates to the technical field related to image encryption and decryption algorithms, in particular to an image local encryption algorithm based on bit plane template exclusive OR.
Background
With the development of digital media and internet technology, the phenomenon of individuals or organizations publishing or disseminating images over networks has become more and more common. In particular, rapid advances in cloud computing have allowed more and more image data to be uploaded to cloud storage. The access of multiple users in the big data environment greatly facilitates the work and life of people. However, the act of publishing or sending the raw picture without processing also risks revealing the privacy of the individual.
In order to solve the problem of privacy disclosure caused by image privacy content release, an effective and feasible method is to encrypt a sensitive portion in an image, for example, to perform mosaic addition on related protected content or directly delete the sensitive content. These processed images are often irreproducible and even thus result in permanent loss of true information. The other method is to encrypt the whole image, and the method takes the whole image as a protected object and protects the whole image by a cryptographic method. But this will cause the hiding of other non-private information, affecting the distribution of non-private information. Generally, the user only wants to restrict the access rights of the image part content to the part of people. It does not restrict access to sensitive data by all people or to all data by third parties. When the conditions permit, the user wishes himself or an authorized party to restore the original content by means of the protected image. Therefore, the local encryption technology will become an important development direction of the image content protection technology.
Disclosure of Invention
In order to solve the problem of identification of a signer in a double-recording video in the prior art, the invention provides an image local encryption algorithm based on bit plane template XOR, which adopts the following technical scheme:
an image local encryption algorithm based on bit plane template exclusive OR comprises the following steps:
step 1: acquiring a BMP image to be encrypted;
step 2: generating a mark matrix, and generating the mark matrix according to the pixels related to the content needing to be encrypted of the BMP image;
and step 3: generating a template matrix, generating a random binary matrix by using the key K, and carrying out and operation on the random binary matrix and the mark matrix to obtain a corresponding template matrix;
and 4, step 4: and generating an encrypted image space domain matrix, and performing XOR operation on the encrypted image space domain matrix and the bit plane by using the template matrix to obtain the encrypted image space domain matrix to finish encryption.
Through the technical scheme, after the steps, the RGB three color component images of the BMP image are encrypted, and the three component images are merged and stored as the BMP image which is the final encrypted image. After the encryption process is completed, the encryptor may send the encrypted image and template matrix to the decryptor. The third party cannot decrypt the image content without the template matrix.
Optionally, the specific method for generating the label matrix in step 2 is as follows:
generating a binary marking matrix
Figure 724087DEST_PATH_IMAGE001
=
Figure 844490DEST_PATH_IMAGE002
i=1,2,3,…,hAnd is provided withj=1,2,3,…wWhen it comes to
Figure 952123DEST_PATH_IMAGE003
When the pixel needs to be encrypted, let
Figure 940808DEST_PATH_IMAGE004
=1, otherwise order
Figure 958442DEST_PATH_IMAGE004
=0。
By the technical scheme, the spatial domain pixel matrix of the image needing to be encrypted is set as
Figure 374380DEST_PATH_IMAGE005
=
Figure 641413DEST_PATH_IMAGE006
,i=1,2,3,…,hAnd j =1,2,3, …,w
Figure 125134DEST_PATH_IMAGE003
is a single pixel of the image and,handwrespectively the height and width of the image.
The user needs to select the parameters in advanceNIs set hereN=1,2,3,…,7;
For the spatial pixel matrix is
Figure 121909DEST_PATH_IMAGE005
=
Figure 177590DEST_PATH_IMAGE006
Generating a binary marking matrix
Figure 525394DEST_PATH_IMAGE001
=
Figure 731248DEST_PATH_IMAGE002
For subsequent encryption of the marked area.
Optionally, the specific method for generating the encrypted image spatial domain matrix in step 3 is:
first using a secret keyKGeneratingNA binary matrix composed of random 0 and 1, respectively
Figure 848108DEST_PATH_IMAGE007
Figure 481215DEST_PATH_IMAGE008
Figure 443879DEST_PATH_IMAGE009
,...
Figure 187844DEST_PATH_IMAGE010
Further performing a bit AND operation, the following can be obtainedNMatrix of each template:
Figure 424791DEST_PATH_IMAGE011
=
Figure 494378DEST_PATH_IMAGE012
Figure 816775DEST_PATH_IMAGE013
=
Figure 364431DEST_PATH_IMAGE014
Figure 190304DEST_PATH_IMAGE015
=
Figure 696372DEST_PATH_IMAGE016
wherein
Figure DEST_PATH_IMAGE017
Is a bit and operation.
Through the technical scheme, an encryptor uses the key K and the binary mark matrix to carry out bit and operation to obtain the template matrix, the bit and operation execution efficiency is higher, and the calculation can be rapidly completed to obtain the template matrix.
Optionally, the bit AND operation will
Figure 974907DEST_PATH_IMAGE018
Figure 185308DEST_PATH_IMAGE019
,… ,
Figure 919216DEST_PATH_IMAGE020
And clearing the binary matrix elements corresponding to the positions of the middle unencrypted pixels, and keeping the binary matrix elements at other positions unchanged.
Through the technical scheme, the key is cleared by clearing the binary matrix element corresponding to the non-encrypted pixel positionKGeneratingNEach composed of random 0 and 1The template matrix encryption is realized by clearing the binary matrix elements corresponding to the non-encrypted pixel positions in the binary matrix, so that users who do not obtain the template matrix cannot realize the encryption through a secret keyKAnd the safety factor is higher when decryption is carried out.
Optionally, the specific method for generating the encrypted image spatial matrix in step 4 is:
for image pixel matrix
Figure 924081DEST_PATH_IMAGE005
=
Figure 955491DEST_PATH_IMAGE006
The high to low numbers 1,2,3, …,Nthis is achieved byNA bit plane is respectively connected withNMatrix of individual templates
Figure 844949DEST_PATH_IMAGE021
Figure 176574DEST_PATH_IMAGE022
,…,
Figure 758865DEST_PATH_IMAGE015
Perform an XOR operation, i.e.
Figure 277571DEST_PATH_IMAGE023
To obtain
Figure 970720DEST_PATH_IMAGE024
For encrypting the spatial matrix of the image, the method comprises
Figure 625693DEST_PATH_IMAGE025
And storing the image file to obtain a final encrypted image.
By the technical scheme, the pixel matrix of the element image is subjected to XOR operation encryption in a template matrix mode, decryption cannot be realized for users who do not obtain template proof, and the safety factor is higher.
Optionally, the representation represents pre-encryption image pixels
Figure 113306DEST_PATH_IMAGE003
From high to lowkThe number of the bits is one,k=1,2,3,…,Nsaid
Figure 119308DEST_PATH_IMAGE026
Representing encrypted image pixels
Figure 212553DEST_PATH_IMAGE027
From high to lowkThe number of the bits is one,k=1,2,3,…,N,if it is usedN<8, then
Figure 862977DEST_PATH_IMAGE028
t=N+1,N+2, …,8。
Optionally, the image decryptor decrypts the image by using the template matrix exclusive-or operation using the template matrix and the highest of the imageNAnd (4) respectively carrying out XOR operation on the bit planes, and restoring the original numerical values of the bit planes to restore the original image after the XOR operation.
According to the technical scheme, the picture encrypted by the template matrix exclusive-or operation is encrypted, the only decryption method is to obtain the template matrix and perform exclusive-or operation reversely to realize decryption, other key decryption modes cannot perform decryption, and the encryption safety is better.
Optionally, the specific method for decrypting the image is as follows:
for image pixel matrix
Figure 646126DEST_PATH_IMAGE005
=
Figure 280369DEST_PATH_IMAGE029
The number 1,2,3, …,Nthis is achieved byNA bit plane respectively andNmatrix of individual templates
Figure 846480DEST_PATH_IMAGE011
Figure 944886DEST_PATH_IMAGE013
,…,
Figure 633356DEST_PATH_IMAGE015
Perform an exclusive OR operation, i.e.
Figure 613951DEST_PATH_IMAGE030
To obtain
Figure 187014DEST_PATH_IMAGE031
For encrypting the spatial matrix of the image, the method comprises
Figure 77610DEST_PATH_IMAGE005
Stored as an image file to obtain the final decrypted image.
According to the technical scheme, decryption is achieved through the reverse operation exclusive-or operation of the template matrix, decryption cannot be achieved through other key decryption modes, encryption safety is better, decryption efficiency is higher, and safety and controllability are achieved.
Optionally, the
Figure 202561DEST_PATH_IMAGE032
And
Figure 139293DEST_PATH_IMAGE026
respectively representing pre-encryption image pixels
Figure 640681DEST_PATH_IMAGE003
And encrypted image pixels
Figure 185451DEST_PATH_IMAGE027
From high to lowkThe number of the bits is one,k=1,2,3,…,N. If it is notN<8, then
Figure 746882DEST_PATH_IMAGE028
t=N+1,N+2, …,8。
In summary, the present invention includes at least one of the following beneficial effects:
the invention provides an image local encryption algorithm based on bit plane template XOR, wherein three RGB color component images of a color BMP image are encrypted by a template matrix, and the three component images are merged and stored as the BMP image as a final encrypted image. After the encryption process is completed, the encryptor may send the encrypted image and template matrix to the decryptor. The third party can not decrypt the image content without the template matrix, the safety factor is high, and the encryption and decryption transportation efficiency is high.
Drawings
FIG. 1 is a schematic diagram of an encryption flow of the present invention;
fig. 2 is a schematic diagram of the decryption process of the present invention.
Detailed Description
The present invention is described in further detail below with reference to fig. 1-2.
The embodiment of the invention discloses a speaker role distinguishing method and system.
Referring to fig. 1, an image local encryption algorithm based on bit plane template xor includes the following steps:
step 1: acquiring a BMP image to be encrypted;
step 2: generating a mark matrix, and generating the mark matrix according to the pixels related to the content needing to be encrypted of the BMP image;
and step 3: generating a template matrix, generating a random binary matrix by using the key K, and carrying out and operation on the random binary matrix and the mark matrix to obtain a corresponding template matrix;
and 4, step 4: and generating an encrypted image space domain matrix, and performing XOR operation on the encrypted image space domain matrix and the bit plane by using the template matrix to obtain the encrypted image space domain matrix to finish encryption.
After the above steps, the RGB three color component images of the BMP image are all encrypted, and the three component images are merged and stored as the BMP image as a final encrypted image. After the encryption process is completed, the encryptor may send the encrypted image and template matrix to the decryptor. The third party cannot decrypt the image content without the template matrix.
The specific method for generating the mark matrix in the step 2 is as follows:
generating a binary marking matrix
Figure 311856DEST_PATH_IMAGE001
=
Figure 616935DEST_PATH_IMAGE002
i=1,2,3,…,hAnd isj=1,2,3,…wWhen is coming into contact with
Figure 482123DEST_PATH_IMAGE003
When the pixel needs to be encrypted, order
Figure 89822DEST_PATH_IMAGE004
=1, otherwise
Figure 673250DEST_PATH_IMAGE004
=0。
Setting the spatial pixel matrix of the image needing encryption as
Figure 250862DEST_PATH_IMAGE005
=
Figure 564031DEST_PATH_IMAGE006
I =1,2,3, ·, h and j =1,2,3 … W,
Figure 342631DEST_PATH_IMAGE003
is a single pixel of the image and,handwrespectively the height and width of the image.
The user needs to select parameters in advanceNThe value of (a) is set here as N =1,2,3 … 7;
for the spatial pixel matrix is
Figure 413356DEST_PATH_IMAGE005
=
Figure 794658DEST_PATH_IMAGE006
Generating a binary marking matrix
Figure 103280DEST_PATH_IMAGE001
=
Figure 583940DEST_PATH_IMAGE002
By usingThe marked area is subsequently encrypted.
The specific method for generating the encrypted image spatial domain matrix in the step 3 is as follows:
first using a secret keyKGeneratingNA binary matrix composed of random 0 and 1, respectively
Figure 204277DEST_PATH_IMAGE007
Figure 654850DEST_PATH_IMAGE008
Figure 349137DEST_PATH_IMAGE009
,...
Figure 203960DEST_PATH_IMAGE010
Further performing a bit AND operation, the following can be obtainedNMatrix of each template:
Figure 580102DEST_PATH_IMAGE011
=
Figure 975312DEST_PATH_IMAGE012
Figure 117580DEST_PATH_IMAGE013
=
Figure 205622DEST_PATH_IMAGE014
Figure 675917DEST_PATH_IMAGE015
=
Figure 468293DEST_PATH_IMAGE016
wherein
Figure 871592DEST_PATH_IMAGE017
Is a bit and operation.
The encryptor uses the key K and the binary mark matrix to carry out bit and operation to obtain the template matrix, the bit and operation execution efficiency is higher, and the calculation can be rapidly completed to obtain the template matrix.
The bit and operation will
Figure 458431DEST_PATH_IMAGE018
Figure 681602DEST_PATH_IMAGE019
,… ,
Figure 418614DEST_PATH_IMAGE020
And clearing the binary matrix elements corresponding to the positions of the middle unencrypted pixels, and keeping the binary matrix elements at other positions unchanged.
The key is realized by clearing the binary matrix element corresponding to the non-encrypted pixel positionKGeneratingNThe template matrix encryption is realized by clearing binary matrix elements corresponding to non-encrypted pixel positions in a binary matrix consisting of random 0 and random 1, so that users who do not obtain the template matrix cannot realize the encryption through a secret keyKAnd the safety factor is higher when decryption is carried out.
The specific method for generating the encrypted image spatial domain matrix in the step 4 is as follows:
for image pixel matrix
Figure 269895DEST_PATH_IMAGE005
=
Figure 168581DEST_PATH_IMAGE006
High to low numbers 1,2, …,Nthis is achieved byNA bit plane is respectively connected withNMatrix of individual templates
Figure 144628DEST_PATH_IMAGE021
Figure 13227DEST_PATH_IMAGE022
,…,
Figure 984594DEST_PATH_IMAGE015
Perform an XOR operation, i.e.
Figure 319760DEST_PATH_IMAGE023
To obtain
Figure 517523DEST_PATH_IMAGE024
For encrypting the spatial matrix of the image, the method comprises
Figure 924234DEST_PATH_IMAGE025
And storing the image file to obtain a final encrypted image.
The pixel matrix of the element image is encrypted by the exclusive-OR operation in the mode of the template matrix, so that decryption cannot be realized for users who do not obtain template proof, and the safety coefficient is higher.
Representing pre-encryption image pixels
Figure 422211DEST_PATH_IMAGE003
From high to lowkThe number of the bits is one,k=1,2,3,…,Nsaid
Figure 536403DEST_PATH_IMAGE026
Representing encrypted image pixels
Figure 955883DEST_PATH_IMAGE027
From high to lowkThe number of the bits is one,k=1,2,3,…,N,if it is notN<8, then
Figure 431863DEST_PATH_IMAGE028
t=N+1,N+2, …,8。
The person who decrypts the image by adopting the exclusive-or operation of the template matrix uses the template matrix and the highest of the imageNAnd (4) respectively carrying out XOR operation on the bit planes, and restoring the original numerical values of the bit planes to restore the original image after the XOR operation.
By adopting the picture encrypted by the template matrix XOR operation, the only decryption method is to obtain the template matrix and perform XOR operation reversely to realize decryption, and other key decryption modes cannot perform decryption, so that the encryption security is better.
The specific method for decrypting the image comprises the following steps:
for image pixel matrix
Figure 112243DEST_PATH_IMAGE005
=
Figure 54792DEST_PATH_IMAGE029
High to low numbers 1,2, …,Nthis is achieved byNA bit plane is respectively connected withNMatrix of individual templates
Figure 961568DEST_PATH_IMAGE011
Figure 382185DEST_PATH_IMAGE013
,…,
Figure 182651DEST_PATH_IMAGE015
Perform an XOR operation, i.e.
Figure 358417DEST_PATH_IMAGE030
To obtain
Figure 283648DEST_PATH_IMAGE031
For encrypting the spatial matrix of the image, the method comprises
Figure 976797DEST_PATH_IMAGE005
Stored as an image file to obtain the final decrypted image.
Decryption is realized by the reverse operation of the template matrix and exclusive-or operation, decryption cannot be performed by other key decryption modes, encryption safety is better, decryption efficiency is higher, and safety and controllability are realized.
Figure 631769DEST_PATH_IMAGE032
And
Figure 916120DEST_PATH_IMAGE026
respectively representing pre-encryption image pixels
Figure 797489DEST_PATH_IMAGE003
And encrypted image pixels
Figure 887804DEST_PATH_IMAGE027
From high to lowkBits, k =1,2,3, ·, N, ifN<8, then
Figure 69387DEST_PATH_IMAGE028
t=N+1,N+2, …,8。
The implementation principle of the image local encryption algorithm based on the bit plane template XOR is as follows:
see FIG. 1, in color BMP imageNFor the case of =4, let us say that the spatial pixel matrix of the image to be encrypted is
Figure 118114DEST_PATH_IMAGE005
=
Figure 221200DEST_PATH_IMAGE006
,i=1,2,3,…,hAnd j =1,2,3, …,w
Figure 118136DEST_PATH_IMAGE003
is a single pixel of the image and,handwrespectively the height and width of the image. The user needs to select parameters in advanceNHere, N =1,2,3 … 7 is set.
1. Generating a mark matrix:
generating a binary marking matrix
Figure 154225DEST_PATH_IMAGE033
=
Figure 373854DEST_PATH_IMAGE034
i=1,2,3,…,hAnd isj=1,2,3,…wWhen is coming into contact with
Figure 964235DEST_PATH_IMAGE035
For pixels requiring encryption
Figure 68457DEST_PATH_IMAGE036
=1, otherwise
Figure 818108DEST_PATH_IMAGE036
=0。
2. Using a secret keyKGeneratingNA template matrix:
first using a secret keyKGeneratingNA binary matrix composed of random 0 and 1, respectively
Figure 943058DEST_PATH_IMAGE037
Figure 551894DEST_PATH_IMAGE038
Figure 194228DEST_PATH_IMAGE039
,...
Figure 532806DEST_PATH_IMAGE040
Further performing a bit AND operation, the following can be obtainedNMatrix of each template:
Figure 500762DEST_PATH_IMAGE011
=
Figure 65735DEST_PATH_IMAGE012
Figure 511760DEST_PATH_IMAGE013
=
Figure 970423DEST_PATH_IMAGE014
Figure 437177DEST_PATH_IMAGE015
=
Figure 20605DEST_PATH_IMAGE016
wherein
Figure 739162DEST_PATH_IMAGE017
For bit AND operation, the operation in the above formula will
Figure 52332DEST_PATH_IMAGE018
Figure 362090DEST_PATH_IMAGE019
,… ,
Figure 29219DEST_PATH_IMAGE020
And clearing the binary matrix elements corresponding to the positions of the middle unencrypted pixels, and keeping the binary matrix elements at other positions unchanged.
3. Encrypting the image by using template matrix XOR operation:
for image pixel matrix
Figure 285888DEST_PATH_IMAGE005
=
Figure 125668DEST_PATH_IMAGE029
The number 1,2, …,Nthis is achieved byNA bit plane is respectively connected withNMatrix of individual templates
Figure 199804DEST_PATH_IMAGE011
Figure 820141DEST_PATH_IMAGE013
,…,
Figure 677238DEST_PATH_IMAGE015
Perform an XOR operation, i.e.
Figure 840367DEST_PATH_IMAGE041
Here, the
Figure 819824DEST_PATH_IMAGE042
And
Figure 865140DEST_PATH_IMAGE043
representing pixels of an image before encryption separately
Figure 588246DEST_PATH_IMAGE003
And encrypted image pixels
Figure 137039DEST_PATH_IMAGE044
From high to lowkThe number of the bits is one,k=1,2,3,…,N. If it is notN<8, then
Figure 693922DEST_PATH_IMAGE028
t=N+1,N+2, …,8, to give
Figure 288851DEST_PATH_IMAGE024
For encrypting the spatial matrix of the image, the method comprises
Figure 222172DEST_PATH_IMAGE045
And storing the image file to obtain a final encrypted image.
The step of image decryption is the reverse of the step of encryption, see fig. 2, as follows:
decrypting the image by using template matrix XOR operation, and for the image pixel matrix
Figure 359893DEST_PATH_IMAGE046
=
Figure 946732DEST_PATH_IMAGE029
High to low numbers 1,2, …,Nthis is achieved byNA bit plane is respectively connected withNMatrix of individual templates
Figure 435482DEST_PATH_IMAGE011
Figure 31548DEST_PATH_IMAGE013
,…,
Figure 554933DEST_PATH_IMAGE015
Perform an XOR operation, i.e.
Figure 922461DEST_PATH_IMAGE030
Here, the
Figure 494912DEST_PATH_IMAGE042
And
Figure 35615DEST_PATH_IMAGE043
respectively representing pre-encryption image pixels
Figure 6982DEST_PATH_IMAGE047
And encrypted image pixels
Figure 810990DEST_PATH_IMAGE044
From high to lowkA bit ofk=1,2,3,…,N. If it is usedN<8, then
Figure 274332DEST_PATH_IMAGE028
t=N+1,N+2, …,8, to give
Figure 212201DEST_PATH_IMAGE031
For encrypting the spatial matrix of the image, the method comprises
Figure 710179DEST_PATH_IMAGE046
Stored as an image file to obtain the final decrypted image.
The specific implementations described herein are merely illustrative of the spirit of the invention. Various fine-tuning modifications or additions may be made to the described embodiments or by a similar method, such as transmitting the mask matrix and the key K to the decryptor without directly transmitting the template matrix, so that the decryptor can calculate the template matrix from the mask matrix and the key K, without departing from the spirit of the invention or exceeding the scope defined by the claims.
The above are all preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, so: all equivalent changes made according to the structure, shape and principle of the invention are covered by the protection scope of the invention.

Claims (9)

1. An image local encryption algorithm based on bit plane template XOR is characterized in that: the method comprises the following steps:
step 1: acquiring a BMP image to be encrypted;
step 2: generating a mark matrix, and generating the mark matrix according to the pixels related to the content needing to be encrypted of the BMP image;
and 3, step 3: generating a template matrix using a keyKGenerating a random binary matrix, and carrying out and operation on the random binary matrix and the mark matrix to obtain a corresponding template matrix;
and 4, step 4: and generating an encrypted image space domain matrix, and performing XOR operation on the encrypted image space domain matrix and the bit plane by using the template matrix to obtain the encrypted image space domain matrix to finish encryption.
2. The image local encryption algorithm based on bit plane template exclusive or according to claim 1, characterized in that: the specific method for generating the mark matrix in the step 2 is as follows:
generating a binary marking matrix
Figure 516082DEST_PATH_IMAGE001
=
Figure 325775DEST_PATH_IMAGE002
i=1,2,3,…,hAnd is provided withj=1,2,3,…wWhen is coming into contact with
Figure 5018DEST_PATH_IMAGE003
When the pixel needs to be encrypted, order
Figure 953907DEST_PATH_IMAGE004
=1, otherwise
Figure 834138DEST_PATH_IMAGE004
=0。
3. The image local encryption algorithm based on bit plane template exclusive or according to claim 1, characterized in that: the specific method for generating the encrypted image spatial domain matrix in the step 3 is as follows:
first using a secret keyKGeneratingNA binary matrix composed of random 0 and 1, respectively
Figure 599969DEST_PATH_IMAGE005
Figure 879640DEST_PATH_IMAGE006
Figure 289893DEST_PATH_IMAGE007
,...
Figure 996818DEST_PATH_IMAGE008
Further performing a bit AND operation, the following can be obtainedNMatrix of each template:
Figure 390890DEST_PATH_IMAGE009
=
Figure 208673DEST_PATH_IMAGE010
Figure 863646DEST_PATH_IMAGE011
=
Figure 616838DEST_PATH_IMAGE012
Figure 357261DEST_PATH_IMAGE013
=
Figure 854101DEST_PATH_IMAGE014
wherein
Figure 629159DEST_PATH_IMAGE015
Is a bit and operation.
4. The image local encryption algorithm based on bit-plane template XOR of claim 3, characterized in that:
the bit AND operation will
Figure 553253DEST_PATH_IMAGE016
Figure 49481DEST_PATH_IMAGE017
,… ,
Figure 84433DEST_PATH_IMAGE018
And clearing the binary matrix elements corresponding to the non-encrypted pixel positions, and keeping the binary matrix elements at other positions unchanged.
5. The image local encryption algorithm based on bit plane template exclusive or according to claim 1, characterized in that: the specific method for generating the encrypted image spatial domain matrix in the step 4 is as follows:
for image pixel matrix
Figure 713998DEST_PATH_IMAGE019
=
Figure 808993DEST_PATH_IMAGE020
The number 1,2,3, …,Nthis is achieved byNA bit plane is respectively connected withNMatrix of individual templates
Figure 524008DEST_PATH_IMAGE021
Figure 628230DEST_PATH_IMAGE022
,…,
Figure 112301DEST_PATH_IMAGE013
Perform an exclusive OR operation, i.e.
Figure 643776DEST_PATH_IMAGE023
To obtain
Figure 580508DEST_PATH_IMAGE024
For encrypting the spatial matrix of the image, the method comprises
Figure 222842DEST_PATH_IMAGE025
And storing the image file to obtain a final encrypted image.
6. The image local encryption algorithm based on bit plane template exclusive OR as claimed in claim 5, wherein:
the above-mentioned
Figure 702365DEST_PATH_IMAGE026
Representing image pixels before encryption
Figure 263796DEST_PATH_IMAGE003
From high to lowkThe number of the bits is one,k=1,2,3,…,Nsaid
Figure 828770DEST_PATH_IMAGE027
Representing encrypted image pixels
Figure 133849DEST_PATH_IMAGE028
From high to lowkThe number of the bits is one,k=1,2,3,…,N,if it is notN<8, then order
Figure 733458DEST_PATH_IMAGE029
t=N+1,N+2,…,8。
7. The image partial encryption algorithm based on bit-plane template XOR of any one of claims 1-6, characterized in that: the method for decrypting the image comprises the following steps: the highest of the template matrix and the image is used by the decipherer for deciphering the image by the exclusive OR operation of the template matrixNAnd (4) respectively carrying out XOR operation on the bit planes, and restoring the original numerical values of the bit planes to restore the original image after the XOR operation.
8. The image local encryption algorithm based on bit plane template exclusive or according to claim 7, characterized in that: the specific method for decrypting the image comprises the following steps:
for image pixel matrix
Figure 465791DEST_PATH_IMAGE019
=
Figure 252481DEST_PATH_IMAGE030
The high to low numbers 1,2,3, …,Nthis is achieved byNA bit plane is respectively connected withNMatrix of individual templates
Figure 364181DEST_PATH_IMAGE009
Figure 818296DEST_PATH_IMAGE011
,…,
Figure 721530DEST_PATH_IMAGE013
Perform an XOR operation, i.e.
Figure 995517DEST_PATH_IMAGE031
To obtain
Figure 642399DEST_PATH_IMAGE032
For encrypting the spatial matrix of the image, the method comprises
Figure 951020DEST_PATH_IMAGE019
Stored as an image file to obtain the final decrypted image.
9. The image local encryption algorithm based on bit plane template exclusive or according to claim 8, characterized in that:
the above-mentioned
Figure 25155DEST_PATH_IMAGE026
And
Figure 52017DEST_PATH_IMAGE027
respectively representing pre-encryption image pixels
Figure 502590DEST_PATH_IMAGE003
And encrypted image pixels
Figure 931297DEST_PATH_IMAGE028
From high to lowkThe number of the bits is one,k=1,2,3,…,Nif, ifN<8, then
Figure 176334DEST_PATH_IMAGE029
t=N+1,N+2, …,8。
CN202210929803.XA 2022-08-04 2022-08-04 Image local encryption algorithm based on bit plane template XOR Pending CN115001666A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210929803.XA CN115001666A (en) 2022-08-04 2022-08-04 Image local encryption algorithm based on bit plane template XOR

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210929803.XA CN115001666A (en) 2022-08-04 2022-08-04 Image local encryption algorithm based on bit plane template XOR

Publications (1)

Publication Number Publication Date
CN115001666A true CN115001666A (en) 2022-09-02

Family

ID=83023215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210929803.XA Pending CN115001666A (en) 2022-08-04 2022-08-04 Image local encryption algorithm based on bit plane template XOR

Country Status (1)

Country Link
CN (1) CN115001666A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116776301A (en) * 2023-08-18 2023-09-19 北京点聚信息技术有限公司 Quick traceability management method for electronic seal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108133445A (en) * 2016-12-01 2018-06-08 钦州市晶通科技有限公司 A kind of image encryption method for spreading mapping scramble and being combined with chaos system
CN108898539A (en) * 2018-05-14 2018-11-27 湘潭大学 A kind of color image encrypting method of compatible JPEG compression standard
CN112040086A (en) * 2019-06-03 2020-12-04 湖北微模式科技发展有限公司 Image encryption and decryption method and device, equipment and readable storage medium
WO2021227349A1 (en) * 2020-05-11 2021-11-18 华南理工大学 Front-end facial image encryption and recognition method for biometric privacy protection
CN114679250A (en) * 2021-12-17 2022-06-28 中国人民解放军海军工程大学 Image encryption algorithm based on mixed chaos and Arnold transformation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108133445A (en) * 2016-12-01 2018-06-08 钦州市晶通科技有限公司 A kind of image encryption method for spreading mapping scramble and being combined with chaos system
CN108898539A (en) * 2018-05-14 2018-11-27 湘潭大学 A kind of color image encrypting method of compatible JPEG compression standard
CN112040086A (en) * 2019-06-03 2020-12-04 湖北微模式科技发展有限公司 Image encryption and decryption method and device, equipment and readable storage medium
WO2021227349A1 (en) * 2020-05-11 2021-11-18 华南理工大学 Front-end facial image encryption and recognition method for biometric privacy protection
CN114679250A (en) * 2021-12-17 2022-06-28 中国人民解放军海军工程大学 Image encryption algorithm based on mixed chaos and Arnold transformation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116776301A (en) * 2023-08-18 2023-09-19 北京点聚信息技术有限公司 Quick traceability management method for electronic seal
CN116776301B (en) * 2023-08-18 2023-10-20 北京点聚信息技术有限公司 Quick traceability management method for electronic seal

Similar Documents

Publication Publication Date Title
CN112040086B (en) Image encryption and decryption methods and devices, equipment and readable storage medium
US20090290711A1 (en) Method, Apparatus and System for Secure Distribution of Content
Arora et al. Digital image security based on the hybrid model of image hiding and encryption
Abdel-Nabi et al. Medical imaging security using partial encryption and histogram shifting watermarking
CN112035847B (en) Image encryption and decryption methods and devices, electronic equipment and storage medium
CN115001666A (en) Image local encryption algorithm based on bit plane template XOR
Baby et al. Combined Strength of Steganography and Cryptography-A Literature Survey.
Hashim et al. Medical image encryption based on hybrid AES with chaotic map
El Abbadi et al. Image encryption based on singular value decomposition
Sahila et al. Secure digital image watermarking by using SVD and AES
CN115330580B (en) Image content encryption algorithm based on data addition
Rao et al. A novel information security scheme using cryptic steganography
Audhi et al. Secure mechanism for communication using image steganography
Schick et al. Document tracking-on the way to a new security service
Meghana et al. A new method for secret image transmission via mosaic fragments using ecc key
Nooh Combining encryption and preservation in information security to secure sending a message
Deepak et al. High payload capacity using steganography combined with cryptography
Yadav et al. A hybrid approach to metamorphic cryptography using KIMLA and DNA concept
Bhatia et al. Digital image security using hybrid visual cryptography
TWI437506B (en) A multiple regions visual cryptography method
Jawad Combining A Cryptography and Steganography Techniques–Based Securing Transmitted Video Through Unsecure Channel
Kamal et al. A Novel Remedy for Image Encryption and Data Hiding
Lukose et al. Combining Cryptography and Steganography for Data Hiding in Videos
Thomas et al. Encryption then steganography framework on high capacity data hiding in grayscale images
Monika A Research Paper on Image Encryption & Decryption Techniques

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220902

RJ01 Rejection of invention patent application after publication