Data storage method and system
By using asymmetric and symmetric encryption algorithms to double-encrypt business data in the data storage system and uploading it to the blockchain for storage, the problems of user data leakage and poor security in the existing technology are solved, and the High security storage of data.
Patent Information
- Application Number
- CN202111090823.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-09-17
AI Technical Summary
Existing data storage technologies have problems with user data leakage and poor security, especially in scenarios where sensitive information is transmitted and processed.
By using an asymmetric encryption algorithm to generate an asymmetric key and a symmetric encryption algorithm to generate a symmetric key between the mobile terminal and the data storage platform, the business data is double encrypted and uploaded to the blockchain for storage, combined with hashing Value validation ensures data security.
It effectively avoids data leakage and malicious tampering, improves the security in the data storage process, and ensures the privacy protection of user data.
Smart Images

Figure CN113779634B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a data storage method and system. Background Art
[0002] With the development of information technology, the commercialization of big data and cloud computing has developed rapidly, and data has become an increasingly important component of daily life. At the same time, the privacy and security of personal data has also become increasingly important.
[0003] In the daily operation of enterprises and other scenarios involving the exchange of sensitive information such as personal privacy information, when the service call and data transmission between the sensitive data holder and the widely distributed big data enterprise systems in various industries are carried out, it is inevitable to involve the transmission and processing of this part of sensitive information. With the development of personal privacy protection, citizens' personal privacy awareness and policies and regulations have put forward high requirements and strong constraints on enterprises and institutions in handling sensitive information and other privacy data.
[0004] Existing data storage technologies mostly use centralized servers for storage, which makes data vulnerable to hacker attacks and poses a risk of data leakage. Summary of the invention
[0005] In order to overcome the problems existing in the prior art, the present invention provides a data storage method and system to solve the problems of user data leakage and poor security caused by the existing data storage method.
[0006] In a first aspect, the present application provides a data storage method, which is applied to a mobile terminal and comprises the following steps:
[0007] Generate an asymmetric key using an asymmetric encryption algorithm according to the user identity information and the logical password, wherein the asymmetric key includes a public key and a private key;
[0008] Sending the public key of the asymmetric key to the data storage platform;
[0009] Generate a symmetric key through a symmetric encryption algorithm based on user identity information;
[0010] The business data is encrypted by using a symmetric key to obtain encrypted business data;
[0011] destroying the symmetric key;
[0012] The once encrypted business data is sent to the data storage platform.
[0013] Before the business data is encrypted by the symmetric key to obtain the encrypted business data, the following steps are also included:
[0014] Performing hash calculation on the business data to obtain a first hash value;
[0015] The hash value is sent to the data storage platform.
[0016] The following steps are also included:
[0017] Generate a symmetric key for encryption based on user information through a symmetric encryption algorithm;
[0018] Encrypting the private key of the asymmetric key by using the symmetric key for encryption;
[0019] Destroying the symmetric key used for encryption;
[0020] The encrypted private key is stored in the mobile terminal.
[0021] The following steps are also included:
[0022] Obtain secondary encrypted business data from the blockchain;
[0023] Decrypting the private key of the asymmetric key by a symmetric encryption algorithm according to the user information;
[0024] The secondary encrypted business data is decrypted by using the private key of the asymmetric key to obtain the business data.
[0025] The following steps are also included:
[0026] Performing hash calculation on the business data to obtain a second hash value;
[0027] Determine whether the second Hash value is consistent with the first Hash value;
[0028] If they are consistent, the verification is successful;
[0029] If they do not match, verification fails.
[0030] The asymmetric key is calculated using the SM2 asymmetric encryption algorithm, and the symmetric key is calculated using the SM4 symmetric encryption algorithm.
[0031] In a second aspect, the present application provides a data storage method, which is applied to a data storage platform, comprising the following steps:
[0032] Receiving a public key in an asymmetric key from the mobile terminal, where the asymmetric key is generated by the mobile terminal according to user identity information and a logical password, and the asymmetric key includes a public key and a private key;
[0033] Receiving once-encrypted service data from the mobile terminal, the once-encrypted service data being obtained by the mobile terminal encrypting service data using a symmetric key, the symmetric key being generated by the mobile terminal using a symmetric encryption algorithm according to user identity information;
[0034] Generate a symmetric key through a symmetric encryption algorithm based on user identity information;
[0035] Decrypting the once encrypted business data using a symmetric key to obtain business data;
[0036] destroying the symmetric key;
[0037] Encrypting the service data by using the public key in the asymmetric key to obtain secondary encrypted service data;
[0038] The secondary encrypted business data is uploaded to the blockchain for storage.
[0039] The following steps are also included:
[0040] Performing hash calculation on the business data to obtain a first hash value;
[0041] The first hash value is uploaded to the blockchain for storage.
[0042] Generate a symmetric key based on user identity information through a symmetric encryption algorithm, including:
[0043] The symmetric key is calculated using the SM4 symmetric encryption algorithm.
[0044] In a third aspect, the present application provides a data storage system, including a mobile terminal and a data storage platform;
[0045] The mobile terminal is configured to generate an asymmetric key through an asymmetric encryption algorithm according to the user identity information and the logical password, wherein the asymmetric key includes a public key and a private key;
[0046] Sending the public key of the asymmetric key to the data storage platform;
[0047] Generate a symmetric key through a symmetric encryption algorithm based on user identity information;
[0048] The business data is encrypted by using a symmetric key to obtain encrypted business data;
[0049] destroying the symmetric key;
[0050] The once encrypted business data is sent to the data storage platform.
[0051] The data storage platform is configured to receive a public key in an asymmetric key from the mobile terminal, wherein the asymmetric key is generated by the mobile terminal according to user identity information and a logical password, and the asymmetric key includes a public key and a private key;
[0052] Receiving once-encrypted service data from the mobile terminal, the once-encrypted service data being obtained by the mobile terminal encrypting service data using a symmetric key, the symmetric key being generated by the mobile terminal using a symmetric encryption algorithm according to user identity information;
[0053] Generate a symmetric key through a symmetric encryption algorithm based on user identity information;
[0054] Decrypting the once encrypted business data using a symmetric key to obtain business data;
[0055] destroying the symmetric key;
[0056] Encrypting the service data by using the public key in the asymmetric key to obtain secondary encrypted service data;
[0057] The secondary encrypted business data is uploaded to the blockchain for storage.
[0058] As can be seen from the above content, the technical solution provided by the embodiment of the present application generates an asymmetric key based on the user identity information and the logical password, generates a symmetric key based on the user identity information through a symmetric encryption algorithm, encrypts the business data with the asymmetric key and the symmetric key in turn, and uploads it to the blockchain for storage. This solves the problem of user data leakage and poor security caused by the existing data storage method. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0060] Figure 1 A data flow diagram of a data storage method of the present application;
[0061] Figure 2 This is a workflow diagram of the mobile terminal of this application;
[0062] Figure 3 A flowchart of an embodiment of the present application;
[0063] Figure 4 This is a workflow diagram of the second embodiment of the present application;
[0064] Figure 5 This is a workflow diagram of the third embodiment of the present application;
[0065] Figure 6 This is a workflow diagram of the data storage platform of this application. DETAILED DESCRIPTION
[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0067] See also Figure 1 , which is a data flow diagram of a data storage method of the present application, generates an asymmetric key according to user identity information and a logical password, generates a symmetric key according to the user identity information through a symmetric encryption algorithm, encrypts the business data with the asymmetric key and the symmetric key in turn, and uploads it to the blockchain for storage. This solves the problem of user data leakage and poor security caused by existing data storage methods.
[0068] First, see Figure 2 The present application provides a data storage method, which is applied to a mobile terminal and includes the following steps:
[0069] S100: Generate an asymmetric key using an asymmetric encryption algorithm according to user identity information and a logical password, wherein the asymmetric key includes a public key and a private key;
[0070] More specifically, the security of the asymmetric key is derived from the elliptic curve public key cryptography algorithm, and the mathematical basis guarantees encryption security.
[0071] S110: Sending the public key of the asymmetric key to a data storage platform;
[0072] S120: Generate a symmetric key using a symmetric encryption algorithm according to the user identity information;
[0073] S130: Encrypt the service data using a symmetric key to obtain primary encrypted service data;
[0074] S140: destroying the symmetric key;
[0075] S150: Send the once encrypted business data to a data storage platform.
[0076] In one embodiment of the present application, see Figure 3 , before encrypting the business data with a symmetric key to obtain the encrypted business data, the following steps are also included:
[0077] S151: Perform hash calculation on the business data to obtain a first hash value;
[0078] S152: Send the hash value to the data storage platform.
[0079] More specifically, the business data is hashed using the SM4 symmetric encryption algorithm.
[0080] In one embodiment of the present application, see Figure 4 , further comprising the following steps:
[0081] S160: Generate a symmetric key for encryption according to the user information by using a symmetric encryption algorithm;
[0082] S161: Encrypt the private key of the asymmetric key by using the symmetric key for encryption;
[0083] S162: destroying the symmetric key used for encryption;
[0084] S163: Store the encrypted private key in the mobile terminal.
[0085] By encrypting the private key of the asymmetric key, the leakage of the once encrypted business data can be effectively avoided, the security of the business data storage process is improved, and it is prevented from being maliciously obtained by others.
[0086] In one embodiment of the present application, see Figure 5 , further comprising the following steps:
[0087] S170: Obtain secondary encrypted business data from the blockchain;
[0088] S171: Decrypting the private key of the asymmetric key by using a symmetric encryption algorithm according to the user information;
[0089] S172: Decrypt the secondary encrypted business data using the private key of the asymmetric key to obtain business data.
[0090] More specifically, during the decryption operation of the secondary encrypted business data using the private key of the asymmetric key, the identity of the mobile terminal will be verified, and the hash value of the business data will be verified. The private key signature challenge number of the asymmetric key is then used, and the back end of the data storage platform performs signature verification through the public key of the asymmetric key.
[0091] In one embodiment of the present application, see Figure 4 , further comprising the following steps:
[0092] Performing hash calculation on the business data to obtain a second hash value;
[0093] Determine whether the second Hash value is consistent with the first Hash value;
[0094] If they are consistent, the verification is successful;
[0095] If they do not match, verification fails.
[0096] By verifying the first hash value, it is possible to effectively prevent the business data from being maliciously tampered with, causing the business data to be lost or leaked, thereby improving security.
[0097] The asymmetric key is calculated using the SM2 asymmetric encryption algorithm, and the symmetric key is calculated using the SM4 symmetric encryption algorithm.
[0098] Second, see Figure 6 The present application provides a data storage method, which is applied to a data storage platform and includes the following steps:
[0099] S200: receiving a public key in an asymmetric key from the mobile terminal, where the asymmetric key is generated by the mobile terminal according to user identity information and a logical password, and the asymmetric key includes a public key and a private key;
[0100] S210: receiving encrypted service data from the mobile terminal, where the encrypted service data is obtained by the mobile terminal encrypting the service data using a symmetric key, where the symmetric key is generated by the mobile terminal using a symmetric encryption algorithm according to user identity information;
[0101] S220: Generate a symmetric key using a symmetric encryption algorithm according to the user identity information;
[0102] More specifically, in one embodiment of the present application, the front end and the back end of the data storage platform respectively generate symmetric keys according to user identity information.
[0103] The back end cuts the symmetric key, sends one third of the symmetric key to the mobile terminal, and stores the remaining two thirds of the symmetric key in the data storage platform.
[0104] S230: decrypting the once encrypted service data using a symmetric key to obtain service data;
[0105] S240: destroying the symmetric key;
[0106] More specifically, when the mobile terminal generates an operation, the front end generates a corresponding registration transaction number, generates TSC using the registration transaction number, timestamp, and did, encrypts the TSC using the TSC as an encryption factor, and sends it to the back end, which obtains the TSC through collision, decrypts one-third of the key, and combines the other two-thirds of the key with it to perform a decryption operation, and then uses the obtained AES key to encrypt and decrypt the file, and then returns the corresponding result to the front end. Obtain business data.
[0107] S250: Encrypt the service data using the public key in the asymmetric key to obtain secondary encrypted service data;
[0108] S260: Upload the secondary encrypted business data to the blockchain for storage.
[0109] In one embodiment of the present application, the following steps are also included:
[0110] Performing hash calculation on the business data to obtain a first hash value;
[0111] The first hash value is uploaded to the blockchain for storage.
[0112] Generate a symmetric key based on user identity information through a symmetric encryption algorithm, including:
[0113] The symmetric key is calculated using the SM4 symmetric encryption algorithm.
[0114] In a third aspect, the present application provides a data storage system, including a mobile terminal and a data storage platform;
[0115] The mobile terminal is configured to generate an asymmetric key through an asymmetric encryption algorithm according to the user identity information and the logical password, wherein the asymmetric key includes a public key and a private key;
[0116] Sending the public key of the asymmetric key to the data storage platform;
[0117] Generate a symmetric key through a symmetric encryption algorithm based on user identity information;
[0118] The business data is encrypted by using a symmetric key to obtain encrypted business data;
[0119] The once encrypted business data is sent to the data storage platform.
[0120] The data storage platform is configured to receive a public key in an asymmetric key from the mobile terminal, wherein the asymmetric key is generated by the mobile terminal according to user identity information and a logical password, and the asymmetric key includes a public key and a private key;
[0121] Receiving once-encrypted service data from the mobile terminal, the once-encrypted service data being obtained by the mobile terminal encrypting service data using a symmetric key, the symmetric key being generated by the mobile terminal using a symmetric encryption algorithm according to user identity information;
[0122] Generate a symmetric key through a symmetric encryption algorithm based on user identity information;
[0123] Decrypting the once encrypted business data using a symmetric key to obtain business data;
[0124] Encrypting the service data by using the public key in the asymmetric key to obtain secondary encrypted service data;
[0125] The secondary encrypted business data is uploaded to the blockchain for storage.
[0126] The data storage platform and the mobile terminal in this embodiment can refer to the description in the method embodiment when executing the above method, and will not be repeated here.
[0127] From the above content, it can be seen that the technical solution provided by the embodiment of the present application, by generating an asymmetric key according to the user identity information and the logical password, generating a symmetric key according to the user identity information through a symmetric encryption algorithm, encrypting the business data by asymmetric keys and symmetric keys in turn, and uploading them to the blockchain for storage. Solve the problem that the existing data storage method leads to user data leakage and poor security.
Claims
1. A data storage method, It is characterized in that Applied to mobile terminals, including the following steps: Generate an asymmetric key using an asymmetric encryption algorithm according to the user identity information and the logical password, wherein the asymmetric key includes a public key and a private key; Sending the public key of the asymmetric key to the data storage platform; Generate a symmetric key for encryption based on user information through a symmetric encryption algorithm; Encrypting the private key of the asymmetric key by using the symmetric key for encryption; Destroying the symmetric key used for encryption; storing the encrypted private key in the mobile terminal; The business data is encrypted by using a symmetric key to obtain encrypted business data; Sending the once encrypted business data to the data storage platform; Obtain secondary encrypted business data from the blockchain; Decrypting the private key of the asymmetric key by a symmetric encryption algorithm according to the user information; The secondary encrypted business data is decrypted by using the private key of the asymmetric key to obtain the business data.
2. The data storage method according to claim 1, It is characterized in that Before the business data is encrypted by the symmetric key to obtain the encrypted business data, the following steps are also included: Performing hash calculation on the business data to obtain a first hash value; The first hash value is stored in the mobile terminal.
3. The data storage method according to claim 2, It is characterized in that The following steps are also included: Performing hash calculation on the business data to obtain a second hash value; Determine whether the second Hash value is consistent with the first Hash value; If they are consistent, the verification is successful; If they do not match, verification fails.
4. The data storage method according to claim 3, It is characterized in that The asymmetric key is calculated using the SM2 asymmetric encryption algorithm, and the symmetric key is calculated using the SM4 symmetric encryption algorithm.
5. A data storage method, It is characterized in that Applied to the data storage platform, including the following steps: Receiving a public key in an asymmetric key from a mobile terminal, wherein the asymmetric key is generated by the mobile terminal according to user identity information and a logical password, and the asymmetric key includes a public key and a private key; Receiving once-encrypted service data from the mobile terminal, the once-encrypted service data being obtained by the mobile terminal encrypting service data using a symmetric key, the symmetric key being generated by the mobile terminal using a symmetric encryption algorithm according to user identity information; Generate a symmetric key through a symmetric encryption algorithm based on user identity information; Decrypting the once encrypted business data using a symmetric key to obtain business data; destroying the symmetric key; Encrypting the service data by using the public key in the asymmetric key to obtain secondary encrypted service data; The secondary encrypted business data is uploaded to the blockchain for storage.
6. The data storage method according to claim 5, It is characterized in that The following steps are also included: Performing hash calculation on the business data to obtain a first hash value; The first hash value is uploaded to the blockchain for storage.
7. The data storage method according to claim 6, It is characterized in that Generate a symmetric key based on user identity information through a symmetric encryption algorithm, including: The symmetric key is calculated using the SM4 symmetric encryption algorithm.
8. A data storage system, It is characterized in that Including mobile terminals and data storage platforms; The mobile terminal is configured to generate an asymmetric key through an asymmetric encryption algorithm according to the user identity information and the logical password, wherein the asymmetric key includes a public key and a private key; Sending the public key of the asymmetric key to the data storage platform; Generate a symmetric key through a symmetric encryption algorithm based on user identity information; The business data is encrypted by using a symmetric key to obtain encrypted business data; destroying the symmetric key; Sending the once encrypted business data to the data storage platform; The data storage platform is configured to receive a public key in an asymmetric key from the mobile terminal, wherein the asymmetric key is generated by the mobile terminal according to user identity information and a logical password, and the asymmetric key includes a public key and a private key; Receiving once-encrypted service data from the mobile terminal, the once-encrypted service data being obtained by the mobile terminal encrypting service data using a symmetric key, the symmetric key being generated by the mobile terminal using a symmetric encryption algorithm according to user identity information; Generate a symmetric key through a symmetric encryption algorithm based on user identity information; Decrypting the once encrypted business data using a symmetric key to obtain business data; destroying the symmetric key; Encrypting the service data by using the public key in the asymmetric key to obtain secondary encrypted service data; The secondary encrypted business data is uploaded to the blockchain for storage.
