Data encryption method and device for cloud platform, equipment and storage medium

By performing binary sequence updates and block encryption on the data in the cloud platform, the problem of low security in existing cloud platform data encryption methods is solved, and the security and anti-attack capabilities of data transmission are improved.

CN121056201APending Publication Date: 2025-12-02SHENZHEN TRUSTED CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511206521.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-12-02

AI Technical Summary

Technical Problem

Existing cloud platform data encryption methods have low security and cannot effectively protect data security during transmission.

Method used

The target data is converted into a binary sequence, the initial key is updated based on the binary sequence to obtain the target key, the binary sequence is then encrypted in groups, the encrypted data groups are identified using a preset identification method, and finally the initial key and the identified encrypted data groups are sent to the terminal.

Benefits of technology

It improves the anti-attack capability of encryption algorithms, avoids the security risks of key reuse or simple encryption modes, and enhances the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121056201A_ABST
    Figure CN121056201A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of encryption, and provides a data encryption method and device for a cloud platform, equipment and a storage medium. The method comprises the steps of obtaining target data in response to a data request of a terminal; obtaining an initial key corresponding to the target data in a database based on the data type of the target data; converting the target data into a binary sequence, and updating the initial key based on the binary sequence to obtain a target key; performing block encryption on the binary sequence based on the target key to obtain a plurality of encrypted data groups; for each encrypted data group, identifying the encrypted data group based on a preset identification method; and sending the initial secret key and each identified encrypted data group to the terminal. According to the method, the potential safety hazard of a simple encryption mode is effectively avoided, and the anti-attack capability of an encryption algorithm is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of encryption technology, and in particular to a data encryption method, apparatus, device and storage medium for cloud platforms. Background Technology

[0002] With the rapid development of cloud computing technology, more and more enterprises and individuals are choosing to migrate their data storage and computing tasks to cloud platforms. While cloud platforms offer efficient computing resources and storage capabilities, data security has become increasingly prominent, especially during data transmission, where data faces potential threats such as leakage, tampering, and unauthorized access. Therefore, effectively protecting user data security on cloud platforms has become a crucial technical issue.

[0003] In current cloud platform data protection solutions, data encryption is considered one of the most effective means. However, existing encryption methods still suffer from low security. Summary of the Invention

[0004] This application provides a data encryption method, apparatus, device, and storage medium for cloud platforms to address the problems mentioned in the background section.

[0005] Firstly, this application provides a data encryption method for a cloud platform, comprising: Respond to the terminal's data request and obtain the target data; Based on the data type of the target data, obtain the initial key corresponding to the target data from the database; The target data is converted into a binary sequence, and the initial key is updated based on the binary sequence to obtain the target key; The binary sequence is grouped and encrypted based on the target key to obtain multiple encrypted data groups; For each of the encrypted data groups, the encrypted data groups are identified based on a preset identification method; The initial key and the encrypted data groups following the identifier are sent to the terminal.

[0006] In one possible implementation, the initial key is a character sequence including numbers and letters, and the step of updating the initial key based on the binary sequence to obtain the target key includes: A first target value and a second target value are obtained based on the binary sequence; wherein, the first target value is the bit value corresponding to the first character of the binary sequence, and the second target value is the bit value corresponding to the second character of the binary sequence; A first target number matching the first target value is determined in the initial key, and the first target number is replaced in the initial key using the last digit of the first target value to obtain a first target character sequence; wherein the first target value and the value corresponding to the sequence of the first target number in the initial key have the same numerical attribute, and the numerical attribute is either odd or even. A second target number matching the second target value is determined in the initial key, and the first digit of the second target value is used to replace the second target number in the initial key to obtain a second target character sequence; wherein the second target value and the value corresponding to the sequence of the second target number in the initial key have the same numerical attribute, and the numerical attribute is either odd or even. The initial key, the first target character sequence, and the second target character sequence are inserted sequentially from top to bottom into a preset blank matrix to obtain an initial matrix; the initial matrix is ​​the target key.

[0007] In one possible implementation, the binary sequence is block-encrypted based on the target key to obtain multiple encrypted data groups, including: The binary sequence is segmented based on a preset segmentation algorithm to obtain a data group sequence; For each data group in the data group sequence, the initial matrix is ​​updated based on the third target value corresponding to the data group to obtain the encryption matrix corresponding to the data group, and the data group is encrypted based on the encryption matrix to obtain the encrypted data group corresponding to the data group; wherein, the third target value is the value corresponding to the sequence of the data group in the data group sequence.

[0008] In one possible implementation, updating the initial matrix based on the third target value corresponding to the data group to obtain the encryption matrix corresponding to the data group includes: Target matrix elements are determined in the initial matrix based on the third target value; wherein, the target matrix elements do not include the numbers in the third target value; The initial matrix is ​​updated based on the element attributes of each of the target matrix elements and the third target value; the element attributes are numbers or letters.

[0009] In one possible implementation, updating the initial matrix based on the element attributes of each of the target matrix elements and the third target value includes: For each of the target matrix elements, if the target matrix element is a number, determine whether the value corresponding to the row number of the target matrix element is a prime number. If it is, replace the target matrix element in the initial matrix with the product of the target matrix element and the third target value. If not, replace the target matrix element in the initial matrix with the sum of the target matrix element and the third target value. For each of the target matrix elements, if the target matrix element is a letter, determine whether the value corresponding to the column number of the target matrix element is a composite number. If yes, replace the target matrix element in the initial matrix with the product of the value corresponding to the column number of the target matrix element and the third target value. If no, replace the target matrix element in the initial matrix with the product of the value corresponding to the row number of the target matrix element and the third target value.

[0010] In one possible implementation, identifying the encrypted data group based on a preset identification method includes: The first target value, the second target value, and the third target value corresponding to the encrypted data group are arranged in sequence to obtain the identifier sequence corresponding to the encrypted data group, and the encrypted data group is identified based on the identifier sequence.

[0011] Secondly, this application provides a data encryption device for a cloud platform, comprising: The first acquisition module is used to respond to data requests from the terminal and acquire target data. The second acquisition module is used to acquire the initial key corresponding to the target data from the database based on the data type of the target data; An update module is used to convert the target data into a binary sequence and update the initial key based on the binary sequence to obtain the target key; An encryption processing module is used to perform block encryption on the binary sequence based on the target key to obtain multiple encrypted data blocks; The identification module is used to identify each of the encrypted data groups based on a preset identification method. The sending module is used to send the initial key and each of the encrypted data groups following the identifier to the terminal.

[0012] Thirdly, this application provides a terminal device, the terminal device including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the data encryption method for a cloud platform as described in any of the preceding claims.

[0013] Fourthly, this application provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the data encryption method for a cloud platform as described in any of the preceding claims.

[0014] This application provides a data encryption method, apparatus, device, and storage medium for a cloud platform. The method includes: responding to a data request from a terminal and obtaining target data; obtaining an initial key corresponding to the target data from a database based on the data type of the target data; converting the target data into a binary sequence and updating the initial key based on the binary sequence to obtain a target key; performing group encryption on the binary sequence based on the target key to obtain multiple encrypted data groups; identifying each encrypted data group based on a preset identification method; and sending the initial key and each identified encrypted data group to the terminal. The method provided in this embodiment, by grouping the binary sequence and performing independent encryption on each data group, ensures that each data group corresponds to a different encryption matrix. This group encryption method effectively avoids the security risks of key reuse or simple encryption modes, and improves the anti-attack capability of the encryption algorithm. Attached Figure Description

[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 A flowchart illustrating a data encryption method for a cloud platform provided in an embodiment of this application; Figure 2 A schematic block diagram of the structure of a data encryption device for a cloud platform provided in the embodiments of this application; Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the described order. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change based on the actual situation.

[0019] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0020] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the relevant listed items and all possible combinations, and includes such combinations.

[0021] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features described herein can be combined with each other.

[0022] Please see Figure 1 , Figure 1 This is a flowchart illustrating a data encryption method for a cloud platform provided in an embodiment of this application, as shown below. Figure 1 As shown, the data encryption method for a cloud platform provided in this application includes steps S1 to S6.

[0023] Step S1: Respond to the terminal's data request and obtain the target data.

[0024] It should be noted that the execution subject of this application embodiment can be a server or a data encryption device used in a cloud platform. The following description takes a server as an example.

[0025] Specifically, the server responds to the terminal's data request and parses the data request. Based on the result of parsing the data request, the server processes the data request to obtain the target data, or retrieves the target data from the database based on the result of parsing the data request.

[0026] Step S2: Obtain the initial key corresponding to the target data from the database based on the data type of the target data.

[0027] Specifically, the target data can be any of video, audio, image, and text. The database has a mapping relationship between each data type and its corresponding initial key. The initial key corresponding to the target data is obtained from the database based on the data type of the target data.

[0028] Step S3: Convert the target data into a binary sequence, and update the initial key based on the binary sequence to obtain the target key.

[0029] Specifically, updating the initial key based on the binary sequence to obtain the target key includes the following steps: A first target value and a second target value are obtained based on the binary sequence; wherein, the first target value is the bit value corresponding to the first character of the binary sequence, and the second target value is the bit value corresponding to the second character of the binary sequence; it can be understood that the first target value and the second target value can be either 0 or 1. For example, when the first target value is 0, the second target value is 1, and the binary sequence is 0101011001110111001110101010, the first target value is 12 and the second target value is 16. A first target number matching the first target value is determined in the initial key, and the first target number is replaced in the initial key using the last digit of the first target value to obtain a first target character sequence; wherein the first target value and the value corresponding to the sequence of the first target number in the initial key have the same numerical attribute, and the numerical attribute is either odd or even. A second target number matching the second target value is determined in the initial key, and the first digit of the second target value is used to replace the second target number in the initial key to obtain a second target character sequence; wherein the second target value and the value corresponding to the sequence of the second target number in the initial key have the same numerical attribute, and the numerical attribute is either odd or even. The initial key, the first target character sequence, and the second target character sequence are inserted sequentially from top to bottom into a preset blank matrix to obtain an initial matrix; the initial matrix is ​​the target key.

[0030] Understandably, step S3 updates the initial key based on the binary sequence to obtain the target key, which enables encryption based on the characteristics of the target data itself, thereby effectively improving the randomness of the target key and helping to prevent potential attack risks.

[0031] Step S4: Encrypt the binary sequence in groups based on the target key to obtain multiple encrypted data groups.

[0032] Specifically, step S4 includes the following steps: The binary sequence is segmented based on a preset segmentation algorithm to obtain a data group sequence; For each data group in the data group sequence, the initial matrix is ​​updated based on the third target value corresponding to the data group to obtain the encryption matrix corresponding to the data group, and the data group is encrypted based on the encryption matrix to obtain the encrypted data group corresponding to the data group; wherein, the third target value is the value corresponding to the sequence of the data group in the data group sequence.

[0033] Understandably, step S3 processes the binary sequence into groups and performs independent encryption on each data group, so that each data group corresponds to a different encryption matrix. This group encryption method effectively avoids the security risks of key reuse or simple encryption modes and improves the anti-attack capability of the encryption algorithm.

[0034] The step of updating the initial matrix based on the third target value corresponding to the data group to obtain the encryption matrix corresponding to the data group includes the following steps: Target matrix elements are determined in the initial matrix based on the third target value; wherein, the target matrix elements do not include the numbers in the third target value; The initial matrix is ​​updated based on the element attributes of each of the target matrix elements and the third target value; the element attributes are numbers or letters.

[0035] The step of updating the initial matrix based on the element attributes of each target matrix element and the third target value includes the following steps: For each of the target matrix elements, if the target matrix element is a number, determine whether the value corresponding to the row number of the target matrix element is a prime number. If it is, replace the target matrix element in the initial matrix with the product of the target matrix element and the third target value. If not, replace the target matrix element in the initial matrix with the sum of the target matrix element and the third target value. For each of the target matrix elements, if the target matrix element is a letter, determine whether the value corresponding to the column number of the target matrix element is a composite number. If yes, replace the target matrix element in the initial matrix with the product of the value corresponding to the column number of the target matrix element and the third target value. If no, replace the target matrix element in the initial matrix with the product of the value corresponding to the row number of the target matrix element and the third target value.

[0036] Understandably, the method described above for updating the initial matrix based on the third target value corresponding to the data group to obtain the encryption matrix corresponding to the data group helps to increase the difficulty of cracking the encryption matrix.

[0037] Step S5: For each of the encrypted data groups, identify the encrypted data groups based on a preset identification method.

[0038] Specifically, for each encrypted data group, the first target value, the second target value, and the third target value corresponding to the encrypted data group are arranged sequentially to obtain an identifier sequence corresponding to the encrypted data group, and the encrypted data group is identified based on the identifier sequence. It can be understood that the third target value corresponding to the encrypted data group is the third target value corresponding to the data group to which the encrypted data group belongs.

[0039] Step S6: Send the initial key and each of the encrypted data groups following the identifier to the terminal.

[0040] Specifically, after receiving the initial key and the identifier, the terminal decrypts each encrypted data group based on the initial key and the identifier sequence corresponding to the encrypted data group to obtain the data group corresponding to the encrypted data group. Then, it sorts each data group based on the third target number corresponding to each data group to obtain the binary sequence and restores the binary sequence to the target data.

[0041] The method provided in this embodiment processes binary sequences into groups and performs independent encryption on each data group, so that each data group corresponds to a different encryption matrix. This group encryption method effectively avoids the security risks of key reuse or simple encryption modes and improves the anti-attack capability of the encryption algorithm.

[0042] Please see Figure 2 , Figure 2 This is a schematic block diagram of the structure of a data encryption device 100 for a cloud platform provided in an embodiment of this application, such as... Figure 2 As shown, the data encryption device 100 for a cloud platform provided in this application embodiment includes: The first acquisition module 110 is used to respond to the terminal's data request and acquire the target data.

[0043] The second acquisition module 120 is used to acquire the initial key corresponding to the target data from the database based on the data type of the target data.

[0044] The update module 130 is used to convert the target data into a binary sequence and update the initial key based on the binary sequence to obtain the target key.

[0045] The encryption processing module 140 is used to perform group encryption on the binary sequence based on the target key to obtain multiple encrypted data groups.

[0046] The identification module 150 is used to identify each of the encrypted data groups based on a preset identification method.

[0047] The sending module 160 is used to send the initial key and each of the encrypted data groups following the identifier to the terminal.

[0048] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device and each module described above can be referred to the process in the aforementioned embodiment of the data encryption method for cloud platforms, and will not be repeated here.

[0049] The data encryption device 100 for a cloud platform provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 3 The terminal device 200 shown is running on it.

[0050] Please see Figure 3 , Figure 3 The present invention provides a schematic block diagram of the structure of a terminal device 200. The terminal device 200 includes a processor 201 and a memory 202, which are connected via a device bus 203. The memory 202 may include a non-volatile storage medium and internal memory.

[0051] The non-volatile storage medium can store a computer program. The computer program includes program instructions that, when executed by the processor 201, cause the processor 201 to perform any of the aforementioned data encryption methods for the cloud platform.

[0052] The processor 201 provides computing and control capabilities to support the operation of the entire terminal device 200.

[0053] The internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor 201, the processor 201 can execute any of the aforementioned data encryption methods for the cloud platform.

[0054] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal device 200 involved in the present application. The specific terminal device 200 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0055] It should be understood that processor 201 can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0056] In some embodiments, the processor 201 is configured to run a computer program stored in memory to perform the following steps: Respond to the terminal's data request and obtain the target data; Based on the data type of the target data, obtain the initial key corresponding to the target data from the database; The target data is converted into a binary sequence, and the initial key is updated based on the binary sequence to obtain the target key; The binary sequence is grouped and encrypted based on the target key to obtain multiple encrypted data groups; For each of the encrypted data groups, the encrypted data groups are identified based on a preset identification method; The initial key and the encrypted data groups following the identifier are sent to the terminal.

[0057] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the terminal device 200 described above can be referred to the aforementioned data encryption method for cloud platforms, and will not be repeated here.

[0058] This application also provides a computer-readable storage medium storing a computer program that, when executed by one or more processors, causes the one or more processors to implement the data encryption method for a cloud platform provided in this application.

[0059] The computer-readable storage medium can be an internal storage unit of the terminal device 200 described in the foregoing embodiments, such as a hard disk or memory of the terminal device 200. The computer-readable storage medium can also be an external storage device of the terminal device 200, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided with the terminal device 200.

[0060] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data encryption method for a cloud platform, characterized in that, include: Respond to the terminal's data request and obtain the target data; Based on the data type of the target data, obtain the initial key corresponding to the target data from the database; The target data is converted into a binary sequence, and the initial key is updated based on the binary sequence to obtain the target key; The binary sequence is grouped and encrypted based on the target key to obtain multiple encrypted data groups; For each of the encrypted data groups, the encrypted data groups are identified based on a preset identification method; The initial key and the encrypted data groups following the identifier are sent to the terminal.

2. The data encryption method for a cloud platform according to claim 1, characterized in that, The initial key is a character sequence, which includes numbers and letters. Updating the initial key based on the binary sequence to obtain the target key includes: A first target value and a second target value are obtained based on the binary sequence; wherein, the first target value is the bit value corresponding to the first character of the binary sequence, and the second target value is the bit value corresponding to the second character of the binary sequence; A first target number matching the first target value is determined in the initial key, and the first target number is replaced in the initial key using the last digit of the first target value to obtain a first target character sequence; wherein the first target value and the value corresponding to the sequence of the first target number in the initial key have the same numerical attribute, and the numerical attribute is either odd or even. A second target number matching the second target value is determined in the initial key, and the first digit of the second target value is used to replace the second target number in the initial key to obtain a second target character sequence; wherein the second target value and the value corresponding to the sequence of the second target number in the initial key have the same numerical attribute, and the numerical attribute is either odd or even. The initial key, the first target character sequence, and the second target character sequence are inserted sequentially from top to bottom into a preset blank matrix to obtain an initial matrix; the initial matrix is ​​the target key.

3. The data encryption method for a cloud platform according to claim 2, characterized in that, The binary sequence is encrypted in blocks based on the target key to obtain multiple encrypted data blocks, including: The binary sequence is segmented based on a preset segmentation algorithm to obtain a data group sequence; For each data group in the data group sequence, the initial matrix is ​​updated based on the third target value corresponding to the data group to obtain the encryption matrix corresponding to the data group, and the data group is encrypted based on the encryption matrix to obtain the encrypted data group corresponding to the data group; wherein, the third target value is the value corresponding to the sequence of the data group in the data group sequence.

4. The data encryption method for a cloud platform according to claim 3, characterized in that, The step of updating the initial matrix based on the third target value corresponding to the data group to obtain the encryption matrix corresponding to the data group includes: Target matrix elements are determined in the initial matrix based on the third target value; wherein, the target matrix elements do not include the numbers in the third target value; The initial matrix is ​​updated based on the element attributes of each of the target matrix elements and the third target value; the element attributes are numbers or letters.

5. The data encryption method for a cloud platform according to claim 4, characterized in that, The step of updating the initial matrix based on the element attributes of each of the target matrix elements and the third target value includes: For each of the target matrix elements, if the target matrix element is a number, determine whether the value corresponding to the row number of the target matrix element is a prime number. If it is, replace the target matrix element in the initial matrix with the product of the target matrix element and the third target value. If not, replace the target matrix element in the initial matrix with the sum of the target matrix element and the third target value. For each of the target matrix elements, if the target matrix element is a letter, determine whether the value corresponding to the column number of the target matrix element is a composite number. If yes, replace the target matrix element in the initial matrix with the product of the value corresponding to the column number of the target matrix element and the third target value. If no, replace the target matrix element in the initial matrix with the product of the value corresponding to the row number of the target matrix element and the third target value.

6. The data encryption method for a cloud platform according to claim 5, characterized in that, The identification of the encrypted data group based on the preset identification method includes: The first target value, the second target value, and the third target value corresponding to the encrypted data group are arranged in sequence to obtain the identifier sequence corresponding to the encrypted data group, and the encrypted data group is identified based on the identifier sequence.

7. A data encryption device for a cloud platform, characterized in that, include: The first acquisition module is used to respond to data requests from the terminal and acquire target data. The second acquisition module is used to acquire the initial key corresponding to the target data from the database based on the data type of the target data; An update module is used to convert the target data into a binary sequence and update the initial key based on the binary sequence to obtain the target key; An encryption processing module is used to perform block encryption on the binary sequence based on the target key to obtain multiple encrypted data blocks; The identification module is used to identify each of the encrypted data groups based on a preset identification method. The sending module is used to send the initial key and each of the encrypted data groups following the identifier to the terminal.

8. A terminal device, characterized in that, The terminal device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the data encryption method for a cloud platform as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the data encryption method for a cloud platform as described in any one of claims 1 to 6.