Method, device, electronic device and storage medium for extending encryption software application
By introducing the national secret algorithm driver and code replacement in VeraCrypt encryption software, the problem of the encryption algorithm level not meeting the requirements is solved, and application expansion in high-security scenarios is achieved.
Patent Information
- Application Number
- CN202210296624.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-03-24
AI Technical Summary
Since the encryption algorithm used internally in VeraCrypt encryption software does not belong to the national secret algorithm, its application in industries with high security requirements such as finance and government and enterprises is restricted, hindering its promotion.
The National Secret algorithm driver is added to the driver module of VeraCrypt encryption software, and the code corresponding to the encryption algorithm is replaced with the National Secret algorithm code to support the scope of application of the National Secret algorithm.
The application scope of VeraCrypt encryption software has been expanded to enable it to be used in scenarios with high security requirements, improving its applicability and security.
Smart Images

Figure CN114676443B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software application extension, and in particular to an encryption software application extension method, device, electronic device and storage medium. Background Art
[0002] Information security has now risen to a strategic level in national security. As a crucial component of information security, ensuring data transmission security is a key priority. Encryption software is central to data transmission security. VeraCrypt is a free, open-source disk encryption software for Windows, Mac OS X, and Linux. VeraCrypt is a fork of TrueCrypt, primarily developed by French developer Mounir Idrassi, who enhanced TrueCrypt's brute-force protection. VeraCrypt enhances the security of its system and partition encryption algorithms, protecting them from brute-force attacks. VeraCrypt also addresses numerous vulnerabilities and security issues discovered in TrueCrypt. However, because its encryption algorithm is not a nationally recognized algorithm, its applicability has been limited. For example, it cannot be used in industries with high security requirements, such as finance, government, and enterprises, hindering its widespread adoption. Summary of the Invention
[0003] In view of this, an embodiment of the present invention provides an encryption software application expansion method, device, electronic device and storage medium to solve the problem that the application field of traditional encryption software is limited due to the encryption algorithm level not meeting relevant requirements, which is not conducive to the promotion and application of encryption software.
[0004] In a first aspect, an embodiment of the present invention provides an encryption software application expansion method, applied to an electronic device, comprising:
[0005] Obtain the encryption algorithm and driver module within the encryption software;
[0006] Add the corresponding driver of the national encryption algorithm to the driver module;
[0007] The encryption algorithm corresponding code inside the encryption software is replaced with the code corresponding to the national secret algorithm, so that the encryption software can be applied to the scope of application of the national secret algorithm.
[0008] According to a specific implementation of an embodiment of the present invention, the encryption software is VeraCrypt encryption software.
[0009] According to a specific implementation of the embodiment of the present invention, the method further includes:
[0010] Start VeraCrypt encryption software to create an encrypted volume;
[0011] During the creation process, select the National Cryptography Algorithm as the encryption algorithm for the encrypted volume;
[0012] Use the encrypted volume mounting application to mount the created encrypted volume;
[0013] Perform read and write operations on the mounted encrypted volume.
[0014] According to a specific implementation of an embodiment of the present invention, the national secret algorithm includes at least one of the following:
[0015] SM3 national secret algorithm and SM4 national secret algorithm.
[0016] According to a specific implementation of an embodiment of the present invention, the code corresponding to the SM3 national secret algorithm includes a context structure definition field, an initialization field, a hash calculation field, and an output field. The encryption method of the SM3 national secret algorithm includes:
[0017] The context structure of SM3 is defined in the context structure definition field. The context structure includes: the number of bytes processed, the intermediate summary status, and the data block being processed;
[0018] In the initialization field, initialize the SM3 context structure defined in the context structure definition field, and pass the initialized SM3 context to the hash calculation field;
[0019] Perform encryption calculation on the context of SM3 in the hash calculation field;
[0020] The result of the encryption calculation obtained in the hash calculation field is output in the output field.
[0021] According to a specific implementation of an embodiment of the present invention, the code corresponding to the SM4 national secret algorithm includes a context key definition field, a key generation field, and an encryption and decryption operation field. The encryption method of the SM4 national secret algorithm includes:
[0022] Define the key context used by SM4 in the context key definition field;
[0023] In the key generation field, the user input key is operated to generate a key for encryption;
[0024] In the encryption / decryption operation field, the data is encrypted / decrypted using the encrypted key.
[0025] In a second aspect, an embodiment of the present invention provides an encryption software application expansion device, comprising:
[0026] An acquisition module is used to obtain the encryption algorithm and driver module inside the encryption software;
[0027] Adding module, used to add the driver corresponding to the national encryption algorithm to the driver module;
[0028] The replacement module is used to replace the encryption algorithm corresponding code inside the encryption software with the national secret algorithm corresponding code, so that the encryption software can be applied to the scope of application of the national secret algorithm.
[0029] According to a specific implementation of the embodiment of the present invention, the method further includes:
[0030] The startup module is used to start the VeraCrypt encryption software to create an encrypted volume;
[0031] The selection module is used to select the national secret algorithm as the encryption algorithm for the encrypted volume during the creation process;
[0032] The mount module is used to use the encrypted volume mount application to mount the created encrypted volume;
[0033] Operation module, used to perform read and write operations on the mounted encrypted volume.
[0034] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, and is used to execute the encryption software application expansion method described in any of the aforementioned implementation methods.
[0035] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the encryption software application expansion method described in any of the aforementioned implementation methods.
[0036] An embodiment of the present invention provides an encryption software application expansion method, device, electronic device and storage medium. By obtaining the encryption algorithm and driver module inside the encryption software, adding the corresponding driver of the national encryption algorithm into the driver module, and replacing the corresponding code of the encryption algorithm inside the encryption software with the corresponding code of the national encryption algorithm, the method can effectively solve the problem that the application field of traditional encryption software is limited due to the encryption algorithm level not meeting the relevant requirements, which is not conducive to the promotion and application of encryption software. It is conducive to the application of traditional encryption software in scenarios with higher security requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.
[0038] Figure 1 This is a flowchart of a method for extending an encryption software application according to embodiment 1 of the present invention;
[0039] Figure 2 This is a flowchart of a method for extending an encryption software application according to embodiment 2 of the present invention;
[0040] Figure 3 This is a functional structure diagram of an encryption software application expansion device according to embodiment 1 of the present invention;
[0041] Figure 4 This is a functional structure diagram of an encryption software application expansion device according to embodiment 2 of the present invention;
[0042] Figure 5 The present invention provides a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following describes embodiments of the present invention in detail with reference to the accompanying drawings. It should be understood that the embodiments described are only some of the embodiments of the present invention, and not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.
[0044] This embodiment provides an encryption software application expansion method to solve the problem that the application field of traditional encryption software is limited due to the encryption algorithm level not meeting relevant requirements, which is not conducive to the promotion and application of encryption software.
[0045] Figure 1 FIG. 1 is a flow chart of an encryption software application expansion method according to an embodiment of the present invention. Figure 1 As shown, the encryption software application extension method of this embodiment is applied to an electronic device.
[0046] The encryption software application extension method of this embodiment may include:
[0047] Step 101: Obtain the encryption algorithm and driver module within the encryption software;
[0048] In this embodiment, the encryption software is, for example, VeraCrypt. VeraCrypt enhances the security of the algorithms used for system and partition encryption, protecting them from brute-force attacks. VeraCrypt also addresses many vulnerabilities and security issues found in TrueCrypt.
[0049] Step 102: Add the driver corresponding to the national encryption algorithm to the driver module;
[0050] VeraCrypt itself provides a Windows system driver and implementations of multiple international standard algorithms. Based on the encryption algorithm implemented by VeraCrypt's own driver, the driver for the implemented national encryption algorithm is integrated into VeraCrypt, enabling VeraCrypt to support the national encryption algorithm.
[0051] Step 103: Replace the encryption algorithm corresponding code in the encryption software with the code corresponding to the national secret algorithm, so that the encryption software can be applied to the scope of application of the national secret algorithm.
[0052] In this embodiment, the national secret algorithm includes but is not limited to:
[0053] SM3 national secret algorithm and SM4 national secret algorithm.
[0054] In some embodiments, the code corresponding to the SM3 national encryption algorithm includes a context structure definition field, an initialization field, a hash calculation field, and an output field. The encryption method of the SM3 national encryption algorithm includes:
[0055] The context structure of SM3 is defined in the context structure definition field. The context structure includes: the number of bytes processed, the intermediate summary status, and the data block being processed;
[0056] In the initialization field, initialize the SM3 context structure defined in the context structure definition field, and pass the initialized SM3 context to the hash calculation field;
[0057] Perform encryption calculation on the context of SM3 in the hash calculation field;
[0058] The result of the encryption calculation obtained in the hash calculation field is output in the output field.
[0059] The context structure definition field is the sm3_ctx field, the initialization field is the sm3_begin field, the hash calculation field is the sm3_hash field, and the output field is the sm3_end field.
[0060] sm3 is an integrated call to sm3_begin, sm3_hash, and sm3_end.
[0061] In some embodiments, the code corresponding to the SM4 national encryption algorithm includes a context key definition field, a key generation field, and an encryption and decryption operation field. The encryption method of the SM4 national encryption algorithm includes:
[0062] Define the key context used by SM4 in the context key definition field;
[0063] In the key generation field, the user input key is operated to generate a key for encryption;
[0064] In the encryption / decryption operation field, the data is encrypted / decrypted using the encrypted key.
[0065] SM4 is a symmetric encryption and decryption algorithm. sm4_context defines the key context used by SM4. sm4_setkey performs a series of operations on the user-entered key to generate a key, ks, that can be used for encryption. sm4_encrypt_blocks and sm4_decrypt_blocks define the operations for encrypting and decrypting data using ks, respectively. sm4_encrypt and sm4_decrypt implement encryption and decryption calculations for a block of data, respectively. They are special cases of sm4_encrypt_blocks and sm4_decrypt_blocks, respectively.
[0066] By replacing the encryption algorithm in VeraCrypt, the application layer can obtain access to the newly added national secret encryption algorithm and make the national secret algorithm effective.
[0067] Information security has risen to a strategic level in national security. As a crucial component of information security, ensuring data transmission security is a key priority. Encryption algorithms are central to data transmission security. However, many industries with high security requirements, such as finance, government, and enterprises, have long relied on internationally accepted cryptographic algorithms and standards, such as 3DES, SHA-1, and RSA. These algorithms are rumoured to be vulnerable to cracking and attacks, and they involve numerous uncontrollable factors. Once exploited by criminals, the resulting damage would be immeasurable. Therefore, these industries with high security requirements widely use national cryptographic algorithms, which outperform comparable internationally accepted algorithms in terms of both encryption strength and computational performance.
[0068] VeraCrypt is a free, open-source disk encryption software for Windows, Mac OS X, and Linux. A fork of TrueCrypt, VeraCrypt was primarily developed by French developer Mounir Idrassi, who enhanced TrueCrypt's brute-force protection. VeraCrypt enhances the security of the algorithms used for system and partition encryption, making them immune to brute-force attacks. VeraCrypt also addresses numerous vulnerabilities and security issues discovered in TrueCrypt. However, because the encryption algorithm used is not a nationally recognized algorithm, its applicability has been limited. For example, it cannot be used in industries with high security requirements, such as finance, government, and enterprises, hindering the widespread adoption of VeraCrypt.
[0069] In this embodiment, by obtaining the encryption algorithm and driver module inside the encryption software, adding the corresponding driver of the national encryption algorithm into the driver module, and replacing the corresponding code of the encryption algorithm inside the encryption software with the corresponding code of the national encryption algorithm, it can effectively solve the problem that the application field of traditional encryption software is limited due to the encryption algorithm level not meeting the relevant requirements, which is not conducive to the promotion and application of encryption software. It is beneficial for traditional encryption software to be used in scenarios with higher security requirements.
[0070] Figure 2 This is a flow chart of the encryption software application expansion method according to the second embodiment of the present invention. Figure 2 As shown, the encryption software application extension method of this embodiment may include:
[0071] Step 201: Start VeraCrypt encryption software to create an encrypted volume;
[0072] Step 202: During the creation process, select the National Cryptography Algorithm as the cryptographic algorithm for the encrypted volume;
[0073] For example, select SM4 and SM3 algorithms as the encryption algorithms for the encrypted volume.
[0074] Step 203: Use the encrypted volume mounting application to mount the created encrypted volume;
[0075] Step 204: Perform read and write operations on the mounted encrypted volume.
[0076] For example, copy files to an encrypted volume; copy files from an encrypted volume to another non-encrypted volume; edit and save files to an encrypted volume using other applications in Windows;
[0077] In some embodiments, when operating on an unmounted encrypted volume, the system will prompt a corresponding error message or fail to read the file content normally;
[0078] In this embodiment, it is ensured that the addition of the national encryption algorithm will not lead to a decrease in the stability and adaptability of VeraCrypt, while improving the efficiency of the algorithm.
[0079] pass Figure 1 、 Figure 2 The technical solution of the method embodiment shown in the present application can not only improve the applicability of encryption software, making traditional encryption software suitable for encryption scenarios with higher security requirements, but also be simple and easy to operate.
[0080] Figure 3 This is a structural diagram of the first embodiment of the encryption software application expansion device of the present invention, as shown in FIG. Figure 3 As shown, the device of this embodiment may include:
[0081] Acquisition module 301, used to obtain the encryption algorithm and driver module inside the encryption software;
[0082] Adding module 302, used to add the driver corresponding to the national encryption algorithm in the driver module;
[0083] The replacement module 303 is used to replace the encryption algorithm corresponding code inside the encryption software with the national encryption algorithm corresponding code, so that the encryption software can be applied to the scope of application of the national encryption algorithm.
[0084] In some embodiments, such as Figure 4 As shown, the device of this embodiment may further include:
[0085] The startup module 401 is used to start the VeraCrypt encryption software to create an encrypted volume;
[0086] The selection module 402 is used to select the national secret algorithm as the cryptographic algorithm for the encrypted volume during the creation process;
[0087] The mounting module 403 is used to mount the created encrypted volume using the encrypted volume mounting application;
[0088] The operation module 404 is used to perform read and write operations on the mounted encrypted volume.
[0089] The device of this embodiment can be used to perform Figure 1 、 Figure 2 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0090] Figure 5 This is a schematic diagram of the structure of an embodiment of the electronic device of the present invention, which can realize the present invention. Figure 1 、 Figure 2 The process of the embodiment shown is as follows: Figure 5As shown, the above-mentioned electronic device may include: a shell 51, a processor 52, a memory 53, a circuit board 54 and a power supply circuit 55, wherein the circuit board 54 is placed inside the space enclosed by the shell 51, and the processor 52 and the memory 53 are arranged on the circuit board 54; the power supply circuit 55 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 53 is used to store executable program code; the processor 52 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 53, so as to execute the encryption software application expansion method described in any of the above-mentioned embodiments.
[0091] For details on the specific execution process of the above steps by the processor 52 and the steps further executed by the processor 52 by running the executable program code, please refer to the present invention. Figure 1 、 Figure 2 The description of the illustrated embodiment will not be repeated here.
[0092] This electronic device exists in many forms, including but not limited to:
[0093] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily provide voice and data communications. These terminals include smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones.
[0094] (2) Mobile personal computer devices: These devices fall under the category of personal computers and have computing and processing capabilities, and generally also have mobile Internet access. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.
[0095] (3) Portable entertainment devices: These devices can display and play multimedia content. These devices include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0096] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a 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, and manageability.
[0097] (5) Other electronic devices with data interaction functions.
[0098] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the encryption software application expansion method described in any of the foregoing embodiments.
[0099] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0100] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0101] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0102] For the convenience of description, the above device is described as being divided into various units / modules based on their functions. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.
[0103] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0104] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for extending an encryption software application, characterized in that: Applied to electronic equipment; the method comprises: Obtain the encryption algorithm and driver module within the encryption software; Add the corresponding driver of the national encryption algorithm to the driver module; Replace the encryption algorithm code inside the encryption software with the code corresponding to the national secret algorithm, so that the encryption software can be used within the scope of application of the national secret algorithm; The encryption software is VeraCrypt encryption software; Also includes: Start VeraCrypt encryption software to create an encrypted volume; During the creation process, select the national encryption algorithm as the encryption algorithm for the encrypted volume; Use the encrypted volume mounting application to mount the created encrypted volume; Perform read and write operations on the mounted encrypted volume; The national secret algorithm includes at least the SM3 national secret algorithm; The code corresponding to the SM3 national secret algorithm includes a context structure definition field, an initialization field, a hash calculation field, and an output field. The encryption method of the SM3 national secret algorithm includes: The context structure of SM3 is defined in the context structure definition field. The context structure includes: the number of bytes processed, the intermediate summary status, and the data block being processed; In the initialization field, initialize the SM3 context structure defined in the context structure definition field, and pass the initialized SM3 context to the hash calculation field; Perform encryption calculation on the context of SM3 in the hash calculation field; The result of the encryption calculation obtained in the hash calculation field is output in the output field.
2. The encryption software application expansion method according to claim 1, characterized in that: The national secret algorithm also includes the SM4 national secret algorithm.
3. The encryption software application expansion method according to claim 2, characterized in that: The code corresponding to the SM4 national secret algorithm includes a context key definition field, a key generation field, and an encryption and decryption operation field. The encryption method of the SM4 national secret algorithm includes: Define the key context used by SM4 in the context key definition field; In the key generation field, the user input key is operated to generate a key for encryption; In the encryption / decryption operation field, the data is encrypted / decrypted using the encrypted key.
4. An electronic device, characterized in that: The electronic device includes: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, and is used to execute the encryption software application expansion method described in any one of claims 1 to 3.
5. 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 encryption software application expansion method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Method for achieving IPsec-VPN based on state secret algorithm
CN106506147A
SM2 encryption method and system based on encryption software, terminal and storage medium
CN111859314A