CN110544199A - Image processing method and device, storage medium and electronic equipment - Google Patents

Image processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110544199A
CN110544199A CN201910841323.6A CN201910841323A CN110544199A CN 110544199 A CN110544199 A CN 110544199A CN 201910841323 A CN201910841323 A CN 201910841323A CN 110544199 A CN110544199 A CN 110544199A
Authority
CN
China
Prior art keywords
data
image
encrypted
electronic device
text
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
CN201910841323.6A
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 Cloud In Faith Network Technology Co Ltd
Original Assignee
Beijing Cloud In Faith Network 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 Cloud In Faith Network Technology Co Ltd filed Critical Beijing Cloud In Faith Network Technology Co Ltd
Priority to CN201910841323.6A priority Critical patent/CN110544199A/en
Publication of CN110544199A publication Critical patent/CN110544199A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

An embodiment of the application provides an image processing method, an image processing device, a storage medium and an electronic device, wherein the image processing method comprises the following steps: acquiring original image data, wherein the original image data comprises image description data and image text data; encrypting the image text data to obtain encrypted data; and obtaining encrypted image data of the original image data according to the encrypted data and the image description data. According to the embodiment of the application, the image text data in the original image is encrypted to obtain the encrypted data, and the encrypted image data is obtained according to the encrypted data and the image description data, so that the image description data is not encrypted in the embodiment of the application, the image description data can represent the encrypted file format as an image, and the file format of the encrypted image data can be identified according to the image description information.

Description

image processing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method, an image processing apparatus, a storage medium, and an electronic device.
Background
with the rapid development of internet technology, people can conveniently communicate with various information including images, voice, video, text and other information through a network, and the problem of how to ensure the security and confidentiality of the information is more and more important. In network and multimedia communications, image file encryption is often involved. In an encryption algorithm for an image, one typically encrypts the image using a symmetric encryption algorithm. For example, the symmetric Encryption algorithm may be an AES (Advanced Encryption Standard) algorithm, a DES (Data Encryption Standard) algorithm, or the like.
In the process of implementing the present invention, the inventor finds that the image encryption algorithm in the prior art destroys the format of the image, so that the encrypted image cannot be recognized by any image viewing software, i.e. the encryption of the image in the prior art is ensured by sacrificing the image format.
Disclosure of Invention
An embodiment of the present application provides an image processing method, an image processing apparatus, a storage medium, and an electronic device, so as to solve a problem that a file format of an encrypted image cannot be identified in the prior art.
In a first aspect, an embodiment of the present application provides an image processing method, including: acquiring original image data, wherein the original image data comprises image description data and image text data; encrypting the image text data to obtain encrypted data; and obtaining encrypted image data of the original image data according to the encrypted data and the image description data.
Therefore, in the embodiment of the present application, the image text data in the original image is encrypted to obtain the encrypted data, and the encrypted image data is obtained according to the encrypted data and the image description data, so that the image description data is not encrypted in the embodiment of the present application, and the image description data can indicate that the encrypted file format is an image, and further, the file format of the encrypted image data can be identified according to the image description information.
That is to say, in the embodiment of the present application, the image text data is encrypted, and the image description data is not encrypted, so that the characteristics of the image can be identified based on the image description data, and the format of the encrypted file can be identified as the image according to the image description data in the encrypted image.
in one possible embodiment, encrypting the image text data to obtain encrypted data includes: scrambling the image text data to obtain scrambled data; and encrypting the scrambled data to obtain encrypted data.
Therefore, the embodiment of the application ensures the security and confidentiality of the image text data by scrambling the image text data first and then encrypting the scrambled data for the second time.
In one possible embodiment, encrypting the scrambled data to obtain encrypted data comprises: and encrypting the scrambled data by using a key stored in the dynamic library or a key issued from the cloud server to obtain encrypted data.
Therefore, the security and confidentiality of the image text data are enhanced by the aid of decompiling of the dynamic library or the high security of the cloud server.
In a second aspect, an embodiment of the present application provides an image processing method, including: acquiring encrypted image data, wherein the encrypted image data is obtained by encrypting original image data through an encryption process, the encrypted image data comprises encrypted data and image description data, and the encrypted data is obtained by encrypting image text data in the original image data; decrypting the encrypted data to obtain image text data; and obtaining original image data according to the image text data and the image description data.
In one possible embodiment, decrypting the encrypted data to obtain the image text data includes: decrypting the encrypted data to obtain scrambled data; and performing reverse scrambling on the scrambled data to obtain image text data.
In one possible embodiment, decrypting the encrypted data to obtain scrambled data includes: and decrypting the encrypted data by using a key stored in the dynamic library or a key issued from the cloud server to obtain scrambled data.
in a third aspect, an embodiment of the present application provides an image processing apparatus, including: the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring original image data, and the original image data comprises image description data and image text data; the encryption module is used for encrypting the image text data to obtain encrypted data; and the first processing module is used for obtaining the encrypted image data of the original image data according to the encrypted data and the image description data.
In one possible embodiment, the encryption module comprises: the scrambling module is used for scrambling the image text data to obtain scrambled data; and the encryption submodule is used for encrypting the scrambled data to obtain encrypted data.
in a possible embodiment, the encryption sub-module is further configured to encrypt the scrambled data with a key stored in the dynamic library or a key issued from the cloud server to obtain encrypted data.
In a fourth aspect, an embodiment of the present application provides an image processing apparatus, including: the second acquisition module is used for acquiring encrypted image data, wherein the encrypted image data is obtained by encrypting original image data, the encrypted image data comprises encrypted data and image description data, and the encrypted data is obtained by encrypting image text data in the original image data; the decryption module is used for decrypting the encrypted data to obtain image text data; and the second processing module is used for obtaining original image data according to the image text data and the image description data.
In one possible embodiment, the decryption module comprises: the decryption submodule is used for decrypting the encrypted data to obtain scrambled data; and the anti-scrambling module is used for carrying out anti-scrambling on the scrambled data to obtain the image text data.
In a possible embodiment, the decryption sub-module is further configured to decrypt the encrypted data by using a key stored in the dynamic library or a key issued from the cloud server, so as to obtain the scrambled data.
In a fifth aspect, the present application provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the method according to the first aspect or any optional implementation manner of the first aspect.
In a sixth aspect, the present application provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the method according to the second aspect or any optional implementation manner of the second aspect.
In a seventh aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the electronic device executes the method according to the first aspect or any optional implementation manner of the first aspect.
In an eighth aspect, the present application provides an electronic device, including a processor and a memory, where the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the electronic device executes the method according to the second aspect or any optional implementation manner of the second aspect.
in a ninth aspect, embodiments of the present application provide a computer program product, which when run on a computer, causes the computer to execute the method of the first aspect or any possible implementation manner of the first aspect.
in a tenth aspect, embodiments of the present application provide a computer program product, which when run on a computer, causes the computer to execute the method of the second aspect or any possible implementation manner of the second aspect.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
in order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic diagram showing image data of a conventional type;
FIG. 2 illustrates a schematic diagram of exemplary hardware and software components of an electronic device in which the concepts of the present application may be implemented, according to an embodiment of the present application;
FIG. 3 is a flow chart of an image processing method provided by an embodiment of the present application;
FIG. 4 is a flow chart of another image processing method provided by the embodiment of the application;
FIG. 5 is a flow chart of another image processing method provided by the embodiment of the application;
Fig. 6 is a block diagram illustrating a configuration of an image processing apparatus according to an embodiment of the present application;
Fig. 7 is a block diagram illustrating a structure of another image processing apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
In order to solve the problem that the file format of an encrypted image cannot be identified in the prior art, embodiments of the present application skillfully provide an image processing method, an image processing apparatus, a storage medium, and an electronic device, wherein image text data in an original image is encrypted to obtain encrypted data, and encrypted image data is obtained according to the encrypted data and image description data.
That is to say, in the embodiment of the present application, the image text data is encrypted, and the image description data is not encrypted, so that the characteristics of the image can be identified based on the image description data, and the format of the encrypted file can be identified as the image according to the image description data in the encrypted image.
To facilitate understanding of the embodiments of the present application, some terms in the embodiments of the present application are first explained herein as follows:
The verb "scramble" may be to scramble the information of an image to convert it into an image that is indiscernible. For example, a pixel is moved to a position of b pixel, b pixel is moved to a position of c pixel, and the like.
The term "step size" may denote how many data are separated in the scrambling process to extract one data.
To facilitate understanding of the step sizes in the embodiments of the present application, the following description will be made by taking josephson scrambling as an example. It should be understood that the scrambling in the embodiments of the present application may be other than josephson scrambling, and the embodiments of the present application are not limited thereto.
For example, in the case of josephson scrambling, if there are 6 data, the 6 data are numbered 1 to 6 in sequence, and the calculation is started from the data numbered 1 in the order of numbering, and the 5 th data is extracted in sequence (i.e. the step size is 5), then the sequence of the finally extracted data is: 5,4,6,2,3,1.
The term "image description data" may denote identification data of the entire image in the image data, in other words, the image description data may be regarded as an image identification in which description information of the image is stored, that is, relevant information such as a file header, an image size, a format, and shooting time may be determined from the image description data.
The term "image text data" may denote data relating to an image that is seen by the human eye when the picture is viewed. In other words, the image text data is an image that is seen by human eyes when the image is viewed.
In the case where the image description data and the image text data in the image data are described above, the following description will be given by taking fig. 1 as an example in order to make the image data more clear.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating image data of a conventional type. The image data shown in fig. 1 includes: image description data and image text data. The image description data comprises a file header, the image text data comprises a text start identifier, text description data and image compression data, and the image data further comprises a file tail.
Wherein the header may be used to indicate the start of the image data; the text start identifier may be used to identify the start of the image text data; the text description data may identify text data of an image in the image text data, for example, the text description data may include a scan start length, a number of color components, and the like; the file trailer may be used to indicate the end of the image data.
In order to facilitate understanding of the image data, a JPEG (Joint Photographic Experts Group) image will be described below as an example.
The JPEG image data includes image description data and image body data. The image description data comprises a file header, and the file header in the JPEG image data is an identification bit DD F8; the image text data comprises text start identification, text description data and image compression data, the text start identification in the JPEG image data is an identification bit FF DA, the text description data in the JPEG image data is an identification segment length (such as 000C) of two bytes behind the identification bit FF DA and a byte with a length corresponding to the identification segment length, and the identification segment length is used for identifying that the image compression data is only after the segment length; the image data also comprises a file tail, and the file tail in the JPEG image data is an identification bit FF D9.
referring to fig. 2, fig. 2 is a schematic diagram illustrating exemplary hardware and software components of an electronic device 200 that may implement the concepts of the present application according to an embodiment of the present application. The electronic device 200 may be a terminal device, a computer, or a server. That is, the specific type of the electronic device 200 may be set according to actual requirements, and the embodiment of the present application is not limited thereto.
Electronic device 200 may include a processor 210, a communication interface 220, a memory 230, and at least one communication bus 240. Wherein the communication bus 240 is used for realizing direct connection communication of these components.
in the embodiment of the present application, the communication interface 220 of the device is used for performing signaling or data communication with other node devices. The processor 210 may be an integrated circuit chip having signal processing capabilities. The Processor 210 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor 210 may be any conventional processor or the like.
The Memory 230 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 230 stores computer readable instructions, and when the computer readable instructions are executed by the processor 210, the electronic device executes the method processes shown in the first electronic device side or the second electronic device side in fig. 3, fig. 4, or fig. 5.
It is understood that the structure shown in fig. 2 is merely illustrative, and the electronic device 200 may further include more or fewer components than those shown in fig. 2, for example, the electronic device 200 may further include a camera for capturing images, or have a different configuration than that shown in fig. 2. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof.
Fig. 3 shows a flowchart of an image processing method provided in an embodiment of the present application, where the method shown in fig. 3 includes:
In step S310, the first electronic device obtains original image data, where the original image data includes image description data and image text data.
It should be understood that the original Image may be a JPEG Image, a TIFF (Tag Image File Format) Image, or a GIF (Graphics Interchange Format) Image. That is, the image format of the original image may be set according to actual requirements, and the embodiment of the present application is not limited thereto.
It should also be understood that the original image data may be data of an image captured by the first electronic device itself, or may also be data of an image sent to the first electronic device by another device (e.g., the second electronic device), and the embodiment of the present application is not limited thereto.
Specifically, in order to ensure the security and confidentiality of the image, after the first electronic device acquires the original image data, the first electronic device may encrypt the original image data, and the subsequent first electronic device may store the encrypted image data of the original image data in the memory of the first electronic device.
After the first electronic device acquires the original image data, the first electronic device may extract the image text data according to the text start identifier and the file end in the original image data. Subsequently, the embodiment of the application can encrypt the extracted image text data.
It should be noted that the image text data here is data between the text start flag and the file end, that is, the image text data does not include two flag bits, namely, the text start flag and the file end.
It should also be understood that, although the embodiment of the present application shows a scheme of extracting text data of an image from image data, a person skilled in the art may also select other parts in the image data to set according to actual needs, and the embodiment of the present application is not limited to this.
for example, step S310 may also extract the image compression data in the image text data for the first electronic device according to the text start identifier, the text description data, and the file end. Subsequently, the embodiment of the application can encrypt the image compressed data, and obtain the encrypted image data according to the image description data, the text start identifier, the text description data and the file tail. That is, the first electronic device may replace the image compression data in the original image with the encrypted image compression data.
In addition, the related processing procedure of the image compressed data may be similar to the related processing procedure of the image text data, and is not described in detail herein, and specific reference may be made to the related processing procedure of the image text data.
in step S320, the first electronic device encrypts the text data of the image to obtain encrypted data.
it should be understood that the preset encryption algorithm used for encryption may be set according to actual requirements, and the embodiment of the present application is not limited thereto. For example, the preset encryption algorithm may be an AES algorithm, or may be a symmetric encryption algorithm such as a DES algorithm.
Specifically, after the first electronic device extracts the image text data, the first electronic device may encrypt the image text data by using a preset encryption algorithm, so as to obtain encrypted data.
It should also be understood that, although the above description is made by taking the example that the first electronic device can directly encrypt the image text data, it should be understood by those skilled in the art that other image encryption manners may be further combined with the above encryption manner in order to further enhance the security and confidentiality of the image processing, and the embodiments of the present application are not limited thereto.
optionally, encrypting the image text data to obtain encrypted data includes: encrypting the image text data by using a first preset encryption algorithm to obtain encrypted subdata; and encrypting the encrypted subdata again by using a second preset encryption algorithm to obtain encrypted data. Wherein. The first preset encryption algorithm and the second preset encryption algorithm may be the same or different, and the embodiment of the application is not limited thereto.
that is, the first electronic device may encrypt the image text data twice, thereby further enhancing the security and confidentiality of the image by the twice encryption.
It should be understood that, in order to guarantee the security of image processing, the first electronic device may store the key to a location with relatively high security, and the embodiments of the present application are not limited thereto.
For example, in the case that the first electronic device is an android phone, the keys corresponding to the two preset encryption algorithms may be stored in the dynamic library, and both the subsequent two encryption processes may be implemented in the dynamic library, so that the advantage of decompilation of the dynamic library is utilized to further enhance the security of image encryption.
for another example, the first electronic device may further store the key to the cloud server, so that when the image text data is subsequently encrypted twice, the first electronic device may further encrypt the image text data twice by using the two keys issued by the cloud server.
for another example, when the first electronic device is an android phone, the first electronic device may further store the key corresponding to the first preset encryption algorithm in the cloud server, and store the key corresponding to the second preset encryption algorithm in the dynamic library, and the subsequent first electronic device may perform the first encryption in the dynamic library by using the key corresponding to the first preset encryption algorithm issued by the cloud server, and perform the second encryption by using the key corresponding to the second preset encryption algorithm stored in the dynamic library.
For another example, when the first electronic device is an android phone, the first electronic device may further store the key corresponding to the first preset encryption algorithm in the dynamic library, and store the key corresponding to the second preset encryption algorithm in the cloud server, and the subsequent first electronic device may perform the first encryption in the dynamic library by using the key corresponding to the first preset encryption algorithm stored in the dynamic library, and perform the second encryption by using the key corresponding to the second preset encryption algorithm issued by the cloud server.
optionally, encrypting the image text data to obtain encrypted data further includes: scrambling the image text data to obtain scrambled data; the scrambled data is encrypted to obtain encrypted data, so that after the image text data is scrambled, the scrambled data is encrypted again for the second time, and the security and confidentiality of the image can be further enhanced.
It should be understood that, in the process of scrambling the image text data, if the current byte in the image text data is the data to be extracted, and the current byte and the adjacent bytes may together form an identification bit, here, the identification bit including the current byte may be extracted as a whole data, and the embodiment of the present application is not limited thereto.
For example, in the case where the image body data is image body data of a JPEG image, in the case of the current byte (00), and the byte adjacent to the current byte is OC, the first electronic device determines that the current byte and the adjacent byte constitute body description data, so that the first electronic device can extract the body description data together as one data.
It should be understood that, in order to ensure the security of the key, the first electronic device may store the key to a location with relatively high security, and the embodiment of the present application is not limited thereto.
For example, in a case that the first electronic device is an android phone, the key may be saved in the dynamic library, and a subsequent encryption process for the scrambled data may also be implemented in the dynamic library.
For another example, the key may be stored in the cloud server, so that when the random data is encrypted for the second time, the first electronic device may further encrypt the random data by using the key issued by the cloud server.
In addition, in the process of obtaining the scrambled data, the step size used in the scrambling process may be set according to an actual requirement, and the embodiment of the present application is not limited to this.
Alternatively, the step size used in the scrambling process may be a fixed step size, so that the first electronic device may perform scrambling by the fixed step size. The fixed step length may be set according to actual requirements, and the embodiment of the present application is not limited to this.
it should be noted that the fixed step size here may mean that the step size used in the scrambling process is the same for the same image text data. However, for different image text data, the step size used in the scrambling process may be the same or different, that is, the step size used for the different image text data may be different or the same, and the embodiment of the present application is not limited thereto.
optionally, in the scrambling process, the step size used in each adjacent two data extraction processes may also be different, which is not limited in this embodiment of the present application.
For example, in the case of 4 data, where the number of 4 data is 1 to 4, the calculation is started from the data of number 1, and the step size for extracting the first data is 6, and the step size for extracting the second data may be 3, and the step size for extracting the third data may be 2, then the order of the finally extracted data is: 2,1,4,3.
It should be understood that, in the embodiment of the present application, the step size used in each two adjacent data extraction processes may also be the same or different, so that to facilitate subsequent decryption, a record file may be preset in the first electronic device, so that, since the step size used in each data extraction process is recordable through the record file, or the step size used in the scrambling process is known, the subsequent first electronic device may implement anti-scrambling on encrypted data.
The recording file can record the step length used by the first electronic device for extracting data each time in the process of scrambling different image text data.
In step S330, the first electronic device obtains encrypted image data of the original image data according to the encrypted data and the image description data.
Specifically, after the first electronic device acquires the encrypted data, the first electronic device may replace the image text data in the original image data with the encrypted data. In other words, the first electronic device may add the encrypted data to the original image from which the image text data is extracted, and the position of the encrypted data is the position of the image text data in the original image, so that the subsequent first electronic device can still recognize that the encrypted file is in the format of an image.
For example, when the first electronic device does not decrypt the encrypted image data, and if the first electronic device opens the encrypted image format, the first electronic device opens the decrypted image and then displays a piece of scrambled code in the image format, which is not limited to this embodiment of the present application.
It should be understood that, the implementation manner in which the first electronic device may replace the image text data in the original image data with the encrypted data may be set according to actual needs, and the embodiment of the present application is not limited thereto.
For example, in the case where the first electronic device extracts the text data of the image in the original image, the first electronic device may determine the position of the extracted text data of the image in the original image according to the text start identifier and the file end in the original image. And after the position is determined, the first electronic equipment places the encrypted data at the position of the image text data in the original image from which the image text data is extracted, so that the first electronic equipment can replace the image text data in the original image data with the encrypted data.
For another example, the first electronic device may copy the original image to obtain first copy data of the original image, so that after the first electronic device acquires the encrypted data, the first electronic device may determine the position of the image text data in the first copy data according to the text start identifier and the file end in the first copy data. And after the position of the image text data in the first copied data is determined, the first electronic device replaces the image text data in the first copied data with the encrypted data (or the first electronic device overwrites the image text data in the first copied data with the encrypted data), so that the first electronic device can realize the replacement of the image text data in the original image data with the encrypted data. The encryption mode can avoid the situation that the original image of the extracted image text data is lost due to network blockage, software crash and the like in the first electronic equipment to cause encryption failure, and the original image data content cannot be influenced by the encryption mode.
Therefore, in the embodiment of the present application, the image text data in the original image is encrypted to obtain the encrypted data, and the encrypted image data is obtained according to the encrypted data and the image description data, so that the image description data is not encrypted in the embodiment of the present application, and the image description data can indicate that the encrypted file format is an image, and further, the file format of the encrypted image data can be identified according to the image description information.
That is to say, in the embodiment of the present application, the image text data is encrypted, and the image description data is not encrypted, so that the characteristics of the image can be identified based on the image description data, and the format of the encrypted file can be identified as the image according to the image description data in the encrypted image.
Referring to fig. 4, fig. 4 is a flowchart illustrating another image processing method according to an embodiment of the present application, where the method illustrated in fig. 4 includes:
Step S410, the first electronic device obtains encrypted image data, where the encrypted image data is obtained by encrypting original image data, the encrypted image data includes encrypted data and image description data, and the encrypted data is obtained by encrypting image text data in the original image data.
Specifically, since the image stored in the memory of the first electronic device is an encrypted image, when the user wants to view the original image data corresponding to the encrypted image data, the first electronic device needs to decrypt the encrypted image data before viewing the encrypted image data.
After the first electronic device obtains the encrypted image data, the first electronic device may extract the encrypted data according to a text start identifier and a file end in the encrypted image data.
It should also be understood that, although the embodiment of the present application shows a scheme of extracting encrypted data from encrypted image data, a person skilled in the art may also set a part of data in the encrypted data according to actual needs, and the embodiment of the present application is not limited thereto.
For example, step S410 may also extract the encrypted image compression data in the encrypted image data for the first electronic device according to the body start identifier, the body description data, and the file end. Subsequently, the embodiment of the application can decrypt the encrypted image compressed data, and obtain the original image data according to the image description data, the text start identifier, the text description data and the file tail. That is, the first electronic device may replace the encrypted image compression data in the encrypted image data with the decrypted image compression data.
In addition, the related processing procedure of the encrypted image compression data may be similar to the related processing procedure of the encrypted data, and is not described in detail herein, and specific reference may be made to the related processing procedure of the encrypted data.
Step S420, the first electronic device decrypts the encrypted data to obtain the image text data.
It should be understood that the preset decryption algorithm used for decryption corresponds to the preset encryption algorithm used for encryption. And because the preset encryption algorithm used for encryption can be set according to actual requirements, the preset decryption algorithm used for decryption can also be set according to actual requirements, and the embodiment of the application is not limited to this.
Specifically, after the first electronic device extracts the encrypted data, the first electronic device may decrypt the encrypted data by using a preset decryption algorithm, so as to obtain the text data of the image.
It should also be appreciated that, because the first electronic device may combine at least two different image encryption manners during the process of encrypting the image text data by the first electronic device, the first electronic device may also need to decrypt the encrypted data at least twice differently to obtain the image text data.
Optionally, decrypting the encrypted data to obtain the image text data includes: decrypting the encrypted data by using a first preset decryption algorithm to obtain encrypted subdata; and decrypting the encrypted subdata by using a second preset decryption algorithm to obtain image text data. Wherein. The first preset decryption algorithm and the second preset decryption algorithm may be the same or different, and the embodiment of the application is not limited thereto.
It should be understood that, in order to ensure the security of the key, the first electronic device may store the key to a location with relatively high security, and the embodiment of the present application is not limited thereto.
For example, in the case that the first electronic device is an android phone, the keys corresponding to the two preset decryption algorithms may be stored in the dynamic library, and the subsequent two decryption processes may also be implemented in the dynamic library, so that the security of decryption of the image is further enhanced by using the advantage of decompilation of the dynamic library.
For another example, the first electronic device may further store the key in the cloud server, so that the first electronic device may further decrypt the encrypted data twice by using the key sent by the cloud server when the encrypted data is subsequently decrypted twice.
For another example, when the first electronic device is an android phone, the first electronic device may further store the key corresponding to the first preset decryption algorithm to the cloud server, and store the key corresponding to the second preset decryption algorithm in the dynamic library, and the subsequent first electronic device may perform first decryption in the dynamic library by using the key corresponding to the first preset decryption algorithm sent by the cloud server, and perform second decryption by using the key corresponding to the second preset decryption algorithm stored in the dynamic library.
For another example, when the first electronic device is an android phone, the first electronic device may further store the key corresponding to the first preset decryption algorithm in the dynamic library, and store the key corresponding to the second preset decryption algorithm in the cloud server, and the subsequent first electronic device may perform first decryption in the dynamic library by using the key corresponding to the first preset decryption algorithm stored in the dynamic library, and perform first decryption by using the key corresponding to the first preset decryption algorithm sent by the cloud server.
Optionally, decrypting the encrypted data to obtain the image text data further includes: decrypting the encrypted data to obtain scrambled data; and performing reverse scrambling on the scrambled data to obtain image text data.
in addition, the step size used in the scrambling process may be a fixed step size, so that the first electronic device may perform inverse scrambling according to the known fixed step size, thereby restoring the data to the original position.
In addition, the step length used in the scrambling process may also be different in the process of extracting data every two adjacent times, so that the first electronic device may implement reverse scrambling by recording the information recorded in the file, thereby restoring the data to the original position.
In step S430, the first electronic device obtains original image data according to the image text data and the image description data.
Specifically, after the first electronic device acquires the image text data, the first electronic device may replace the encrypted data in the encrypted image data with the image text data. In other words, the first electronic device may add the image body data to the encrypted image data from which the encrypted data is extracted, and the position at which the image body data is located is also the position of the encrypted data in the encrypted image.
it should be understood that, the implementation manner in which the first electronic device may replace the encrypted data in the encrypted image data with the image text data may be set according to actual needs, and the embodiment of the present application is not limited thereto.
For example, in a case where the first electronic device extracts encrypted data in one piece of encrypted image data, the first electronic device may determine the position of the extracted encrypted data in the piece of encrypted image data according to a text start identifier and a file end in the piece of encrypted image data. And after the position is determined, the first electronic device places the image text data to the position of the encrypted data in the encrypted image data from which the encrypted data is extracted, so that the first electronic device can replace the encrypted data in the encrypted image data into the image text data.
For another example, the first electronic device may copy the encrypted image data to obtain second copied data of the encrypted image data. And after the first electronic device acquires the image text data, the first electronic device can determine the position of the encrypted data in the second copied data according to the text start identifier and the file end in the second copied data. And after the position of the encrypted data in the second copied data is determined, the first electronic device replaces the encrypted data in the second copied data with the image text data (or the first electronic device overwrites the encrypted data in the second copied data with the image text data), so that the first electronic device can realize the replacement of the encrypted data in the encrypted image data with the image text data. The decryption mode can avoid the situation that the decryption fails due to data loss of the encrypted image data from which the encrypted data is extracted caused by network congestion, software crash and the like in the first electronic device, and the original picture data content cannot be influenced by the decryption mode.
Therefore, according to the embodiment of the application, through the decryption process corresponding to the encryption process, when the first electronic device starts to decrypt the encrypted file, the first electronic device can determine that the current encrypted file is an image.
In addition, under the condition that the first electronic equipment can know that the encrypted file is the image, the file archiving is convenient to realize, and the file storage is more favorable.
In addition, although fig. 3 and fig. 4 illustrate the process of encrypting the original image data and decrypting the encrypted image data of the original image data by the same first device, it should be understood by those skilled in the art that the process of encrypting the original image data and decrypting the encrypted image data of the original image data may be disposed on different electronic devices, and the embodiment of the present application is not limited thereto.
In order to facilitate understanding of the embodiments of the present application, the following description will be given by way of specific examples.
Referring to fig. 5, fig. 5 is a flowchart illustrating another image processing method according to an embodiment of the present application, where the method illustrated in fig. 5 includes:
in step S510, the first electronic device acquires original image data.
In step S520, the first electronic device encrypts the text data of the image to obtain encrypted data. The first electronic device may encrypt the first electronic device by using a key issued from the cloud server, which is not limited in this embodiment of the present application.
In step S530, the first electronic device obtains encrypted image data of the original image data according to the encrypted data and the image description data.
In step S540, the first electronic device sends the encrypted image data to the second electronic device.
In step S550, the second electronic device acquires the encrypted image data.
And step S560, the second electronic device decrypts the encrypted image data to obtain the image text data. The second electronic device may decrypt the encrypted data by using a key issued from the cloud server, which is not limited in this embodiment of the application.
and step S570, the second electronic equipment obtains original image data according to the image text data and the image description data.
It is to be understood that the above-described image processing method is merely exemplary, and those skilled in the art can make various modifications according to the above-described method.
Referring to fig. 6, fig. 6 shows a block diagram of a structure of an image processing apparatus 600 provided in an embodiment of the present application, it should be understood that the apparatus 600 corresponds to the first electronic device side in the above-mentioned method embodiment of fig. 3 or fig. 5, and is capable of executing various steps related to the first electronic device side in the above-mentioned method embodiment, and specific functions of the apparatus 600 may be referred to the description above, and a detailed description is appropriately omitted here to avoid redundancy. The device 600 includes at least one software functional module that can be stored in a memory in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the device 600. Specifically, the apparatus 600 includes:
A first obtaining module 610, configured to obtain original image data, where the original image data includes image description data and image text data; the encryption module 620 is configured to encrypt the image text data to obtain encrypted data; the first processing module 630 is configured to obtain encrypted image data of the original image data according to the encrypted data and the image description data.
In one possible embodiment, the encryption module 620 includes: a scrambling module (not shown) for scrambling the image text data to obtain scrambled data; and an encryption sub-module (not shown) for encrypting the scrambled data to obtain encrypted data.
In a possible embodiment, the encryption sub-module is further configured to encrypt the scrambled data with a key stored in the dynamic library or a key issued from the cloud server to obtain encrypted data.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
Referring to fig. 7, fig. 7 shows a block diagram of a structure of an image processing apparatus 700 provided in an embodiment of the present application, it should be understood that the apparatus 700 corresponds to the first electronic device side in the embodiment of the method in fig. 4 or the second electronic device side in the embodiment of the method in fig. 5, and specific functions of the apparatus 700 may be referred to the description above, and detailed descriptions are omitted here as appropriate to avoid redundancy. The device 700 includes at least one software functional module that can be stored in a memory in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the device 700. Specifically, the apparatus 700 includes:
A second obtaining module 710, configured to obtain encrypted image data, where the encrypted image data is obtained by encrypting original image data, and the encrypted image data includes encrypted data and image description data, and the encrypted data is obtained by encrypting image text data in the original image data; the decryption module 720 is configured to decrypt the encrypted data to obtain image text data; the second processing module 730 is configured to obtain original image data according to the image text data and the image description data.
In one possible embodiment, the decryption module 720 includes: a decryption submodule (not shown) for decrypting the encrypted data to obtain scrambled data; and an inverse scrambling module (not shown) for performing inverse scrambling on the scrambled data to obtain the image text data.
In a possible embodiment, the decryption sub-module is further configured to decrypt the encrypted data by using a key stored in the dynamic library or a key issued from the cloud server, so as to obtain the scrambled data.
it is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
the embodiment of the present application further provides a storage medium, on which a computer program is stored, and when being executed by a processor, the computer program executes an image processing method on the first electronic device side in fig. 3, fig. 4, or fig. 5, or an image processing method on the second device side in fig. 5.
An embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method for processing an image on a first electronic device side in fig. 3, fig. 4, or fig. 5, or the method for processing an image on a second device side in fig. 5 is executed.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. An image processing method, comprising:
Acquiring original image data, wherein the original image data comprises image description data and image text data;
encrypting the image text data to obtain encrypted data;
And obtaining the encrypted image data of the original image data according to the encrypted data and the image description data.
2. The image processing method according to claim 1, wherein said encrypting the image text data to obtain encrypted data comprises:
Scrambling the image text data to obtain scrambled data;
And encrypting the scrambled data to obtain the encrypted data.
3. The image processing method according to claim 2, wherein the encrypting the scrambled data to obtain the encrypted data comprises:
And encrypting the scrambled data by using a key stored in a dynamic library or a key issued from a cloud server to obtain the encrypted data.
4. an image processing method, comprising:
Acquiring encrypted image data, wherein the encrypted image data is obtained by encrypting original image data through an encryption process, the encrypted image data comprises encrypted data and image description data, and the encrypted data is obtained by encrypting image text data in the original image data;
Decrypting the encrypted data to obtain the image text data;
And obtaining the original image data according to the image text data and the image description data.
5. The image processing method according to claim 4, wherein said decrypting the encrypted data to obtain the image text data comprises:
Decrypting the encrypted data to obtain scrambled data;
And performing reverse scrambling on the scrambled data to obtain the image text data.
6. The image processing method according to claim 5, wherein said decrypting the encrypted data to obtain scrambled data comprises:
And decrypting the encrypted data by using a key stored in a dynamic library or a key issued from a cloud server to obtain the scrambled data.
7. An image processing apparatus characterized by comprising:
The system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring original image data, and the original image data comprises image description data and image text data;
The encryption module is used for encrypting the image text data to obtain encrypted data;
and the first processing module is used for obtaining the encrypted image data of the original image data according to the encrypted data and the image description data.
8. An image processing apparatus characterized by comprising:
The second acquisition module is used for acquiring encrypted image data, wherein the encrypted image data is obtained by encrypting original image data, the encrypted image data comprises encrypted data and image description data, and the encrypted data is obtained by encrypting image text data in the original image data;
the decryption module is used for decrypting the encrypted data to obtain the image text data;
And the second processing module is used for obtaining the original image data according to the image text data and the image description data.
9. A storage medium, having stored thereon a computer program which, when executed by a processor, performs the image processing method according to any one of claims 1 to 6.
10. An electronic device comprising a processor and a memory, the memory storing computer readable instructions that, when executed by the processor, perform the image processing method of any of claims 1 to 6.
CN201910841323.6A 2019-09-05 2019-09-05 Image processing method and device, storage medium and electronic equipment Pending CN110544199A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910841323.6A CN110544199A (en) 2019-09-05 2019-09-05 Image processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910841323.6A CN110544199A (en) 2019-09-05 2019-09-05 Image processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110544199A true CN110544199A (en) 2019-12-06

Family

ID=68712770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910841323.6A Pending CN110544199A (en) 2019-09-05 2019-09-05 Image processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110544199A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022681A (en) * 2022-05-14 2022-09-06 中国广电广州网络股份有限公司 Method for processing broadcast picture of broadcast television

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146168A (en) * 2006-06-30 2008-03-19 株式会社理光 Image processing apparatus and image processing method
CN105975866A (en) * 2016-04-26 2016-09-28 长安大学 Intra-class coefficient scrambling-based JPEG image encryption method
CN106407824A (en) * 2016-09-28 2017-02-15 重庆第二师范学院 Image encryption method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146168A (en) * 2006-06-30 2008-03-19 株式会社理光 Image processing apparatus and image processing method
CN105975866A (en) * 2016-04-26 2016-09-28 长安大学 Intra-class coefficient scrambling-based JPEG image encryption method
CN106407824A (en) * 2016-09-28 2017-02-15 重庆第二师范学院 Image encryption method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022681A (en) * 2022-05-14 2022-09-06 中国广电广州网络股份有限公司 Method for processing broadcast picture of broadcast television

Similar Documents

Publication Publication Date Title
US11178123B2 (en) Video communication data security
EP2832102B1 (en) Methods and systems for cryptographic access control of video
WO2016115912A1 (en) Image encryption method, image viewing method, system, and terminal
JP2006311548A (en) Method for securing integrity of image set
JP2002542523A (en) Method and apparatus for inserting a digital signature into digital data and authenticating the digital signature in the digital data
JP2010158024A (en) Fingerprinting of data object
CN101763397B (en) Device and method for processing expanding information in image file
CN104680078A (en) Method and system for taking photos and checking images and terminal
JP2019161643A (en) Tamper protection and video source identification for video processing pipeline
KR20130114037A (en) Masking and recovering method of privacy region
CN114390316A (en) Processing method and device for image acquisition synchronous encryption privacy protection
KR20110058062A (en) Network photographing apparatus having a partial encryption function
Yari et al. An overview and computer forensic challenges in image steganography
Yi et al. An improved reversible data hiding in encrypted images
CN110544199A (en) Image processing method and device, storage medium and electronic equipment
JP2012114654A (en) Monitoring camera, storage device, and method for detecting tampering of monitoring image
CN111026583A (en) Backup recovery method for multiple private keys of blockchain wallet and computer-readable storage medium
CN114374773A (en) Method for encrypting image acquisition synchronization information and decrypting, restoring and recovering image acquisition synchronization information at using end
CN113206926A (en) Method for balancing privacy and usability of image based on three-pixel-point encryption
JP5621014B2 (en) Video playback device, video processing device, video playback method, video processing method, video playback program, and video processing program
US12010320B2 (en) Encoding of modified video
US20220201312A1 (en) Encoding of modified video
US12002127B2 (en) Robust selective image, video, and audio content authentication
JP2003179746A (en) Method for inserting binary messages in digital image
JP5497974B2 (en) Video processing apparatus, video processing method, and video processing program

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: 20191206