WO2016115888A1 - 一种拍摄照片的方法、查看图片的方法、系统和终端 - Google Patents

一种拍摄照片的方法、查看图片的方法、系统和终端 Download PDF

Info

Publication number
WO2016115888A1
WO2016115888A1 PCT/CN2015/087534 CN2015087534W WO2016115888A1 WO 2016115888 A1 WO2016115888 A1 WO 2016115888A1 CN 2015087534 W CN2015087534 W CN 2015087534W WO 2016115888 A1 WO2016115888 A1 WO 2016115888A1
Authority
WO
WIPO (PCT)
Prior art keywords
encrypted
file
data block
photo
encrypted data
Prior art date
Application number
PCT/CN2015/087534
Other languages
English (en)
French (fr)
Inventor
陈璐
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016115888A1 publication Critical patent/WO2016115888A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • This document relates to the field of terminal technologies, and in particular, to a method for taking a photo, a method for viewing a picture, a system, and a terminal.
  • the mobile phone itself also has security risks.
  • the photo files stored by the user on the mobile phone will be obtained by the thief.
  • the thief disguised a game software for the user to use.
  • the built-in Trojan sneaked through all the image files (for example, jpg files) on the mobile phone in the background, and the scanned images were scaled and packaged and sent to the thief's own server.
  • the embodiment of the invention provides a method for photographing a photo, a method for viewing a picture, and a terminal, and can provide a safe photographing mode, wherein the photograph taken in the safe photographing mode can be encrypted and saved, and the photograph is provided by using the image provided by the embodiment of the present invention.
  • Embodiments of the present invention provide a method for taking a photo, including:
  • the photographed photo is encrypted and saved, including: generating a first photo file, the first image file includes an indication image for indicating the encrypted photo; and encrypting the photographed photo, Generating an encrypted data block; splicing the first picture file with the encrypted data block to generate an encrypted photo file and saving.
  • the splicing the first picture file and the encrypted data block to generate an encrypted photo file and saving the file includes:
  • an encrypted photo file including a first picture file and an encrypted data file, where the file header information of the first picture file carries the first indication information, and the encrypted data block is spliced in the After the end of the file of the first picture file;
  • the first indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the splicing the first picture file and the encrypted data block to generate an encrypted photo file and saving the file includes:
  • an encrypted photo file including a first picture file, an encrypted data block, and a second indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The second indication information is added after the encrypted data block;
  • the second indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the splicing the first picture file and the encrypted data block to generate an encrypted photo file and saving the file includes:
  • an encrypted photo file including a first picture file, an encrypted data block, and a third indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The third indication information is added between the file end character of the first picture file and the encrypted data block;
  • the third indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the encrypting the captured photo to generate an encrypted data block includes:
  • the photographed photo is encrypted by the encrypted password to generate an encrypted data block; when the user does not set the encrypted password in the secure photographing mode, the user is prompted to set the encrypted password.
  • the captured photo is encrypted by the encrypted password to generate an encrypted data block.
  • the embodiment of the invention further provides a method for viewing a picture, the method comprising:
  • Parsing a picture file and determining that the picture file carries indication information for indicating an encrypted photo, determining, according to the indication information, a location of the encrypted data block included in the picture file;
  • the picture file carrying the indication information is formed by splicing a first picture file and an encrypted data block, where the first picture file includes an indication picture, and the encrypted data block is a data block obtained by encrypting the original picture. .
  • the parsing the image file when determining that the image file carries the indication information for indicating the encrypted photo, determining the location of the encrypted data block included in the image file according to the indication information, including:
  • the end position of the encrypted data block is determined according to the length information of the encrypted data block included in the first indication information.
  • the parsing the image file when determining that the image file carries the indication information for indicating the encrypted photo, determining the location of the encrypted data block included in the image file according to the indication information, including:
  • the parsing the image file when determining that the image file carries the indication information for indicating the encrypted photo, determining the location of the encrypted data block included in the image file according to the indication information, including:
  • the reading the encrypted data block and decrypting, after the decryption is successful, obtaining data of the original photo, displaying the original photo including:
  • Reading the encrypted data block prompting the user to input the decryption password, and after receiving the decryption password input by the user, decrypting the encrypted data block according to the decryption password, if the decryption is successful, obtaining the original photo data before encryption , the original photo is displayed.
  • the embodiment of the invention further provides a system for taking a photo, comprising:
  • a detection module configured to detect whether the security camera mode is on
  • the security camera module is configured to encrypt and save the captured photos when the security camera mode is on.
  • the security camera module is configured to encrypt and save the captured photo in the following manner:
  • the first picture file including an indication picture for indicating an encrypted photo
  • the first picture file is spliced with the encrypted data block to generate an encrypted photo file and saved.
  • the security camera module is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the following:
  • the file header information of the first picture file carries the first indication information, and the encrypted data block is spliced after the file end character of the first picture file;
  • the first indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the security camera module is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the following:
  • an encrypted photo file including a first picture file, an encrypted data block, and a second indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The second indication information is added after the encrypted data block;
  • the second indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the security camera module is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the following:
  • an encrypted photo file including a first picture file, an encrypted data block, and a third indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The third indication information is added between the file end character of the first picture file and the encrypted data block;
  • the third indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the security camera module is configured to encrypt the captured photo in the following manner to generate an encrypted data block:
  • the photographed photo is encrypted by the encrypted password to generate an encrypted data block; when the user does not set the encrypted password in the secure photographing mode, the user is prompted to set the encrypted password.
  • the captured photo is encrypted by the encrypted password to generate an encrypted data block.
  • the embodiment of the invention further provides a system for viewing pictures, including:
  • the parsing module is configured to parse the image file, and is used to determine that the image file carries When the indication information of the encrypted photo is displayed, determining a location of the encrypted data block included in the image file according to the indication information;
  • a decryption module configured to read the encrypted data block and perform decryption, and after successful decryption, obtain data of the original photo to display the original photo;
  • the picture file carrying the indication information is formed by splicing a first picture file and an encrypted data block, where the first picture file includes an indication picture, and the encrypted data block is a data block obtained by encrypting the original picture. .
  • the parsing module is configured to parse the image file in the following manner, and when determining that the image file carries the indication information for indicating the encrypted photo, determining, according to the indication information, the image file The location of the encrypted data block:
  • the end position of the encrypted data block is determined according to the length information of the encrypted data block included in the first indication information.
  • the parsing module is configured to parse the image file in the following manner, and when determining that the image file carries the indication information for indicating the encrypted photo, determining, according to the indication information, the image file The location of the encrypted data block:
  • Second indication information for indicating an encrypted photo from the tail of the picture file, if extracted, determining that the encrypted data block is located before the second indication information, according to the second indication information
  • the length information of the encrypted data block determines the starting position of the encrypted data block.
  • the parsing module is configured to parse the image file in the following manner, and when determining that the image file carries the indication information for indicating the encrypted photo, determining, according to the indication information, the image file The location of the encrypted data block:
  • the decrypting module is configured to read the encrypted data block in the following manner and Decrypting, after the decryption is successful, obtaining the data of the original photo, displaying the original photo:
  • Reading the encrypted data block prompting the user to input the decryption password, and after receiving the decryption password input by the user, decrypting the encrypted data block according to the decryption password, if the decryption is successful, obtaining the original photo data before encryption , the original photo is displayed.
  • the embodiment of the invention further provides a terminal, including:
  • a memory for storing instructions
  • a processor coupled to the memory, the processor configured to execute instructions stored in the memory, wherein the processor is configured to detect whether a secure camera mode is on, in a secure camera mode When the image is in an open state, the captured photo is encrypted and saved, including: generating a first image file, the first image file includes an indication image for indicating the encrypted photo; and encrypting the captured photo to generate an encrypted data block. And splicing the first picture file with the encrypted data block to generate an encrypted photo file and saving.
  • the processor is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the file, including:
  • an encrypted photo file including a first picture file and an encrypted data file, where the file header information of the first picture file carries the first indication information, and the encrypted data block is spliced in the After the end of the file of the first picture file;
  • the first indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the processor is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the file, including:
  • an encrypted photo file including a first picture file, an encrypted data block, and a second indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The second indication information is added after the encrypted data block;
  • the second indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the processor is configured to use the first picture file with the encryption
  • the data blocks are stitched together to generate an encrypted photo file and saved, including:
  • an encrypted photo file including a first picture file, an encrypted data block, and a third indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The third indication information is added between the file end character of the first picture file and the encrypted data block;
  • the third indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the processor is configured to encrypt the captured photo to generate an encrypted data block, including:
  • the photographed photo is encrypted by the encrypted password to generate an encrypted data block; when the user does not set the encrypted password in the secure photographing mode, the user is prompted to set the encrypted password.
  • the captured photo is encrypted by the encrypted password to generate an encrypted data block.
  • the invention also provides a terminal, comprising:
  • a memory for storing instructions
  • a processor coupled to the memory, the processor configured to execute instructions stored in the memory, wherein the processor is configured to parse a picture file, useful in determining the picture file When indicating the indication information of the encrypted photo, determining the location of the encrypted data block included in the picture file according to the indication information; reading the encrypted data block and decrypting, and after successfully decrypting, obtaining the data of the original photo, Display the original photo;
  • the picture file carrying the indication information is formed by splicing a first picture file and an encrypted data block, where the first picture file includes an indication picture, and the encrypted data block is a data block obtained by encrypting the original picture. .
  • the processor is configured to parse a picture file, and when determining that the picture file carries indication information for indicating an encrypted photo, determining, according to the indication information, the content included in the picture file
  • the location of the encrypted data block including:
  • the data block is located after the file end character of the first picture file, and determines an end position of the encrypted data block according to length information of the encrypted data block included in the first indication information.
  • the processor is configured to parse a picture file, and when determining that the picture file carries indication information for indicating an encrypted photo, determining, according to the indication information, the content included in the picture file
  • the location of the encrypted data block including:
  • Second indication information for indicating an encrypted photo from the tail of the picture file, if extracted, determining that the encrypted data block is located before the second indication information, according to the second indication information
  • the length information of the encrypted data block determines the starting position of the encrypted data block.
  • the processor is configured to parse a picture file, and when determining that the picture file carries indication information for indicating an encrypted photo, determining, according to the indication information, the content included in the picture file
  • the location of the encrypted data block including:
  • the processor is configured to read the encrypted data block and perform decryption. After the decryption is successful, obtaining data of the original photo, displaying the original photo, includes:
  • Reading the encrypted data block prompting the user to input the decryption password, and after receiving the decryption password input by the user, decrypting the encrypted data block according to the decryption password, if the decryption is successful, obtaining the original photo data before encryption , the original photo is displayed.
  • the embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
  • the embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
  • the photo taken by the terminal in the security photographing mode can be encrypted and saved. If the encrypted photo is viewed by using the photo viewing method provided by the embodiment of the present invention, if the decryption is successful, the authenticity of the encrypted photo can be seen. Content, otherwise you can only see the schematic image and not see Protect the user's photo privacy by encrypting the real content of the photo.
  • FIG. 1 is a schematic diagram of a method for taking a photo according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of an encrypted photo file (taking JPG format as an example) according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a method for viewing a picture according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a system for taking a photo according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a system for viewing a picture according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a terminal (having a security photographing mode) according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a terminal (capable of viewing an encrypted photo) according to an embodiment of the present invention.
  • the photos are taken and displayed by the underlying framework of the terminal in accordance with the request of the upper application.
  • the bottom frame of the mobile phone of the embodiment of the present invention can provide a safe photographing mode, in which the photograph taken is directly encrypted, and only the correct decryption key can be displayed, otherwise the real image of the photo can not be seen (including the photo Copy to the PC for display) and only recognize that this is a photo, so as to protect the privacy of the user's photos.
  • the stored format of the encrypted photo file maintains the normal file format, but it has some distinguishable features.
  • Use the normal picture viewing software either the software on the PC or the software on the phone
  • an indication picture the indication picture is used to indicate that this is an encrypted picture
  • the encrypted photo file is not decrypted.
  • the status is displayed, it is not a real photo, but an indication picture that can explain to the human eye that this is an encrypted photo. This can be done with the encrypted photo file of the embodiment of the present invention.
  • the data indicating the picture is placed in front, and the encrypted photo data block is placed behind (actually a bunch of garbled characters).
  • the embodiment of the invention utilizes the fault tolerance mechanism of the modern image processing software for the common image format: since the image may always have transmission errors during the transmission process, the modern image processing software tries to perform fault tolerance processing on the image to ensure that the user can see the image.
  • An important mechanism in these fault-tolerant mechanisms is that if the terminator specified in the file format is read, it ends and the bytes are not read down.
  • the format of the image file is very large, in the commonly used JPG format (here, the JPG format means the file storage format of the JPG image, such as JFIF (JPEG File Interchange Format) or EXIF (Exchangeable Image File, Exchangeable image file) Storage format)
  • JFIF JPEG File Interchange Format
  • EXIF Exchangeable Image File, Exchangeable image file
  • the JPG file format always starts with FFD8 and ends with FFD9.
  • the normal picture viewing software generally reads to FFD9, and the bytes added after FFD9 do not affect the display of the picture.
  • an embodiment of the present invention provides a method for taking a photo, the method comprising:
  • S102 Encrypting and saving the captured photo when the security photographing mode is in an open state, including: generating a first image file, where the first image file includes an indication image for indicating an encrypted photo; and performing the captured photo Encrypting, generating an encrypted data block; splicing the first picture file and the encrypted data block to generate an encrypted photo file and saving;
  • the method further includes: when the security photographing mode is in a closed state, the original file of the photographed photo is not encrypted, and the original file is directly saved;
  • the indication picture is a picture that can explain to the human eye that this is an encrypted photo
  • the storage format of the first picture file may be an EXIF (Exchangeable Image File) format or a JFIF (JPEG File Interchange Format) format;
  • the original data format of the photograph taken may be any image format
  • generating an indication picture includes:
  • the description information may include: file name information generated by the system for the photograph taken; for example, indicating that the following information is displayed on the image: IMG_20141205124530.jpg;
  • the splicing the first picture file and the encrypted data block to generate an encrypted photo file and saving the file includes:
  • an encrypted photo file including a first picture file and an encrypted data file, where the file header information of the first picture file carries the first indication information, and the encrypted data block is spliced in the After the end of the file of the first picture file;
  • the first indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included;
  • the storage format of the first picture file may be an EXIF format
  • the splicing the first picture file and the encrypted data block to generate an encrypted photo file and saving the file includes:
  • an encrypted photo file including a first picture file, an encrypted data block, and a second indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The second indication information is added after the encrypted data block;
  • the second indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included;
  • the second indication information is a fixed-length character string, and the indicator is located at a fixed position of the character string;
  • the splicing the first picture file and the encrypted data block to generate an encrypted photo file and saving the file includes:
  • an encrypted photo file including a first picture file, an encrypted data block, and a third indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The third indication information is added between the file end character of the first picture file and the encrypted data block;
  • the third indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included;
  • the third indication information is a fixed-length character string, and the indicator is located at a fixed position of the character string;
  • the encrypting the captured photo to generate an encrypted data block including:
  • the photographed photo is encrypted by the encrypted password to generate an encrypted data block;
  • the user does not set the encrypted password in the secure photographing mode, the user is prompted to set the encrypted password.
  • the encryption data is used to encrypt the data, and the related data encryption method may be adopted.
  • the encryption key is generated according to the encryption password, and then the encryption key is used to encrypt the data by using an encryption algorithm.
  • a decryption key is generated based on the decrypted password, and the encrypted data block is decrypted by the decryption algorithm using the decryption key.
  • the decryption process corresponds to the encryption process.
  • a photo taken in a secure photographing mode is subjected to an encryption process to generate an encrypted data block (102 in FIG. 2), and the encrypted data block is stitched into the first image file (FIG. 2).
  • the end of file of 101 in 2) is after FFD9.
  • the original photo before encryption can be any image format or even RAW (unprocessed) format image.
  • the normal picture viewing software When viewing the encrypted photo file in this scheme, the normal picture viewing software will only read the file end character FFD9 of the first picture file (including an indication picture), and only display the indication picture, and ignore the indication picture. The latter data.
  • the terminal (having an encrypted photo viewing function) of the embodiment of the present invention can recognize that the photo taken in the secure photographing mode is an encrypted photo file, and decrypts the encrypted photo and displays it to the user when the user inputs the correct decryption password.
  • the indication information indicating the encryption processing may be added to the picture detailed description information of the first picture file (generally in the file header information).
  • the EXIF storage format is specifically designed with a data segment for accompanying picture detailed description information.
  • a fixed length string is added between the first picture file and the encrypted data block, or after the encrypted data block.
  • the string begins with a sequence of special characters.
  • XXXXXXXX is a string of hexadecimal digits fixed to an 8-bit length, indicating the length of the encrypted data block.
  • the safe photo mode provides a floating window floating on the screen with two buttons on it; one button is a switch for quickly turning on/off the "safe photo mode”; another button clicks to enter a password dialog box for quick user access. Enter the encrypted password. After the encrypted password is entered, the encrypted password can be valid until the "safe photo mode" is turned off.
  • an embodiment of the present invention provides a method for viewing a picture, where the method includes:
  • the picture file carrying the indication information is formed by splicing a first picture file and an encrypted data block, where the first picture file includes an indication picture, and the encrypted data block is a data block obtained by encrypting the original picture. .
  • the determining the image file when determining that the image file carries the indication information for indicating the encrypted photo, determining the location of the encrypted data block included in the image file according to the indication information, including:
  • the indication picture may further display description information of the photographed photo;
  • the description information may include: file name information generated by the system for the photograph taken; for example, the following information is displayed on the indication picture: IMG_20141205124530.jpg;
  • the storage format of the first picture file may be an EXIF format
  • the determining the image file when determining that the image file carries the indication information for indicating the encrypted photo, determining the location of the encrypted data block included in the image file according to the indication information, including:
  • Second indication information for indicating an encrypted photo from the tail of the picture file, if extracted, determining that the encrypted data block is located before the second indication information, according to the second indication information
  • the length information of the encrypted data block determines a starting position of the encrypted data block
  • the second indication information is a fixed-length character string, and includes an indicator for indicating an encryption process and length information of the encrypted data block, where the indicator is located at a fixed position of the character string;
  • the determining the image file when determining that the image file carries the indication information for indicating the encrypted photo, determining the location of the encrypted data block included in the image file according to the indication information, including:
  • the third indication information is a fixed-length character string, and includes an indicator for indicating an encryption process and length information of the encrypted data block, where the indicator is located at a fixed position of the character string;
  • the reading the encrypted data block and decrypting, after the decryption is successful, obtaining data of the original photo, displaying the original photo including:
  • Reading the encrypted data block prompting the user to input the decryption password, and after receiving the decryption password input by the user, decrypting the encrypted data block according to the decryption password, if the decryption is successful, obtaining the original photo data before encryption Showing the original photo;
  • the user After prompting the user to enter the password, if the decryption password or the decryption password is not received, the user also includes:
  • the indication picture is displayed
  • the first picture file has not been parsed, parsing the first picture file, and after obtaining the indication picture, displaying the indication picture;
  • an embodiment of the present invention provides a system for taking a photo, including:
  • the detecting module 401 is configured to detect whether the security photographing mode is in an open state
  • the security camera module 402 is configured to encrypt and save the captured photo when the security camera mode is in an open state, including: generating a first picture file, where the first picture file includes an indication picture for indicating an encrypted photo; The captured photo is encrypted to generate an encrypted data block; the first image file is spliced with the encrypted data block, and an encrypted photo file is generated and saved.
  • the security camera module 402 is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the following:
  • an encrypted photo file including a first picture file and an encrypted data file, where the file header information of the first picture file carries the first indication information, and the encrypted data block is spliced in the After the end of the file of the first picture file;
  • the first indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the security camera module 402 is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the following:
  • an encrypted photo file including a first picture file, an encrypted data block, and a second indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The second indication information is added after the encrypted data block;
  • the second indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the security camera module 402 is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the following:
  • the third indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the security camera module 402 is configured to encrypt the captured photo in the following manner to generate an encrypted data block:
  • the photographed photo is encrypted by the encrypted password to generate an encrypted data block; when the user does not set the encrypted password in the secure photographing mode, the user is prompted to set the encrypted password.
  • the captured photo is encrypted by the encrypted password to generate an encrypted data block.
  • an embodiment of the present invention provides a system for viewing a picture, including:
  • the parsing module 501 is configured to parse the picture file, and when determining that the picture file carries the indication information for indicating the encrypted photo, determining, according to the indication information, a location of the encrypted data block included in the picture file;
  • the decryption module 502 is configured to read the encrypted data block and perform decryption, and after the decryption succeeds, obtain data of the original photo, and display the original photo;
  • the picture file carrying the indication information is formed by splicing a first picture file and an encrypted data block, where the first picture file includes an indication picture, and the encrypted data block is a data block obtained by encrypting the original picture. .
  • the parsing module 501 is configured to parse the image file in the following manner, and when determining that the image file carries the indication information for indicating the encrypted photo, determining the encryption included in the image file according to the indication information.
  • the end position of the encrypted data block is determined according to the length information of the encrypted data block included in the first indication information.
  • the parsing module 501 is configured to parse the image file in the following manner, and when determining that the image file carries the indication information for indicating the encrypted photo, determining the encryption included in the image file according to the indication information.
  • Second indication information for indicating an encrypted photo from the tail of the picture file, if extracted, determining that the encrypted data block is located before the second indication information, according to the second indication information
  • the length information of the encrypted data block determines the starting position of the encrypted data block.
  • the parsing module 501 is configured to parse the image file in the following manner, and when determining that the image file carries the indication information for indicating the encrypted photo, determining the encryption included in the image file according to the indication information.
  • the decryption module 502 is configured to read and decrypt the encrypted data block in the following manner. After the decryption succeeds, the data of the original photo is obtained, and the original photo is displayed:
  • Reading the encrypted data block prompting the user to input the decryption password, and after receiving the decryption password input by the user, decrypting the encrypted data block according to the decryption password, if the decryption is successful, obtaining the original photo data before encryption , the original photo is displayed.
  • an embodiment of the present invention provides a terminal, including:
  • a processor 602 coupled to the memory, the processor configured to execute an instruction stored in the memory, wherein the processor is configured to detect whether a secure photo mode is in an on state, in a safe photo When the mode is in the on state, the captured photo is encrypted and saved, including: generating a first picture file, the first picture file includes an indication picture for indicating the encrypted photo; encrypting the captured photo to generate encrypted data And splicing the first picture file with the encrypted data block to generate an encrypted photo file and saving.
  • the processor 602 is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the file, including:
  • an encrypted photo file including a first picture file and an encrypted data file, where the file header information of the first picture file carries the first indication information, and the encrypted data block is spliced in the After the end of the file of the first picture file;
  • the first indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the processor 602 is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the file, including:
  • an encrypted photo file including a first picture file, an encrypted data block, and a second indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The second indication information is added after the encrypted data block;
  • the second indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the processor 602 is configured to splicing the first picture file and the encrypted data block to generate an encrypted photo file and save the file, including:
  • an encrypted photo file including a first picture file, an encrypted data block, and a third indication information, wherein the encrypted data block is spliced after the file end character of the first picture file, The third indication information is added between the file end character of the first picture file and the encrypted data block;
  • the third indication information is used to indicate an encrypted photo, where the length information of the encrypted data block and an indicator for indicating an encrypted photo are included.
  • the processor 602 is configured to encrypt the captured photo to generate an encrypted data block, including:
  • the photographed photo is encrypted by the encrypted password to generate an encrypted data block; when the user does not set the encrypted password in the secure photographing mode, the user is prompted to set the encrypted password.
  • the captured photo is encrypted by the encrypted password to generate an encrypted data block.
  • an embodiment of the present invention further provides a terminal, including:
  • a processor 702 coupled to the memory, the processor configured to execute instructions stored in the memory, wherein the processor is configured to parse a picture file for carrying in determining the picture file When there is indication information for indicating an encrypted photo, determining a location of the encrypted data block included in the image file according to the indication information; reading the encrypted data block and decrypting, and obtaining data of the original photo after the decryption is successful Showing the original photo;
  • the picture file carrying the indication information is formed by splicing a first picture file and an encrypted data block, where the first picture file includes an indication picture, and the encrypted data block is a data block obtained by encrypting the original picture. .
  • the processor 702 is configured to parse a picture file, and when determining that the picture file carries indication information for indicating an encrypted photo, determining, according to the indication information, encryption included in the picture file.
  • the location of the data block including:
  • the end position of the encrypted data block is determined according to the length information of the encrypted data block included in the first indication information.
  • the processor 702 is configured to parse a picture file, and when determining that the picture file carries indication information for indicating an encrypted photo, determining, according to the indication information, encryption included in the picture file.
  • the location of the data block including:
  • Second indication information for indicating an encrypted photo from the tail of the picture file, if extracted, determining that the encrypted data block is located before the second indication information, according to the second indication information
  • the length information of the encrypted data block determines the starting position of the encrypted data block.
  • the processor 702 is configured to parse a picture file, and when determining that the picture file carries indication information for indicating an encrypted photo, determining, according to the indication information, encryption included in the picture file.
  • the location of the data block including:
  • the block is located after the third indication information, according to the third indication information packet
  • the length information of the encrypted data block included determines the end position of the encrypted data block.
  • the processor 702 is configured to read the encrypted data block and perform decryption. After the decryption succeeds, the data of the original photo is obtained, and the original photo is displayed, including:
  • Reading the encrypted data block prompting the user to input the decryption password, and after receiving the decryption password input by the user, decrypting the encrypted data block according to the decryption password, if the decryption is successful, obtaining the original photo data before encryption , the original photo is displayed.
  • the photo taken by the terminal in the security photographing mode can be encrypted and saved. If the encrypted photo is viewed by using the photo viewing method provided by the embodiment of the present invention, if the decryption is successful, the authenticity of the encrypted photo can be seen. Content, otherwise you can only see the schematic image and can't see the real content of the encrypted photo, thus protecting the user's photo privacy.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)
  • Television Signal Processing For Recording (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

一种拍摄照片的方法,包括:在检测到安全拍照模式处于开启状态时(S101),对拍摄的照片进行加密处理并保存:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存(S102)。一种拍摄照片的终端,包括检测模块和安全拍照模块。

Description

一种拍摄照片的方法、查看图片的方法、系统和终端 技术领域
本文涉及终端技术领域,尤其涉及的是一种拍摄照片的方法、查看图片的方法、系统和终端。
背景技术
现代手机最常用的功能之一就是拍照,所以在用户的手机(包括手机存储卡)中常常存储着大量的使用手机拍摄出的照片。
但是,一旦手机或存储卡落入其他人手中时,最容易泄露的用户隐私就是存储在手机上的照片。另外,人们还喜欢把自己用手机拍摄的照片通过网络分享给朋友,他们通常使用社交型聊天软件进行分享(例如微信),这类软件均有发送图片的功能。该功能的使用方式通常是:在聊天时直接打开照相机拍照后立即发送,或者在聊天时打开图库选择已有的照片进行发送。但是这种分享照片的方式存在安全隐患:照片在网络上传输的过程中可能被黑客截获,从而泄露用户的隐私。
另外,手机本身也存在安全隐患,一旦手机中了木马病毒,则用户存储在手机上的照片文件会被窃密者获取到。比如,窃密者伪装一款游戏软件给用户使用,内藏木马在后台偷偷扫描手机上所有的图片文件(比如,jpg文件),将扫描到的图片进行缩放后打包传给窃密者自己的服务器。
因此,用户的照片隐私存在泄露危险。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例提供了一种拍摄照片的方法、查看图片的方法和终端,能够提供一种安全拍照模式,在该安全拍照模式下拍摄的照片能够加密保存,使用本发明实施例提供的图片查看方法查看所述加密照片且解密成功,能够 看到加密照片的真实内容。
本发明实施例提供了一种拍摄照片的方法,包括:
检测安全拍照模式是否处于开启状态;以及
在安全拍照模式处于开启状态时,对拍摄的照片进行加密处理并保存,包括:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存。
可选地,所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述对拍摄的照片进行加密,生成加密数据块,包括:
在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块。
本发明实施例还提供了一种查看图片的方法,该方法包括:
解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;以及
读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
可选地,所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
可选地,所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二 指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置。
可选地,所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
可选地,所述读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片,包括:
读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片。
本发明实施例还提供了一种拍摄照片的系统,包括:
检测模块,设置为检测安全拍照模式是否处于开启状态;以及
安全拍照模块,设置为在安全拍照模式处于开启状态时,对拍摄的照片进行加密处理并保存。
可选地,所述安全拍照模块,是设置为采用以下方式对拍摄的照片进行加密处理并保存:
生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;
对拍摄的照片进行加密,生成加密数据块;
将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存。
可选地,所述安全拍照模块,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加 密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述安全拍照模块,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述安全拍照模块,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述安全拍照模块,是设置为采用以下方式对拍摄的照片进行加密,生成加密数据块:
在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块。
本发明实施例还提供了一种查看图片的系统,包括:
解析模块,设置为解析图片文件,在确定所述图片文件中携带有用于指 示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;以及
解密模块,设置为读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
可选地,所述解析模块,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
可选地,所述解析模块,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置。
可选地,所述解析模块,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
可选地,所述解密模块,是设置为采用以下方式读取所述加密数据块并 进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片:
读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片。
本发明实施例还提供了一种终端,包括:
存储器,用于存储指令;以及
处理器,其与所述存储器耦合,所述处理器配置为执行存储在所述存储器中的指令,其中,所述处理器被配置为用于检测安全拍照模式是否处于开启状态,在安全拍照模式处于开启状态时,对拍摄的照片进行加密处理并保存,包括:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存。
可选地,所述处理器,其被配置为用于将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述处理器,其被配置为用于将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述处理器,其被配置为用于将所述第一图片文件与所述加密 数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
可选地,所述处理器,其被配置为用于对拍摄的照片进行加密,生成加密数据块,包括:
在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块。
本发明还提供了一种终端,包括:
存储器,用于存储指令;以及
处理器,其与所述存储器耦合,所述处理器配置为执行存储在所述存储器中的指令,其中,所述处理器被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
可选地,所述处理器,其被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密 数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
可选地,所述处理器,其被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置。
可选地,所述处理器,其被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
可选地,所述处理器,其被配置为用于读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片,包括:
读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片。
本发明实施例还提供一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上述拍摄照片的方法。
本发明实施例还提供一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上述查看图片的方法。
本发明实施例提供的技术方案,终端在安全拍照模式下拍摄的照片能够加密保存,使用本发明实施例提供的图片查看方法查看所述加密照片时如果解密成功,则能够看到加密照片的真实内容,否则仅能看到示意图像而看不 到加密照片的真实内容,从而保护用户的照片隐私。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为本发明实施例一种拍摄照片的方法的示意图。
图2为本发明实施例一种加密照片文件(以JPG格式为例)的结构示意图。
图3为本发明实施例一种查看图片的方法的示意图。
图4为本发明实施例一种拍摄照片的系统的示意图。
图5为本发明实施例一种查看图片的系统的示意图。
图6为本发明实施例的一种终端(具有安全拍照模式)的示意图。
图7为本发明实施例的一种终端(能够查看加密照片)的示意图。
本发明的实施方式
照片都是由终端底层框架按照上层应用的请求拍摄和显示的。本发明实施例的手机的底层框架能够提供一种安全拍照模式,在该模式下拍摄的照片直接就是加密的,只有获得正确的解密密钥才能显示,否则看不见照片的真实图像(包括将照片拷贝到PC上进行显示的情况)而只能识别出这是一张照片,从而达到保护用户照片隐私的目的。
安全拍照模式下拍摄的照片存储为加密照片文件后,该加密照片文件的存储格式保持着正常的文件格式,但是它具有一些可分辨的特征。使用普通图片查看软件(无论是PC机上的软件还是手机上的软件)都可以显示出一张指示图片(指示图片用于表示这是一张加密照片),也即,该加密照片文件处于非解密状态时显示的并非是真实照片,而是一幅能向人眼说明这是一张加密照片的指示图片,能做到这一点是和本发明实施例的加密照片文件的结 构有关的。本发明实施例的加密照片文件结构中,指示图片的数据放在前面,加密后的照片数据块放在后面(实际上是一堆乱码)。
本发明实施例利用了现代图像处理软件对常用图片格式的容错机制:因为图片在传输过程中总有可能会出现传输错误,所以现代图像处理软件尽量对图片进行容错处理,保证用户能看到图片,这些容错机制中有一条重要机制是:如果读取到文件格式规定的结束符,就结束,不再往下读取字节了。图片文件的格式非常繁多,以常用的JPG格式(这里所说的JPG格式的意思是指JPG图像的文件存储格式,例如JFIF(JPEG File Interchange Format,JPEG档案交换格式)或者EXIF(Exchangeable Image File,可交换图像文件)存储格式)为例,JPG文件格式总是以FFD8开头,以FFD9结尾。普通图片查看软件一般读取到FFD9为止,在FFD9之后添加的字节不会影响到图片的显示。
如图1所示,本发明实施例提供了一种拍摄照片的方法,该方法包括:
S101,检测安全拍照模式是否处于开启状态;
S102,在安全拍照模式处于开启状态时,对拍摄的照片进行加密处理并保存,包括:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存;
所述方法还包括:在安全拍照模式处于关闭状态时,对拍摄的照片的原始文件不进行加密处理,直接保存所述原始文件;
其中,所述指示图片是一幅能向人眼说明这是一张加密照片的图片;
其中,所述第一图片文件的存储格式可以为EXIF(Exchangeable Image File,可交换图像文件)格式或JFIF(JPEG File Interchange Format,JPEG档案交换格式)格式;
其中,所述拍摄的照片的原始数据格式可以为任意图片格式;
其中,生成指示图片,包括:
生成能够显示所述拍摄的照片的说明信息的图片;其中,所述说明信息可以包括:系统为所述拍摄的照片生成的文件名信息;比如,指示图片上显示如下信息:IMG_20141205124530.jpg;
其中,所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符;
可选地,所述第一图片文件的存储格式可以为EXIF格式;
其中,所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符;
其中,所述第二指示信息为固定长度的字符串,所述指示符位于所述字符串的固定位置上;
其中,所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符;
其中,所述第三指示信息为固定长度的字符串,所述指示符位于所述字符串的固定位置上;
其中,所述对拍摄的照片进行加密,生成加密数据块,包括:
在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;
其中,利用加密密码对数据进行加密处理,可以采用相关的数据加密方法,一般,根据加密密码生成加密密钥,再利用加密密钥通过加密算法对数据进行加密。解密时,根据解密密码生成解密密钥,再利用解密密钥通过解密算法对加密后的数据块进行解密。解密过程与加密过程相对应。
如图2所示,本发明实施例在安全拍照模式下拍摄的照片经过加密处理后生成加密数据块(附图2中的102),将所述加密数据块拼接在第一图片文件(附图2中的101)的文件结束符FFD9之后。加密前的原始照片可以是任意图片格式甚至是RAW(未经加工)格式图片。
普通图片查看软件在查看本方案中加密照片文件时,它只会读到第一图片文件(包含一张指示图片)的文件结束符FFD9就结束,只将指示图片显示出来,而忽略掉指示图片后面的数据。
本发明实施例的终端(具有加密照片查看功能)能识别出安全拍照模式下拍摄的照片是加密照片文件,在用户输入正确解密密码的情况下,将加密照片解密出来显示给用户。
为了能让终端识别出安全拍照模式下拍摄的照片,需要在加密照片文件中加入一些可分辨的特征,有两种可选的方案:
1)方案一、
可以将指示加密处理的指示信息添加到第一图片文件的图片详细说明信息中去(一般在文件头信息中),比如,EXIF存储格式中专门设计有数据段,用于附带图片详细说明信息。
例如:我们可以在指示图片的图片详细说明信息中的“作者”这一项中填入“WindtalkerXXXXXXXX”,终端读取这一项时根据“Windtalker”就可以分辨出该照片文件是加密文件;而XXXXXXXX是固定为8位长度的十六进制数字串,表示加密数据块的长度。
2)方案二、
在第一图片文件和加密数据块之间,或者是在加密数据块的后面,添加固定长度的字符串。所述字符串以特殊字符序列作为开头。
例如:在加密数据块的后面添加字符串“WindtalkerXXXXXXXX”。终端解析该加密照片文件时,在读取到加密照片文件的最后18个字节是“Windtalker”开头时,判定该文件是加密照片文件。而XXXXXXXX是固定为8位长度的十六进制数字串,表示加密数据块的长度。
安全拍照模式提供漂浮在屏幕上的悬浮窗,上有两个按钮;其中一个按钮是开关,用于快速打开/关闭“安全拍照模式”;另一个按钮点击后出现输入密码对话框,便于用户快速输入加密密码,所述加密密码输入后,在“安全拍照模式”关闭前,该加密密码可以一直有效。
如图3所示,本发明实施例提供了一种查看图片的方法,该方法包括:
S301,解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;
S302,读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
其中,所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置;
其中,所述指示图片还可以显示所述拍摄的照片的说明信息;其中,所 述说明信息可以包括:系统为所述拍摄的照片生成的文件名信息;比如,指示图片上显示如下信息:IMG_20141205124530.jpg;
可选地,所述第一图片文件的存储格式可以为EXIF格式;
其中,所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置;
其中,所述第二指示信息为固定长度的字符串,包含用于表示加密处理的指示符和加密数据块的长度信息,所述指示符位于所述字符串的固定位置上;
其中,所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置;
其中,所述第三指示信息为固定长度的字符串,包含用于表示加密处理的指示符和加密数据块的长度信息,所述指示符位于所述字符串的固定位置上;
其中,所述读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片,包括:
读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片;
提示用户输入密码后,在未接收到解密密码或解密密码错误时,还包括:
如已经解析第一图片文件并获得指示图片,则显示所述指示图片;
如还未解析第一图片文件,则对所述第一图片文件进行解析,在获得所述指示图片后,对所述指示图片进行显示;
如图4所示,本发明实施例提供了一种拍摄照片的系统,包括:
检测模块401,设置为检测安全拍照模式是否处于开启状态;以及
安全拍照模块402,设置为在安全拍照模式处于开启状态时,对拍摄的照片进行加密处理并保存,包括:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存。
其中,所述安全拍照模块402,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
其中,所述安全拍照模块402,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
其中,所述安全拍照模块402,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并 保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
其中,所述安全拍照模块402,是设置为采用以下方式对拍摄的照片进行加密,生成加密数据块:
在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块。
如图5所示,本发明实施例提供了一种查看图片的系统,包括:
解析模块501,设置为解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;以及
解密模块502,用于读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
其中,所述解析模块501,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
其中,所述解析模块501,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置。
其中,所述解析模块501,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
其中,所述解密模块502,是设置为采用以下方式读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片:
读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片。
如图6所示,本发明实施例提供了一种终端,包括:
存储器601,用于存储指令;以及
处理器602,其与所述存储器耦合,所述处理器配置为执行存储在所述存储器中的指令,其中,所述处理器被配置为用于检测安全拍照模式是否处于开启状态,在安全拍照模式处于开启状态时,对拍摄的照片进行加密处理并保存,包括:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存。
其中,所述处理器602,其被配置为用于将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
其中,所述处理器602,其被配置为用于将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
其中,所述处理器602,其被配置为用于将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
其中,所述处理器602,其被配置为用于对拍摄的照片进行加密,生成加密数据块,包括:
在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块。
如图7所示,本发明实施例还提供了一种终端,包括:
存储器701,用于存储指令;以及
处理器702,其与所述存储器耦合,所述处理器配置为执行存储在所述存储器中的指令,其中,所述处理器被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
其中,所述处理器702,其被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
其中,所述处理器702,其被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置。
其中,所述处理器702,其被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包 含的加密数据块的长度信息确定所述加密数据块的结束位置。
其中,所述处理器702,其被配置为用于读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片,包括:
读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,上述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本发明实施例不限制于任何特定形式的硬件和软件的结合。
工业实用性
本发明实施例提供的技术方案,终端在安全拍照模式下拍摄的照片能够加密保存,使用本发明实施例提供的图片查看方法查看所述加密照片时如果解密成功,则能够看到加密照片的真实内容,否则仅能看到示意图像而看不到加密照片的真实内容,从而保护用户的照片隐私。

Claims (31)

  1. 一种拍摄照片的方法,包括:
    检测安全拍照模式是否处于开启状态;以及
    在安全拍照模式处于开启状态时,对拍摄的照片进行加密处理并保存,包括:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存。
  2. 如权利要求1所述的方法,其中:
    所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
    生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
    其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
  3. 如权利要求1所述的方法,其中:
    所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
    生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
    其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
  4. 如权利要求1所述的方法,其中:
    所述将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
    生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
    其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
  5. 如权利要求1所述的方法,其中:
    所述对拍摄的照片进行加密,生成加密数据块,包括:
    在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块。
  6. 一种查看图片的方法,包括:
    解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;以及
    读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
    其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
  7. 如权利要求6所述的方法,其中:
    所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
    从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密 数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
  8. 如权利要求6所述的方法,其中:
    所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
    从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置。
  9. 如权利要求6所述的方法,其中:
    所述解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
    从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
  10. 如权利要求6所述的方法,其中:
    所述读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片,包括:
    读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片。
  11. 一种拍摄照片的系统,包括:
    检测模块,设置为检测安全拍照模式是否处于开启状态;以及
    安全拍照模块,设置为在安全拍照模式处于开启状态时,对拍摄的照片 进行加密处理并保存,包括:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存。
  12. 如权利要求11所述的系统,其中:
    所述安全拍照模块,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
    生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
    其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
  13. 如权利要求11所述的系统,其中:
    所述安全拍照模块,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
    生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
    其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
  14. 如权利要求11所述的系统,其中:
    所述安全拍照模块,是设置为采用以下方式将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存:
    生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
    其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块 的长度信息和用于表示加密照片的指示符。
  15. 如权利要求11所述的系统,其中:
    所述安全拍照模块,是设置为采用以下方式对拍摄的照片进行加密,生成加密数据块:
    在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块。
  16. 一种查看图片的系统,包括:
    解析模块,设置为解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;以及
    解密模块,设置为读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
    其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
  17. 如权利要求16所述的系统,其中:
    所述解析模块,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
    从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
  18. 如权利要求16所述的系统,其中:
    所述解析模块,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
    从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置。
  19. 如权利要求16所述的系统,其中:
    所述解析模块,是设置为采用以下方式解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置:
    从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
  20. 如权利要求16所述的系统,其中:
    所述解密模块,是设置为采用以下方式读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片:
    读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片。
  21. 一种终端,包括:
    存储器,用于存储指令;以及
    处理器,其与所述存储器耦合,所述处理器配置为执行存储在所述存储器中的指令,其中,所述处理器被配置为用于检测安全拍照模式是否处于开启状态,在安全拍照模式处于开启状态时,对拍摄的照片进行加密处理并保存,包括:生成第一图片文件,所述第一图片文件包含用于指示加密照片的指示图片;对拍摄的照片进行加密,生成加密数据块;将所述第一图片文件 与所述加密数据块进行拼接,生成加密照片文件并保存。
  22. 如权利要求21所述的终端,其中:
    所述处理器,其被配置为用于将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
    生成包含第一图片文件和加密数据块的加密照片文件并保存,在所述加密照片文件中,所述第一图片文件的文件头信息中携带第一指示信息,所述加密数据块拼接在所述第一图片文件的文件结束符之后;
    其中,所述第一指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
  23. 如权利要求21所述的终端,其中:
    所述处理器,其被配置为用于将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
    生成包含第一图片文件、加密数据块和第二指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第二指示信息添加在所述加密数据块之后;
    其中,所述第二指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
  24. 如权利要求21所述的终端,其中:
    所述处理器,其被配置为用于将所述第一图片文件与所述加密数据块进行拼接,生成加密照片文件并保存,包括:
    生成包含第一图片文件、加密数据块和第三指示信息的加密照片文件并保存,在所述加密照片文件中,所述加密数据块拼接在所述第一图片文件的文件结束符之后,所述第三指示信息添加在所述第一图片文件的文件结束符与所述加密数据块之间;
    其中,所述第三指示信息用于指示加密照片,其中包含所述加密数据块的长度信息和用于表示加密照片的指示符。
  25. 如权利要求21所述的终端,其中:
    所述处理器,其被配置为用于对拍摄的照片进行加密,生成加密数据块,包括:
    在用户设置了安全拍照模式下的加密密码时,利用所述加密密码对拍摄的照片进行加密,生成加密数据块;在用户未设置安全拍照模式下的加密密码时,提示用户设置加密密码,在获取到用户设置的加密密码后,利用所述加密密码对拍摄的照片进行加密,生成加密数据块。
  26. 一种终端,包括:
    存储器,用于存储指令;以及
    处理器,其与所述存储器耦合,所述处理器配置为执行存储在所述存储器中的指令,其中,所述处理器被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置;读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片;
    其中,携带有所述指示信息的图片文件由第一图片文件和加密数据块拼接而成,所述第一图片文件包含指示图片,所述加密数据块是对原始照片进行加密后获得的数据块。
  27. 如权利要求26所述的终端,其中:
    所述处理器,其被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
    从所述图片文件的前部解析出第一图片文件,在确定所述第一图片文件的文件头信息中携带有用于指示加密照片的第一指示信息后,确定所述加密数据块位于所述第一图片文件的文件结束符之后,根据所述第一指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
  28. 如权利要求26所述的终端,其中:
    所述处理器,其被配置为用于解析图片文件,在确定所述图片文件中携 带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
    从所述图片文件的尾部尝试提取用于指示加密照片的第二指示信息,如提取到,则确定所述加密数据块位于所述第二指示信息之前,根据所述第二指示信息中包含的加密数据块的长度信息确定所述加密数据块的起始位置。
  29. 如权利要求26所述的终端,其中:
    所述处理器,其被配置为用于解析图片文件,在确定所述图片文件中携带有用于指示加密照片的指示信息时,根据所述指示信息确定所述图片文件中包含的加密数据块的位置,包括:
    从所述图片文件的前部解析出第一图片文件,从所述第一图片文件的文件结束符后面尝试提取用于指示加密照片的第三指示信息,如提取到,则确定所述加密数据块位于所述第三指示信息之后,根据所述第三指示信息中包含的加密数据块的长度信息确定所述加密数据块的结束位置。
  30. 如权利要求26所述的终端,其中:
    所述处理器,其被配置为用于读取所述加密数据块并进行解密,在解密成功后,获得原始照片的数据,显示所述原始照片,包括:
    读取所述加密数据块,提示用户输入解密密码,在接收到用户输入的解密密码后,根据所述解密密码对所述加密数据块进行解密,如解密成功,则获得加密前的原始照片数据,显示所述原始照片。
  31. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求1-10任一项所述的方法。
PCT/CN2015/087534 2015-01-20 2015-08-19 一种拍摄照片的方法、查看图片的方法、系统和终端 WO2016115888A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510029022.5 2015-01-20
CN201510029022.5A CN104680078B (zh) 2015-01-20 2015-01-20 一种拍摄照片的方法、查看图片的方法、系统和终端

Publications (1)

Publication Number Publication Date
WO2016115888A1 true WO2016115888A1 (zh) 2016-07-28

Family

ID=53315105

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/087534 WO2016115888A1 (zh) 2015-01-20 2015-08-19 一种拍摄照片的方法、查看图片的方法、系统和终端

Country Status (2)

Country Link
CN (1) CN104680078B (zh)
WO (1) WO2016115888A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680077B (zh) * 2015-01-20 2021-10-12 中兴通讯股份有限公司 一种加密图片的方法、查看图片的方法、系统和终端
CN104680078B (zh) * 2015-01-20 2021-09-03 中兴通讯股份有限公司 一种拍摄照片的方法、查看图片的方法、系统和终端
CN105069364B (zh) * 2015-06-30 2017-11-17 广东欧珀移动通信有限公司 一种图片展示方法及移动终端
CN106445324A (zh) * 2016-08-29 2017-02-22 珠海市魅族科技有限公司 一种照片发送方法及装置
CN106650469B (zh) * 2016-10-12 2021-05-18 宇龙计算机通信科技(深圳)有限公司 一种照片处理方法以及终端设备
CN106326762A (zh) * 2016-10-17 2017-01-11 广东七洲科技股份有限公司 一种移动终端即拍即加密的数据保护方法
CN107145794B (zh) * 2017-04-20 2021-01-12 北京安云世纪科技有限公司 一种数据处理方法和装置及移动终端
CN108804932A (zh) * 2018-05-29 2018-11-13 北京珠穆朗玛移动通信有限公司 图片存储方法、移动终端及存储介质
CN110061835B (zh) * 2019-03-28 2021-11-12 东南大学 一种安全拍摄设备及其实现方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101359989A (zh) * 2008-09-03 2009-02-04 深圳华为通信技术有限公司 生成安全数字照片的方法、装置及移动通信终端
CN101562681A (zh) * 2009-05-26 2009-10-21 西南交通大学 基于状态参数的含水印数字照片的生成方法
US20120218275A1 (en) * 2009-12-23 2012-08-30 Zte Corporation Apparatus and Method for Processing Extension Information in Image Files
CN104135605A (zh) * 2013-06-21 2014-11-05 腾讯科技(深圳)有限公司 拍照方法及装置
CN104680078A (zh) * 2015-01-20 2015-06-03 中兴通讯股份有限公司 一种拍摄照片的方法、查看图片的方法、系统和终端

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6839844B1 (en) * 2000-01-03 2005-01-04 Hirokazu Okano Image encryption method and device
US6993196B2 (en) * 2002-03-18 2006-01-31 Eastman Kodak Company Digital image storage method
US20050185047A1 (en) * 2004-02-19 2005-08-25 Hii Desmond Toh O. Method and apparatus for providing a combined image
CN101459807A (zh) * 2007-12-12 2009-06-17 佛山普立华科技有限公司 图片加密/解密系统及方法
CN103400064B (zh) * 2013-08-20 2016-08-24 北京网秦天下科技有限公司 用于文件加密和解密的方法和设备
CN103942469A (zh) * 2014-04-14 2014-07-23 小米科技有限责任公司 图片处理方法、装置及终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101359989A (zh) * 2008-09-03 2009-02-04 深圳华为通信技术有限公司 生成安全数字照片的方法、装置及移动通信终端
CN101562681A (zh) * 2009-05-26 2009-10-21 西南交通大学 基于状态参数的含水印数字照片的生成方法
US20120218275A1 (en) * 2009-12-23 2012-08-30 Zte Corporation Apparatus and Method for Processing Extension Information in Image Files
CN104135605A (zh) * 2013-06-21 2014-11-05 腾讯科技(深圳)有限公司 拍照方法及装置
CN104680078A (zh) * 2015-01-20 2015-06-03 中兴通讯股份有限公司 一种拍摄照片的方法、查看图片的方法、系统和终端

Also Published As

Publication number Publication date
CN104680078A (zh) 2015-06-03
CN104680078B (zh) 2021-09-03

Similar Documents

Publication Publication Date Title
WO2016115888A1 (zh) 一种拍摄照片的方法、查看图片的方法、系统和终端
WO2016115887A1 (zh) 一种伪装图片的方法、查看图片的方法、系统和终端
US9817954B2 (en) Multi-mode protected content wrapper
CN104680077B (zh) 一种加密图片的方法、查看图片的方法、系统和终端
US8571212B2 (en) Image encrypting device, image decrypting device and method
JP4931924B2 (ja) メディアデータ処理装置及びメディアデータ処理方法
US8230216B2 (en) Information processing apparatus, control method therefor, information processing system, and program
US20070172256A1 (en) Information processing method, falsification verification method and device, storage medium, and program
US9479678B1 (en) Method and device for image processing, and storage medium
WO2019205366A1 (zh) 一种图片管理方法、装置、计算机设备及存储介质
CN105678114B (zh) 一种照片的预览方法及装置
WO2015058658A1 (zh) 文本加密交互方法、加密方法及装置、解密方法及装置
JP6277868B2 (ja) ドキュメント管理システム、ドキュメント再現装置、ドキュメント管理方法、およびコンピュータプログラム
CN110008718A (zh) 一种图像处理方法及终端
CN109255249B (zh) 图像生成方法、装置,图像显示方法、装置和存储介质
US20090268056A1 (en) Digital camera with portrait image protecting function and portrait image protecting method thereof
JP5563361B2 (ja) 撮像装置、画像保存方法およびプログラム
WO2016188079A1 (zh) 终端设备的数据存储方法及终端设备
JP6428152B2 (ja) 肖像権保護プログラム、情報通信装置及び肖像権保護方法
JP2006345450A (ja) 画像検証システム、撮像装置、並びに画像検証装置
CN110544199A (zh) 一种图像处理方法、装置、存储介质和电子设备
CN114006721B (zh) 电子邮件的风险检测方法及系统
KR20160071777A (ko) 디지털 증거물 데이터 획득시 무결성을 보장하는 포렌식 시스템 및 그 방법
CN113572994A (zh) 摄像头、数据保护方法、视频监控方法及存储介质
CN113268775A (zh) 照片处理方法、装置、系统及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15878557

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15878557

Country of ref document: EP

Kind code of ref document: A1