CN115134473A - Image encryption method and device - Google Patents

Image encryption method and device Download PDF

Info

Publication number
CN115134473A
CN115134473A CN202210744234.1A CN202210744234A CN115134473A CN 115134473 A CN115134473 A CN 115134473A CN 202210744234 A CN202210744234 A CN 202210744234A CN 115134473 A CN115134473 A CN 115134473A
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.)
Granted
Application number
CN202210744234.1A
Other languages
Chinese (zh)
Other versions
CN115134473B (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

Images

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: in the case that the content in the first image is identified to comprise the private content, displaying M second images, wherein M is a positive integer; receiving a first input of a user to a third image in the M second images; in response to the first input, hiding the image information of the first image into a third image based on an image encryption steganography algorithm to obtain a fourth image; and each second image is an image which is not hidden with image information.

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 can encrypt an image through a privacy cabinet in the electronic device to protect information in the image. Specifically, the electronic device may first set corresponding password information for a privacy cabinet in the electronic device through input of a user, and then import an image to be encrypted into the privacy cabinet, so that the image in the privacy cabinet may be encrypted through the privacy cabinet.
However, according to the above method, on one hand, since the encrypted identifier is usually included in the identifier of the encrypted image, other users can know that the image is encrypted through the encrypted identifier, thereby increasing the risk of snooping; on the other hand, all images in the privacy cabinet are encrypted through the corresponding password information of the privacy cabinet, so once the password information is leaked, all the images in the privacy cabinet lose protection. Thus, the electronic device has a poor effect of 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 image encryption effect of electronic equipment is poor.
In a first aspect, an embodiment of the present application provides an image encryption method, where the method includes: in the case that the content in the first image is identified to comprise the private content, displaying M second images, wherein M is a positive integer; receiving a first input of a user to a third image in the M second images; in response to the first input, hiding the image information of the first image into a third image based on an image encryption steganography algorithm to obtain a fourth image; and each second image is an image which is not hidden with image information.
In a second aspect, an embodiment of the present application provides an image encryption apparatus, which includes an identification module, a display module, a receiving module, and a hiding module; the display module is used for displaying M second images under the condition that the identification module identifies that the content in the first image comprises the private content, wherein M is a positive integer; the receiving module is used for receiving first input of a user to a third image in the M second images; the hiding module is used for responding to the first input received by the receiving module, hiding the image information of the first image into a third image based on an image encryption steganography algorithm, and obtaining a fourth image; and each second image is an image which is not hidden with image information.
In a third aspect, embodiments of the present application provide an electronic device, which includes a processor and a memory, where the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement 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 the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product, stored on a storage medium, for execution 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 when the content in the first image is identified to include private content, wherein M is a positive integer; receiving a first input of a user to a third image in the M second images; in response to the first input, hiding the image information of the first image into a third image based on an image encryption steganography algorithm to obtain a fourth image; and each second image is an image which is not hidden with image information. According to the scheme, the electronic equipment can hide the image information of the first image into the third image which is selected through 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 password information in the traditional technology can be avoided, the risk that the first image is decrypted can be reduced, and the effect of the electronic equipment 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 interface diagram of an application of an image encryption method provided in an embodiment of the present application;
FIG. 3 is a second schematic interface diagram of an application of the image encryption method according to the embodiment of the present application;
fig. 4 is a third schematic interface diagram of an application of the image encryption method according to the embodiment of the present application;
FIG. 5 is a fourth schematic view of an interface applied by the image encryption method according to the embodiment of the present application;
FIG. 6 is a schematic diagram of an image encryption apparatus provided in an embodiment of the present application;
FIG. 7 is a schematic diagram of an electronic device provided by an embodiment of the application;
fig. 8 is a hardware schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application are capable of operation in sequences other than those illustrated or described herein, and that the terms "first," "second," etc. are generally used in a generic sense and do not limit the number of terms, e.g., a first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The image encryption method and apparatus provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Currently, in the process of using the electronic device by a user, personal information of the user stored in the electronic device is increasing, for example, a life snapshot carried by the user, a certificate image of the user collected during authentication and registration, and the like. As more and more functions are developed and used on electronic devices, electronic devices have been an aggregate of our personal information, and the exposure of personal information has also been a common problem at present. Because personal information may be exposed due to loss, borrowing of electronic devices, and abuse of the authority of applications, it has become increasingly important to better protect or hide the personal information.
Various data encryption schemes are provided in current electronic equipment, for example, the electronic equipment encrypts an image, and the electronic equipment can encrypt the image through a privacy cabinet in the electronic equipment to protect information in the image. Specifically, the electronic device may first set corresponding password information for a privacy cabinet in the electronic device through input of a user, and then import an image to be encrypted into the privacy cabinet, so that the image in the privacy cabinet may be encrypted through the privacy cabinet. When the user needs to check the encrypted image, the electronic device can open the privacy cabinet for the user to check through inputting the password information corresponding to the privacy cabinet by the user.
However, according to the above method, although the image can be encrypted, on one hand, since the encrypted image identifier usually includes an encrypted identifier, other users can know that the image is encrypted through the encrypted identifier, so that the risk of snooping is increased, and if the user's family knows that the image is encrypted, a trust crisis is also generated; on the other hand, all images in the privacy cabinet are encrypted through the corresponding password information of the privacy cabinet, so once the password information is leaked, all the images in the privacy cabinet lose protection. Thus, the electronic device has a poor effect of encrypting the image.
In order to solve the above problem, in the image encryption method provided in the embodiment of the present application, taking the example that 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) which are not hidden with image information, in a case that 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 in the image 2 to obtain an image 4 (for example, a fourth image in the embodiment of the present application) through a single click input (for example, the first input in the embodiment of the present application) of the user to the image 2 (for example, the third image in the embodiment of the present application), based on an image encryption steganography algorithm (i.e., a technology that hides secret information in publicity media information and makes it difficult for people to perceive the existence of the secret information through intuitive vision and hearing). 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 user through input and is not hidden with the image information so as to encrypt the image 1, so that other users can not know that the image 1 is encrypted, the problem that a plurality of encrypted images correspond to one password information in the traditional technology can be avoided, the risk that the image 1 is decrypted can be reduced, and the effect of the electronic equipment on image encryption can be improved.
An embodiment of the present application provides an image encryption method, and fig. 1 shows a flowchart of the image encryption method provided in the embodiment of the present application. As shown in fig. 1, the image encryption method provided in the embodiment of the present application may include steps 101 to 103 described below. The method is exemplarily described below by taking the electronic device as an example to execute 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.
Optionally, in this embodiment of the application, the first image may be an image captured by the electronic device, or may be any image stored in the electronic device.
Optionally, in this embodiment of the present application, the privacy content may include: any content relating to user privacy, such as identity information, chat content, or financial information.
It should be noted that, in actual implementation, the electronic device may set any content as the private content according to a user requirement, and the embodiment of the present application is not limited.
In this embodiment, each of the M second images is an image in which image information is not hidden.
Optionally, in this embodiment of the application, the second image may be any image that is stored in the electronic device and has no image information hidden therein.
Optionally, in this embodiment of the application, the electronic device may identify an image in which the image information is not hidden as "0" and identify an image in which the image information is hidden as "1".
It can be understood that the above-mentioned mark "0" and mark "1" are both marks set for the image by the electronic device inside the system, and the marks are not displayed.
Optionally, in this embodiment of the application, after recognizing 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 images not hidden with image information may be quickly filtered out and displayed, so as to facilitate the encryption operation of the user.
Optionally, in this embodiment of the application, when the first image is an image acquired by the electronic device, after the electronic device acquires the first image, content identification may be performed on the acquired first image; therefore, after the content in the first image is recognized to include the private content, the M second images may be automatically displayed (manner one), or a prompt control may be displayed first to prompt the user that the content in the first image includes the private content, whether the first image needs to be encrypted is determined, and then the M second images are displayed through the input of the user to the prompt control (manner two).
Optionally, in this embodiment of the application, in the second mode, the prompt control may be a control for displaying any parameter.
Optionally, in this 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 present application is exemplarily described below by taking the above-mentioned second mode as an example with reference to the drawings.
Illustratively, as shown in (a) of fig. 2, after the electronic device acquires the image 21 (i.e., the first image), the electronic device performs content recognition on the image 21, and recognizes that the content in the image 21 includes the private content 22, then as shown in (b) of fig. 2, the electronic device may display a prompt control 23 to prompt the user whether the content in the image 21 includes the private content and the image 21 needs to be encrypted; further, the electronic device may display the M second images not hiding the image information for encrypting the image 21 by a single-click input of the user to the sub-control 24 in the prompt control 23.
Optionally, in this embodiment of the 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 user input on the first image, where the encryption control may be used to encrypt the first image, and then display the M second images through user input on the encryption control.
For example, taking the first image as an arbitrary image stored in the electronic device as an example, as shown in (a) in fig. 3, the 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 above-mentioned encryption control) in the interface 30. The electronic device may thus display the M second images with no image information hidden for encrypting the image 31 by user input to the "protect" control 32.
Optionally, in this embodiment of the present application, the encryption control may be a control for displaying any parameter.
Step 102, the electronic device receives a first input of a user to a third image of the M second images.
In an embodiment of the application, the first input is used for triggering the electronic device to encrypt the first image.
Optionally, in this embodiment of the application, the first input may be any possible form of input, such as a hovering input, a touch input, or a voice input.
For example, taking the first input as the 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 user on the third image.
Step 103, the electronic device responds to the first input, and based on the image encryption steganography algorithm, hides the image information of the first image into the third image to obtain a fourth image.
Optionally, in this embodiment of the application, the image information of the first image may be: a pixel value of each pixel in the first image.
Optionally, in this embodiment of the application, after receiving the first input, the electronic device may hide a pixel value of each pixel in the first image into a third image based on an image encryption steganography algorithm, and obtain a fourth image, thereby completing encryption of the first image.
It can be seen that the fourth image is obtained including: 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 specific descriptions in the related art, and details are not repeated here to avoid repetition.
A detailed description will be given below of a specific method for the electronic device to hide the image information of the first image in the third image and obtain the fourth image.
Alternatively, in this embodiment of the application, the step 103 may be specifically implemented by the following step 103 a.
And 103a, the electronic equipment responds to the first input, based on an image encryption steganography algorithm, and sequentially fills pixel values of all pixels in the first image into the pixels of the third image according to a preset rule to obtain a fourth image.
In this embodiment of the 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 this embodiment of the present application, the preset rule may be: and according to the arrangement mode of the pixels in the first image, sequentially filling the pixel values of the pixels in the first image into the rule among the corresponding pixels of the third image.
For example, the preset rule may be: the electronic equipment fills a pixel value of an ith pixel in the first image into the third image according to the arrangement mode of the pixels in the first image, wherein the pixel value of the ith pixel is between a jth pixel and a jth +1 pixel corresponding to the ith pixel, and then fills a pixel value of an ith +1 pixel in the first image into the third image, and the pixel value of each pixel in the first image is between a jth + k pixel and a jth + k +1 pixel corresponding to the ith +1 pixel until the pixel value of each pixel in the first image is filled completely, wherein i, j and k are positive integers.
Optionally, in this embodiment of the 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 this 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 which do not include the pixel value of one pixel in the first image exist between the pixels in the fourth image.
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 may be filled between any two pixels of the third image, so as to hide the image information of the first image; and under the resolution of human eyes, the change among the pixels cannot be perceived, namely, 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 device can sequentially fill the pixel values of the pixels in the first image to the pixels of the third image according to the arrangement mode of the pixels in the first image to complete the hiding of the image information of the first image, so that other users cannot intuitively know that the first image is encrypted, and the image protection effect can be improved.
Alternatively, in this embodiment of the application, the step 103a may be specifically implemented by the following steps 103a1 and 103a 2.
Step 103a1, the electronic device responds to the first input, and converts the pixel values of the pixels in the first image into binary values respectively based on the image encryption steganography algorithm.
Optionally, in this embodiment of the application, all the binary values obtained by conversion may form a binary sequence, and an arrangement manner of the binary values in the binary sequence is the same as an arrangement manner of 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 detailed description in the related art, and details are not repeated here to avoid repetition.
Step 103a2, the electronic device sequentially fills binary values corresponding to the pixels in the first image into the pixels in the third image according to a preset rule to obtain a fourth image.
For the specific description of step 103a2, reference may be made to the description related to step 104a in the foregoing embodiment, and details are not repeated here to avoid repetition.
In this embodiment of the application, the electronic device may sequentially fill binary values corresponding to pixels in the first image between pixels in the third image according to the arrangement of the pixels in the first image, so as to complete hiding of the image information of the first image, that is, the electronic device may fill the pixel values of the pixels in the first image between the pixels in the third image in the form of binary values, so that the efficiency of hiding the image information by the electronic device may be improved.
The image encryption method provided by the embodiment of the present application is exemplarily described below with reference to the drawings.
Illustratively, as shown in fig. 4 (a), the electronic device displays an image 41 (i.e., a first image) in an interface 40, and a plurality of functionality controls including a "protect" control 42 (i.e., the encryption control described above), and after the electronic device receives a single click input by a user to the "protect" control 42, as shown in fig. 4 (b), the electronic device may display an image 44, an image 45, an image 46, and images 47 (i.e., M second images) identified as "0" inside the system in the interface 44. Therefore, after receiving a long press input (i.e., a first input) to the image 44 (i.e., a third image) from a user, the electronic device may convert the pixel values of the pixels in the image 41 into binary values based on an encryption steganography algorithm, and sequentially fill the binary values corresponding to the pixels in the image 41 among the pixels in the image 44 according to the preset rule, and after the filling is finished, as shown in (c) of fig. 4, the electronic device may obtain a filled image 48 (i.e., a fourth image). This can complete the concealment of the image information of the image 41.
In the image encryption method 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 user through input and is not hidden with the image information, so as to encrypt the first image, other users cannot know that the first image is encrypted, and the problem that a plurality of encrypted images correspond to one password information in the conventional technology can be avoided, so that the risk of decrypting the first image can be reduced, and the effect of the electronic device on encrypting the image can be improved.
Optionally, in this 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 this embodiment of the present application may further include the following step 104.
And step 104, the electronic equipment stores the fourth image into the first image folder and deletes the first image.
In the embodiment of the present application, the images in the first image folder are arranged according to the file size of the images.
Optionally, in this embodiment of the application, the images in the first image folder may be arranged in the order from large to small of the files of the images, or may be arranged in the order from small to large of the files of the images.
Optionally, in this embodiment of the application, the first image folder may be an image folder in the electronic device, where the image folder is only used for encrypting an image, that is, an image stored in the first image folder includes: an image in which the image information is hidden, and an image for hiding the image information (e.g., the above-mentioned M second images).
Optionally, in this embodiment of the application, a file size difference between every two images for hiding the image information is smaller than or equal to a preset threshold, so that after one image for hiding the image information hides the image information of the other images, a file size of a resulting target image (for example, a fourth image in this embodiment of the application) may become larger, and thus, an order of the target image in the first image folder may be front or back. Therefore, when the user needs the electronic equipment to decrypt the target image, the target image can be quickly found in the first image folder.
Optionally, in this embodiment of the application, when the electronic device displays the M second images, the file size corresponding to each second image may be displayed, so that a user may quickly know the second image in which the image information is hidden and the second image used for hiding the image information in the M second images.
It should be noted that, in practical implementation, the electronic device may store the fourth image in any storage space in the electronic device, which may be determined according to a user requirement, and the embodiment of the present application is not limited.
Optionally, in this embodiment of the application, after the electronic device stores the fourth image, the fourth image may be identified as "1", so that when the electronic device encrypts another image again, the fourth image may not be displayed, so that a user may select an image in which image information is not hidden.
Optionally, in this embodiment of the application, after deleting the first image, the electronic device may retain the third image, and may also delete the third image.
Optionally, in this embodiment of the application, the electronic device may determine to retain or delete the third image according to the importance degree of the third image.
For example, if the third image is an image that is acquired and stored by the electronic device triggered by the user, the importance degree of the third image may be considered to be higher, so that the electronic device may retain the third image after deleting the first image; if the third image is an image that is automatically downloaded (or randomly generated) by the electronic device when encrypting the image, the importance level of the third image may be considered to be low, so that the electronic device may delete the third image after deleting the first image.
In the embodiment of the application, because the electronic device can store the fourth image in the first image folder in which the images are arranged according to the file sizes of the images and delete the first image, other users cannot 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, so that on one hand, the effect of the electronic device on encrypting the image can be further improved, and on the other hand, the process of decrypting the image can be simplified.
Optionally, in this embodiment of the present application, after the step 104, the image encryption method provided in this embodiment of the present application may further include the following steps 105 to 107.
Step 105, the electronic device receives a second input of the fourth image by the user.
In an embodiment of the application, the second input is used to trigger the electronic device to decrypt the first image.
Optionally, in this embodiment of the application, the second input may be any possible form of input, such as touch input, hovering input, or voice input.
And 106, the electronic equipment responds to the second input, and extracts the image information of the first image from the fourth image based on the image extraction algorithm.
Optionally, in this embodiment of the application, the electronic device may extract all the pixel values filled between the pixels of the fourth image according to the arrangement of the filled pixel values in the fourth image, that is, the arrangement of all the extracted pixel values is the same as the arrangement of the pixels in the first image.
Optionally, in this embodiment of the application, after extracting the image information of the first image from the fourth image, the electronic device may obtain the third image again, where the fourth image includes only the image information of the third image.
Optionally, in this embodiment of the 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 this embodiment of the application, after decrypting the first image, the electronic device may copy and retain the fourth image, which may be determined according to a use requirement of a user, and this embodiment of the application is not limited.
For the description of the image extraction algorithm, reference may be made to specific descriptions in the related art, and details are not repeated here to avoid repetition.
Optionally, in this embodiment of the application, after receiving a second input to the fourth image by the user, the electronic device may display a decryption control for decrypting the image, and then extract image information of the first image from the fourth image based on an image extraction algorithm through the input to the decryption control by the user.
Optionally, in this embodiment of the present application, the decryption control may be a control for displaying any parameter.
The following describes an image encryption method provided in an embodiment of the present application, with reference to the accompanying drawings.
Exemplarily, as shown in (a) of fig. 5, assuming that the fourth image is an image 51 displayed in the interface 50 by the electronic device, after the electronic device receives a long press input (i.e., a second input) to the image 51 by the user, as shown in (b) of fig. 5, the electronic device may display a plurality of function controls including an "extraction" control 52 (i.e., the above-mentioned decryption control) in the interface 50. The electronic device may thus extract image information for the image that is hidden from the image 51 based on an image extraction algorithm via a single click input by the user to the "extract" control 52. In this way, decryption of the image can be accomplished.
Optionally, in this embodiment of the application, after receiving a second input to the fourth image by the user, the electronic device may display a password input control for inputting password information, and extract the image information of the first image from the fourth image based on an image extraction algorithm when the password information input by the user matches preset password information.
Optionally, in this embodiment of the application, the password input control may be a control for displaying any parameter.
Optionally, in this embodiment of the present application, the preset password information may be digital password information, voice password information, or biometric password information set by a user.
In the embodiment of the application, the electronic device can extract the image information of the first image from the fourth image under the condition that the password information input by the user to the password input control is matched with the preset password information, so that the security of the electronic device for decrypting the image can be improved.
Step 107, the electronic device generates a first image based on the image information of the first image.
Optionally, in this embodiment of the application, the electronic device may generate a pixel value sequence according to the extracted pixel value of each pixel of the first image and the arrangement manner of each pixel value, and may generate the first image according to the pixel value sequence, thereby completing decryption of the first image.
In the embodiment of the application, the electronic device 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 device can be improved.
According to the image encryption method provided by the embodiment of the application, the execution main body can be an image encryption device. The embodiment of the present application takes an image encryption device executing an image encryption method as an example, and describes an image encryption device provided in the embodiment of the present application.
With reference 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 when the identification module 61 identifies that the content in the first image includes private content, where M is a positive integer. The receiving module 63 may be configured to receive a first input of a user to 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 an image encryption steganography algorithm in response to the first input received by the receiving module 63, so as to obtain a fourth image. And each second image is an image which is not hidden with image information.
In a possible implementation manner, the hiding module 64 may be specifically configured to sequentially fill pixel values of pixels in the first image into the spaces between pixels in 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 the pixels in the first image, and the 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 concealment module 64 may include a conversion sub-module and a padding sub-module. And the conversion sub-module can be used for converting the pixel value of each pixel in the first image into a binary value respectively. And the filling submodule can be used for sequentially filling binary values corresponding to all pixels in the first image converted by the conversion submodule 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 apparatus 60 may further include a processing module. The processing module may be configured to, after the hiding module 64 is configured to, in response 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 image encryption steganography algorithm to 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 manner, the image encryption apparatus 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. An extracting module, which may be configured to extract the 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 can be used for generating the first image based on the image information of the first image extracted by the extracting module.
In the image encryption device provided in 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 user through input and is not hidden with the image information, so as to encrypt the first image, other users cannot 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 conventional technology can be avoided, so that the risk that the first image is decrypted can be reduced, and the effect of encrypting the image can be improved.
The image encryption device in the embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The electronic Device may be, for example, a Mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The image encryption device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The image encryption device provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to fig. 5, and is not described here again to avoid repetition.
As shown in fig. 7, an electronic device 700 provided in the embodiment of the present application further includes a processor 701 and a memory 702, where the memory 702 stores a program or an instruction that can be executed on the processor 701, and when the program or the instruction is executed by the processor 701, the steps of the above-mentioned embodiment of the image encryption method are implemented, and the same technical effects can be achieved, and are not described again here to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
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: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010.
Those skilled in the art will appreciate that the electronic device 1000 may further comprise a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 1010 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through 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 those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The display unit 1006 may be configured to display M second images when the processor 1010 recognizes that the content in the first image includes private content, where M is a positive integer. The user input unit 1007 may be configured to receive a first input of a third image of the M second images from a user. The processor 1010 may be configured to hide the 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. And each second image is an image which is not hidden with image information.
In a possible implementation manner, the processor 1010 may be specifically configured to sequentially fill pixel values of pixels in the first image among pixels in 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 the pixels in the first image, and the 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 pixel values of pixels in the first image into binary values, and sequentially fill the binary values corresponding to the pixels in the first image obtained through conversion into the pixels in the third image according to the preset rule, so as to obtain the fourth image.
In a possible implementation manner, the M second images are images in the first image folder. The processor 1010 may be further configured to, in response to a first input received by the user input unit 1007, hide image information of the first image into the third image based on the above-mentioned image encryption steganography algorithm to 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 a file size of the images.
In a possible implementation manner, the user input unit 1007 may be further configured to receive a second input of the 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 a 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 user through input and is not hidden with the image information so as to encrypt the first image, other users cannot 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 can be avoided, so that the risk that the first image is decrypted can be reduced, and the effect of the electronic device on image encryption can be improved.
The beneficial effects of the various implementation manners in this embodiment may specifically refer to the beneficial effects of the corresponding implementation manners in the above method embodiments, and are not described herein again to avoid repetition.
It should be understood that in the embodiment of the present application, the input Unit 1004 may include a Graphics Processing Unit (GPU) 10041 and a microphone 10042, and the Graphics Processing Unit 10041 processes image data of still pictures or videos obtained by an image capturing device (such as 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 may include two parts, 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, and a joystick, 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 storage area storing a program or an instruction and a second storage area storing data, wherein the first storage area may store an operating system, an application program or an instruction (such as a sound playing function, an image playing function, and the like) 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 non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous Link DRAM (SLDRAM), and a Direct Memory bus RAM (DRRAM). The memory 1009 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
Processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor, which primarily handles operations related to the operating system, user interface, applications, etc., and a modem processor, which primarily handles wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into processor 1010.
The embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored, and when the program or the instruction is executed by a processor, the program or the instruction implements the processes of the above embodiment of the image encryption method, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the processes according to the embodiment of the image encryption method, and can achieve the same technical effects, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
The embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the above-mentioned embodiment of the image encryption method, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. An image encryption method, characterized in that the method comprises:
in the case that the content in the first image is identified to comprise the private content, displaying M second images, wherein M is a positive integer;
receiving a first input of a user to a third image in the M second images;
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;
and each second image is an image which is not hidden with image information.
2. The method according to claim 1, wherein the hiding the image information of the first image into the third image to obtain a fourth image comprises:
filling the pixel values of all pixels in the first image among the pixels of the third image in sequence according to a preset rule to obtain a fourth image;
the preset rule is related to the arrangement mode of the pixels in the first image, and the 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 the sequentially filling pixel values of pixels in the first image among pixels in the third image according to a preset rule to obtain the fourth image comprises:
respectively converting the pixel value of each pixel in the first image into a binary value;
and sequentially filling binary values corresponding to the pixels in the first image into the pixels of the third image according to the preset rule to obtain the fourth image.
4. The method according to any one of claims 1 to 3, wherein the M second images are images in a first image folder;
after the hiding the image information of the first image into the third image based on an image encryption steganography algorithm in response to the first input, obtaining a fourth image, the method further comprises:
storing the fourth image to the first image folder, and deleting the first image;
wherein the images in the first image folder are arranged according to a 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 the fourth image by the user;
extracting image information of the first image from the fourth image based on an image extraction algorithm in response to the second input;
generating the first image 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 and a hiding module;
the display module is used for displaying M second images under the condition that the identification module identifies that the content in the first image comprises the private content, wherein 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 responding to the first input received by the receiving module, hiding the image information of the first image into the third image based on an image encryption steganography algorithm, and obtaining a fourth image;
and each second image is an image which is not hidden with image information.
7. The apparatus of claim 6,
the hiding module is specifically configured to sequentially fill pixel values of pixels in the first image into the pixels of the third image according to a preset rule to obtain the fourth image;
the preset rule is related to the arrangement mode of the pixels in the first image, and the 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 padding sub-module;
the conversion submodule is used for converting the pixel value of each pixel in the first image into a binary number value respectively;
and the filling sub-module is configured to sequentially fill binary values corresponding to pixels in the first image obtained by conversion by the conversion sub-module into pixels in the third image according to the preset rule, so as to obtain the fourth image.
9. The apparatus according to any one of claims 6 to 8, wherein the M second images are images in a first image folder, the apparatus further comprising a processing module;
the processing module is configured to, after the hiding module is 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 to obtain the 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 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 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 is used for responding to the second input received by the receiving module, and extracting the image information of the first image from the fourth image based on an image extraction algorithm;
the generating module is configured to generate 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 true CN115134473A (en) 2022-09-30
CN115134473B 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
CN115134473B (en) 2023-11-17

Similar Documents

Publication Publication Date Title
US10659226B2 (en) Data encryption method, decryption method, apparatus, and system
CN109891478A (en) Method for protecting the transaction executed from non-security terminal
US20090293119A1 (en) User authentication method and system and password management system
CN105429761A (en) Key generation method and device
CN104239815A (en) Electronic document encryption and decryption method and method based on iris identification
WO2008010275A1 (en) Medium data processing device and medium data processing method
CN110113535A (en) End message source tracing method, device, terminal and medium
JP2007206762A (en) Communication method and communication device using two-dimensional code
CN113486377A (en) Image encryption method and device, electronic equipment and readable storage medium
US10003462B2 (en) Key generating method and apparatus
US20150286843A1 (en) Method and system for modular digital watermarking of electronic files
CN107248972B (en) Data encryption and decryption method and device and electronic equipment
Ye et al. PRA-TPE: Perfectly recoverable approximate thumbnail-preserving image encryption
CN106161947A (en) Photo encryption method and system for camera terminal
US11558375B1 (en) Password protection with independent virtual keyboard
CN111581622A (en) Information processing method and device and electronic equipment
CN112270004B (en) Content encryption method and device and electronic equipment
CN115134473B (en) Image encryption method and device
JP5913041B2 (en) Secret information concealment device, secret information restoration device, secret information concealment program, and secret information restoration program
CN113010918A (en) Information processing method and device
CN113868702A (en) Object moving method and device
CN111125742A (en) File management method, intelligent terminal and device with storage function
CN115600229A (en) Information display method and device
CN115396222B (en) Device instruction execution method, system, electronic device and readable storage medium
CN113407959B (en) Operation execution 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