# US 10,454,905 B2 · Method and apparatus for encrypting and decrypting picture, and device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,454,905 B2
- Document ID: US10454905B2
- Status: Granted
- Kind: B2
- Application number: 15/705,098
- Filed: 2017-09-14
- Published: 2018-01-04
- Granted: 2019-10-22
- Earliest claimed: 2015-10-19
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Lihong Su
- Web page: https://patentgrep.com/patent/US10454905B2

## CPC

- H04L 63/0428: {wherein the data content is protected, e.g. by encrypting or encapsulating the payload}
- G06F 21/60: Protecting data
- G06F 21/606: {by securing the transmission between two devices or processes}
- H04L 9/0819: {Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) (network architectures or network communication protocols for key distribution in a packet data network H04L63/062)}
- H04L 9/0822: {using key encryption key}
- H04L 9/14: using a plurality of keys or algorithms
- H04L 9/30: Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
- H04L 9/3239: {involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD}
- H04L 63/0435: {wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption (cryptographic mechanisms or cryptographic arrangements for symmetric key encryption H04L9/06)}
- H04L 63/126: {the source of the received data}
- G06F 2221/2107: File encryption
- G06F 2221/2111: Location-sensitive, e.g. geographical location, GPS
- H04L 2209/046: of operations, operands or results of the operations
- H04L 2463/062: applying encryption of the keys
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure relates to the field of computer technologies and it discloses a method for encrypting a picture performed at a sending device, the method including: obtaining, by a sending device raw data of a to-be-encrypted picture, a first key, a second key, and location information that is used for adding disturbance data to the raw data; generating the disturbance data, and adding the disturbance data to the raw data according to the location information, to obtain first data; encrypting the first data by using the first key, to obtain the second data, and encrypting the first key and the length of the disturbance data by using the second key, to obtain first encrypted data; and sending the second data, the first encrypted data, and the second key to a receiving device.

## Claims

### Claim 1

A method for encrypting a picture performed at a sending device having one or more processors and memory storing programs to be executed by the one or more processors, the method comprising:
obtaining, by the sending device, raw data of a to-be-encrypted picture, a first key, a second key, and location information that is used for adding disturbance data to the raw data;
adding, by the sending device, the disturbance data to the raw data according to the location information, to obtain first data;
encrypting, by the sending device, the first data by using the first key, to obtain second data, and encrypting the first key and the length of the disturbance data by using the second key, to obtain first encrypted data; and
sending, by the sending device, the second data, the first encrypted data, and the second key to a receiving device.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the sending device and the receiving device are in a chat session of a social networking application and the to-be-encrypted picture is part of a message that the sending device sends to the receiving device through the chat session.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the disturbance data is a comment of the to-be-encrypted picture provided by a user of the sending device through the chat session.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the location information is negotiated between the sending device and the receiving device independently from the sending, by the sending device, the second data, the first encrypted data, and the second key to the receiving device.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the location information is determined by the sending device according to a predefined algorithm and a current timestamp of the sending, by the sending device, the second data, the first encrypted data, and the second key to the receiving device.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the sending, by the sending device, the second key to a receiving device comprises:
encrypting, by the sending device, the second key by using a third key, to obtain second encrypted data; and
sending, by the sending device, the second encrypted data to the receiving device.

### Claim 7 (depends on 1)

The method according to claim 1, further comprising:
calculating, by the sending device, a Message-Digest Algorithm 5 (MD5) value of the raw data to serve as a first MD5 value, and calculating an MD5 value of the second data to serve as a second MD5 value;
encrypting, by the sending device, the first MD5 value by using the second key, and adding the encrypted first MD5 value to the first encrypted data; and
sending, by the sending device, the second MD5 value to the receiving device.

### Claim 8 (depends on 1)

The method according to claim 1, wherein the encrypting, by the sending device, the first data by using the first key, to obtain second data comprises:
encrypting, by the sending device, the first data by using an iteration exclusive OR encryption algorithm and the first key, to obtain the second data.

### Claim 9 (depends on 1)

The method according to claim 1, further comprising:
encrypting, by the sending device, the location information by using the second key, and adding the encrypted location information to the first encrypted data; and
encrypting, by the sending device, a mode identifier by using the second key, and adding the encrypted mode identifier to the first encrypted data, wherein the mode identifier is used for identifying the location information.

### Claim 10

A sending device, comprising:
one or more processors;
memory; and
one or more programs stored in the memory, wherein the one or more programs, when executed by the one or more processors, cause the sending device to perform a plurality of operations including:
obtaining, by the sending device, raw data of a to-be-encrypted picture, a first key, a second key, and location information that is used for adding disturbance data to the raw data;
adding, by the sending device, the disturbance data to the raw data according to the location information, to obtain first data;
encrypting, by the sending device, the first data by using the first key, to obtain second data, and encrypting the first key and the length of the disturbance data by using the second key, to obtain first encrypted data; and
sending, by the sending device, the second data, the first encrypted data, and the second key to a receiving device.

### Claim 11 (depends on 10)

The sending device according to claim 10, wherein the sending device and the receiving device are in a chat session of a social networking application and the to-be-encrypted picture is part of a message that the sending device sends to the receiving device through the chat session.

### Claim 12 (depends on 11)

The sending device according to claim 11, wherein the disturbance data is a comment of the to-be-encrypted picture provided by a user of the sending device through the chat session.

### Claim 13 (depends on 10)

The sending device according to claim 10, wherein the location information is negotiated between the sending device and the receiving device independently from the sending, by the sending device, the second data, the first encrypted data, and the second key to the receiving device.

### Claim 14 (depends on 10)

The sending device according to claim 10, wherein the location information is determined by the sending device according to a predefined algorithm and a current timestamp of the sending, by the sending device, the second data, the first encrypted data, and the second key to the receiving device.

### Claim 15 (depends on 10)

The sending device according to claim 10, wherein the sending, by the sending device, the second key to a receiving device comprises:
encrypting, by the sending device, the second key by using a third key, to obtain second encrypted data; and
sending, by the sending device, the second encrypted data to the receiving device.

### Claim 16 (depends on 10)

The sending device according to claim 10, wherein the plurality of further comprising:
calculating, by the sending device, a Message-Digest Algorithm 5 (MD5) value of the raw data to serve as a first MD5 value, and calculating an MD5 value of the second data to serve as a second MD5 value;
encrypting, by the sending device, the first MD5 value by using the second key, and adding the encrypted first MD5 value to the first encrypted data; and
sending, by the sending device, the second MD5 value to the receiving device.

### Claim 17 (depends on 10)

The sending device according to claim 10, wherein the encrypting, by the sending device, the first data by using the first key, to obtain second data comprises:
encrypting, by the sending device, the first data by using an iteration exclusive OR encryption algorithm and the first key, to obtain the second data.

### Claim 18 (depends on 10)

The sending device according to claim 10, wherein the plurality of further comprising:
encrypting, by the sending device, the location information by using the second key, and adding the encrypted location information to the first encrypted data; and
encrypting, by the sending device, a mode identifier by using the second key, and adding the encrypted mode identifier to the first encrypted data, wherein the mode identifier is used for identifying the location information.

### Claim 19

A non-transitory computer readable storage medium storing one or more programs, wherein the one or more programs, when executed one or more processors of a sending device, cause the sending device to perform a plurality of operations including:
obtaining, by the sending device, raw data of a to-be-encrypted picture, a first key, a second key, and location information that is used for adding disturbance data to the raw data;
adding, by the sending device, the disturbance data to the raw data according to the location information, to obtain first data;
encrypting, by the sending device, the first data by using the first key, to obtain second data, and encrypting the first key and the length of the disturbance data by using the second key, to obtain first encrypted data; and
sending, by the sending device, the second data, the first encrypted data, and the second key to a receiving device.

### Claim 20 (depends on 19)

The non-transitory computer readable storage medium according to claim 19, wherein the sending device and the receiving device are in a chat session of a social networking application and the to-be-encrypted picture is part of a message that the sending device sends to the receiving device through the chat session.
