IP Library Granted Patent US 10,818,202
Granted Patent B2
US 10,818,202 · App. 16/027,174 · Granted Oct 27, 2020

Method and apparatus for encrypting data, method and apparatus for decrypting data

Inventors: Yuepeng Liu (Beijing, CN); Peng Yun (Beijing, CN)
Assignee: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
G09C1/00H04L9/0625H04L9/0637H04L9/0643H04L9/3239
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,818,202
App. No.
16/027,174
Granted
Oct 27, 2020
Kind
B2
Abstract

The disclosure discloses a method and apparatus for encrypting data, and a method and apparatus for decrypting data. The method for encrypting data includes: acquiring a to-be-encrypted data block; executing a first encryption on the to-be-encrypted data block to obtain a data ciphertext; executing a hash operation on the to-be-encrypted data block to obtain an index key; designating a last ciphertext block as a first target ciphertext block, and decrypting the first target ciphertext block to acquire an index value of the first target ciphertext block; executing a preset operation on the index value of the first target ciphertext block to obtain the index value of the to-be-encrypted data block, and executing a second encryption on the index value of the to-be-encrypted data block based on the index key to generate an index ciphertext; and combining the data ciphertext and the index ciphertext to generate a ciphertext block.

Claims (33)

1. A method for encrypting data, comprising:

acquiring a to-be-encrypted data block;

executing a first encryption on the to-be-encrypted data block using a preset security key to obtain a data ciphertext of the to-be-encrypted data block;

executing a hash operation on the to-be-encrypted data block to obtain an index key of the to-be-encrypted data block;

designating a last ciphertext block in a generated ciphertext block sequence as a first target ciphertext block, and decrypting the first target ciphertext block to acquire an index value of the first target ciphertext block;

executing a preset operation on the index value of the first target ciphertext block to obtain the index value of the to-be-encrypted data block, and executing a second encryption on the index value of the to-be-encrypted data block based on the index key to generate an index ciphertext of the to-be-encrypted data block; and

combining the data ciphertext and the index ciphertext of the to-be-encrypted data block to generate a ciphertext block corresponding to the to-be-encrypted data block.

2. The method according to claim 1 , wherein the designating a last ciphertext block in a generated ciphertext block sequence as a first target ciphertext block, and decrypting the first target ciphertext block to acquire an index value of the first target ciphertext block comprises:

decrypting the first target ciphertext block using the preset security key, to obtain the index ciphertext and a data plaintext of the first target ciphertext block;

executing the hash operation on the data plaintext of the first target ciphertext block to obtain the index key of the first target ciphertext block; and

decrypting the index ciphertext of the first target ciphertext block using the index key of the first target ciphertext block, to obtain the index value of the first target ciphertext block.

3. The method according to claim 1 , wherein the executing a preset operation on the index value of the first target ciphertext block to obtain the index value of the to-be-encrypted data block comprises:

increasing the index value of the first target ciphertext block by one to obtain the index value of the to-be-encrypted data block.

4. The method according to claim 1 , further comprising:

adding the ciphertext block corresponding to the to-be-encrypted data block to an end of the ciphertext block sequence.

5. A non-transitory computer-readable storage medium storing a computer program, the computer program when executed by one or more processors, causes the one or more processors to perform the method according to claim 1 .

6. An apparatus for encrypting data, comprising:

at least one processor; and

a memory storing instructions, the instructions when executed by the at least one processor, cause the at least one processor to perform operations, the operations comprising:

acquiring a to-be-encrypted data block;

executing a first encryption on the to-be-encrypted data block using a preset security key to obtain a data ciphertext of the to-be-encrypted data block;

executing a hash operation on the to-be-encrypted data block to obtain an index key of the to-be-encrypted data block;

designating a last ciphertext block in a generated ciphertext block sequence as a first target ciphertext block, and decrypting the first target ciphertext block to acquire an index value of the first target ciphertext block;

executing a preset operation on the index value of the first target ciphertext block to obtain the index value of the to-be-encrypted data block, and executing a second encryption on the index value of the to-be-encrypted data block based on the index key to generate an index ciphertext of the to-be-encrypted data block; and

combining the data ciphertext and the index ciphertext of the to-be-encrypted data block to generate a ciphertext block corresponding to the to-be-encrypted data block.

7. The apparatus according to claim 6 , wherein the designating a last ciphertext block in a generated ciphertext block sequence as a first target ciphertext block, and decrypting the first target ciphertext block to acquire an index value of the first target ciphertext block comprises:

decrypting the first target ciphertext block using the preset security key, to obtain the index ciphertext and a data plaintext of the first target ciphertext block;

executing the hash operation on the data plaintext of the first target ciphertext block to obtain the index key of the first target ciphertext block; and

decrypting the index ciphertext of the first target ciphertext block using the index key of the first target ciphertext block, to obtain the index value of the first target ciphertext block.

8. The apparatus according to claim 6 , wherein the executing a preset operation on the index value of the first target ciphertext block to obtain the index value of the to-be-encrypted data block comprises:

increasing the index value of the first target ciphertext block by one to obtain the index value of the to-be-encrypted data block.

9. The apparatus according to claim 6 , further comprising:

adding the ciphertext block corresponding to the to-be-encrypted data block to an end of the ciphertext block sequence.

Assignments (3)
CORRECTIVE ASSIGNMENT TO CORRECT THE APPLICANT NAME PREVIOUSLY RECORDED AT REEL: 057933 FRAME: 0812. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Dec 28, 2021
From: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
To: APOLLO INTELLIGENT DRIVING TECHNOLOGY (BEIJING) CO., LTD.
Reel/Frame 058594/0836 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 13, 2021
From: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
To: APOLLO INTELLIGENT DRIVING (BEIJING) TECHNOLOGY CO., LTD.
Reel/Frame 057933/0812 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 8, 2018
From: LIU, YUEPENG; YUN, PENG
To: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
Reel/Frame 046288/0310 →
Priority Claims (1)
CN 2017 1 0539291 · Jul 4, 2017 · national
Continuity (1)
Related Publication 20190012935A1 · Jan 10, 2019