[go: up one dir, main page]

CN105357415B - Image ciphering, the method and device of decryption - Google Patents

Image ciphering, the method and device of decryption Download PDF

Info

Publication number
CN105357415B
CN105357415B CN201510757987.6A CN201510757987A CN105357415B CN 105357415 B CN105357415 B CN 105357415B CN 201510757987 A CN201510757987 A CN 201510757987A CN 105357415 B CN105357415 B CN 105357415B
Authority
CN
China
Prior art keywords
picture
byte stream
byte
original image
decrypted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510757987.6A
Other languages
Chinese (zh)
Other versions
CN105357415A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510757987.6A priority Critical patent/CN105357415B/en
Publication of CN105357415A publication Critical patent/CN105357415A/en
Application granted granted Critical
Publication of CN105357415B publication Critical patent/CN105357415B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Facsimile Transmission Control (AREA)

Abstract

本发明提供了一种图片加密、解密的方法及装置。该图片加密的方法包括:获取原始图片以及用于对所述原始图片进行加密处理的加密图片;分别将所述原始图片和所述加密图片转换成字节流;根据图片的字节格式合并所述原始图片和所述加密图片的字节流,得到目标图片的字节流,并生成所述目标图片。本发明实施例是通过对字节流的合并处理,生成目标图片,使得目标图片的图片格式不会发生变化,相当于基于原始图片格式,对其图片信息量进行了调整,不会影响图片的传输或存储,同时图片信息量的调整提高了图片的安全性。

The invention provides a method and device for encrypting and decrypting pictures. The method for encrypting pictures includes: obtaining an original picture and an encrypted picture for encrypting the original picture; converting the original picture and the encrypted picture into byte streams respectively; merging all the pictures according to the byte format of the pictures The byte stream of the original picture and the encrypted picture is obtained to obtain the byte stream of the target picture, and the target picture is generated. In the embodiment of the present invention, the target picture is generated by merging byte streams, so that the picture format of the target picture will not change, which is equivalent to adjusting the amount of picture information based on the original picture format without affecting the picture quality. Transmission or storage, while the adjustment of the image information improves the security of the image.

Description

图片加密、解密的方法及装置Method and device for image encryption and decryption

技术领域technical field

本发明涉及互联网应用技术领域,特别涉及一种图片加密、解密的方法及装置。The invention relates to the technical field of Internet applications, in particular to a method and device for encrypting and decrypting pictures.

背景技术Background technique

随着云盘(或网盘)等产品的普及,当前大多数用户会将手机或数码相机拍摄的照片存放到云盘上,又或者直接存放到手机厂家自带的云相册上(如xx云相册、xxx云相册等)。With the popularization of products such as cloud disks (or network disks), most users currently store photos taken by mobile phones or digital cameras on cloud disks, or directly on cloud albums provided by mobile phone manufacturers (such as xx cloud album, xxx cloud album, etc.).

上传到云盘或者云相册上的照片仅仅是丢失的可能性减小了,而安全性能方面并没有太大提升,这是因为云盘或者云相册备份的照片都是未进行任何加密处理的明文照片,管理云相册的工作人员完全可以对其一览无余。另外,如果受到黑客攻击,照片内容会被黑客读取。因此,对于涉及到隐私的照片,安全意识较强的用户会存放于本地隐藏文件夹内或者使用隐私空间(如,360隐私空间等)进行加密。The photos uploaded to the cloud disk or cloud album are only less likely to be lost, but the security performance has not been greatly improved, because the photos backed up by the cloud disk or cloud album are plaintext without any encryption Photos, the staff who manage the cloud album can completely see it. In addition, if hacked, the content of the photo will be read by the hacker. Therefore, for photos related to privacy, users with strong security awareness will store them in a local hidden folder or use a private space (eg, 360 private space, etc.) to encrypt them.

然而,将照片存放在本地隐藏文件夹是容易丢失的,当终端设备丢失或者系统崩溃无法开机需要重装系统的时候,数据会很难找回。如果使用隐私控件类软件的话,用户完全不知道自己的照片当前存放的格式和位置,很可能被其它清理软件当作垃圾删除,也会造成数据的丢失。因此,如何在防丢失的同时增加照片的安全性成为亟待解决的技术问题。However, storing photos in a local hidden folder is easy to lose. When the terminal device is lost or the system crashes and cannot be turned on, and the system needs to be reinstalled, the data will be difficult to retrieve. If you use privacy control software, users will not know the format and location of their photos at all, and it is likely to be deleted as garbage by other cleaning software, which will also cause data loss. Therefore, how to increase the security of photos while preventing loss has become a technical problem to be solved urgently.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的图片加密、解密的方法及相应的装置。In view of the above problems, the present invention is proposed to provide a method for encrypting and decrypting pictures and a corresponding device that overcomes the above problems or at least partially solves the above problems.

依据本发明的一方面,提供了一种图片加密的方法,包括:According to one aspect of the present invention, a method for encrypting pictures is provided, including:

获取原始图片以及用于对所述原始图片进行加密处理的加密图片;Obtaining an original picture and an encrypted picture used for encrypting the original picture;

分别将所述原始图片和所述加密图片转换成字节流;respectively converting the original picture and the encrypted picture into byte streams;

根据图片的字节格式合并所述原始图片和所述加密图片的字节流,得到目标图片的字节流,并生成所述目标图片。Merge the byte stream of the original picture and the encrypted picture according to the byte format of the picture to obtain the byte stream of the target picture, and generate the target picture.

可选地,所述根据图片的字节格式合并所述原始图片和所述加密图片的字节流,包括:Optionally, the merging the byte stream of the original picture and the encrypted picture according to the byte format of the picture includes:

分别以所述原始图片和所述加密图片的字节流中的开始标记或结束标记作为合并节点,对所述原始图片和所述加密图片的字节流进行合并处理。Merge the original picture and the byte stream of the encrypted picture by using the start marker or the end marker in the byte stream of the original picture and the encrypted picture as a merge node respectively.

可选地,分别以所述原始图片和所述加密图片的字节流中的开始标记或结束标记作为合并节点,对所述原始图片和所述加密图片的字节流进行合并处理,包括:Optionally, using the start tag or the end tag in the byte stream of the original picture and the encrypted picture as a merging node to merge the original picture and the byte stream of the encrypted picture, including:

确定以所述加密图片的字节流中的结束标记作为合并节点;Determine to use the end marker in the byte stream of the encrypted picture as the merge node;

获取所述原始图片的字节流中的开始标记;Obtain the start tag in the byte stream of the original picture;

将所述原始图片的开始标记设置于确定的所述合并节点之后,并顺序添加所述原始图片的字节流。Setting the start marker of the original picture after the determined merging node, and sequentially adding the byte stream of the original picture.

可选地,分别以所述原始图片和所述加密图片的字节流中的开始标记或结束标记作为合并节点,对所述原始图片和所述加密图片的字节流进行合并处理,包括:Optionally, using the start tag or the end tag in the byte stream of the original picture and the encrypted picture as a merging node to merge the original picture and the byte stream of the encrypted picture, including:

确定以所述原始图片的字节流中的开始标记作为合并节点;Determining that the start tag in the byte stream of the original picture is used as the merging node;

获取所述加密图片的字节流中的结束标记;Obtain the end marker in the byte stream of the encrypted picture;

将所述加密图片的结束标记设置于确定的所述合并节点之前,并逆序添加所述加密图片的字节流。Setting the end marker of the encrypted picture before the determined merging node, and adding the byte stream of the encrypted picture in reverse order.

可选地,在将所述加密图片转换成字节流之前,还包括:Optionally, before converting the encrypted picture into a byte stream, it also includes:

对所述加密图片进行模糊化处理,以增加所述加密图片的滤像功能。Perform blurring processing on the encrypted picture to increase the image filtering function of the encrypted picture.

可选地,所述获取原始图片,包括:从终端的相册中获取即将上传至云相册的原始图片;Optionally, the acquiring the original picture includes: acquiring the original picture to be uploaded to the cloud album from the terminal's album;

在生成所述目标图片之后,所述方法还包括:将所述目标图片上传至所述云相册。After generating the target picture, the method further includes: uploading the target picture to the cloud album.

可选地,各字节流以字节数组的形式存在。Optionally, each byte stream exists in the form of a byte array.

依据本发明的另一方面,提供了一种图片解密的方法,包括:According to another aspect of the present invention, a method for decrypting a picture is provided, including:

获取待解密图片,并将所述待解密图片转换为字节流,其中,所述待解密图片的字节流是根据图片的字节格式,合并原始图片和用于对所述原始图片进行加密处理的加密图片的字节流得到的;Obtaining the picture to be decrypted, and converting the picture to be decrypted into a byte stream, wherein the byte stream of the picture to be decrypted is based on the byte format of the picture, merging the original picture and encrypting the original picture The byte stream of the processed encrypted image is obtained;

根据所述图片的字节格式,从所述待解密图片的字节流中提取所述原始图片的字节流,并生成所述原始图片。According to the byte format of the picture, extract the byte stream of the original picture from the byte stream of the picture to be decrypted, and generate the original picture.

可选地,根据所述图片的字节格式,从所述待解密图片的字节流中提取所述原始图片的字节流,包括:Optionally, according to the byte format of the picture, extracting the byte stream of the original picture from the byte stream of the picture to be decrypted includes:

以所述待解密图片的字节流中的开始标记或结束标记作为提取点,从所述待解密图片的字节流中提取所述原始图片的字节流。The byte stream of the original picture is extracted from the byte stream of the picture to be decrypted by using the start mark or the end mark in the byte stream of the picture to be decrypted as an extraction point.

可选地,以所述待解密图片的字节流中的开始标记作为提取点,从所述待解密图片的字节流中提取所述原始图片的字节流,包括:Optionally, using the start marker in the byte stream of the picture to be decrypted as an extraction point, extracting the byte stream of the original picture from the byte stream of the picture to be decrypted includes:

在读取所述待解密图片的字节流的过程中,记录所述待解密图片的字节流中的开始标记的出现情况;In the process of reading the byte stream of the picture to be decrypted, recording the appearance of the start marker in the byte stream of the picture to be decrypted;

确定第一指定数量个开始标记作为提取点,将包含该提取点以及该提取点之后的字节流作为所述原始图片的字节流。Determining the first specified number of start markers as the extraction point, and using the byte stream including the extraction point and after the extraction point as the byte stream of the original picture.

可选地,以所述待解密图片的字节流中的结束标记作为提取点,从所述待解密图片的字节流中提取所述原始图片的字节流,包括:Optionally, using the end marker in the byte stream of the picture to be decrypted as an extraction point, extracting the byte stream of the original picture from the byte stream of the picture to be decrypted includes:

在读取所述待解密图片的字节流的过程中,记录所述待解密图片的字节流中的结束标记的出现情况;During the process of reading the byte stream of the picture to be decrypted, recording the occurrence of the end marker in the byte stream of the picture to be decrypted;

确定第二指定数量个结束标记作为提取点,将该提取点之后的字节流作为所述原始图片的字节流。Determining the second specified number of end markers as extraction points, and using the byte stream after the extraction point as the byte stream of the original picture.

依据本发明的又一方面,还提供了一种图片加密的装置,包括:According to yet another aspect of the present invention, a device for encrypting pictures is also provided, including:

第一获取模块,适于获取原始图片以及用于对所述原始图片进行加密处理的加密图片;The first obtaining module is adapted to obtain an original picture and an encrypted picture used for encrypting the original picture;

第一转换模块,适于分别将所述原始图片和所述加密图片转换成字节流;a first conversion module adapted to convert the original picture and the encrypted picture into byte streams;

加密模块,适于根据图片的字节格式合并所述原始图片和所述加密图片的字节流,得到目标图片的字节流,并生成所述目标图片。The encryption module is adapted to combine the byte stream of the original picture and the encrypted picture according to the byte format of the picture to obtain the byte stream of the target picture, and generate the target picture.

可选地,所述加密模块还适于:Optionally, the encryption module is also suitable for:

分别以所述原始图片和所述加密图片的字节流中的开始标记或结束标记作为合并节点,对所述原始图片和所述加密图片的字节流进行合并处理。Merge the original picture and the byte stream of the encrypted picture by using the start marker or the end marker in the byte stream of the original picture and the encrypted picture as a merge node respectively.

可选地,所述加密模块还适于:Optionally, the encryption module is also suitable for:

确定以所述加密图片的字节流中的结束标记作为合并节点;Determine to use the end marker in the byte stream of the encrypted picture as the merge node;

获取所述原始图片的字节流中的开始标记;Obtain the start tag in the byte stream of the original picture;

将所述原始图片的开始标记设置于确定的所述合并节点之后,并顺序添加所述原始图片的字节流。Setting the start marker of the original picture after the determined merging node, and sequentially adding the byte stream of the original picture.

可选地,所述加密模块还适于:Optionally, the encryption module is also suitable for:

确定以所述原始图片的字节流中的开始标记作为合并节点;Determining that the start tag in the byte stream of the original picture is used as the merging node;

获取所述加密图片的字节流中的结束标记;Obtain the end marker in the byte stream of the encrypted picture;

将所述加密图片的结束标记设置于确定的所述合并节点之前,并逆序添加所述加密图片的字节流。Setting the end marker of the encrypted picture before the determined merging node, and adding the byte stream of the encrypted picture in reverse order.

可选地,所述装置还包括:Optionally, the device also includes:

处理模块,适于在所述第一转换模块将所述加密图片转换成字节流之前,对所述加密图片进行模糊化处理,以增加所述加密图片的滤像功能。The processing module is adapted to perform obfuscation processing on the encrypted picture before the first conversion module converts the encrypted picture into a byte stream, so as to increase the image filtering function of the encrypted picture.

可选地,所述第一获取模块还适于:从终端的相册中获取即将上传至云相册的原始图片;Optionally, the first acquiring module is further adapted to: acquire the original picture to be uploaded to the cloud album from the album of the terminal;

所述装置还包括上传模块,适于在所述加密模块生成所述目标图片之后,将所述目标图片上传至所述云相册。The device also includes an upload module adapted to upload the target picture to the cloud album after the encryption module generates the target picture.

可选地,各字节流以字节数组的形式存在。Optionally, each byte stream exists in the form of a byte array.

依据本发明的又一方面,还提供了一种图片解密的装置,包括:According to yet another aspect of the present invention, a device for decrypting pictures is also provided, including:

第二获取模块,适于获取待解密图片;The second obtaining module is suitable for obtaining the picture to be decrypted;

第二转换模块,适于将所述待解密图片转换为字节流,其中,所述待解密图片的字节流是根据图片的字节格式,合并原始图片和用于对所述原始图片进行加密处理的加密图片的字节流得到的;The second conversion module is adapted to convert the picture to be decrypted into a byte stream, wherein the byte stream of the picture to be decrypted is based on the byte format of the picture, merging the original picture and used to process the original picture Obtained from the byte stream of the encrypted image processed by encryption;

解密模块,适于根据所述图片的字节格式,从所述待解密图片的字节流中提取所述原始图片的字节流,并生成所述原始图片。The decryption module is adapted to extract the byte stream of the original picture from the byte stream of the picture to be decrypted according to the byte format of the picture, and generate the original picture.

可选地,所述解密模块还适于:Optionally, the decryption module is also suitable for:

以所述待解密图片的字节流中的开始标记或结束标记作为提取点,从所述待解密图片的字节流中提取所述原始图片的字节流。The byte stream of the original picture is extracted from the byte stream of the picture to be decrypted by using the start mark or the end mark in the byte stream of the picture to be decrypted as an extraction point.

可选地,所述解密模块还适于:Optionally, the decryption module is also suitable for:

在读取所述待解密图片的字节流的过程中,记录所述待解密图片的字节流中的开始标记的出现情况;In the process of reading the byte stream of the picture to be decrypted, recording the appearance of the start marker in the byte stream of the picture to be decrypted;

确定第一指定数量个开始标记作为提取点,将包含该提取点以及该提取点之后的字节流作为所述原始图片的字节流。Determining the first specified number of start markers as the extraction point, and using the byte stream including the extraction point and after the extraction point as the byte stream of the original picture.

可选地,所述解密模块还适于:Optionally, the decryption module is also suitable for:

在读取所述待解密图片的字节流的过程中,记录所述待解密图片的字节流中的结束标记的出现情况;During the process of reading the byte stream of the picture to be decrypted, recording the occurrence of the end marker in the byte stream of the picture to be decrypted;

确定第二指定数量个结束标记作为提取点,将该提取点之后的字节流作为所述原始图片的字节流。Determining the second specified number of end markers as extraction points, and using the byte stream after the extraction point as the byte stream of the original picture.

本发明实施例提供了一种图片加密的新思路,即,获取原始图片以及用于对原始图片进行加密处理的加密图片,随后分别将原始图片和加密图片转换成字节流,进而根据图片的字节格式合并原始图片和加密图片的字节流,得到目标图片的字节流,并生成目标图片。本发明实施例是通过对字节流的合并处理,生成目标图片,使得目标图片的图片格式不会发生变化,相当于基于原始图片格式,对其图片信息量进行了调整,不会影响图片的传输或存储,同时图片信息量的调整提高了图片的安全性。The embodiment of the present invention provides a new idea of picture encryption, that is, the original picture and the encrypted picture used to encrypt the original picture are obtained, and then the original picture and the encrypted picture are respectively converted into byte streams, and then according to the The byte format combines the byte stream of the original picture and the encrypted picture to obtain the byte stream of the target picture, and generates the target picture. In the embodiment of the present invention, the target picture is generated by merging byte streams, so that the picture format of the target picture will not change, which is equivalent to adjusting the amount of picture information based on the original picture format, without affecting the picture quality. Transmission or storage, while the adjustment of the image information improves the security of the image.

进一步,对于加密后的目标图片,本发明实施例提供了对其进行解密方法,能够快速、准确地从目标图片中提取出原始图片。即,获取待解密图片(加密后的目标图片),并将待解密图片转换为字节流,随后根据图片的字节格式,从待解密图片的字节流中提取原始图片的字节流,并生成原始图片。Further, for the encrypted target picture, the embodiment of the present invention provides a method for decrypting it, which can quickly and accurately extract the original picture from the target picture. That is, obtain the picture to be decrypted (encrypted target picture), convert the picture to be decrypted into a byte stream, and then extract the byte stream of the original picture from the byte stream of the picture to be decrypted according to the byte format of the picture, and generate the original image.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

根据下文结合附图对本发明具体实施例的详细描述,本领域技术人员将会更加明了本发明的上述以及其他目的、优点和特征。Those skilled in the art will be more aware of the above and other objects, advantages and features of the present invention according to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1所示为jpeg格式的图片文件的二进制字节流示意图;Fig. 1 shows the schematic diagram of the binary byte stream of the image file in jpeg format;

图2所示为jpeg格式的图片文件的十六进制字节流示意图;Figure 2 shows a schematic diagram of a hexadecimal byte stream of a picture file in jpeg format;

图3示出了根据本发明一个实施例的图片加密的方法的流程图;Fig. 3 shows the flowchart of the method for picture encryption according to one embodiment of the present invention;

图4示出了根据本发明一个实施例的字节流合并处理的方法的流程图;FIG. 4 shows a flowchart of a method for merging byte streams according to an embodiment of the present invention;

图5示出了根据本发明一个实施例的字节流合并处理后的效果图;FIG. 5 shows an effect diagram after byte stream merging processing according to an embodiment of the present invention;

图6示出了根据本发明另一个实施例的字节流合并处理的方法的流程图;FIG. 6 shows a flowchart of a method for merging byte streams according to another embodiment of the present invention;

图7示出了根据本发明一个实施例的生成的目标图片的效果图;FIG. 7 shows an effect diagram of a generated target picture according to an embodiment of the present invention;

图8示出了根据本发明又一个实施例的图片加密的方法的流程图;FIG. 8 shows a flowchart of a method for encrypting pictures according to yet another embodiment of the present invention;

图9示出了根据本发明一个实施例的加密前后的图片效果示意图;Fig. 9 shows a schematic diagram of picture effects before and after encryption according to an embodiment of the present invention;

图10示出了根据本发明一个实施例的图片解密的方法的流程图;FIG. 10 shows a flowchart of a method for decrypting a picture according to an embodiment of the present invention;

图11示出了根据本发明一个实施例的提取原始图片的字节流的方法的流程图;FIG. 11 shows a flowchart of a method for extracting byte streams of original pictures according to one embodiment of the present invention;

图12示出了根据本发明另一个实施例的提取原始图片的字节流的方法的流程图;Fig. 12 shows a flowchart of a method for extracting byte streams of original pictures according to another embodiment of the present invention;

图13示出了根据本发明的提取的原始图片的效果图;Fig. 13 shows the rendering of the original picture extracted according to the present invention;

图14示出了根据本发明一个实施例的图片加密的装置的结构示意图;Fig. 14 shows a schematic structural diagram of a device for encrypting pictures according to an embodiment of the present invention;

图15示出了根据本发明另一个实施例的图片加密的装置的结构示意图;以及Fig. 15 shows a schematic structural diagram of a device for encrypting pictures according to another embodiment of the present invention; and

图16示出了根据本发明一个实施例的图片解密的装置的结构示意图。Fig. 16 shows a schematic structural diagram of an apparatus for decrypting a picture according to an embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

图像或图片格式是计算机存储图片的格式,常见的存储格式有bmp(bitmap,位图)、jpg或jpeg(joint photographic expert group,联合照片专家组)、tiff(tag imagefile format,标签图像文件格式)、gif(graphics interchange format,图形交换格式)等。举例来说,bmp图像格式,它是一种与硬件设备无关的图像文件格式,使用非常广。它采用位映射存储格式,除了图像深度可选以外,不采用其他任何压缩,因此,bmp文件所占用的空间很大。bmp文件的图像深度可选lbit(比特)、4bit、8bit及24bit。bmp文件存储数据时,图像的扫描方式是按从左到右、从下到上的顺序。由于bmp文件格式是Windows(窗口)环境中交换与图有关的数据的一种标准,因此在Windows环境中运行的图形图像软件都支持bmp图像格式。典型的bmp图像文件由三部分组成:位图文件头数据结构,它包含bmp图像文件的类型、显示内容等信息;位图信息数据结构,它包含有bmp图像的宽、高、压缩方法;以及定义颜色等信息。The image or picture format is the format used by the computer to store pictures. Common storage formats include bmp (bitmap, bitmap), jpg or jpeg (joint photographic expert group, joint photo expert group), tiff (tag imagefile format, tag image file format) , gif (graphics interchange format, graphics interchange format), etc. For example, the bmp image format, which is an image file format independent of hardware devices, is widely used. It uses a bitmap storage format, and does not use any compression except for the optional image depth, so the bmp file takes up a lot of space. The image depth of the bmp file can be selected from lbit (bit), 4bit, 8bit and 24bit. When a bmp file stores data, the scanning method of the image is from left to right and from bottom to top. Since the bmp file format is a standard for exchanging graph-related data in the Windows (window) environment, all graphics and image software running in the Windows environment support the bmp image format. A typical bmp image file is composed of three parts: a bitmap file header data structure, which includes information such as the type and display content of the bmp image file; a bitmap information data structure, which includes the width, height, and compression method of the bmp image; and Define information such as colors.

jpeg图像格式,是最常用的图像文件格式,由一个软件开发联合会组织制定,是一种有损压缩格式,能够将图像压缩在很小的储存空间,图像中重复或不重要的资料会被丢失,因此容易造成图像数据的损伤。尤其是使用过高的压缩比例,将使最终解压缩后恢复的图像质量明显降低,如果追求高品质图像,不宜采用过高压缩比例。但是jpeg压缩技术十分先进,它用有损压缩方式去除冗余的图像数据,在获得极高的压缩率的同时能展现十分丰富生动的图像,换句话说,就是可以用最少的磁盘空间得到较好的图像品质。而且jpeg是一种很灵活的格式,具有调节图像质量的功能,允许用不同的压缩比例对文件进行压缩,支持多种压缩级别,压缩比率通常在10:1到40:1之间,压缩比越大,品质就越低;相反地,压缩比越小,品质就越好。比如可以把1.37Mb的bmp位图文件压缩至20.3KB。当然也可以在图像质量和文件尺寸之间找到平衡点。jpeg格式压缩的主要是高频信息,对色彩的信息保留较好,适合应用于互联网,可减少图像的传输时间,可以支持24bit真彩色,也普遍应用于需要连续色调的图像。The jpeg image format is the most commonly used image file format. It is formulated by a software development association. It is a lossy compression format that can compress images in a small storage space. Repeated or unimportant data in the image will be deleted. Lost, so it is easy to cause damage to image data. In particular, if the compression ratio is too high, the quality of the restored image after decompression will be significantly reduced. If you pursue high-quality images, you should not use an excessive compression ratio. However, jpeg compression technology is very advanced. It uses lossy compression to remove redundant image data, and can display very rich and vivid images while obtaining extremely high compression rates. Good image quality. Moreover, jpeg is a very flexible format, which has the function of adjusting image quality, allows files to be compressed with different compression ratios, supports multiple compression levels, and the compression ratio is usually between 10:1 and 40:1. The larger the value, the lower the quality; conversely, the smaller the compression ratio, the better the quality. For example, a 1.37Mb bmp bitmap file can be compressed to 20.3KB. Of course, you can also find a balance between image quality and file size. The jpeg format mainly compresses high-frequency information, and retains color information better. It is suitable for use on the Internet, can reduce image transmission time, can support 24bit true color, and is also widely used in images that require continuous tone.

图片文件可以转换成字节流的形式,如图1所示为jpeg格式的图片文件的二进制字节流示意图。在图1中,<start>为图片的开始标记,<end>为图片的结束标记。如图2所示为jpeg格式的图片文件的十六进制字节流示意图。在图2中,“FF D8”为图片的开始标记,“FF D9”为图片的结束标记。A picture file can be converted into a form of a byte stream, and FIG. 1 is a schematic diagram of a binary byte stream of a picture file in jpeg format. In Figure 1, <start> is the start tag of the picture, and <end> is the end tag of the picture. FIG. 2 is a schematic diagram of a hexadecimal byte stream of a picture file in jpeg format. In FIG. 2, "FF D8" is the start mark of the picture, and "FF D9" is the end mark of the picture.

申请人发现,在图片的结束标记后面添加任何内容都不会影响图片内容,因此,可以在图片的结束标记后面增加一句话,一个URL(Uniform Resource Locator,统一资源定位符)地址,甚至是一整张图片,等等。The applicant found that adding any content after the end tag of the picture will not affect the content of the picture. Therefore, a sentence, a URL (Uniform Resource Locator, Uniform Resource Locator) address, or even a URL can be added after the end tag of the picture. The whole picture, etc.

基于上述原理,本发明实施例提供了一种图片加密的方法,该方法可以应用在终端或服务器中。图3示出了根据本发明一个实施例的图片加密的方法的流程图。如图3所示,该方法至少包括以下步骤S302至步骤S306:Based on the above principles, an embodiment of the present invention provides a method for encrypting pictures, which can be applied in a terminal or a server. Fig. 3 shows a flowchart of a method for encrypting pictures according to an embodiment of the present invention. As shown in Figure 3, the method at least includes the following steps S302 to S306:

步骤S302,获取原始图片以及用于对原始图片进行加密处理的加密图片;Step S302, obtaining the original picture and the encrypted picture used for encrypting the original picture;

步骤S304,分别将原始图片和加密图片转换成字节流;Step S304, respectively converting the original picture and the encrypted picture into a byte stream;

步骤S306,根据图片的字节格式合并原始图片和加密图片的字节流,得到目标图片的字节流,并生成目标图片。Step S306: Merge the byte streams of the original picture and the encrypted picture according to the byte format of the picture to obtain the byte stream of the target picture, and generate the target picture.

本发明实施例提供了一种图片加密的新思路,即,获取原始图片以及用于对原始图片进行加密处理的加密图片,随后分别将原始图片和加密图片转换成字节流,进而根据图片的字节格式合并原始图片和加密图片的字节流,得到目标图片的字节流,并生成目标图片。本发明实施例是通过对字节流的合并处理,生成目标图片,使得目标图片的图片格式不会发生变化,相当于基于原始图片格式,对其图片信息量进行了调整,不会影响图片的传输或存储,同时图片信息量的调整提高了图片的安全性。The embodiment of the present invention provides a new idea of picture encryption, that is, the original picture and the encrypted picture used to encrypt the original picture are obtained, and then the original picture and the encrypted picture are respectively converted into byte streams, and then according to the The byte format combines the byte stream of the original picture and the encrypted picture to obtain the byte stream of the target picture, and generates the target picture. In the embodiment of the present invention, the target picture is generated by merging byte streams, so that the picture format of the target picture will not change, which is equivalent to adjusting the amount of picture information based on the original picture format, without affecting the picture quality. Transmission or storage, while the adjustment of the image information improves the security of the image.

在步骤S306中,根据图片的字节格式合并原始图片和加密图片的字节流,本发明实施例提供了一种可选的方案,在该方案中,可以分别以原始图片和加密图片的字节流中的开始标记或结束标记作为合并节点,对原始图片和加密图片的字节流进行合并处理。In step S306, the byte streams of the original picture and the encrypted picture are merged according to the byte format of the picture. This embodiment of the present invention provides an optional solution, in which the character streams of the original picture and the encrypted picture can be respectively The start tag or end tag in throttling is used as a merge node to merge the byte streams of the original picture and the encrypted picture.

图4示出了根据本发明一个实施例的字节流合并处理的方法的流程图。如图4所示,该方法至少包括以下步骤S402至步骤S406:Fig. 4 shows a flowchart of a method for merging byte streams according to an embodiment of the present invention. As shown in Figure 4, the method at least includes the following steps S402 to S406:

步骤S402,确定以加密图片的字节流中的结束标记作为合并节点;Step S402, determine to use the end marker in the byte stream of the encrypted picture as the merge node;

步骤S404,获取原始图片的字节流中的开始标记;Step S404, obtaining the start marker in the byte stream of the original picture;

步骤S406,将原始图片的开始标记设置于确定的合并节点之后,并顺序添加原始图片的字节流。Step S406, setting the start marker of the original picture after the determined merging node, and sequentially adding the byte stream of the original picture.

以jpeg格式的图片文件的二进制字节流为例,合并之后的效果图如图5所示。图5中,顺序第一对<start>和<end>之间的字节流为加密图片的字节流,第二对<start>和<end>之间的字节流为原始图片的字节流。Taking the binary byte stream of an image file in jpeg format as an example, the combined effect diagram is shown in Figure 5. In Figure 5, the byte stream between the first pair of <start> and <end> is the byte stream of the encrypted picture, and the byte stream between the second pair of <start> and <end> is the byte stream of the original picture throttling.

图6示出了根据本发明另一个实施例的字节流合并处理的方法的流程图。如图6所示,该方法至少包括以下步骤S602至步骤S606:Fig. 6 shows a flowchart of a method for merging byte streams according to another embodiment of the present invention. As shown in Figure 6, the method at least includes the following steps S602 to S606:

步骤S602,确定以原始图片的字节流中的开始标记作为合并节点;Step S602, determining to use the start marker in the byte stream of the original picture as the merge node;

步骤S604,获取加密图片的字节流中的结束标记;Step S604, obtaining the end marker in the byte stream of the encrypted picture;

步骤S606,将加密图片的结束标记设置于确定的合并节点之前,并逆序添加加密图片的字节流。Step S606, setting the end marker of the encrypted picture before the determined merging node, and adding the byte stream of the encrypted picture in reverse order.

根据图4或图6的方法得到的合并字节流,其生成的目标图片的效果图,如图7所示。图7中,将原始图片原封不动的藏到加密图片的第二层,第一层放置的是加密图片。According to the combined byte stream obtained by the method in FIG. 4 or FIG. 6 , an effect diagram of the target picture generated by it is shown in FIG. 7 . In Figure 7, the original picture is hidden in the second layer of the encrypted picture intact, and the encrypted picture is placed on the first layer.

为了获得进一步地有效保护,在将加密图片转换成字节流之前,本发明实施例还可以对加密图片进行模糊化处理,以增加加密图片的滤像功能。这里的模糊化处理可以采用高斯模糊、马赛克、分辨率降低等方式,本发明对此不做限制。特别地,高斯模糊技术是不可逆的,而且模糊后的图片可以有效的保护隐私内容,并且大致的轮廓可以让用户有一定的感知,这一点要比隐私空间类软件完全改变图片存放格式,对用户是完全不可见的处理方式做得人性化。In order to obtain further effective protection, before converting the encrypted picture into a byte stream, the embodiments of the present invention may further perform obfuscation processing on the encrypted picture, so as to increase the image filtering function of the encrypted picture. The blurring processing here may adopt methods such as Gaussian blurring, mosaicing, and resolution reduction, which are not limited in the present invention. In particular, the Gaussian blur technology is irreversible, and the blurred picture can effectively protect the privacy content, and the rough outline can make the user have a certain perception. It is completely invisible and humanized.

上文提及,因为云盘或者云相册备份的照片都是未进行任何加密处理的明文照片,管理云相册的工作人员完全可以对其一览无余。另外,如果受到黑客攻击,照片内容会被黑客读取。为解决这一问题,可以在拍照和上传云盘或云相册这两个步骤之间再加一个处理环节,即,图片(照片)加密。图8示出了根据本发明又一个实施例的图片加密的方法的流程图。如图8所示,该方法至少包括以下步骤S802至步骤S812。As mentioned above, because the photos backed up by the cloud disk or cloud album are plaintext photos without any encryption, the staff who manage the cloud album can completely see them. In addition, if hacked, the content of the photo will be read by the hacker. In order to solve this problem, another processing link can be added between the two steps of taking pictures and uploading to cloud disk or cloud album, that is, picture (photo) encryption. Fig. 8 shows a flowchart of a method for encrypting a picture according to yet another embodiment of the present invention. As shown in FIG. 8, the method at least includes the following steps S802 to S812.

步骤S802,从终端的相册中获取即将上传至云相册的原始图片。Step S802, obtaining the original picture to be uploaded to the cloud album from the album of the terminal.

在该步骤中,以终端为Android系统的手机为例,可以从相册中读取原始照片文件到内存,使用Android(安卓)自带的Bitmap类读取原始照片文件。In this step, taking a mobile phone with an Android system as an example, the original photo file can be read from the photo album to the internal memory, and the original photo file can be read using the Bitmap class that comes with Android (Android).

步骤S804,获取用于对原始图片进行加密处理的加密图片,并对加密图片进行模糊化处理,以增加加密图片的滤像功能。Step S804, obtaining an encrypted image for encrypting the original image, and performing blurring processing on the encrypted image, so as to increase the image filtering function of the encrypted image.

在该步骤中,模糊化处理可以采用高斯模糊、马赛克、分辨率降低等方式,本发明对此不做限制。In this step, Gaussian blurring, mosaicing, resolution reduction, etc. may be used for blurring, which is not limited in the present invention.

步骤S806,分别将原始图片和模糊化处理后的加密图片转换成字节流。Step S806, converting the original picture and the encrypted picture after blurring into byte streams respectively.

步骤S808,确定以加密图片的字节流中的结束标记作为合并节点。In step S808, it is determined to use the end marker in the byte stream of the encrypted picture as the merging node.

步骤S810,获取原始图片的字节流中的开始标记,并将原始图片的开始标记设置于确定的合并节点之后,并顺序添加原始图片的字节流,得到目标图片的字节流,并生成目标图片。Step S810, obtain the start marker in the byte stream of the original picture, and set the start marker of the original picture after the determined merge node, and sequentially add the byte stream of the original picture to obtain the byte stream of the target picture, and generate target image.

如图9所示为加密前后的图片效果示意图。在图9中,左边的图为加密前的原始图片,右边的图为加密后的目标图片。FIG. 9 is a schematic diagram of picture effects before and after encryption. In Fig. 9, the picture on the left is the original picture before encryption, and the picture on the right is the target picture after encryption.

步骤S812,将目标图片上传至云相册。Step S812, uploading the target picture to the cloud album.

在本实施例中,各字节流可以以字节数组的形式存在。In this embodiment, each byte stream may exist in the form of a byte array.

本发明实施例中,不改变原始图片的格式,完全按照正常图片存放,不影响应用使用任何商家的云相册或者云盘,也就是说,加密后的目标照片可以无丢失的备份到云相册,而且其他人(如云相册的工作人员或者黑客)看到的只是一张张模糊的照片,实现安全且无丢失的目的。In the embodiment of the present invention, the format of the original picture is not changed, and it is stored completely according to the normal picture, which does not affect the application to use any merchant's cloud album or cloud disk. That is to say, the encrypted target photo can be backed up to the cloud album without loss. And other people (such as the staff of the cloud album or hackers) only see blurred photos, so as to achieve the purpose of safety and no loss.

并且,本发明实施例对加密图片进行模糊处理,并合并处理后的加密图片与原始图片的字节流,生成目标图片,可以有效的保护隐私内容,并且大致的轮廓可以让用户有一定的感知,这一点要比隐私空间类软件完全改变图片存放格式,对用户是完全不可见的处理方式做得人性化。Moreover, the embodiment of the present invention performs blurring processing on the encrypted picture, and merges the processed encrypted picture and the byte stream of the original picture to generate the target picture, which can effectively protect the privacy content, and the rough outline can make the user have a certain perception , This is better than privacy space software that completely changes the image storage format and is completely invisible to the user. The processing method is humanized.

相应的,本发明实施例提供了一种图片解密的方法,该方法可以应用在终端或服务器中。图10示出了根据本发明一个实施例的图片解密的方法的流程图。如图10所示,该方法至少包括以下步骤S1002至步骤S1004:Correspondingly, the embodiment of the present invention provides a method for decrypting a picture, and the method can be applied in a terminal or a server. Fig. 10 shows a flowchart of a method for decrypting a picture according to an embodiment of the present invention. As shown in Figure 10, the method at least includes the following steps S1002 to S1004:

步骤S1002,获取待解密图片,并将待解密图片转换为字节流,其中,待解密图片的字节流是根据图片的字节格式,合并原始图片和用于对原始图片进行加密处理的加密图片的字节流得到的;Step S1002, obtain the picture to be decrypted, and convert the picture to be decrypted into a byte stream, wherein the byte stream of the picture to be decrypted is based on the byte format of the picture, combining the original picture and the encryption used to encrypt the original picture The byte stream of the picture is obtained;

步骤S1004,根据图片的字节格式,从待解密图片的字节流中提取原始图片的字节流,并生成原始图片。Step S1004, according to the byte format of the picture, extract the byte stream of the original picture from the byte stream of the picture to be decrypted, and generate the original picture.

对于加密后的目标图片,本发明实施例提供了对其进行解密方法,能够快速、准确地从目标图片中提取出原始图片。即,获取待解密图片(加密后的目标图片),并将待解密图片转换为字节流,随后根据图片的字节格式,从待解密图片的字节流中提取原始图片的字节流,并生成原始图片。For the encrypted target picture, the embodiment of the present invention provides a method for decrypting it, which can quickly and accurately extract the original picture from the target picture. That is, obtain the picture to be decrypted (encrypted target picture), convert the picture to be decrypted into a byte stream, and then extract the byte stream of the original picture from the byte stream of the picture to be decrypted according to the byte format of the picture, and generate the original image.

在步骤S1004中,根据图片的字节格式,从待解密图片的字节流中提取原始图片的字节流,本发明实施例提供了一种可选的方案,在该方案中,可以以待解密图片的字节流中的开始标记或结束标记作为提取点,从待解密图片的字节流中提取原始图片的字节流。In step S1004, according to the byte format of the picture, the byte stream of the original picture is extracted from the byte stream of the picture to be decrypted. The embodiment of the present invention provides an optional solution. In this solution, the The start mark or end mark in the byte stream of the decrypted picture is used as an extraction point, and the byte stream of the original picture is extracted from the byte stream of the picture to be decrypted.

图11示出了根据本发明一个实施例的提取原始图片的字节流的方法的流程图。如图11所示,该方法至少包括以下步骤S1102至步骤S1104:Fig. 11 shows a flowchart of a method for extracting a byte stream of an original picture according to an embodiment of the present invention. As shown in Figure 11, the method at least includes the following steps S1102 to S1104:

步骤S1102,在读取待解密图片的字节流的过程中,记录待解密图片的字节流中的开始标记的出现情况;Step S1102, during the process of reading the byte stream of the picture to be decrypted, record the occurrence of the start marker in the byte stream of the picture to be decrypted;

步骤S1104,确定第一指定数量个开始标记作为提取点,将包含该提取点以及该提取点之后的字节流作为原始图片的字节流。Step S1104, determine the first specified number of start markers as extraction points, and use the byte stream including the extraction point and the byte stream after the extraction point as the byte stream of the original picture.

在该步骤中,可以是读取到第三个开始标记,因为手机拍得的照片会将拍摄信息(如时间、地点等)记录到原始图片(即,原始照片)的前面,因此手机拍照的开始标记实际上是有两个的。而且经实验发现,模糊处理后的加密图片也是具有两个开始标记,因此第三个开始标记后面的内容才是原始图片。In this step, the third start mark can be read, because the photos taken by the mobile phone will record the shooting information (such as time, place, etc.) in front of the original picture (that is, the original photo), so the There are actually two start tags. Moreover, it is found through experiments that the encrypted picture after blurring processing also has two start marks, so the content behind the third start mark is the original picture.

图12示出了根据本发明另一个实施例的提取原始图片的字节流的方法的流程图。如图12所示,该方法至少包括以下步骤S1202至步骤S1204:Fig. 12 shows a flowchart of a method for extracting a byte stream of an original picture according to another embodiment of the present invention. As shown in Figure 12, the method at least includes the following steps S1202 to S1204:

步骤S1202,在读取待解密图片的字节流的过程中,记录待解密图片的字节流中的结束标记的出现情况。Step S1202, during the process of reading the byte stream of the picture to be decrypted, record the appearance of the end marker in the byte stream of the picture to be decrypted.

步骤S1204,确定第二指定数量个结束标记作为提取点,将该提取点之后的字节流作为原始图片的字节流。Step S1204, determining a second specified number of end markers as the extraction point, and taking the byte stream after the extraction point as the byte stream of the original picture.

以jpeg格式的图片文件的二进制字节流为例,提取原始图片的效果图如图13所示。Taking the binary byte stream of a picture file in jpeg format as an example, the rendering of extracting the original picture is shown in Figure 13.

基于上文各个实施例提供的图片加密和图片解密的方法,基于同一发明构思,本发明实施例还提供了一种图片加密和图片解密的装置。Based on the methods for encrypting and decrypting pictures provided in the above embodiments and based on the same inventive concept, an embodiment of the present invention further provides a device for encrypting and decrypting pictures.

图14示出了根据本发明一个实施例的图片加密的装置的结构示意图。如图14所示,该装置1400至少可以包括第一获取模块1410、第一转换模块1420以及加密模块1430。Fig. 14 shows a schematic structural diagram of an apparatus for encrypting pictures according to an embodiment of the present invention. As shown in FIG. 14 , the apparatus 1400 may at least include a first obtaining module 1410 , a first conversion module 1420 and an encryption module 1430 .

现介绍本发明实施例的图片加密的装置1400的各组成或器件的功能以及各部分间的连接关系:Now introduce the functions of each component or device of the image encryption device 1400 in the embodiment of the present invention and the connection relationship between each part:

第一获取模块1410,适于获取原始图片以及用于对原始图片进行加密处理的加密图片;The first acquiring module 1410 is adapted to acquire an original picture and an encrypted picture used for encrypting the original picture;

第一转换模块1420,与第一获取模块1410相耦合,适于分别将原始图片和加密图片转换成字节流;The first conversion module 1420, coupled with the first acquisition module 1410, is adapted to convert the original picture and the encrypted picture into byte streams;

加密模块1430,与第一转换模块1420相耦合,适于根据图片的字节格式合并原始图片和加密图片的字节流,得到目标图片的字节流,并生成目标图片。The encryption module 1430, coupled with the first conversion module 1420, is adapted to combine the byte stream of the original picture and the encrypted picture according to the byte format of the picture to obtain the byte stream of the target picture, and generate the target picture.

在本发明一实施例中,加密模块1430还适于:In an embodiment of the present invention, the encryption module 1430 is also suitable for:

分别以原始图片和加密图片的字节流中的开始标记或结束标记作为合并节点,对原始图片和加密图片的字节流进行合并处理。The byte streams of the original picture and the encrypted picture are merged by using the start mark or the end mark in the byte stream of the original picture and the encrypted picture as the merging node respectively.

在本发明一实施例中,加密模块1430还适于:In an embodiment of the present invention, the encryption module 1430 is also suitable for:

确定以加密图片的字节流中的结束标记作为合并节点;Determine to use the end marker in the byte stream of the encrypted picture as the merge node;

获取原始图片的字节流中的开始标记;Get the start tag in the byte stream of the original picture;

将原始图片的开始标记设置于确定的合并节点之后,并顺序添加原始图片的字节流。The start marker of the original picture is set after the determined merging node, and the byte stream of the original picture is sequentially added.

在本发明一实施例中,加密模块1430还适于:In an embodiment of the present invention, the encryption module 1430 is also suitable for:

确定以原始图片的字节流中的开始标记作为合并节点;Make sure to use the start tag in the byte stream of the original picture as the merge node;

获取加密图片的字节流中的结束标记;Obtain the end marker in the byte stream of the encrypted image;

将加密图片的结束标记设置于确定的合并节点之前,并逆序添加加密图片的字节流。Set the end marker of the encrypted picture before the determined merging node, and add the byte stream of the encrypted picture in reverse order.

在本发明一实施例中,如图15所示,图14展示的装置还可以包括:In an embodiment of the present invention, as shown in FIG. 15, the device shown in FIG. 14 may further include:

处理模块1440,与第一获取模块1410相耦合,适于在第一转换模块1420将加密图片转换成字节流之前,对加密图片进行模糊化处理,以增加加密图片的滤像功能。The processing module 1440, coupled with the first obtaining module 1410, is adapted to perform obfuscation processing on the encrypted picture before the first conversion module 1420 converts the encrypted picture into a byte stream, so as to increase the filtering function of the encrypted picture.

在本发明一实施例中,第一获取模块1410还适于:从终端的相册中获取即将上传至云相册的原始图片;In an embodiment of the present invention, the first acquiring module 1410 is further adapted to: acquire the original picture to be uploaded to the cloud album from the album of the terminal;

图片加密装置还可以包括上传模块1450,与加密模块1430相耦合,适于在加密模块1430生成目标图片之后,将目标图片上传至云相册。The image encryption device may also include an upload module 1450, coupled with the encryption module 1430, adapted to upload the target image to the cloud album after the encryption module 1430 generates the target image.

在本发明一实施例中,各字节流以字节数组的形式存在。In an embodiment of the present invention, each byte stream exists in the form of a byte array.

相应的,图16示出了根据本发明一个实施例的图片解密的装置的结构示意图。如图16所示,该装置1600至少可以包括第二获取模块1610、第二转换模块1620以及解密模块1630。Correspondingly, FIG. 16 shows a schematic structural diagram of an apparatus for decrypting a picture according to an embodiment of the present invention. As shown in FIG. 16 , the apparatus 1600 may at least include a second obtaining module 1610 , a second converting module 1620 and a decrypting module 1630 .

现介绍本发明实施例的图片解密的装置1600的各组成或器件的功能以及各部分间的连接关系:Now introduce the functions of each component or device of the image decryption device 1600 according to the embodiment of the present invention and the connection relationship between each part:

第二获取模块1610,适于获取待解密图片;The second obtaining module 1610 is adapted to obtain the picture to be decrypted;

第二转换模块1620,与第二获取模块1610相耦合,适于将待解密图片转换为字节流,其中,待解密图片的字节流是根据图片的字节格式,合并原始图片和用于对原始图片进行加密处理的加密图片的字节流得到的;The second conversion module 1620, coupled with the second acquisition module 1610, is adapted to convert the picture to be decrypted into a byte stream, wherein the byte stream of the picture to be decrypted is based on the byte format of the picture, combining the original picture and the It is obtained by encrypting the byte stream of the encrypted picture of the original picture;

解密模块1630,与第二转换模块1620相耦合,适于根据图片的字节格式,从待解密图片的字节流中提取原始图片的字节流,并生成原始图片。The decryption module 1630, coupled with the second conversion module 1620, is adapted to extract the byte stream of the original picture from the byte stream of the picture to be decrypted according to the byte format of the picture, and generate the original picture.

在本发明一实施例中,解密模块1630还适于:In an embodiment of the present invention, the decryption module 1630 is also suitable for:

以待解密图片的字节流中的开始标记或结束标记作为提取点,从待解密图片的字节流中提取原始图片的字节流。The byte stream of the original picture is extracted from the byte stream of the picture to be decrypted by taking the start mark or the end mark in the byte stream of the picture to be decrypted as an extraction point.

在本发明一实施例中,解密模块1630还适于:In an embodiment of the present invention, the decryption module 1630 is also suitable for:

在读取待解密图片的字节流的过程中,记录待解密图片的字节流中的开始标记的出现情况;In the process of reading the byte stream of the picture to be decrypted, record the occurrence of the start marker in the byte stream of the picture to be decrypted;

确定第一指定数量个开始标记作为提取点,将包含该提取点以及该提取点之后的字节流作为原始图片的字节流。Determine the first specified number of start markers as extraction points, and use the byte stream including the extraction point and the byte stream after the extraction point as the byte stream of the original picture.

在本发明一实施例中,解密模块1630还适于:In an embodiment of the present invention, the decryption module 1630 is also suitable for:

在读取待解密图片的字节流的过程中,记录待解密图片的字节流中的结束标记的出现情况;In the process of reading the byte stream of the picture to be decrypted, record the occurrence of the end mark in the byte stream of the picture to be decrypted;

确定第二指定数量个结束标记作为提取点,将该提取点之后的字节流作为原始图片的字节流。Determine the second specified number of end markers as extraction points, and use the byte stream after the extraction point as the byte stream of the original picture.

根据上述任意一个优选实施例或多个优选实施例的组合,本发明实施例能够达到如下有益效果:According to any one of the above preferred embodiments or a combination of multiple preferred embodiments, the embodiments of the present invention can achieve the following beneficial effects:

本发明实施例提供了一种图片加密的新思路,即,获取原始图片以及用于对原始图片进行加密处理的加密图片,随后分别将原始图片和加密图片转换成字节流,进而根据图片的字节格式合并原始图片和加密图片的字节流,得到目标图片的字节流,并生成目标图片。本发明实施例是通过对字节流的合并处理,生成目标图片,使得目标图片的图片格式不会发生变化,相当于基于原始图片格式,对其图片信息量进行了调整,不会影响图片的传输或存储,同时图片信息量的调整提高了图片的安全性。The embodiment of the present invention provides a new idea of picture encryption, that is, the original picture and the encrypted picture used to encrypt the original picture are obtained, and then the original picture and the encrypted picture are respectively converted into byte streams, and then according to the The byte format combines the byte stream of the original picture and the encrypted picture to obtain the byte stream of the target picture, and generates the target picture. In the embodiment of the present invention, the target picture is generated by merging byte streams, so that the picture format of the target picture will not change, which is equivalent to adjusting the amount of picture information based on the original picture format, without affecting the picture quality. Transmission or storage, while the adjustment of the image information improves the security of the image.

进一步,对于加密后的目标图片,本发明实施例提供了对其进行解密方法,能够快速、准确地从目标图片中提取出原始图片。即,获取待解密图片(加密后的目标图片),并将待解密图片转换为字节流,随后根据图片的字节格式,从待解密图片的字节流中提取原始图片的字节流,并生成原始图片。Further, for the encrypted target picture, the embodiment of the present invention provides a method for decrypting it, which can quickly and accurately extract the original picture from the target picture. That is, obtain the picture to be decrypted (encrypted target picture), convert the picture to be decrypted into a byte stream, and then extract the byte stream of the original picture from the byte stream of the picture to be decrypted according to the byte format of the picture, and generate the original image.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的图片加密、解密的装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the image encryption and decryption device according to the embodiment of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

至此,本领域技术人员应认识到,虽然本文已详尽示出和描述了本发明的多个示例性实施例,但是,在不脱离本发明精神和范围的情况下,仍可根据本发明公开的内容直接确定或推导出符合本发明原理的许多其他变型或修改。因此,本发明的范围应被理解和认定为覆盖了所有这些其他变型或修改。So far, those skilled in the art should appreciate that, although a number of exemplary embodiments of the present invention have been shown and described in detail herein, without departing from the spirit and scope of the present invention, the disclosed embodiments of the present invention can still be used. Many other variations or modifications consistent with the principles of the invention are directly identified or derived from the content. Accordingly, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.

本发明实施例还公开了:The embodiment of the invention also discloses:

A1、一种图片加密的方法,包括:A1, a method for picture encryption, comprising:

获取原始图片以及用于对所述原始图片进行加密处理的加密图片;Obtaining an original picture and an encrypted picture used for encrypting the original picture;

分别将所述原始图片和所述加密图片转换成字节流;respectively converting the original picture and the encrypted picture into byte streams;

根据图片的字节格式合并所述原始图片和所述加密图片的字节流,得到目标图片的字节流,并生成所述目标图片。Merge the byte stream of the original picture and the encrypted picture according to the byte format of the picture to obtain the byte stream of the target picture, and generate the target picture.

A2、根据A1所述的方法,其中,所述根据图片的字节格式合并所述原始图片和所述加密图片的字节流,包括:A2. The method according to A1, wherein the merging the byte stream of the original picture and the encrypted picture according to the byte format of the picture includes:

分别以所述原始图片和所述加密图片的字节流中的开始标记或结束标记作为合并节点,对所述原始图片和所述加密图片的字节流进行合并处理。Merge the original picture and the byte stream of the encrypted picture by using the start marker or the end marker in the byte stream of the original picture and the encrypted picture as a merge node respectively.

A3、根据A2所述的方法,其中,分别以所述原始图片和所述加密图片的字节流中的开始标记或结束标记作为合并节点,对所述原始图片和所述加密图片的字节流进行合并处理,包括:A3. The method according to A2, wherein, using the start marker or the end marker in the byte stream of the original picture and the encrypted picture respectively as a merge node, the bytes of the original picture and the encrypted picture are Streams are merged and processed, including:

确定以所述加密图片的字节流中的结束标记作为合并节点;Determine to use the end marker in the byte stream of the encrypted picture as the merge node;

获取所述原始图片的字节流中的开始标记;Obtain the start tag in the byte stream of the original picture;

将所述原始图片的开始标记设置于确定的所述合并节点之后,并顺序添加所述原始图片的字节流。Setting the start marker of the original picture after the determined merging node, and sequentially adding the byte stream of the original picture.

A4、根据A2所述的方法,其中,分别以所述原始图片和所述加密图片的字节流中的开始标记或结束标记作为合并节点,对所述原始图片和所述加密图片的字节流进行合并处理,包括:A4. The method according to A2, wherein, using the start marker or the end marker in the byte stream of the original picture and the encrypted picture respectively as a merge node, the bytes of the original picture and the encrypted picture are Streams are merged and processed, including:

确定以所述原始图片的字节流中的开始标记作为合并节点;Determining that the start tag in the byte stream of the original picture is used as the merging node;

获取所述加密图片的字节流中的结束标记;Obtain the end marker in the byte stream of the encrypted picture;

将所述加密图片的结束标记设置于确定的所述合并节点之前,并逆序添加所述加密图片的字节流。Setting the end marker of the encrypted picture before the determined merging node, and adding the byte stream of the encrypted picture in reverse order.

A5、根据A1-A4任一项所述的方法,其中,在将所述加密图片转换成字节流之前,还包括:A5. The method according to any one of A1-A4, wherein, before converting the encrypted picture into a byte stream, it also includes:

对所述加密图片进行模糊化处理,以增加所述加密图片的滤像功能。Perform blurring processing on the encrypted picture to increase the image filtering function of the encrypted picture.

A6、根据A1-A5任一项所述的方法,其中,所述获取原始图片,包括:从终端的相册中获取即将上传至云相册的原始图片;A6. The method according to any one of A1-A5, wherein said acquiring the original picture includes: acquiring the original picture to be uploaded to the cloud album from the terminal's album;

在生成所述目标图片之后,所述方法还包括:将所述目标图片上传至所述云相册。After generating the target picture, the method further includes: uploading the target picture to the cloud album.

A7、根据A1-A6任一项所述的方法,其中,各字节流以字节数组的形式存在。A7. The method according to any one of A1-A6, wherein each byte stream exists in the form of a byte array.

A8、一种图片解密的方法,包括:A8, a method for picture decryption, comprising:

获取待解密图片,并将所述待解密图片转换为字节流,其中,所述待解密图片的字节流是根据图片的字节格式,合并原始图片和用于对所述原始图片进行加密处理的加密图片的字节流得到的;Obtaining the picture to be decrypted, and converting the picture to be decrypted into a byte stream, wherein the byte stream of the picture to be decrypted is based on the byte format of the picture, merging the original picture and encrypting the original picture The byte stream of the processed encrypted image is obtained;

根据所述图片的字节格式,从所述待解密图片的字节流中提取所述原始图片的字节流,并生成所述原始图片。According to the byte format of the picture, extract the byte stream of the original picture from the byte stream of the picture to be decrypted, and generate the original picture.

A9、根据A8所述的方法,其中,根据所述图片的字节格式,从所述待解密图片的字节流中提取所述原始图片的字节流,包括:A9. The method according to A8, wherein, according to the byte format of the picture, extracting the byte stream of the original picture from the byte stream of the picture to be decrypted includes:

以所述待解密图片的字节流中的开始标记或结束标记作为提取点,从所述待解密图片的字节流中提取所述原始图片的字节流。The byte stream of the original picture is extracted from the byte stream of the picture to be decrypted by using the start mark or the end mark in the byte stream of the picture to be decrypted as an extraction point.

A10、根据A9所述的方法,其中,以所述待解密图片的字节流中的开始标记作为提取点,从所述待解密图片的字节流中提取所述原始图片的字节流,包括:A10. The method according to A9, wherein the byte stream of the original picture is extracted from the byte stream of the picture to be decrypted by using the start marker in the byte stream of the picture to be decrypted as the extraction point, include:

在读取所述待解密图片的字节流的过程中,记录所述待解密图片的字节流中的开始标记的出现情况;In the process of reading the byte stream of the picture to be decrypted, recording the appearance of the start marker in the byte stream of the picture to be decrypted;

确定第一指定数量个开始标记作为提取点,将包含该提取点以及该提取点之后的字节流作为所述原始图片的字节流。Determining the first specified number of start markers as the extraction point, and using the byte stream including the extraction point and after the extraction point as the byte stream of the original picture.

A11、根据A9所述的方法,其中,以所述待解密图片的字节流中的结束标记作为提取点,从所述待解密图片的字节流中提取所述原始图片的字节流,包括:A11. The method according to A9, wherein the byte stream of the original picture is extracted from the byte stream of the picture to be decrypted, using the end marker in the byte stream of the picture to be decrypted as the extraction point, include:

在读取所述待解密图片的字节流的过程中,记录所述待解密图片的字节流中的结束标记的出现情况;During the process of reading the byte stream of the picture to be decrypted, recording the occurrence of the end marker in the byte stream of the picture to be decrypted;

确定第二指定数量个结束标记作为提取点,将该提取点之后的字节流作为所述原始图片的字节流。Determining the second specified number of end markers as extraction points, and using the byte stream after the extraction point as the byte stream of the original picture.

B12、一种图片加密的装置,包括:B12. A device for encrypting images, comprising:

第一获取模块,适于获取原始图片以及用于对所述原始图片进行加密处理的加密图片;The first obtaining module is adapted to obtain an original picture and an encrypted picture used for encrypting the original picture;

第一转换模块,适于分别将所述原始图片和所述加密图片转换成字节流;a first conversion module adapted to convert the original picture and the encrypted picture into byte streams;

加密模块,适于根据图片的字节格式合并所述原始图片和所述加密图片的字节流,得到目标图片的字节流,并生成所述目标图片。The encryption module is adapted to combine the byte stream of the original picture and the encrypted picture according to the byte format of the picture to obtain the byte stream of the target picture, and generate the target picture.

B13、根据B12所述的装置,其中,所述加密模块还适于:B13. The device according to B12, wherein the encryption module is further adapted to:

分别以所述原始图片和所述加密图片的字节流中的开始标记或结束标记作为合并节点,对所述原始图片和所述加密图片的字节流进行合并处理。Merging the original picture and the byte stream of the encrypted picture by using the start marker or the end marker in the byte stream of the original picture and the encrypted picture as a merge node respectively.

B14、根据B13所述的装置,其中,所述加密模块还适于:B14. The device according to B13, wherein the encryption module is further adapted to:

确定以所述加密图片的字节流中的结束标记作为合并节点;Determine to use the end marker in the byte stream of the encrypted picture as the merge node;

获取所述原始图片的字节流中的开始标记;Obtain the start tag in the byte stream of the original picture;

将所述原始图片的开始标记设置于确定的所述合并节点之后,并顺序添加所述原始图片的字节流。Setting the start marker of the original picture after the determined merging node, and sequentially adding the byte stream of the original picture.

B15、根据B13所述的装置,其中,所述加密模块还适于:B15. The device according to B13, wherein the encryption module is further adapted to:

确定以所述原始图片的字节流中的开始标记作为合并节点;Determining that the start tag in the byte stream of the original picture is used as the merging node;

获取所述加密图片的字节流中的结束标记;Obtain the end marker in the byte stream of the encrypted picture;

将所述加密图片的结束标记设置于确定的所述合并节点之前,并逆序添加所述加密图片的字节流。Setting the end marker of the encrypted picture before the determined merging node, and adding the byte stream of the encrypted picture in reverse order.

B16、根据B12-B15任一项所述的装置,其中,还包括:B16. The device according to any one of B12-B15, further comprising:

处理模块,适于在所述第一转换模块将所述加密图片转换成字节流之前,对所述加密图片进行模糊化处理,以增加所述加密图片的滤像功能。The processing module is adapted to perform obfuscation processing on the encrypted picture before the first conversion module converts the encrypted picture into a byte stream, so as to increase the image filtering function of the encrypted picture.

B17、根据B12-B16任一项所述的装置,其中,所述第一获取模块还适于:从终端的相册中获取即将上传至云相册的原始图片;B17. The device according to any one of B12-B16, wherein the first acquisition module is further adapted to: acquire the original picture to be uploaded to the cloud album from the terminal's album;

所述装置还包括上传模块,适于在所述加密模块生成所述目标图片之后,将所述目标图片上传至所述云相册。The device also includes an upload module adapted to upload the target picture to the cloud album after the encryption module generates the target picture.

B18、根据B12-B17任一项所述的装置,其中,各字节流以字节数组的形式存在。B18. The device according to any one of B12-B17, wherein each byte stream exists in the form of a byte array.

B19、一种图片解密的装置,包括:B19. A device for decrypting pictures, comprising:

第二获取模块,适于获取待解密图片;The second obtaining module is suitable for obtaining the picture to be decrypted;

第二转换模块,适于将所述待解密图片转换为字节流,其中,所述待解密图片的字节流是根据图片的字节格式,合并原始图片和用于对所述原始图片进行加密处理的加密图片的字节流得到的;The second conversion module is adapted to convert the picture to be decrypted into a byte stream, wherein the byte stream of the picture to be decrypted is based on the byte format of the picture, merging the original picture and used to process the original picture Obtained from the byte stream of the encrypted image processed by encryption;

解密模块,适于根据所述图片的字节格式,从所述待解密图片的字节流中提取所述原始图片的字节流,并生成所述原始图片。The decryption module is adapted to extract the byte stream of the original picture from the byte stream of the picture to be decrypted according to the byte format of the picture, and generate the original picture.

B20、根据B19所述的装置,其中,所述解密模块还适于:B20. The device according to B19, wherein the decryption module is further adapted to:

以所述待解密图片的字节流中的开始标记或结束标记作为提取点,从所述待解密图片的字节流中提取所述原始图片的字节流。The byte stream of the original picture is extracted from the byte stream of the picture to be decrypted by using the start mark or the end mark in the byte stream of the picture to be decrypted as an extraction point.

B21、根据B20所述的装置,其中,所述解密模块还适于:B21. The device according to B20, wherein the decryption module is further adapted to:

在读取所述待解密图片的字节流的过程中,记录所述待解密图片的字节流中的开始标记的出现情况;In the process of reading the byte stream of the picture to be decrypted, recording the appearance of the start marker in the byte stream of the picture to be decrypted;

确定第一指定数量个开始标记作为提取点,将包含该提取点以及该提取点之后的字节流作为所述原始图片的字节流。Determining the first specified number of start markers as the extraction point, and using the byte stream including the extraction point and after the extraction point as the byte stream of the original picture.

B22、根据B20所述的装置,其中,所述解密模块还适于:B22. The device according to B20, wherein the decryption module is further adapted to:

在读取所述待解密图片的字节流的过程中,记录所述待解密图片的字节流中的结束标记的出现情况;During the process of reading the byte stream of the picture to be decrypted, recording the occurrence of the end marker in the byte stream of the picture to be decrypted;

确定第二指定数量个结束标记作为提取点,将该提取点之后的字节流作为所述原始图片的字节流。Determining the second specified number of end markers as extraction points, and using the byte stream after the extraction point as the byte stream of the original picture.

Claims (22)

1. a kind of method of image ciphering, including:
Obtain original image and the encryption picture for the original image to be encrypted;
The original image and the encryption picture are converted into byte stream respectively;
Merge the byte stream of the original image and the encryption picture according to the byte format of picture, obtain the word of Target Photo Throttling, and generate the Target Photo.
2. the method according to claim 11, wherein, it is described that the original image and institute are merged according to the byte format of picture The byte stream of encryption picture is stated, including:
Saved respectively using the beginning label in the byte stream of the original image and the encryption picture or end mark as merging Point, processing is merged to the byte stream of the original image and the encryption picture.
3. the method according to claim 11, wherein, respectively with the byte stream of the original image and the encryption picture Beginning label or end mark as merge node, the byte stream of the original image and the encryption picture is merged Processing, including:
It is determined that merge node is used as using the end mark in the byte stream of the encryption picture;
Obtain the beginning label in the byte stream of the original image;
After the beginning label of the original image is arranged at into the merge node of determination, and order adds the original graph The byte stream of piece.
4. the method according to claim 11, wherein, respectively with the byte stream of the original image and the encryption picture Beginning label or end mark as merge node, the byte stream of the original image and the encryption picture is merged Processing, including:
It is determined that merge node is used as using the beginning label in the byte stream of the original image;
Obtain the end mark in the byte stream of the encryption picture;
Before the end mark of the encryption picture is arranged at into the merge node of determination, and the backward addition encryption figure The byte stream of piece.
5. according to the method described in claim any one of 1-4, wherein, before the encryption picture is converted into byte stream, Also include:
Fuzzy processing is carried out to the encryption picture, to increase the image filtering function of the encryption picture.
6. according to the method described in claim any one of 1-4, wherein, the acquisition original image, including:From the photograph album of terminal Middle acquisition will be uploaded to the original image of cloud photograph album;
After the Target Photo is generated, methods described also includes:The Target Photo is uploaded to the cloud photograph album.
7. according to the method described in claim any one of 1-4, wherein, each byte stream exists in the form of byte arrays.
8. a kind of method of picture decryption, including:
Picture to be decrypted is obtained, and the picture to be decrypted is converted into byte stream, wherein, the byte stream of the picture to be decrypted It is the byte format according to picture, merges original image and the encryption picture for the original image to be encrypted What byte stream obtained;
According to the byte format of the picture, the byte of the original image is extracted from the byte stream of the picture to be decrypted Stream, and generate the original image.
9. the method according to claim 11, wherein, according to the byte format of the picture, from the picture to be decrypted The byte stream of the original image is extracted in byte stream, including:
Using the beginning label in the byte stream of the picture to be decrypted or end mark as extraction point, from the picture to be decrypted Byte stream in extract the byte stream of the original image.
10. according to the method for claim 9, wherein, using the beginning label in the byte stream of the picture to be decrypted as Point is extracted, the byte stream of the original image is extracted from the byte stream of the picture to be decrypted, including:
During the byte stream of the picture to be decrypted is read, record and start to mark in the byte stream of the picture to be decrypted The appearance situation of note;
Determine that the first specified quantity beginning label as extraction point, will include the byte after the extraction point and the extraction point Flow the byte stream as the original image.
11. according to the method for claim 9, wherein, using the end mark in the byte stream of the picture to be decrypted as Point is extracted, the byte stream of the original image is extracted from the byte stream of the picture to be decrypted, including:
During the byte stream of the picture to be decrypted is read, the end mark in the byte stream of the picture to be decrypted is recorded The appearance situation of note;
The second specified quantity end mark is determined as extraction point, using the byte stream after the extraction point as the original graph The byte stream of piece.
12. a kind of device of image ciphering, including:
First acquisition module, suitable for obtaining original image and the encryption figure for the original image to be encrypted Piece;
First modular converter, suitable for the original image and the encryption picture are converted into byte stream respectively;
Encrypting module, suitable for merging the byte stream of the original image and the encryption picture according to the byte format of picture, obtain To the byte stream of Target Photo, and generate the Target Photo.
13. device according to claim 12, wherein, the encrypting module is further adapted for:
Saved respectively using the beginning label in the byte stream of the original image and the encryption picture or end mark as merging Point, processing is merged to the byte stream of the original image and the encryption picture.
14. device according to claim 13, wherein, the encrypting module is further adapted for:
It is determined that merge node is used as using the end mark in the byte stream of the encryption picture;
Obtain the beginning label in the byte stream of the original image;
After the beginning label of the original image is arranged at into the merge node of determination, and order adds the original graph The byte stream of piece.
15. device according to claim 13, wherein, the encrypting module is further adapted for:
It is determined that merge node is used as using the beginning label in the byte stream of the original image;
Obtain the end mark in the byte stream of the encryption picture;
Before the end mark of the encryption picture is arranged at into the merge node of determination, and the backward addition encryption figure The byte stream of piece.
16. according to the device described in claim any one of 12-15, wherein, in addition to:
Processing module, suitable for first modular converter by it is described encryption picture be converted into byte stream before, to the encryption Picture carries out Fuzzy processing, to increase the image filtering function of the encryption picture.
17. according to the device described in claim any one of 12-15, wherein, first acquisition module is further adapted for:From terminal The original image of cloud photograph album will be uploaded to by being obtained in photograph album;
Described device also includes uploading module, after generating the Target Photo in the encrypting module, by the target Picture is uploaded to the cloud photograph album.
18. according to the device described in claim any one of 12-15, wherein, each byte stream exists in the form of byte arrays.
19. a kind of device of picture decryption, including:
Second acquisition module, suitable for obtaining picture to be decrypted;
Second modular converter, suitable for the picture to be decrypted is converted into byte stream, wherein, the byte stream of the picture to be decrypted It is the byte format according to picture, merges original image and the encryption picture for the original image to be encrypted What byte stream obtained;
Deciphering module, suitable for the byte format according to the picture, the original is extracted from the byte stream of the picture to be decrypted The byte stream of beginning picture, and generate the original image.
20. device according to claim 19, wherein, the deciphering module is further adapted for:
Using the beginning label in the byte stream of the picture to be decrypted or end mark as extraction point, from the picture to be decrypted Byte stream in extract the byte stream of the original image.
21. device according to claim 20, wherein, the deciphering module is further adapted for:
During the byte stream of the picture to be decrypted is read, record and start to mark in the byte stream of the picture to be decrypted The appearance situation of note;
Determine that the first specified quantity beginning label as extraction point, will include the byte after the extraction point and the extraction point Flow the byte stream as the original image.
22. device according to claim 20, wherein, the deciphering module is further adapted for:
During the byte stream of the picture to be decrypted is read, the end mark in the byte stream of the picture to be decrypted is recorded The appearance situation of note;
The second specified quantity end mark is determined as extraction point, using the byte stream after the extraction point as the original graph The byte stream of piece.
CN201510757987.6A 2015-11-09 2015-11-09 Image ciphering, the method and device of decryption Active CN105357415B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510757987.6A CN105357415B (en) 2015-11-09 2015-11-09 Image ciphering, the method and device of decryption

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510757987.6A CN105357415B (en) 2015-11-09 2015-11-09 Image ciphering, the method and device of decryption

Publications (2)

Publication Number Publication Date
CN105357415A CN105357415A (en) 2016-02-24
CN105357415B true CN105357415B (en) 2017-12-08

Family

ID=55333269

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510757987.6A Active CN105357415B (en) 2015-11-09 2015-11-09 Image ciphering, the method and device of decryption

Country Status (1)

Country Link
CN (1) CN105357415B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525747B (en) * 2017-09-20 2021-05-28 阿里巴巴集团控股有限公司 Picture uploading method, encryption and decryption method, device and system and electronic equipment
CN110489386A (en) * 2019-08-06 2019-11-22 Oppo广东移动通信有限公司 Information processing method, device, storage medium and electronic equipment
CN110996132A (en) * 2019-12-26 2020-04-10 合肥道正企智大数据有限公司 Video image splitting, encrypting and transmitting method, device and system
CN111107245A (en) * 2019-12-26 2020-05-05 合肥道正企智大数据有限公司 Efficient interrupt recoverable image hiding encryption transmission method, device and system
CN111010491A (en) * 2019-12-26 2020-04-14 合肥道正企智大数据有限公司 Image data transmission method, device and system based on hiding technology
CN113239371A (en) * 2021-04-29 2021-08-10 广州群志科技股份有限公司 Method for preventing face data from divulging secret

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007336244A (en) * 2006-06-15 2007-12-27 Megachips System Solutions Inc Encryption method and decryption method
CN102306114A (en) * 2010-09-25 2012-01-04 广东电子工业研究院有限公司 Data timing backup and recovery method based on cloud storage
CN103595730A (en) * 2013-11-28 2014-02-19 中国科学院信息工程研究所 Ciphertext cloud storage method and system
CN104200171A (en) * 2014-08-20 2014-12-10 中国科学技术大学先进技术研究院 Virtual file system based on information hiding
CN104680077A (en) * 2015-01-20 2015-06-03 中兴通讯股份有限公司 Picture encryption method and picture checking method, system and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4910324B2 (en) * 2005-07-21 2012-04-04 ソニー株式会社 Information processing apparatus, information processing method, and computer program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007336244A (en) * 2006-06-15 2007-12-27 Megachips System Solutions Inc Encryption method and decryption method
CN102306114A (en) * 2010-09-25 2012-01-04 广东电子工业研究院有限公司 Data timing backup and recovery method based on cloud storage
CN103595730A (en) * 2013-11-28 2014-02-19 中国科学院信息工程研究所 Ciphertext cloud storage method and system
CN104200171A (en) * 2014-08-20 2014-12-10 中国科学技术大学先进技术研究院 Virtual file system based on information hiding
CN104680077A (en) * 2015-01-20 2015-06-03 中兴通讯股份有限公司 Picture encryption method and picture checking method, system and terminal

Also Published As

Publication number Publication date
CN105357415A (en) 2016-02-24

Similar Documents

Publication Publication Date Title
CN105357415B (en) Image ciphering, the method and device of decryption
JP7049437B2 (en) Techniques for encoding, decoding and representing high dynamic range images
CN104394324B (en) Special efficacy video generation method and device
EP1249002B1 (en) Authenticating metadata and embedding metadata in watermarks of media signals
CN104079830B (en) Private mark adding method and device, private mark photo processing method and device
CN103973937B (en) Information concealing method based on wireless multimedia sensor network
US20150035999A1 (en) Method for sharing digital photos securely
JP2019527444A (en) System and method for identifying matching content
US20140078153A1 (en) Embedding Animation in Electronic Mail, Text Messages and Websites
CN102970307B (en) Cipher safety system and password safety method
CN104657409B (en) Apparatus and method for managing image files by displaying backup information
US20130335594A1 (en) Enhancing captured data
US9165605B1 (en) System and method for personal floating video
Pizzolante et al. Copyright protection for images on mobile devices
JP5025498B2 (en) Image processing apparatus and control method thereof
CN114996663B (en) Image processing method, storage medium and computer terminal
JP5264155B2 (en) Program, file management apparatus and file management method
TW201143381A (en) Digital camera with upload function
JP4353467B2 (en) Image server and control method thereof
JP2005250716A (en) Image processing system
JP6282136B2 (en) Imaging apparatus and control method thereof
JP2006332990A (en) Personal video distribution system
JP3218489U (en) AR content provision system
AU2020104195A4 (en) A method for data security using virtual key replacement in image steganography
JP7114387B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD AND PROGRAM

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220718

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right