Nothing Special   »   [go: up one dir, main page]

CN115134473B - Image encryption method and device - Google Patents

Image encryption method and device Download PDF

Info

Publication number
CN115134473B
CN115134473B CN202210744234.1A CN202210744234A CN115134473B CN 115134473 B CN115134473 B CN 115134473B CN 202210744234 A CN202210744234 A CN 202210744234A CN 115134473 B CN115134473 B CN 115134473B
Authority
CN
China
Prior art keywords
image
module
images
pixels
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210744234.1A
Other languages
Chinese (zh)
Other versions
CN115134473A (en
Inventor
汪明华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202210744234.1A priority Critical patent/CN115134473B/en
Publication of CN115134473A publication Critical patent/CN115134473A/en
Application granted granted Critical
Publication of CN115134473B publication Critical patent/CN115134473B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32267Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32267Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image
    • H04N1/32272Encryption or ciphering

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses an image encryption method and device, and belongs to the technical field of communication. The method comprises the following steps: displaying M second images under the condition that the content in the first images is identified to comprise private content, wherein M is a positive integer; receiving a first input of a user to a third image of the M second images; in response to the first input, hiding the image information of the first image into the third image based on an image encryption steganography algorithm to obtain a fourth image; wherein each of the second images is an image in which the image information is not hidden.

Description

Image encryption method and device
Technical Field
The application belongs to the technical field of communication, and particularly relates to an image encryption method and device.
Background
Currently, an electronic device may encrypt an image through a secret cabinet in the electronic device to protect information in the image. Specifically, the electronic device may first set corresponding password information for the secret cabinet in the electronic device through input of the user, and then import the image to be encrypted into the secret cabinet, so that the encryption of the image in the secret cabinet may be achieved through the secret cabinet.
However, according to the above method, on one hand, since the encrypted image usually includes an encrypted identifier, other users can learn that the image is encrypted through the encrypted identifier, so that the snooping risk is increased; on the other hand, since all the images in the security cabinet are encrypted by the corresponding password information of the security cabinet, once the password information is revealed, all the images in the security cabinet are unprotected. As such, the electronic device is caused to be less effective in encrypting the image.
Disclosure of Invention
The embodiment of the application aims to provide an image encryption method and device, which can solve the problem that the effect of electronic equipment on image encryption is poor.
In a first aspect, an embodiment of the present application provides an image encryption method, including: displaying M second images under the condition that the content in the first images is identified to comprise private content, wherein M is a positive integer; receiving a first input of a user to a third image of the M second images; in response to the first input, hiding the image information of the first image into the third image based on an image encryption steganography algorithm to obtain a fourth image; wherein each of the second images is an image in which the image information is not hidden.
In a second aspect, an embodiment of the present application provides an image encryption apparatus, where the apparatus includes an identification module, a display module, a receiving module, and a hiding module; the display module is used for displaying M second images when the identification module identifies that the content in the first images comprises private content, and M is a positive integer; the receiving module is used for receiving a first input of a user to a third image in the M second images; the hiding module is used for hiding the image information of the first image into the third image based on the image encryption steganography algorithm to obtain a fourth image in response to the first input received by the receiving module; wherein each of the second images is an image in which the image information is not hidden.
In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, M second images can be displayed under the condition that the content in the first image is identified to comprise private content, wherein M is a positive integer; and receiving a first input of a user to a third image of the M second images; in response to the first input, hiding the image information of the first image into the third image based on an image encryption steganography algorithm to obtain a fourth image; wherein each of the second images is an image in which the image information is not hidden. According to the scheme, the electronic device can hide the image information of the first image into the third image which is selected through the input of the user and is not hidden with the image information so as to encrypt the first image, so that other users can not know that the first image is encrypted, the problem that a plurality of encrypted images correspond to one piece of password information in the traditional technology does not exist, the risk that the first image is decrypted can be reduced, and the effect of the electronic device on image encryption can be improved.
Drawings
Fig. 1 is a flowchart of an image encryption method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of an interface to which an image encryption method according to an embodiment of the present application is applied;
FIG. 3 is a second schematic diagram of an interface for applying the image encryption method according to the embodiment of the present application;
FIG. 4 is a third exemplary diagram of an interface for applying the image encryption method according to the embodiment of the present application;
FIG. 5 is a diagram illustrating an interface of an image encryption method according to an embodiment of the present application;
fig. 6 is a schematic diagram of an image encryption device according to an embodiment of the present application;
FIG. 7 is a schematic diagram of an electronic device according to an embodiment of the present application;
fig. 8 is a schematic hardware diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The image encryption method and device provided by the embodiment of the application are described in detail through specific embodiments and application scenes thereof with reference to the accompanying drawings.
Currently, in the process of using an electronic device by a user, personal information of the user stored in the electronic device is more and more, for example, a user's life is taken a candid photograph, and a certificate image of the user is acquired during authentication registration. As more and more functions are developed and used on electronic devices, electronic devices have been an aggregate of our personal information, and exposure of personal information has also been a common problem. It has become increasingly important how personal information is better protected or hidden because loss, borrowing, and rights abuse of applications of electronic devices may result in exposure of personal information.
Various schemes for encrypting data are provided in the current electronic equipment, and the electronic equipment is taken as an example for encrypting the image, so that the electronic equipment can encrypt the image through a secret cabinet in the electronic equipment to protect information in the image. Specifically, the electronic device may first set corresponding password information for the secret cabinet in the electronic device through input of the user, and then import the image to be encrypted into the secret cabinet, so that the encryption of the image in the secret cabinet may be achieved through the secret cabinet. When the user needs to check the encrypted image, the electronic equipment can open the secret cabinet for the user to check through inputting the password information corresponding to the secret cabinet by the user.
However, according to the above method, although encryption of the image can be achieved, on one hand, since the encrypted image usually includes an encrypted identifier, other users can learn that the image is encrypted through the encrypted identifier, so that the risk of being snooped is increased, and if the families of the users learn that the image is encrypted, a trust crisis is generated; on the other hand, since all the images in the security cabinet are encrypted by the corresponding password information of the security cabinet, once the password information is revealed, all the images in the security cabinet are unprotected. As such, the electronic device is caused to be less effective in encrypting the image.
In order to solve the above-mentioned problem, in the image encryption method provided in the embodiment of the present application, taking an example in which the electronic device encrypts the image 1, the electronic device may display the image 2 and the image 3 (for example, M second images in the embodiment of the present application) in which the image information is not hidden, in a case in which it is recognized that the content in the image 1 (for example, the first image in the embodiment of the present application) includes private content; and the image information of the image 1 can be hidden into the image 2 by clicking the image 2 (such as the third image in the embodiment of the application) by a user (such as the first input in the embodiment of the application), based on an image encryption steganography algorithm (i.e. a technology of hiding secret information in publicly available media information so that people cannot easily perceive the existence of the secret information by visual sense and hearing), so as to obtain the image 4 (such as the fourth image in the embodiment of the application). According to the scheme, the electronic equipment can hide the image information of the image 1 into the image 2 which is selected by the input of the user and is not hidden with the image information so as to encrypt the image 1, so that other users cannot know that the image 1 is encrypted, the problem that a plurality of encrypted images correspond to one piece of password information in the conventional technology does not exist, the risk that the image 1 is decrypted can be reduced, and the effect of the electronic equipment on image encryption can be improved.
The embodiment of the application provides an image encryption method, and fig. 1 shows a flow chart of the image encryption method provided by the embodiment of the application. As shown in fig. 1, the image encryption method provided by the embodiment of the present application may include the following steps 101 to 103. The method is exemplarily described below taking an electronic device as an example of executing the method.
Step 101, the electronic device displays M second images when recognizing that the content in the first image includes private content.
Wherein M is a positive integer.
Alternatively, in the embodiment of the present application, the first image may be an image acquired by the electronic device, or may be any image stored in the electronic device.
Optionally, in an embodiment of the present application, the above private content may include: identity information, chat content, financial information, or the like, refers to any content that is private to the user.
In practical implementation, the electronic device may set any content as the above private content according to the use requirement of the user, and the embodiment of the present application is not limited.
In the embodiment of the present application, each of the M second images is an image with no hidden image information.
Alternatively, in the embodiment of the present application, the second image may be any image that is stored in the electronic device and has no image information hidden.
Alternatively, in the embodiment of the present application, the electronic device may identify an image not hidden with image information as "0" and an image hidden with image information as "1".
It can be understood that, the above identifiers "0" and "1" are identifiers that are set by the electronic device for images in the system, and the identifiers are not displayed.
Optionally, in the embodiment of the present application, after identifying that the content in the first image includes the private content, the electronic device may filter (i.e. not display) the image identified as "1" through the identifier "0" and the identifier "1", so as to display only the M second images identified as "0", so that the image not hidden with the image information may be quickly screened for display, so as to facilitate the encryption operation of the user.
Optionally, in the embodiment of the present application, in the case that the first image is an image acquired by the electronic device, the electronic device may perform content identification on the acquired first image after acquiring the first image; therefore, after recognizing that the content in the first image includes the private content, the M second images (mode one) may be automatically displayed, or a prompt control may be displayed first to prompt the user whether the content in the first image includes the private content, and then the M second images are displayed through the input of the prompt control by the user.
Optionally, in the embodiment of the present application, in the second mode, the prompt control may be a control for displaying any parameter.
Optionally, in an embodiment of the present application, the display parameters may include: shape, color or size, etc.
The image encryption method provided by the embodiment of the application is exemplarily described below by taking the second mode as an example with reference to the accompanying drawings.
Illustratively, as shown in fig. 2 (a), after the electronic device acquires the image 21 (i.e., the first image), the electronic device performs content identification on the image 21, and identifies that the content in the image 21 includes the private content 22, and then, as shown in fig. 2 (b), the electronic device may display a prompt control 23 to prompt the user whether the content in the image 21 includes the private content or not, and whether the image 21 needs to be encrypted; further, the electronic device may display M second images without hidden image information for encrypting the image 21 by a single click input by the user to the sub-control 24 in the prompt control 23.
Optionally, in the embodiment of the present application, if the electronic device does not recognize that the content in the first image includes private content, or the first image is any image stored in the electronic device, the electronic device may display an encryption control through input of a user to the first image, where the encryption control may be used to encrypt the first image, and then display the M second images through input of the user to the encryption control.
For example, taking the first image as an arbitrary image stored in the electronic device, as shown in (a) in fig. 3, an image 31 (i.e., the first image) displayed in the interface 30 by the electronic device is an image stored in the electronic device, and the electronic device receives a long press input of the image 31 by the user, then, as shown in (b) in fig. 3, the electronic device may display a plurality of function controls including a "protection" control 32 (i.e., the encryption control described above) in the interface 30. So that the electronic device can display M second images without hidden image information for encrypting the image 31 by user input to the "protect" control 32.
Optionally, in an embodiment of the present application, the encryption control may be any control that displays parameters.
Step 102, the electronic device receives a first input from a user for a third image of the M second images.
In the embodiment of the application, the first input is used for triggering the electronic equipment to encrypt the first image.
Alternatively, in the embodiment of the present application, the first input may be any possible form of input, such as a hover input, a touch input, or a voice input.
For example, taking the first input as a touch input as an example, the first input may be a single click input, a double click input, a long press input, or the like of the third image by the user.
Step 103, the electronic device responds to the first input and hides the image information of the first image into the third image based on the image encryption steganography algorithm to obtain a fourth image.
Optionally, in an embodiment of the present application, the image information of the first image may be: pixel values for each pixel in the first image.
Optionally, in the embodiment of the present application, after receiving the first input, the electronic device may hide the pixel values of each pixel in the first image into the third image based on an image encryption steganography algorithm, and obtain the fourth image, so as to complete encryption of the first image.
It can be seen that the fourth image obtained includes: image information of the first image, and image information of the third image.
For the description of the encryption steganography algorithm, reference may be made to the specific description in the related art, and in order to avoid repetition, the description is omitted here.
The specific method for hiding the image information of the first image into the third image and obtaining the fourth image by the electronic device is described in detail below.
Alternatively, in the embodiment of the present application, the above step 103 may be specifically implemented by the following step 103 a.
Step 103a, the electronic device responds to the first input, based on an image encryption steganography algorithm, sequentially fills pixel values of pixels in the first image between pixels of the third image according to a preset rule, and obtains a fourth image.
In the embodiment of the present application, the preset rule is related to an arrangement manner of pixels in the first image, and a pixel value of at most one pixel in the first image is included between any two adjacent pixels in the fourth image.
Optionally, in an embodiment of the present application, the preset rule may be: and filling the pixel values of the pixels in the first image to the rules among the corresponding pixels of the third image in sequence according to the arrangement mode of the pixels in the first image.
For example, the preset rule may be: the electronic equipment fills the pixel value of the ith pixel in the first image into the third image according to the arrangement mode of the pixels in the first image, and fills the pixel value of the (i+1) th pixel in the first image into the third image between the (j+k) th pixel and the (j+k+1) th pixel corresponding to the (i+1) th pixel until the pixel value of each pixel in the first image is completely filled, wherein i, j and k are positive integers.
Optionally, in the embodiment of the present application, the arrangement manner of the pixel values of the pixels in the first image in the fourth image is the same as the arrangement manner of the pixels in the first image, but the arrangement density may be the same or different.
Optionally, in the embodiment of the present application, if the arrangement densities are the same, a pixel value of one pixel in the first image is included between any two adjacent pixels in the fourth image; if the arrangement densities are different, two adjacent pixels between the pixels in the fourth image, which do not include the pixel value of one pixel in the first image, are present.
It should be noted that, because a certain spatial error value exists between any two pixels of the image, the pixel value of the pixel of the first image can be filled between any two pixels of the third image so as to hide the image information of the first image; in addition, the change between pixels cannot be perceived under the resolution of human eyes, that is, the display effect of the fourth image is the same as the original display effect of the third image.
In the embodiment of the application, the electronic equipment can sequentially fill the pixel values of the pixels in the first image between the pixels of the third image according to the arrangement mode of the pixels in the first image so as to hide the image information of the first image, so that other users cannot intuitively know that the first image is encrypted, and the effect of image protection can be improved.
Alternatively, in the embodiment of the present application, the above step 103a may be specifically implemented by the following steps 103a1 and 103a 2.
Step 103a1, the electronic device converts the pixel values of each pixel in the first image into a binary value based on the image encryption steganography algorithm in response to the first input.
Alternatively, in the embodiment of the present application, all binary values obtained by conversion may form a binary sequence, and the binary values in the binary sequence are arranged in the same manner as the pixels in the first image.
For a specific method for converting a pixel value into a binary value by an electronic device, reference may be made to the specific description in the related art, and in order to avoid repetition, a description is omitted here.
Step 103a2, the electronic device sequentially fills binary values corresponding to the pixels in the first image to the pixels of the third image according to a preset rule, so as to obtain a fourth image.
For a specific description of step 103a2, reference may be made to the description of step 104a in the above embodiment, and in order to avoid repetition, the description is omitted here.
In the embodiment of the application, the electronic device can sequentially fill the binary values corresponding to the pixels in the first image between the pixels of the third image according to the arrangement mode of the pixels in the first image so as to hide the image information of the first image, namely, the electronic device can fill the pixel values of the pixels in the first image between the pixels of the third image in the binary values, thereby improving the efficiency of hiding the image information of the electronic device.
An image encryption method provided by an embodiment of the present application is exemplarily described below with reference to the accompanying drawings.
Illustratively, as shown in (a) of fig. 4, the electronic device displays an image 41 (i.e., a first image) in the interface 40, and a plurality of functionality controls including a "protect" control 42 (i.e., the encryption control described above), after the electronic device receives a user click input to the "protect" control 42, the electronic device may display an image 44, an image 45, an image 46, and an image 47 (i.e., M second images) within the system, identified as "0", in the interface 44, as shown in (b) of fig. 4. After receiving the long press input (i.e., the first input) of the user to the image 44 (i.e., the third image), the electronic device may convert the pixel values of each pixel in the image 41 into binary values based on the encryption steganography algorithm, and sequentially fill the binary values corresponding to each pixel in the image 41 between the pixels of the image 44 according to the preset rule, and after the filling is finished, as shown in (c) in fig. 4, the electronic device may obtain a filled image 48 (i.e., a fourth image). This completes the concealment of the image information of the image 41.
In the image encryption method provided by the embodiment of the application, the electronic equipment can hide the image information of the first image into the third image which is selected by the input of the user and is not hidden with the image information so as to encrypt the first image, so that other users cannot know that the first image is encrypted, the problem that a plurality of encrypted images correspond to one piece of password information in the traditional technology does not exist, the risk that the first image is decrypted can be reduced, and the effect of the electronic equipment on encrypting the image can be improved.
Optionally, in the embodiment of the present application, the M second images may be images in the first image folder, and after the step 103, the image encryption method provided in the embodiment of the present application may further include the following step 104.
Step 104, the electronic device stores the fourth image in the first image folder, and deletes the first image.
In the embodiment of the application, the images in the first image folder are arranged according to the file size of the images.
Alternatively, in the embodiment of the present application, the images in the first image folder may be arranged in order of the files of the images from large to small, or may be arranged in order of the files of the images from small to large.
Optionally, in the embodiment of the present application, the first image folder may be an image folder in the electronic device that is only used for encrypting the image, that is, the image stored in the first image folder includes: an image with hidden image information, and an image for hiding image information (e.g., the above-described M second images).
Optionally, in the embodiment of the present application, the difference between the file sizes of each two images used for hiding the image information is smaller than or equal to a preset threshold, so that after one image used for hiding the image information hides the image information of the other image, the file size of the obtained target image (for example, the fourth image in the embodiment of the present application) may be increased, and thus the ordering of the target image in the first image folder may be forward or backward. Thus, when the user needs the electronic device to decrypt the target image, the target image can be quickly found in the first image folder.
Optionally, in the embodiment of the present application, when the electronic device displays the M second images, a file size corresponding to each second image may be displayed, so that a user may quickly learn a second image with image information hidden in the M second images and a second image used for hiding image information.
It should be noted that in an actual implementation, the electronic device may store the fourth image in any storage space in the electronic device, which may be specifically determined according to a user's use requirement, and the embodiment of the present application is not limited.
Optionally, in the embodiment of the present application, after the fourth image is stored in the electronic device, the fourth image may be identified as "1", so that when the electronic device encrypts the other images, the fourth image may not be displayed, so that the user may conveniently select an image that is not hidden with image information.
Optionally, in the embodiment of the present application, after deleting the first image, the electronic device may retain the third image, or may delete the third image.
Optionally, in the embodiment of the present application, the electronic device may determine to keep or delete the third image according to the importance level of the third image.
For example, if the third image is an image that the user triggers the electronic device to collect and store, the importance degree of the third image may be considered to be higher, so that the electronic device may keep the third image after deleting the first image; if the third image is an image that the electronic device automatically downloads (or randomly generates) when encrypting the image, the third image may be considered to have a low importance level, so that the electronic device may delete the third image after deleting the first image.
In the embodiment of the application, the electronic device can store the fourth image in the first image folder which is used for arranging the images according to the file size of the images and delete the first image, so that other users can not find the first image, and the user can quickly find the first image from the first image folder when needing to decrypt the first image, thereby further improving the effect of encrypting the images by the electronic device on one hand and simplifying the process of decrypting the images on the other hand.
Optionally, in the embodiment of the present application, after the step 104, the image encryption method provided in the embodiment of the present application may further include steps 105 to 107 described below.
Step 105, the electronic device receives a second input from the user of the fourth image.
In the embodiment of the application, the second input is used for triggering the electronic equipment to decrypt the first image.
Alternatively, in the embodiment of the present application, the second input may be any possible form of input such as a touch input, a hover input, or a voice input.
Step 106, the electronic device extracts the image information of the first image from the fourth image based on the image extraction algorithm in response to the second input.
Optionally, in the embodiment of the present application, the electronic device may extract all the pixel values filled between the pixels of the fourth image according to the arrangement manner of the filled pixel values in the fourth image, that is, the arrangement manner of all the extracted pixel values is the same as the arrangement manner of the pixels in the first image.
Optionally, in the embodiment of the present application, after extracting the image information of the first image from the fourth image, the electronic device includes only the image information of the third image in the fourth image, that is, the third image may be obtained again.
Optionally, in the embodiment of the present application, after obtaining the third image, the electronic device may identify the third image as "0", so that the electronic device may redisplay the third image when encrypting the image again.
Optionally, in the embodiment of the present application, after decrypting the first image, the electronic device may copy and retain the fourth image, which may specifically be determined according to a user's use requirement, and the embodiment of the present application is not limited.
For the description of the image extraction algorithm, reference may be made to the specific description in the related art, and in order to avoid repetition, the description is omitted here.
Optionally, in the embodiment of the present application, after receiving the second input of the user to the fourth image, the electronic device may display a decryption control for decrypting the image, and then extract, through the input of the user to the decryption control, the image information of the first image from the fourth image based on the image extraction algorithm.
Optionally, in an embodiment of the present application, the decryption control may be any control that displays parameters.
An image encryption method provided by an embodiment of the present application is exemplarily described below with reference to the accompanying drawings.
Illustratively, assuming that the fourth image is an image 51 displayed by the electronic device in the interface 50, as shown in fig. 5 (a), the electronic device, after receiving a long press input (i.e., a second input) to the image 51 by the user, may display a plurality of functionality controls including an "extract" control 52 (i.e., the decryption control described above) in the interface 50, as shown in fig. 5 (b). So that the electronic device can extract image information of the hidden image from the image 51 based on the image extraction algorithm by a single click input of the "extract" control 52 by the user. In this way, decryption of the image can be completed.
Optionally, in the embodiment of the present application, after receiving the second input of the user to the fourth image, the electronic device may first display a password input control for inputting password information, and extract, based on an image extraction algorithm, image information of the first image from the fourth image, if the password information input by the user matches with preset password information.
Optionally, in an embodiment of the present application, the password input control may be any control that displays parameters.
Optionally, in the embodiment of the present application, the preset password information may be digital password information, voice password information, or biological password information set by a user.
In the embodiment of the application, the electronic equipment can extract the image information of the first image from the fourth image under the condition that the password information input by the user on the password input control is matched with the preset password information, so that the safety of decrypting the image by the electronic equipment can be improved.
Step 107, the electronic device generates the first image based on the image information of the first image.
Optionally, in the embodiment of the present application, the electronic device may generate a pixel value sequence according to the pixel values of each pixel of the extracted first image and the arrangement manner of each pixel value, and may generate the first image according to the pixel value sequence, so as to complete decryption of the first image.
In the embodiment of the application, the electronic equipment can extract the image information of the first image from the fourth image through the input of the user and generate the first image based on the extracted image information of the first image, so that the accuracy of decrypting the image by the electronic equipment can be improved.
According to the image encryption method provided by the embodiment of the application, the execution subject can be an image encryption device. In the embodiment of the present application, an image encryption device is described by taking an example of an image encryption method performed by the image encryption device.
Referring to fig. 6, an embodiment of the present application provides an image encryption apparatus 60, and the image encryption apparatus 60 may include an identification module 61, a display module 62, a receiving module 63, and a hiding module 64. The display module 62 may be configured to display M second images, where M is a positive integer, in a case where the identification module 61 identifies that the content in the first images includes private content. The receiving module 63 may be configured to receive a first input from a user for a third image of the M second images. The hiding module 64 may be configured to hide the image information of the first image into the third image based on the image encryption steganography algorithm in response to the first input received by the receiving module 63, to obtain a fourth image. Wherein each of the second images is an image in which the image information is not hidden.
In a possible implementation manner, the hiding module 64 may be specifically configured to sequentially fill pixel values of each pixel in the first image between pixels of the third image according to a preset rule, so as to obtain a fourth image; the preset rule is related to the arrangement mode of pixels in the first image, and a pixel value of at most one pixel in the first image is included between any two adjacent pixels in the fourth image.
In one possible implementation, the hiding module 64 may include a conversion sub-module and a stuffing sub-module. The conversion sub-module may be configured to convert pixel values of pixels in the first image into binary values, respectively. And the filling sub-module can be used for sequentially filling binary values corresponding to each pixel in the first image obtained by conversion of the conversion sub-module into the pixels of the third image according to the preset rule to obtain a fourth image.
In a possible implementation manner, the M second images are images in the first image folder, and the image encryption device 60 may further include a processing module. The processing module may be configured to, after the hiding module 64 is responsive to the first input received by the receiving module 63, hide the image information of the first image into the third image based on the above-mentioned image encryption steganography algorithm, obtain a fourth image, store the fourth image into the first image folder, and delete the first image; wherein the images in the first image folder are arranged according to the file size of the images.
In a possible implementation, the image encryption device 60 may further include an extraction module and a generation module. The receiving module 63 may be further configured to receive a second input of the fourth image from the user after the processing module stores the fourth image in the first image folder and deletes the first image. The extracting module may be configured to extract image information of the first image from the fourth image based on an image extraction algorithm in response to the second input received by the receiving module 63. The generating module may be configured to generate the first image based on the image information of the first image extracted by the extracting module.
In the image encryption device provided by the embodiment of the application, because the image encryption device can hide the image information of the first image into the third image which is selected by the input of the user and is not hidden with the image information so as to encrypt the first image, other users can not know that the first image is encrypted, and the problem that a plurality of encrypted images correspond to one piece of password information in the traditional technology does not exist, thereby reducing the risk of decrypting the first image and improving the effect of encrypting the image.
The image encryption device in the embodiment of the application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The image encryption device in the embodiment of the application can be a device with an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The image encryption device provided by the embodiment of the present application can implement each process implemented by the embodiments of the methods of fig. 1 to 5, and in order to avoid repetition, a description is omitted here.
As shown in fig. 7, the embodiment of the present application further provides an electronic device 700, which includes a processor 701 and a memory 702, wherein a program or an instruction capable of running on the processor 701 is stored in the memory 702, and when the program or the instruction is executed by the processor 701, the steps of the above-mentioned image encryption method embodiment are implemented, and the same technical effects can be achieved, so that repetition is avoided, and no redundant description is provided herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 1000 includes, but is not limited to: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.
Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 1010 by a power management system to perform functions such as managing charge, discharge, and power consumption by the power management system. The electronic device structure shown in fig. 8 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The display unit 1006 may be configured to display M second images, where M is a positive integer, when the processor 1010 recognizes that the content in the first images includes private content. The user input unit 1007 may be used to receive a first input from a user of a third image of the M second images. The processor 1010 may be configured to conceal image information of the first image into the third image based on an image encryption steganography algorithm in response to the first input received by the user input unit 1007, resulting in a fourth image. Wherein each of the second images is an image in which the image information is not hidden.
In a possible implementation manner, the processor 1010 may be specifically configured to sequentially fill pixel values of pixels in the first image between pixels of the third image according to a preset rule, so as to obtain a fourth image; the preset rule is related to the arrangement mode of pixels in the first image, and a pixel value of at most one pixel in the first image is included between any two adjacent pixels in the fourth image.
In a possible implementation manner, the processor 1010 may be specifically configured to convert the pixel values of each pixel in the first image into a binary value, and sequentially fill the binary values corresponding to each pixel in the converted first image between the pixels of the third image according to the preset rule, so as to obtain a fourth image.
In one possible implementation manner, the M second images are images in the first image folder. The processor 1010 is further configured to, in response to the first input received by the user input unit 1007, hide the image information of the first image into the third image based on the above-described image encryption steganography algorithm, obtain a fourth image, store the fourth image into the first image folder, and delete the first image; wherein the images in the first image folder are arranged according to the file size of the images.
In a possible implementation, the user input unit 1007 may also be configured to receive a second input of a fourth image from the user after the processor 1010 stores the fourth image in the first image folder and deletes the first image. The processor 1010 may be further configured to extract image information of the first image from the fourth image based on an image extraction algorithm in response to the second input received by the user input unit 1007, and generate the first image based on the extracted image information of the first image.
In the electronic device provided by the embodiment of the application, because the electronic device can hide the image information of the first image into the third image which is selected by the input of the user and is not hidden with the image information so as to encrypt the first image, other users can not know that the first image is encrypted, and the problem that a plurality of encrypted images correspond to one piece of password information in the traditional technology does not exist, thereby reducing the risk of decrypting the first image, and improving the effect of the electronic device on encrypting the image.
The beneficial effects of the various implementation manners in this embodiment may be specifically referred to the beneficial effects of the corresponding implementation manners in the foregoing method embodiment, and in order to avoid repetition, the description is omitted here.
It should be appreciated that in an embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 can include two portions, a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
The memory 1009 may be used to store software programs as well as various data. The memory 1009 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 1009 may include volatile memory or nonvolatile memory, or the memory 1009 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 1009 in embodiments of the application includes, but is not limited to, these and any other suitable types of memory.
The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, and the like, and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 1010.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, which when executed by a processor, implements the processes of the above-described image encryption method embodiment, and can achieve the same technical effects, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, the chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions, the processes of the embodiment of the image encryption method can be realized, the same technical effects can be achieved, and the repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
Embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the respective processes of the above-described image encryption method embodiments, and achieve the same technical effects, and for avoiding repetition, a detailed description is omitted herein.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (10)

1. An image encryption method, the method comprising:
displaying M second images under the condition that the content in the first images is identified to comprise private content, wherein M is a positive integer;
receiving a first input of a user to a third image of the M second images;
in response to the first input, hiding the image information of the first image into the third image based on an image encryption steganography algorithm to obtain a fourth image;
storing the fourth image into a first image folder and deleting the first image;
the M second images are images in the first image folder, each second image is an image without hiding image information, each second image is provided with a first mark, and the fourth image is provided with a second mark;
the first identifier and the second identifier are identifiers which are set by the electronic equipment for the image and are not displayed, the first identifier is used for identifying the image which is displayed when the image is encrypted, and the second identifier is used for identifying the image which is not displayed when the image is encrypted.
2. The method of claim 1, wherein hiding the image information of the first image into the third image to obtain a fourth image comprises:
Filling pixel values of pixels in the first image among pixels of the third image in sequence according to a preset rule to obtain the fourth image;
the preset rule is related to an arrangement mode of pixels in the first image, and a pixel value of at most one pixel in the first image is included between any two adjacent pixels in the fourth image.
3. The method according to claim 2, wherein sequentially filling pixel values of pixels in the first image between pixels of the third image according to a preset rule to obtain the fourth image includes:
respectively converting pixel values of pixels in the first image into binary values;
and filling binary values corresponding to the pixels in the first image among the pixels of the third image in sequence according to the preset rule to obtain the fourth image.
4. A method according to any one of claims 1 to 3, wherein the images in the first image folder are arranged according to the file size of the images.
5. The method of claim 4, wherein after storing the fourth image in the first image folder and deleting the first image, the method further comprises:
Receiving a second input of a user to the fourth image;
extracting image information of the first image from the fourth image based on an image extraction algorithm in response to the second input;
the first image is generated based on image information of the first image.
6. An image encryption device is characterized by comprising an identification module, a display module, a receiving module, a hiding module and a processing module;
the display module is used for displaying M second images when the identification module identifies that the content in the first images comprises private content, and M is a positive integer;
the receiving module is used for receiving a first input of a user to a third image in the M second images;
the hiding module is used for hiding the image information of the first image into the third image based on an image encryption steganography algorithm to obtain a fourth image in response to the first input received by the receiving module;
the processing module is used for storing the fourth image hidden by the hiding module into the first image folder and deleting the first image;
the M second images are images in the first image folder, each second image is an image without hiding image information, each second image is provided with a first mark, and the fourth image is provided with a second mark;
The first identifier and the second identifier are identifiers which are not displayed and are set for the image by the image encryption device, the first identifier is used for identifying the image which is displayed when the image is encrypted, and the second identifier is used for identifying the image which is not displayed when the image is encrypted.
7. The apparatus of claim 6, wherein the device comprises a plurality of sensors,
the hiding module is specifically configured to sequentially fill pixel values of pixels in the first image between pixels of the third image according to a preset rule, so as to obtain the fourth image;
the preset rule is related to an arrangement mode of pixels in the first image, and a pixel value of at most one pixel in the first image is included between any two adjacent pixels in the fourth image.
8. The apparatus of claim 7, wherein the concealment module comprises a conversion sub-module and a stuffing sub-module;
the conversion sub-module is used for respectively converting the pixel values of all pixels in the first image into binary values;
and the filling sub-module is used for sequentially filling binary values corresponding to each pixel in the first image obtained by conversion by the conversion sub-module into the pixels of the third image according to the preset rule to obtain the fourth image.
9. The apparatus of any one of claims 6 to 8, wherein the images in the first image folder are arranged according to a file size of the images.
10. The apparatus of claim 9, further comprising an extraction module and a generation module;
the receiving module is further configured to receive a second input of a user to the fourth image after the processing module stores the fourth image in the first image folder and deletes the first image;
the extracting module is used for responding to the second input received by the receiving module and extracting image information of the first image from the fourth image based on an image extracting algorithm;
the generating module is used for generating the first image based on the image information of the first image extracted by the extracting module.
CN202210744234.1A 2022-06-27 2022-06-27 Image encryption method and device Active CN115134473B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210744234.1A CN115134473B (en) 2022-06-27 2022-06-27 Image encryption method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210744234.1A CN115134473B (en) 2022-06-27 2022-06-27 Image encryption method and device

Publications (2)

Publication Number Publication Date
CN115134473A CN115134473A (en) 2022-09-30
CN115134473B true CN115134473B (en) 2023-11-17

Family

ID=83379669

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210744234.1A Active CN115134473B (en) 2022-06-27 2022-06-27 Image encryption method and device

Country Status (1)

Country Link
CN (1) CN115134473B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104700010A (en) * 2013-12-05 2015-06-10 腾讯科技(深圳)有限公司 Personal information protection method and protection device
CN107911563A (en) * 2017-12-28 2018-04-13 维沃移动通信有限公司 A kind of image processing method and mobile terminal
CN112804445A (en) * 2020-12-30 2021-05-14 维沃移动通信有限公司 Display method and device and electronic equipment
CN113239852A (en) * 2021-05-27 2021-08-10 支付宝(杭州)信息技术有限公司 Privacy image processing method, device and equipment based on privacy protection
CN113312668A (en) * 2021-06-08 2021-08-27 支付宝(杭州)信息技术有限公司 Image identification method, device and equipment based on privacy protection
CN113536374A (en) * 2021-07-15 2021-10-22 荣耀终端有限公司 Image privacy protection method and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104700010A (en) * 2013-12-05 2015-06-10 腾讯科技(深圳)有限公司 Personal information protection method and protection device
CN107911563A (en) * 2017-12-28 2018-04-13 维沃移动通信有限公司 A kind of image processing method and mobile terminal
CN112804445A (en) * 2020-12-30 2021-05-14 维沃移动通信有限公司 Display method and device and electronic equipment
CN113239852A (en) * 2021-05-27 2021-08-10 支付宝(杭州)信息技术有限公司 Privacy image processing method, device and equipment based on privacy protection
CN113312668A (en) * 2021-06-08 2021-08-27 支付宝(杭州)信息技术有限公司 Image identification method, device and equipment based on privacy protection
CN113536374A (en) * 2021-07-15 2021-10-22 荣耀终端有限公司 Image privacy protection method and electronic equipment

Also Published As

Publication number Publication date
CN115134473A (en) 2022-09-30

Similar Documents

Publication Publication Date Title
Muhammad et al. Image steganography using uncorrelated color space and its application for security of visual contents in online social networks
CN109886417A (en) Model parameter training method, device, equipment and medium based on federation's study
KR20180048429A (en) Method for authenticating a user by means of a non-secure terminal
US10659226B2 (en) Data encryption method, decryption method, apparatus, and system
US11716197B2 (en) System and method for generating a cryptographic key
CN109214201B (en) Data sharing method, terminal equipment and computer readable storage medium
WO2008010275A1 (en) Medium data processing device and medium data processing method
CA3066701A1 (en) Controlling access to data
CN110113535A (en) terminal information tracing method, device, terminal and medium
CN110377202A (en) Image processing method, device, electronic equipment and storage medium
WO2021159644A1 (en) Screen capture management method and apparatus, and mobile terminal
CN106203141A (en) The data processing method of a kind of application and device
US20150286843A1 (en) Method and system for modular digital watermarking of electronic files
Ye et al. PRA-TPE: Perfectly recoverable approximate thumbnail-preserving image encryption
CN113010918A (en) Information processing method and device
CN117115287A (en) Image generation method, device, electronic equipment and readable storage medium
CN115134473B (en) Image encryption method and device
CN111581622A (en) Information processing method and device and electronic equipment
CN116193198A (en) Video processing method, device, electronic equipment, storage medium and product
CN112270004B (en) Content encryption method and device and electronic equipment
CN112508764B (en) Encryption method for balancing image privacy and usability based on information embedding
CN112184535B (en) Image anti-counterfeiting method, device and equipment
CN113672954A (en) Feature extraction method and device and electronic equipment
CN111291356A (en) Security risk control method and related product
CN112434327A (en) Information protection method and device and electronic equipment

Legal Events

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