A method and system for storing and accessing private data
Through the encryption and decryption mechanism of session keys and PIN codes, combined with the use of SM2 key pairs, the inconvenient problem of private data storage and access in the existing technology is solved, and security and user experience are improved.
Patent Information
- Application Number
- CN202011416770.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-07
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2040-12-07
AI Technical Summary
The existing secure storage and secure access of private data mainly relies on hardware devices, which are inconvenient to use and provide poor user experience.
The session key is used to encrypt data and the PIN code is used to encrypt the session key. The session key and master key are randomly generated to encrypt and decrypt the data. Combined with the use of SM2 key pairs, the secure storage and access of data are achieved.
It improves the storage and access security of private data, improves user experience, supports user PIN code reset and offline use, and enhances data protection capabilities.
Smart Images

Figure CN112464265B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information security technology, and in particular relates to a storage access method and system for private data. Background Art
[0002] The privacy protection of private data has always been the cornerstone of the digital world. The secure storage and access of private data is a topic that needs to be continuously studied. Currently, the secure storage and access of private data mainly use hardware devices for access, such as using UKey for encryption and decryption. The entire encryption and decryption process is carried out in UKey. This method requires carrying hardware devices, which is inconvenient to use and has a poor user experience. Summary of the invention
[0003] In view of the defects in the prior art, the present invention provides a method and system for storing and accessing private data, which improves the security of private data storage and access and enhances user experience.
[0004] In a first aspect, a highly secure data storage access method comprises the following steps:
[0005] When data is being stored, the plain text of the entered data and the user PIN code are obtained;
[0006] Randomly generate session keys;
[0007] Encrypt the data plaintext using the session key to obtain and store the data ciphertext;
[0008] Encrypt the session key using the user PIN code, and obtain and store the encryption key;
[0009] When accessing private data, obtain the entered user PIN code;
[0010] The user PIN code is used to decrypt the encryption key, and when the decryption is successful, the decrypted session key is obtained;
[0011] The decrypted session key is used to decrypt the data ciphertext to obtain the data plaintext.
[0012] Preferably, the step of encrypting the session key using the user PIN code and obtaining and storing the encryption key specifically comprises:
[0013] Encrypting the session key using the user PIN code to obtain and store the first session key ciphertext;
[0014] Decrypting the encryption key using the user PIN code, when the decryption is successful, obtaining the decrypted session key specifically includes:
[0015] The user PIN code is used to decrypt the first session key ciphertext. If the decryption is successful, the decrypted session key is obtained.
[0016] Preferably, after obtaining and storing the first session key ciphertext, the method further comprises:
[0017] Get the entered administrator PIN code;
[0018] Randomly generate a master key that is symmetric to the session key;
[0019] The administrator PIN code is used to encrypt the master key, and the first master key ciphertext is obtained and stored;
[0020] Encrypting the session key using the master key to obtain and store the second session key ciphertext;
[0021] When resetting the user PIN, obtain the entered administrator PIN and the new user PIN;
[0022] The administrator PIN code is used to decrypt the first master key ciphertext. If the decryption is successful, the decrypted master key is obtained;
[0023] Decrypt the second session key ciphertext using the decrypted master key. If the decryption is successful, obtain the decrypted session key.
[0024] The session key obtained by encrypting and decrypting the new user PIN code is used to obtain a new first session key ciphertext;
[0025] The original first session key ciphertext is replaced with the new first session key ciphertext.
[0026] Preferably, when storing data, obtaining the entered data plaintext and user PIN code specifically includes:
[0027] When data is stored, the client obtains the plain text of the entered data and the user PIN code;
[0028] The client generates a user SM2 key pair according to the user PIN code, where the user SM2 key pair includes a public key and a private key;
[0029] The client sends the public key of the user's SM2 key pair to the server;
[0030] The server generates a unique identification ID;
[0031] The server generates a server SM2 key pair, and associates the server SM2 key pair with the public key of the user SM2 key pair through a unique identification ID; wherein the server SM2 key pair includes a public key and a private key;
[0032] The server stores the unique identification ID, the public key of the user's SM2 key pair, and the server's SM2 key pair;
[0033] The server sends the public key and unique identification ID in the server SM2 key to the client.
[0034] Preferably, the randomly generating a session key; encrypting the data plaintext using the session key to obtain and store the data ciphertext; encrypting the session key using the user PIN code to obtain and store the encryption key specifically includes:
[0035] The client randomly generates a session key;
[0036] The client uses the session key to encrypt the data plaintext, obtains and stores the data ciphertext;
[0037] The client uses the public key of the user SM2 key pair and the public key of the server SM2 key to encrypt the session key, and obtains and stores the third session key ciphertext.
[0038] Preferably, when accessing private data, obtaining an entered user PIN code; decrypting an encryption key using the user PIN code, and when the decryption is successful, obtaining a decrypted session key; and decrypting data ciphertext using the decrypted session key to obtain data plaintext specifically includes:
[0039] When accessing private data, the client obtains the entered user PIN code;
[0040] The client generates a user SM2 key pair based on the user PIN code;
[0041] The client initiates an authentication challenge to the server based on the user's SM2 key pair;
[0042] When the server detects that the client's identity authentication challenge is successful, it uses the private key in the server SM2 key to decrypt the third session key ciphertext to obtain the primary plaintext of the session key;
[0043] The server sends the primary plaintext of the session key to the client;
[0044] The client uses the private key in the user's SM2 key to decrypt the primary plaintext of the session key. If the decryption is successful, the decrypted session key is obtained;
[0045] The client uses the decrypted session key to decrypt the data ciphertext and obtain the data plaintext.
[0046] Preferably, after obtaining and storing the third session key ciphertext, the method further comprises:
[0047] The client obtains the entered administrator PIN code;
[0048] The client generates an administrator SM2 key pair based on the administrator PIN code, where the user SM2 key pair includes a public key and a private key;
[0049] The client sends the public key of the administrator's SM2 key pair to the server;
[0050] The server associates the server SM2 key pair with the public key of the administrator SM2 key pair through the unique identification ID;
[0051] The server stores the public key of the administrator's SM2 key pair;
[0052] The client randomly generates a master key that is symmetric to the session key;
[0053] The client encrypts the master key using the public key of the administrator SM2 key pair and the public key of the server SM2 key, and obtains and stores the second master key ciphertext;
[0054] The client encrypts the session key using the master key to obtain and store the fourth session key ciphertext;
[0055] When resetting the user PIN, the client obtains the entered administrator PIN and the new user PIN;
[0056] The client generates an administrator SM2 key pair based on the administrator PIN code, and generates a new user SM2 key pair based on the new user PIN code;
[0057] The client initiates an authentication challenge to the server based on the administrator's SM2 key pair;
[0058] When the server detects that the client's identity authentication challenge is successful, it uses the private key in the server's SM2 key to decrypt the second master key ciphertext to obtain the primary plaintext of the master key;
[0059] The server sends the primary plaintext of the master key to the client;
[0060] The client uses the private key in the administrator's SM2 key to decrypt the primary plaintext of the master key. If the decryption is successful, the decrypted master key is obtained;
[0061] The client uses the decrypted master key to decrypt the fourth session key ciphertext. If the decryption is successful, the decrypted session key is obtained.
[0062] The client uses the public key in the new server SM2 key and the public key in the new user SM2 key to encrypt and decrypt the obtained session key to obtain a new third session key ciphertext;
[0063] The original third session key ciphertext is replaced with the new third session key ciphertext.
[0064] Preferably, the identity authentication challenge specifically includes:
[0065] The client sends the public key in the user's SM2 key or the public key in the administrator's SM2 key to the server;
[0066] The client sends the unique identification ID to the server;
[0067] The server generates a random challenge number and sends it to the client;
[0068] The client signs the challenge random number using the private key in the user SM2 key or the private key in the administrator SM2 key, and sends the obtained signature and the third session key ciphertext to the server, or sends the obtained signature, the second master key ciphertext and the public key of the new user SM2 key pair to the server;
[0069] The server verifies the signature using the public key in the user's SM2 key and the challenge random number, or the public key in the administrator's SM2 key and the challenge random number. If the signature S verification fails, a decryption error prompt is returned;
[0070] When the server detects that the number of consecutive identity authentication challenges from the client is greater than a preset value, it locks the private key in the service SM2 key.
[0071] In a second aspect, a high-security data storage access system comprises a processor, an input device, an output device and a memory, wherein the processor, input device, output device and memory are interconnected, wherein the memory is used to store a computer program, and the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect.
[0072] In a third aspect, a high-security data storage access system includes a client and a server;
[0073] The client is used to execute the method described in the first aspect;
[0074] The server is used to generate a server SM2 key pair and associate it with the user's PIN code; the server is also used to execute the identity authentication challenge initiated by the client.
[0075] It can be seen from the above technical solutions that the private data storage access method and system provided by the present invention improve the security of private data storage and access and enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0077] Figure 1 This is a flowchart of data storage in the storage access method provided in Embodiment 1 of the present invention.
[0078] Figure 2 This is a flow chart of data access in the storage access method provided in Embodiment 1 of the present invention.
[0079] Figure 3 This is a flowchart of data storage in the storage access method provided in Embodiment 2 of the present invention.
[0080] Figure 4 This is a flow chart of data access in the storage access method provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0081] The embodiments of the technical solution of the present invention will be described in detail below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and are therefore only used as examples, and the protection scope of the present invention cannot be limited thereto. It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should be the common meanings understood by those skilled in the art to which the present invention belongs.
[0082] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0083] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0084] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0085] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0086] Embodiment 1:
[0087] The embodiment provides a locally implemented data storage access method, comprising the following steps:
[0088] 1. Data storage, see Figure 1 .
[0089] When data is stored, the plain text of the entered data and the user PIN code userPin are obtained;
[0090] Randomly generate a session key sessionKey;
[0091] Use the session key sessionKey to encrypt the data plaintext, obtain and store the data ciphertext;
[0092] The user PIN code userPin is used to encrypt the session key sessionKey, and the first session key ciphertext is obtained and stored; wherein the encryption and decryption process provided in this embodiment includes verifying padding.
[0093] 2. Data access, see Figure 2 .
[0094] When accessing private data, obtain the entered user PIN code userPin;
[0095] The user PIN code userPin is used to decrypt the first session key ciphertext. If the decryption is successful, the decrypted session key sessionKey is obtained; if the decryption fails, a prompt indicating that the PIN code is wrong is returned.
[0096] Use the decrypted session key sessionKey to decrypt the data ciphertext to obtain the data plaintext.
[0097] 3. Reset user PIN code.
[0098] The method also has the function of resetting the user PIN code, which is used when the user forgets the user PIN code. The steps specifically include:
[0099] Get the entered administrator PIN code soPin;
[0100] Randomly generate a master key masterKey that is symmetric to the session key;
[0101] The administrator PIN code soPin is used to encrypt the master key masterKey, and the first master key ciphertext is obtained and stored;
[0102] The master key masterKey is used to encrypt the session key sessionKey, and the second session key ciphertext is obtained and stored;
[0103] When resetting the user PIN code, obtain the entered administrator PIN code soPin and the new user PIN code userPin;
[0104] The administrator PIN code soPin is used to decrypt the first master key ciphertext. If the decryption is successful, the decrypted master key masterKey is obtained; if the decryption fails, a prompt indicating that the PIN code is wrong is returned.
[0105] The decrypted master key masterKey is used to decrypt the second session key ciphertext. If the decryption is successful, the decrypted session key sessionKey is obtained; if the decryption fails, a decryption error prompt is returned.
[0106] The session key sessionKey obtained by encrypting and decrypting the new user PIN code userPin is obtained to obtain a new first session key ciphertext;
[0107] The original first session key ciphertext is replaced with the new first session key ciphertext.
[0108] This method can be run offline. The user only needs to provide the correct user PIN code userPin to decrypt the encrypted data ciphertext. This method also supports the user PIN code userPin reset and retrieval function. This method improves the security of private data storage and access and enhances the user experience.
[0109] Embodiment 2:
[0110] The embodiment provides an online data storage access method, comprising the following steps:
[0111] 1. Data storage, see Figure 3 .
[0112] When data is stored, the client obtains the plain text of the entered data and the user PIN userPin;
[0113] The client generates a user SM2 key pair (d1, P1) according to the user PIN code userPin, where the user SM2 key pair (d1, P1) includes a one-to-one corresponding public key P1 and private key d1;
[0114] The client sends the public key P1 of the user SM2 key pair to the server;
[0115] The server generates a unique identifier IDuuid;
[0116] The server generates a server SM2 key pair (d3, P3), and associates the server SM2 key pair (d3, P3) with the public key P1 of the user SM2 key pair through a unique identifier IDuuid; wherein the server SM2 key pair (d3, P3) includes a one-to-one corresponding public key P3 and a private key d3;
[0117] The server stores the unique identifier IDuuid, the public key P1 of the user SM2 key pair, and the server SM2 key pair (d3, P3), where the private key d3 can be stored after being encrypted and protected using a cryptographic machine;
[0118] The server sends the public key P3 and unique identifier IDuuid in the server SM2 key to the client.
[0119] The client randomly generates a session key sessionKey;
[0120] The client uses the session key sessionKey to encrypt the data plaintext, obtain and store the data ciphertext;
[0121] The client uses the public key P1 of the user SM2 key pair and the public key P3 of the server SM2 key to encrypt the session key sessionKey, obtains and stores the third session key ciphertext see, that is, see = enc(enc(sessionKey, P1), P3). During encryption, the public key P1 of the user SM2 key pair is used to perform the first-level encryption on the session key sessionKey, and the public key P3 of the server SM2 key is used to perform the second-level encryption on the result of the first-level encryption.
[0122] 2. Data access, see Figure 4 .
[0123] When accessing private data, the client obtains the entered user PIN code userPin;
[0124] The client generates a user SM2 key pair (d1, P1) based on the user PIN code userPin;
[0125] The client initiates an identity authentication challenge to the server based on the user's SM2 key (d1, P1);
[0126] When the server detects that the client's identity authentication challenge is successful, it uses the private key d3 in the server SM2 key to decrypt the third session key ciphertext see to obtain the primary plaintext se of the session key, that is, se=dec(see,d3);
[0127] The server sends the primary plaintext of the session key to the client;
[0128] The client uses the private key d1 in the user SM2 key to decrypt the primary plaintext of the session key se. If the decryption is successful, the decrypted session key sessionKey is obtained, that is, sessionKey = dec(se, d1);
[0129] The client uses the decrypted session key sessionKey to decrypt the data ciphertext and obtain the data plaintext.
[0130] The identity authentication challenges specifically include:
[0131] The client sends the public key P1 in the user SM2 key to the server and initiates an authentication challenge for the public key P1;
[0132] The client sends the unique identifier IDuuid to the server;
[0133] The server generates a random challenge number r and sends it to the client;
[0134] The client uses the private key d1 in the user SM2 key to sign the challenge random number r, and sends the obtained signature S and the third session key ciphertext see to the server;
[0135] The server verifies the signature S using the public key P1 in the user SM2 key and the challenge random number r; if the signature S verification fails, a decryption error prompt is returned;
[0136] When the server detects that the number of consecutive identity authentication challenges from the client is greater than a preset value, it locks the private key in the service SM2 key.
[0137] 3. Reset user PIN code.
[0138] The client obtains the entered administrator PIN code soPin;
[0139] The client generates an administrator SM2 key pair (d2, P2) according to the administrator PIN code soPin, where the user SM2 key pair (d2, P2) includes a one-to-one corresponding public key P2 and private key d2;
[0140] The client sends the public key P2 of the administrator SM2 key pair to the server;
[0141] The server associates the server SM2 key (d3, P3) pair with the public key P2 of the administrator SM2 key pair through the unique identifier IDuuid;
[0142] The server stores the public key P2 of the administrator SM2 key pair;
[0143] The client randomly generates a master key masterKey that is symmetric to the session key;
[0144] The client uses the public key P2 of the administrator SM2 key pair and the public key P3 of the server SM2 key to encrypt the master key, obtain and store the second master key ciphertext mee, mee = enc (enc (masterKey, P2), P3);
[0145] The client encrypts the session key sessionKey using the master key masterKey to obtain and store the fourth session key ciphertext;
[0146] When resetting the user PIN code userPin, the client obtains the entered administrator PIN code soPin and the new user PIN code userPin;
[0147] The client generates an administrator SM2 key pair (d2, P2) based on the administrator PIN code soPin, and generates a new user SM2 key pair (d1, P1) based on the new user PIN code userPin;
[0148] The client initiates an authentication challenge to the server based on the administrator's SM2 key (d2, P2);
[0149] When the server detects that the client's identity authentication challenge is successful, it uses the private key d3 in the server SM2 key to decrypt the second master key ciphertext mee to obtain the master key primary plaintext me, me=dec(mee,d3).
[0150] The server sends the primary plaintext me of the master key to the client;
[0151] The client uses the private key d2 in the administrator's SM2 key to decrypt the primary plaintext of the master key me. If the decryption is successful, the decrypted master key masterKey is obtained, that is, masterKey = dec(me, d2);
[0152] The client uses the decrypted master key masterKey to decrypt the fourth session key ciphertext. If the decryption is successful, the decrypted session key sessionKey is obtained.
[0153] The client uses the public key P3 in the new server SM2 key and the public key P1 in the new user SM2 key to encrypt and decrypt the obtained session key sessionKey, and obtains the new third session key ciphertext new see, new see = enc (enc (sessionKey, new P1), P3);
[0154] The original third session key ciphertext is replaced with the new third session key ciphertext.
[0155] The identity authentication challenges specifically include:
[0156] The client sends the public key P2 in the administrator's SM2 key to the server and initiates an authentication challenge for the public key P2;
[0157] The client sends the unique identifier IDuuid to the server;
[0158] The server generates a random challenge number r and sends it to the client;
[0159] The client uses the private key d2 in the administrator SM2 key to sign the challenge random number r, and sends the obtained signature S, the second master key ciphertext mee and the public key P1 of the new user SM2 key pair to the server;
[0160] The server verifies the signature S through the public key P2 in the administrator's SM2 key and the challenge random number r; if the signature S verification fails, a decryption error prompt is returned;
[0161] When the server detects that the number of consecutive identity authentication challenges from the client is greater than a preset value, the server locks the private key d3 in the service SM2 key. For example, when n is greater than or equal to 1, the private key d3 is locked.
[0162] This method is safer and does not fear brute force cracking of the PIN code. It improves the security of private data storage and access and enhances user experience.
[0163] The method provided in the embodiment of the present invention is briefly described. For matters not mentioned in the embodiment part, reference can be made to the corresponding contents in the aforementioned method embodiment.
[0164] Embodiment three:
[0165] A high-security data storage access system includes a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method described in Example 1.
[0166] It should be understood that in the embodiments of the present invention, the processor referred to may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0167] Input devices may include a touchpad, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and output devices may include a display (LCD, etc.), a speaker, etc.
[0168] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0169] The system provided in the embodiment of the present invention is briefly described. For matters not mentioned in the embodiment part, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0170] Embodiment 4:
[0171] A high-security data storage access system includes a client and a server;
[0172] The client is used to execute the method described in the second embodiment;
[0173] The server is used to generate a server SM2 key pair and associate it with the user's PIN code; the server is also used to execute the identity authentication challenge initiated by the client.
[0174] The system provided in the embodiment of the present invention is briefly described. For matters not mentioned in the embodiment part, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. A highly secure data storage access method, characterized in that: The following steps are involved: When data is being stored, the plain text of the entered data and the user PIN code are obtained; Randomly generate session keys; Encrypt the data plaintext using the session key to obtain and store the data ciphertext; Encrypt the session key using the user PIN code, and obtain and store the encryption key; When accessing private data, obtain the entered user PIN code; The user PIN code is used to decrypt the encryption key, and when the decryption is successful, the decrypted session key is obtained; Decrypt the data ciphertext using the decrypted session key to obtain the data plaintext; When accessing private data, the user PIN code entered is obtained; the encryption key is decrypted using the user PIN code, and when the decryption is successful, the decrypted session key is obtained; The decrypted session key is used to decrypt the data ciphertext, and the data plaintext obtained includes: When accessing private data, the client obtains the entered user PIN code; The client generates a user SM2 key pair based on the user PIN code; The client initiates an authentication challenge to the server based on the user's SM2 key pair; When the server detects that the client's identity authentication challenge is successful, it uses the private key in the server SM2 key to decrypt the third session key ciphertext to obtain the primary plaintext of the session key; The server sends the primary plaintext of the session key to the client; The client uses the private key in the user's SM2 key to decrypt the primary plaintext of the session key. If the decryption is successful, the decrypted session key is obtained; The client uses the decrypted session key to decrypt the data ciphertext and obtain the data plaintext; When data is stored, obtaining the entered data plain text and user PIN code specifically includes: When data is stored, the client obtains the plain text of the entered data and the user PIN code; The client generates a user SM2 key pair according to the user PIN code, where the user SM2 key pair includes a public key and a private key; The client sends the public key of the user's SM2 key pair to the server; The server generates a unique identification ID; The server generates a server SM2 key pair, and associates the server SM2 key pair with the public key of the user SM2 key pair through a unique identification ID; wherein the server SM2 key pair includes a public key and a private key; The server stores the unique identification ID, the public key of the user's SM2 key pair, and the server's SM2 key pair; The server sends the public key and unique identification ID in the server SM2 key to the client; The randomly generated session key; the use of the session key to encrypt the data plaintext, obtain and store the data ciphertext; the use of the user PIN code to encrypt the session key, obtain and store the encryption key specifically includes: The client randomly generates a session key; The client uses the session key to encrypt the data plaintext, obtains and stores the data ciphertext; The client uses the public key of the user SM2 key pair and the public key of the server SM2 key to encrypt the session key, and obtains and stores the third session key ciphertext.
2. The high-security data storage access method according to claim 1, characterized in that: The method of encrypting the session key using the user PIN code and obtaining and storing the encryption key specifically includes: Encrypting the session key using the user PIN code to obtain and store the first session key ciphertext; Decrypting the encryption key using the user PIN code, when the decryption is successful, obtaining the decrypted session key specifically includes: The user PIN code is used to decrypt the first session key ciphertext. If the decryption is successful, the decrypted session key is obtained.
3. The high-security data storage access method according to claim 2, characterized in that: After obtaining and storing the first session key ciphertext, the method further includes: Get the entered administrator PIN code; Randomly generate a master key that is symmetric to the session key; The administrator PIN code is used to encrypt the master key, and the first master key ciphertext is obtained and stored; Encrypting the session key using the master key to obtain and store the second session key ciphertext; When resetting the user PIN, obtain the entered administrator PIN and the new user PIN; The administrator PIN code is used to decrypt the first master key ciphertext. If the decryption is successful, the decrypted master key is obtained; Decrypt the second session key ciphertext using the decrypted master key. If the decryption is successful, obtain the decrypted session key. The session key obtained by encrypting and decrypting the new user PIN code is used to obtain a new first session key ciphertext; The original first session key ciphertext is replaced with the new first session key ciphertext.
4. The high-security data storage access method according to claim 1, characterized in that: After obtaining and storing the third session key ciphertext, the method further includes: The client obtains the entered administrator PIN code; The client generates an administrator SM2 key pair based on the administrator PIN code, where the user SM2 key pair includes a public key and a private key; The client sends the public key of the administrator's SM2 key pair to the server; The server associates the server SM2 key pair with the public key of the administrator SM2 key pair through the unique identification ID; The server stores the public key of the administrator's SM2 key pair; The client randomly generates a master key that is symmetric to the session key; The client encrypts the master key using the public key of the administrator SM2 key pair and the public key of the server SM2 key, and obtains and stores the second master key ciphertext; The client encrypts the session key using the master key to obtain and store the fourth session key ciphertext; When resetting the user PIN, the client obtains the entered administrator PIN and the new user PIN; The client generates an administrator SM2 key pair based on the administrator PIN code, and generates a new user SM2 key pair based on the new user PIN code; The client initiates an authentication challenge to the server based on the administrator's SM2 key pair; When the server detects that the client's identity authentication challenge is successful, it uses the private key in the server's SM2 key to decrypt the second master key ciphertext to obtain the primary plaintext of the master key; The server sends the primary plaintext of the master key to the client; The client uses the private key in the administrator's SM2 key to decrypt the primary plaintext of the master key. If the decryption is successful, the decrypted master key is obtained; The client uses the decrypted master key to decrypt the fourth session key ciphertext. If the decryption is successful, the decrypted session key is obtained. The client uses the public key in the new server SM2 key and the public key in the new user SM2 key to encrypt and decrypt the obtained session key to obtain a new third session key ciphertext; The original third session key ciphertext is replaced with the new third session key ciphertext.
5. The high-security data storage access method according to claim 1 or 4, characterized in that: The identity authentication challenges specifically include: The client sends the public key in the user's SM2 key or the public key in the administrator's SM2 key to the server; The client sends the unique identification ID to the server; The server generates a random challenge number and sends it to the client; The client signs the challenge random number using the private key in the user SM2 key or the private key in the administrator SM2 key, and sends the obtained signature and the third session key ciphertext to the server, or sends the obtained signature, the second master key ciphertext and the public key of the new user SM2 key pair to the server; The server verifies the signature using the public key in the user's SM2 key and the challenge random number, or the public key in the administrator's SM2 key and the challenge random number. If the signature S verification fails, a decryption error prompt is returned; When the server detects that the number of consecutive identity authentication challenges from the client is greater than a preset value, it locks the private key in the service SM2 key.
6. A highly secure data storage and access system, characterized in that: The method comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 2 to 4.
7. A highly secure data storage and access system, characterized in that: Includes client and server; The client is used to execute the method as claimed in claim 1; The server is used to generate a server SM2 key pair and associate it with the user's PIN code; the server is also used to execute the identity authentication challenge initiated by the client.
Citation Information
Patent Citations
Encryption system and control method thereof
US20040086124A1
Re-encryption system, re-encryption method and re-encryption program
US20150236850A1
