Key derivation method, data encryption method, server, electronic device and storage medium
By using the two-factor key derivation method of the master password and the unique identification information of the user authentication device in the password management tool, the problem of the single-factor key derivation method being exposed after the master password is leaked is solved, and higher data is achieved. Cryptographic security and key protection effects.
Patent Information
- Application Number
- CN202210339817.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-04-01
Smart Images

Figure CN114785495B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a key derivation method, a data encryption method, a server, an electronic device and a storage medium. Background Art
[0002] With the rapid development and popularization of information technology, electronic accounts and passwords are needed in more and more online scenarios, such as browser login accounts, email accounts, various application software login names, etc. There are many corresponding passwords, which are easy to forget. In order to solve this problem, some software for password management tools have emerged, which can centrally manage accounts and passwords.
[0003] Password management tools can help users create different passwords for each account without worrying about passwords being forgotten. With the help of the password management tools, users can store all passwords in a password file locked with a master password. They only need to remember one master password, and then use this master password to encrypt and protect passwords for a large number of online applications. But this means that the protection of the master password will become a top priority.
[0004] The key involved in encryption and decryption operations is generally not directly using the master password set by the user, but is generated based on the master password set by the user through the key derivation algorithm KDF (Key Derivation Function). The principles of key derivation algorithms are diverse, and the parameters involved in the derivation are different. Currently, in addition to the master password set by the user, most KDF algorithms can also improve the security of the derived key by adding parameters such as salt and number of iterations.
[0005] However, the inventors found in the process of implementing the invention that the password file header stores the salt and iteration count used when saving the password file. Although the parameter values are different each time when saving, the salt and iteration count can be read from the file header when opening the key file. The only thing that cannot be obtained is the master password set by the user. At present, based on the single master password factor key derivation method, once the single master password is leaked, all account password records in the entire password file will be exposed without reservation. Summary of the invention
[0006] In view of this, embodiments of the present invention provide a key derivation method, a file encryption method, a server, an electronic device and a storage medium, which can improve the security of data encryption to a certain extent.
[0007] In order to achieve the above-mentioned invention object, the following technical scheme is adopted:
[0008] In a first aspect, an embodiment of the present invention provides a key derivation method, comprising: obtaining a master password input by a user and unique identification information of a user authentication device;
[0009] Based on the master password and the unique identification information of the user authentication device, a key derivation operation is performed according to a first key derivation algorithm to obtain a key for encrypting data.
[0010] Optionally, the user authentication device is a Bluetooth device, and the unique identification information is Bluetooth address information or a machine code.
[0011] Optionally, after obtaining the master password input by the user, the method further comprises: verifying whether the master password is correct;
[0012] If so, a hash calculation is performed on the master password according to a cryptographic hash algorithm to obtain a first hash value of the master password.
[0013] Optionally, the unique identification information is Bluetooth address information;
[0014] After obtaining the unique identification information of the user authentication device, the method further includes:
[0015] A hash calculation is performed on the Bluetooth address information of the user authentication device according to a cryptographic hash algorithm to obtain a corresponding second hash value.
[0016] Optionally, the first key derivation algorithm includes: a cryptographic hash algorithm and a multi-factor key derivation algorithm;
[0017] The step of performing a key derivation operation based on the master password and the unique identification information of the user authentication device according to a first key derivation algorithm to obtain a key for encrypting data includes:
[0018] Concatenate the first hash value of the master password and the second hash value corresponding to the Bluetooth address information;
[0019] A concatenated third Hash value is calculated according to a cryptographic hash algorithm; the third Hash value is a bit string parameter used to be passed into a multi-factor key derivation algorithm;
[0020] The bit string parameter is received and an iterative operation is performed using a multi-factor key derivation algorithm to obtain a key for encrypting data.
[0021] Optionally, the multi-factor key derivation algorithm is a national secret hash algorithm;
[0022] The receiving the bit string parameter passed in, and performing iterative operations using a multi-factor key derivation algorithm to obtain a key for encrypting data includes:
[0023] Assign the obtained salt value to the intermediate sequence code variable as the initial intermediate sequence code variable value;
[0024] Initializing the key data bit string to a bit string of a predetermined byte length;
[0025] Using the national secret hash algorithm to perform a first iteration operation on the input bit string parameter and the initial value of the intermediate sequence code variable to obtain a first intermediate sequence code variable value;
[0026] Performing an XOR operation on the initialization key data bit string and the first intermediate sequence code variable value to obtain a first intermediate key data bit string; the first intermediate key data bit string has the same length as the initialization key data bit string;
[0027] Substituting the first intermediate key data bit string and the first intermediate sequence code variable value into the national secret hash algorithm, performing a second iterative operation, and obtaining a second intermediate sequence code variable value;
[0028] Performing an XOR operation on the first intermediate key data bit string and the second intermediate sequence code variable value to obtain a second intermediate key data bit string; the second intermediate key data bit string has the same length as the initialization key data bit string;
[0029] Substitute the i-th intermediate key data bit string and the i-th intermediate sequence code variable value obtained by the i-th iterative operation into the national secret hash algorithm, perform the i+1-th iterative operation, and obtain the i+1-th intermediate sequence code variable value;
[0030] Perform an XOR operation on the i-th intermediate key data bit string and the i+1-th intermediate sequence code variable value to obtain a final key data bit string; wherein i is the key derivation operation iteration count variable, i≥0;
[0031] The final key data bit string is stored as a key for encrypting data.
[0032] In a second aspect, an embodiment of the present invention further provides a data encryption method, comprising: generating a key for encrypting data according to any key derivation method described in the first aspect;
[0033] Based on the key, the data is encrypted according to a preset encryption algorithm.
[0034] In a third aspect, an embodiment of the present invention provides a server, including a host, on which a password management application is installed, and the password management application is at least used to respond to a user's request and execute any key derivation method described in the first aspect.
[0035] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising: one or more processors; a memory; one or more executable programs are stored in the memory, and the one or more processors read the executable program code stored in the memory and run a password management application corresponding to the executable program code to execute any key derivation method described in the first aspect.
[0036] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement any key derivation method described in the first aspect.
[0037] The key derivation method, data encryption method, server, electronic device and storage medium provided by the embodiments of the present invention obtain the master password input by the user and the unique identification information of the user authentication device; perform a key derivation operation based on the password and the unique identification information of the user authentication device as operation factors for key derivation. Compared with the key derivation method based on the existing single-factor key derivation method, the key used for encrypting data obtained by performing a key derivation operation using two-factor parameters can improve the security of data encryption. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of a process of a key derivation method according to an embodiment of the present invention;
[0040] Figure 2 This is a flow chart of another embodiment of the key derivation method of the present invention;
[0041] Figure 3 A schematic diagram of a data encryption method according to an embodiment of the present invention
[0042] Figure 4 This is a schematic block diagram of the architecture of a server according to an embodiment of the present invention;
[0043] Figure 5 The figure is a schematic diagram of the structure of an embodiment of the electronic device of the present invention. DETAILED DESCRIPTION
[0044] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0045] It should be clear that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] The key derivation method and data encryption method provided by the embodiments of the present invention can be applied to password management tools and are suitable for encrypted data security protection scenarios. By using user authentication devices, such as Bluetooth technology, and user master password protection together for key derivation, a key derivation method based on dual factors is implemented, which increases the difficulty of key cracking and further achieves the purpose of protecting encrypted files.
[0047] It should be noted that the method can be solidified in a certain manufactured physical product in the form of software, and when the user uses the product, the method flow of the present application can be reproduced.
[0048] Figure 1 FIG. 1 is a flow chart of an embodiment of a key derivation method of the present invention; see FIG. Figure 1 As shown, the key derivation method may include the steps of:
[0049] S110: Acquire a master password input by a user and unique identification information of a user authentication device.
[0050] The master password is also called the master password, which can be composed of Arabic numerals, English letters and / or other special characters. The length of the master password set by different users may be different. To ensure the security of the master password, in some embodiments, after obtaining the master password input by the user, some password derivation algorithms, such as the national secret hash algorithm SM3, can be used to perform hash calculations on the master password and output a 256-bit master password hash value to participate in the subsequent derivation operation of the key used to encrypt data, thereby improving the security of the key.
[0051] Please see Figure 2 As shown, specifically, after obtaining the master password input by the user, the method further includes: verifying whether the master password is correct;
[0052] Specifically, a master password input box and a master password confirmation box are set in the setting interface of the password management tool, wherein the master password confirmation box contains a correct master password defined by the user; and whether the master password input is correct is confirmed by comparing whether the passwords in the two boxes are consistent.
[0053] If yes, the master password is hashed according to the cryptographic hash algorithm to obtain the first hash value of the master password. After confirming that the master password is correctly input, the hash value of the master password is calculated according to a preset cryptographic hash algorithm, such as the SM3 algorithm. In this way, the complexity of cracking the encrypted file key can be increased, thereby increasing the security protection performance of the key.
[0054] Please continue to see Figure 2 As shown, in some embodiments, the user authentication device is a Bluetooth device, and the unique identification information is Bluetooth address information or a machine code.
[0055] The method for obtaining the unique identification code of the user authentication device can be, for example: setting the Bluetooth device scanning function in the setting interface of the password management tool, scanning the Bluetooth devices that are paired and connected to the device running the password management tool, reading the Bluetooth name and Bluetooth address, forming a Bluetooth device list for the user to select the Bluetooth device for password file encryption and decryption, and performing hash calculation on the Bluetooth device address information of the user authentication according to a cryptographic hash algorithm, for example, the SM3 algorithm, and using the hash value corresponding to the Bluetooth device address information obtained as a subsequent key derivation calculation parameter.
[0056] In this embodiment, the address information of the Bluetooth device is used as a unique identifier to participate in the key derivation together with the master password input by the user, so that the security of the derived key can be improved.
[0057] Since the machine code can also identify the uniqueness of the Bluetooth device, the unique identifier can also be the machine code, and the machine code and the master password are used together in the key derivation operation.
[0058] When the unique identification information is Bluetooth address information; after obtaining the unique identification information of the user authentication device, the method further includes:
[0059] A hash calculation is performed on the Bluetooth address information of the user authentication device according to a cryptographic hash algorithm to obtain a corresponding second hash value.
[0060] S120. Based on the master password and the unique identification information of the user authentication device, perform a key derivation operation according to a first key derivation algorithm to obtain a key for encrypting data.
[0061] Please continue to see Figure 2As shown, specifically, the first key derivation algorithm may include: a cryptographic hash algorithm and a multi-factor key derivation algorithm; the key derivation operation is performed according to the first key derivation algorithm based on the master password and the unique identification information of the user authentication device to obtain the key for encrypting data, including: concatenating the first hash value of the master password and the second hash value corresponding to the Bluetooth address information; calculating the concatenated third hash value according to the cryptographic hash algorithm; the third hash value is a bit string parameter for passing into the multi-factor key derivation algorithm; receiving the passed bit string parameter, and performing iterative operation using the multi-factor key derivation algorithm to obtain the key for encrypting data.
[0062] In this embodiment, the hash value of the master password and the hash value of the Bluetooth address are concatenated and then the SM3 algorithm hash value is calculated again to obtain the parameter bit string P passed into the multi-factor-KDF algorithm.
[0063] in, Figure 2 The symbol “||” represents the concatenation operation.
[0064] Specifically, the multi-factor key derivation algorithm may also be the national secret hash algorithm SM3;
[0065] The receiving the bit string parameter passed in, and performing iterative operations using a multi-factor key derivation algorithm to obtain a key for encrypting data includes:
[0066] The obtained salt value is assigned to the intermediate sequence code variable as the initial intermediate sequence code variable value; the key data bit string is initialized to a bit string of a predetermined byte length.
[0067] Using the national secret hash algorithm to perform a first iteration operation on the input bit string parameter and the initial value of the intermediate sequence code variable to obtain a first intermediate sequence code variable value;
[0068] Performing an XOR operation on the initialization key data bit string and the first intermediate sequence code variable value to obtain a first intermediate key data bit string; the first intermediate key data bit string has the same length as the initialization key data bit string;
[0069] Substituting the first intermediate key data bit string and the first intermediate sequence code variable value into the national secret hash algorithm, performing a second iterative operation, and obtaining a second intermediate sequence code variable value;
[0070] Performing an XOR operation on the first intermediate key data bit string and the second intermediate sequence code variable value to obtain a second intermediate key data bit string; the second intermediate key data bit string has the same length as the initialization key data bit string;
[0071] Substitute the i-th intermediate key data bit string and the i-th intermediate sequence code variable value obtained by the i-th iterative operation into the national secret hash algorithm, perform the i+1-th iterative operation, and obtain the i+1-th intermediate sequence code variable value;
[0072] Perform an XOR operation on the i-th intermediate key data bit string and the i+1-th intermediate sequence code variable value to obtain a final key data bit string; wherein i is the variable for the number of key derivation operation iterations, i≥0; and store the final key data bit string as a key for encrypting data.
[0073] Exemplarily, assume that the third hash value calculated in the aforementioned embodiment is a bit string P; the selected salt is S, and the number of iterations of the key derivation operation is R; and the three parameters are passed as input parameters into the national secret hash algorithm SM3 for iterative operation.
[0074] Initial intermediate sequence code variable value U_1 = S; Initialize K to 0 for each bit, 256 bits in length; Execute for iteration number variable i from 1 to R: Calculate U_(i+1) = HMAC-SM3(P,U_i); K = K i ^U_(i+1); after executing the above algorithm for a predetermined number of iterations R, a key data bit string K with a length of 256 bits is output. The K value is used as the encryption key for the cipher file data block.
[0075] Among them, HMAC-SM3 means that the hash algorithm used in the calculation process of the HMAC algorithm is replaced with the national secret hash algorithm SM3 to calculate the key; the symbol ^ represents the XOR operation; the salt S can be arbitrarily specified or a randomly generated sequence number, for example, the random sequence number 35sd6, which is used to be saved in the password file header later and can be read from the file header when decrypting the password file data block. The default value of the iteration number R can be 3000, which can also be changed by the user in the setting interface of the password management tool and saved in the password file header.
[0076] In the embodiment of the present invention, in addition to the master password set by the user and the unique identification information of the user authentication device, most KDF algorithms can also improve the security of the derived key by adding parameters such as salt and number of iterations.
[0077] In addition, if Figure 3 As shown, an embodiment of the present invention also provides a data encryption method, which generates a key for encrypting data (S210 and S220) according to any key derivation method described in the present invention; S230, based on the key, encrypt the data according to a preset encryption algorithm.
[0078] The preset encryption algorithm may be a symmetric encryption algorithm or an asymmetric encryption algorithm. Common symmetric encryption algorithms include DES, 3DES, AES and other algorithms, and common asymmetric algorithms include RSA, DSA and other algorithms. It should be noted that the abbreviations in capital letters here are all terms in the technical field of this field and have precise meanings.
[0079] In the present invention, the key derived based on the multi-factor key derivation algorithm is used as the encryption key for data, which can prevent the problem of all account passwords stored in the password file being exposed without reservation due to the leakage of a single factor, thereby improving the security of data encryption to a certain extent.
[0080] According to the above description, in the embodiment of the present invention, the principles of Bluetooth and national commercial encryption algorithms are utilized, the Bluetooth address and the master password are used as factors of the key derivation algorithm, and a dual-factor key derivation algorithm is used for key derivation. This can prevent the leakage of a single factor from causing all account passwords stored in the password file to be exposed without reservation, thereby helping to improve the security of encrypted files.
[0081] In addition, compared with the current KDF algorithm, which basically uses the international SHA series hash algorithm or the message authentication code (HMAC) algorithm based on these hash algorithms in the calculation process, it is easy for hackers to exploit the vulnerabilities in the international KDF algorithm to launch attacks. The security is difficult to control and it is difficult to achieve domestic independent control.
[0082] In the present invention, based on the national secret algorithm, such as the SM3 algorithm, a new multi-factor key derivation algorithm DF-KDF is independently proposed. By taking advantage of the self-controllable national secret algorithm, hackers can be prevented from launching attacks by exploiting possible vulnerabilities in the international KDF algorithm, thereby improving the security of the key. Furthermore, based on the multi-factor key derivation algorithm, the problem of all account passwords stored in the password file being exposed without reservation due to the leakage of a single factor can be prevented, thereby improving the security of data encryption to a certain extent.
[0083] Embodiment 2
[0084] Figure 4 This is a schematic block diagram of the architecture of an embodiment of the Web application server of the present invention, see Figure 4 As shown, an embodiment of the present invention provides a server, including a host, on which a password management application is installed, and the password management application is at least used to respond to a user's request and execute any key derivation method described in the first aspect.
[0085] The server of this embodiment can be used to execute Figure 1The technical solution of the method embodiment shown, the server of this embodiment, its implementation principle and technical effect are similar to those of embodiment 1, and will not be described in detail here, and can be referenced by each other.
[0086] Embodiment 3
[0087] The present invention also provides an electronic device according to an embodiment, comprising one or more processors; a memory; the memory stores one or more executable programs, and the one or more processors read the executable program code stored in the memory to run the program corresponding to the executable program code, so as to execute any method described in embodiment one.
[0088] Figure 5 FIG. 1 is a schematic diagram of the structure of an embodiment of an electronic device of the present invention, which can implement any method described in Embodiment 1 of the present invention, such as Figure 5 As shown, as an optional embodiment, the above-mentioned electronic device may include: a shell 41, a processor 42, a memory 43, a circuit board 44 and a power supply circuit 45, wherein the circuit board 44 is arranged inside the space enclosed by the shell 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; the power supply circuit 45 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 43 is used to store executable program codes; the processor 42 runs the password management application program corresponding to the executable program code by reading the executable program code stored in the memory 43, and is used to execute the key derivation method and file encryption method described in any of the aforementioned embodiment one.
[0089] The specific execution process of the processor 42 for the above steps and the steps further executed by the processor 42 by running the executable program code can be found in the description of the key derivation method and file encryption method embodiment 1 of the present invention, which will not be repeated here.
[0090] The electronic device exists in various forms, including but not limited to: (1) Mobile communication devices: This type of device is characterized by having mobile communication functions and providing voice and data communication as its main goal. Such terminals include: smart phones (such as iPhones), multimedia phones, functional phones, and low-end phones. (2) Ultra-mobile personal computer devices: This type of device belongs to the category of personal computers, has computing and processing functions, and generally also has mobile Internet access features. Such terminals include: PDA, MID and UMPC devices, such as iPad. (3) Portable entertainment devices: This type of device can display and play multimedia content. Such devices include: audio and video playback modules (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices. (4) Servers: Devices that provide computing services. The server's composition includes processors, hard disks, memory, system buses, etc. The server is similar to the general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc. (5) Other electronic devices with data interaction functions.
[0091] An embodiment of the present invention also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the key derivation method and data encryption method described in any one of the above-mentioned embodiments.
[0092] In summary, according to the description of the above embodiments, the key derivation method and data encryption method disclosed in this embodiment, based on a multi-factor key derivation algorithm, can prevent the problem of all account passwords stored in the password file being exposed without reservation due to the leakage of a single factor, thereby improving the security of data encryption to a certain extent.
[0093] In addition, based on the same technical concept, a password file management tool installed on the provided server is used to execute the key derivation method in the embodiment of the present invention. Based on the national secret algorithm, such as the SM3 algorithm, a new multi-factor key derivation algorithm DF-KDF is independently proposed. By utilizing the advantages of the national secret algorithm being independently controllable, it can prevent hackers from exploiting possible vulnerabilities in the international KDF algorithm to launch attacks, thereby improving the security of the key.
[0094] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0095] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0096] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can also be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0097] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A key derivation method, characterized in that: The method comprises the steps of: Obtain the master password entered by the user and the unique identification information of the user authentication device; Based on the master password and the unique identification information of the user authentication device, a key derivation operation is performed according to a first key derivation algorithm to obtain a key for encrypting data; After obtaining the master password input by the user, the method further includes: verifying whether the master password is correct; If yes, performing hash calculation on the master password according to a cryptographic hash algorithm to obtain a first hash value of the master password; The unique identification information is Bluetooth address information; After obtaining the unique identification information of the user authentication device, the method further includes: Performing hash calculation on the Bluetooth address information of the user authentication device according to a cryptographic hash algorithm to obtain a corresponding second hash value; The first key derivation algorithm includes: a cryptographic hash algorithm and a multi-factor key derivation algorithm; The step of performing a key derivation operation based on the master password and the unique identification information of the user authentication device according to a first key derivation algorithm to obtain a key for encrypting data includes: Concatenate the first hash value of the master password and the second hash value corresponding to the Bluetooth address information; A concatenated third Hash value is calculated according to a cryptographic hash algorithm; the third Hash value is a bit string parameter used to be passed into a multi-factor key derivation algorithm; Receiving the bit string parameter passed in, performing iterative operations using a multi-factor key derivation algorithm to obtain a key for encrypting data; The multi-factor key derivation algorithm is a national secret hash algorithm; The receiving the bit string parameter passed in, and performing iterative operations using a multi-factor key derivation algorithm to obtain a key for encrypting data includes: Assign the obtained salt value to the intermediate sequence code variable as the initial intermediate sequence code variable value; Initializing the key data bit string to a bit string of a predetermined byte length; Using the national secret hash algorithm to perform a first iteration operation on the input bit string parameter and the initial value of the intermediate sequence code variable to obtain a first intermediate sequence code variable value; Performing an XOR operation on the initialization key data bit string and the first intermediate sequence code variable value to obtain a first intermediate key data bit string; the first intermediate key data bit string has the same length as the initialization key data bit string; Substituting the first intermediate key data bit string and the first intermediate sequence code variable value into the national secret hash algorithm, performing a second iterative operation, and obtaining a second intermediate sequence code variable value; Performing an XOR operation on the first intermediate key data bit string and the second intermediate sequence code variable value to obtain a second intermediate key data bit string; the second intermediate key data bit string has the same length as the initialization key data bit string; Substitute the i-th intermediate key data bit string and the i-th intermediate sequence code variable value obtained by the i-th iterative operation into the national secret hash algorithm, perform the i+1-th iterative operation, and obtain the i+1-th intermediate sequence code variable value; Perform an XOR operation on the i-th intermediate key data bit string and the i+1-th intermediate sequence code variable value to obtain a final key data bit string; wherein i is the key derivation operation iteration count variable, i≥0; The final key data bit string is stored as a key for encrypting data.
2. The key derivation method according to claim 1, characterized in that: The user authentication device is a Bluetooth device, and the unique identification information is Bluetooth address information or a machine code.
3. A data encryption method, characterized in that: Generate a key for encrypting data according to the key derivation method according to any one of claims 1 to 2; Based on the key, the data is encrypted according to a preset encryption algorithm.
4. A server, characterized in that: It comprises a host having a password management application installed thereon, wherein the password management application is at least used to respond to a user's request and execute the key derivation method according to any one of claims 1 to 2.
5. An electronic device, characterized in that: include: One or more processors; Memory; One or more executable programs are stored in the memory, and the one or more processors read the executable program code stored in the memory and run the password management application corresponding to the executable program code to execute the key derivation method described in any one of claims 1 to 2.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method of any one of claims 1 to 2.
Citation Information
Patent Citations
Collaborative key-based processing method and system, computer equipment and storage medium
CN108494551A
Method and device for generating and acquiring key in device
CN108959978A
Trusted access verification system based on domestic Loongson processor, computer and readable storage medium
CN110046489A
Data key protection method, data key protection system, electronic equipment and storage medium
CN110378139A
Key generation method and device, equipment and encryption method
CN111740828A
