Cryptographic unit creation method, data processing method, device and electronic device

By statically linking and encapsulating the password components and dependent components to form an independent password unit, the startup speed and security risks caused by password devices relying on Linux systems is solved, and fast startup and efficient password services are achieved.

CN112052446BActive Publication Date: 2024-11-19BEIJING CERTIFICATE AUTHORITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010959128.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-14
Publication Date
2024-11-19
Estimated Expiration
2040-09-14

AI Technical Summary

Technical Problem

Existing password devices rely on Linux systems, resulting in reduced startup speed and increased security risks, and the complexity of Linux systems slows down password service functions and increases attack surface.

Method used

By obtaining the password component and its dependent components, statically linking it into a mirror file, forming an independent password unit, which can be started and run without relying on a general Linux operating system, reducing the attack surface and improving the startup speed.

Benefits of technology

It realizes the rapid start-up and efficient operation of the password unit, reduces the security risks of data processing, and improves the performance and security of the password service functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112052446B_ABST
    Figure CN112052446B_ABST
Patent Text Reader

Abstract

This application provides a method for creating cryptographic units, a data processing method, an apparatus, and an electronic device. The creation method includes: obtaining a cryptographic component for performing cryptographic processing operations; obtaining each type of target dependency component corresponding to the cryptographic component based on the dependency relationship between the cryptographic component and its dependent components; and using a build tool, statically linking and encapsulating the cryptographic component and each type of target dependency component into an image file representing a cryptographic unit installation package. In this solution, by isolating the cryptographic component and target dependency components and then statically linking and encapsulating them into an image file, this image file can perform the corresponding cryptographic operations at runtime. Therefore, the cryptographic unit has a small capacity, which helps reduce the attack surface and improve data security. Furthermore, the small capacity also helps improve the startup and recycling speed when using cryptographic service functions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer cryptography technology, and in particular to a cryptographic unit creation method, a data processing method, a device and an electronic device. Background Art

[0002] In the computer field, in order to improve the security of data, cryptographic devices are usually required to perform corresponding encryption or decryption operations on the transmitted data. At present, cryptographic devices rely on the Linux system and provide cryptographic functions through dedicated hardware. The cryptographic device is highly coupled with the Linux system, and the Linux system itself is not used in the cryptographic field. In recent years, with the continuous development of the Linux kernel, it supports more and more types of hardware drivers, file systems, scheduling modes, application software, etc., making the Linux kernel and distribution become huge, thereby reducing the startup speed and increasing the attack surface. In the cryptographic device, even if the Linux system has undergone a series of cuts, there are still parts that are closely integrated with the system functional components and cannot be cut, which affects the startup speed of the cryptographic device and increases the security risk of the data. Summary of the invention

[0003] The present application provides a cryptographic unit creation method, a data processing method, a device and an electronic device, which can improve the startup speed when using a cryptographic service function and enhance the security of data.

[0004] In order to achieve the above purpose, the technical solutions provided in the embodiments of the present application are as follows:

[0005] In a first aspect, an embodiment of the present application provides a cryptographic unit creation method, which is applied to a development terminal, and the method includes:

[0006] Get a cryptographic component for performing cryptographic processing operations;

[0007] According to the dependency relationship between the cryptographic component and the dependent components, obtaining each type of target dependent component corresponding to the cryptographic component;

[0008] By building a tool, the cryptographic component and each type of target dependent component are statically linked and packaged into a mirror file representing a cryptographic unit installation package, and the mirror file is a file including an operating system.

[0009] In the above-mentioned implementation, by separating the cryptographic component and the target dependent component, and then encapsulating them into a mirror file in a statically linked manner, the mirror file can implement the corresponding cryptographic operation at runtime. The cryptographic unit itself is a unit that includes an operating system. The cryptographic unit no longer needs a general Linux operating system to start and run, and can start and run independently to provide cryptographic services. That is, the cryptographic unit already includes the operating system functions necessary for startup and operation, so no additional operating system support is required, which is conducive to reducing the attack surface to improve data security. In addition, since the cryptographic unit includes few components of the operating system, the capacity of the cryptographic unit is small, which is conducive to improving the startup speed and recovery speed when using the cryptographic service function.

[0010] In conjunction with the first aspect, in some optional implementations, obtaining a cryptographic component for performing a cryptographic processing operation includes:

[0011] At least one of a first type of cryptographic component for performing a cryptographic operation through a cryptographic operation strategy and a second type of cryptographic component for sending data to be processed to a corresponding cryptographic operation component is obtained.

[0012] In the above implementation, by acquiring a variety of cryptographic components, it is convenient to select a corresponding cryptographic processing method according to needs, so as to enrich the implementation methods of cryptographic processing.

[0013] In combination with the first aspect, in some optional implementations, before acquiring each type of target dependent component corresponding to the cryptographic component according to the dependency relationship between the cryptographic component and the dependent component, the method further includes:

[0014] A dependency relationship between the cryptographic component and dependent components is created, wherein the dependent components corresponding to the cryptographic component include a basic dependent component, a TCP protocol stack component, a network support component, and a programming language runtime component.

[0015] In the above implementation, by obtaining dependent components of the cryptographic component and then encapsulating them, the cryptographic unit can be run without relying on the Linux system, thereby facilitating the transplantation and relocation of the cryptographic unit.

[0016] In combination with the first aspect, in some optional implementations, the image file is used to be installed in a physical computer to form the cryptographic unit, or is used to be loaded by a virtualization manager to form the cryptographic unit.

[0017] In combination with the first aspect, in some optional implementations, the method further includes:

[0018] The obtained multiple image files are sent to a cryptographic device, so that the cryptographic device constructs a cryptographic integrated service system according to the multiple image files.

[0019] In a second aspect, an embodiment of the present application further provides a data processing method, which is applied to a cryptographic device, wherein the cryptographic device stores the above-mentioned image file, and the method comprises:

[0020] Obtaining a password processing request and data to be processed corresponding to the password processing request;

[0021] According to the cryptographic operation strategy corresponding to the cryptographic processing request, the cryptographic operation is performed on the data to be processed by running the image file to obtain the data to be processed after the cryptographic operation.

[0022] In a third aspect, an embodiment of the present application further provides a cryptographic unit creation device, which is applied to a development terminal, and the device includes:

[0023] A first acquisition module, used to acquire a cryptographic component for performing a cryptographic processing operation;

[0024] A second acquisition module, configured to acquire each type of target dependent component corresponding to the cryptographic component according to the dependency relationship between the cryptographic component and the dependent component;

[0025] The encapsulation module is used to encapsulate the cryptographic component and each type of target dependent component into a mirror file representing the cryptographic unit installation package by static linking through a construction tool, and the mirror file is a file including an operating system.

[0026] In a fourth aspect, an embodiment of the present application further provides a data processing device, which is applied to a cryptographic device, wherein the cryptographic device stores the above-mentioned image file, and the device comprises:

[0027] A third acquisition module is used to acquire a password processing request and data to be processed corresponding to the password processing request;

[0028] The cryptographic operation unit is used to perform a cryptographic operation on the data to be processed by running the image file according to the cryptographic operation strategy corresponding to the cryptographic processing request, so as to obtain the data to be processed after the cryptographic operation.

[0029] In the fifth aspect, an embodiment of the present application also provides an electronic device, comprising a memory and a processor coupled to each other, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device executes the above-mentioned cryptographic unit creation method or data processing method.

[0030] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer executes the above-mentioned cryptographic unit creation method or data processing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work.

[0032] Figure 1 A schematic diagram of the communication connection between the development terminal and the cryptographic device provided in an embodiment of the present application.

[0033] Figure 2 A flowchart of a cryptographic unit creation method provided in an embodiment of the present application.

[0034] Figure 3 A schematic diagram of the functional modules of the cryptographic unit provided in an embodiment of the present application.

[0035] Figure 4 A functional block diagram of a cryptographic unit creation device provided in an embodiment of the present application.

[0036] Figure 5 A flowchart of a data processing method provided in an embodiment of the present application.

[0037] Figure 6 A functional block diagram of a data processing device provided in an embodiment of the present application.

[0038] Icons: 10 - development terminal; 20 - cryptographic device; 200 - cryptographic unit creation device; 210 - first acquisition module; 220 - second acquisition module; 230 - packaging module; 400 - data processing device; 410 - third acquisition module; 420 - cryptographic operation module. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. It should be noted that the terms "first", "second" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.

[0040] At present, cryptographic devices usually exist in the form of a dedicated computer. Cryptographic devices mainly run under the Linux system, and the degree of coupling between cryptographic devices and the Linux system is high. The complex mechanism of the Linux system can easily slow down the cryptographic service function and increase the complexity. For example, the current cryptographic service is provided to the outside through TCP / HTTP. When the cryptographic device receives a request, it needs to switch between user mode and kernel mode, read the request content, and then call the cryptographic calculation function, and switch between user mode and kernel mode again. Finally, after completing the cryptographic function, it switches again and sends a response to the client. This method will reduce the response speed of the cryptographic function. In addition, user management is an important part of Linux. Users can operate by logging in to Linux locally or remotely. In a dedicated device such as a cryptographic device, it is necessary to pay attention to the safekeeping of user information and password information. For example, for the root user (administrator), if the user information and password information are leaked, it will increase the security risk of the cryptographic device processing data.

[0041] In view of the above problems, the inventors of the present application propose the following embodiments to solve the above problems. The embodiments of the present application are described in detail below in conjunction with the accompanying drawings. The following embodiments and features in the embodiments can be combined with each other without conflict.

[0042] Please refer to Figure 1 , an embodiment of the present application provides an electronic device, which may be a development terminal 10 or a cryptographic device 20. When the electronic device is a development terminal 10, it may be used to execute the steps of the following cryptographic unit creation method. When the electronic device is a cryptographic device 20, it may be used to execute the steps of the following data processing method.

[0043] The development terminal 10 may be, but is not limited to, a personal computer (PC), a server, etc. The cryptographic device 20 may be, but is not limited to, a server, an industrial computer, a virtual machine, etc.

[0044] In this embodiment, the electronic device includes a memory and a processor, and the memory stores a computer program. Of course, the electronic device may also include other modules. For example, the electronic device may also include a communication module, a cryptographic unit creation device, a data processing device, etc.

[0045] If the electronic device is a development terminal 10, when the computer program is executed by the processor, the electronic device can perform the steps of the following cryptographic unit creation method. If the electronic device is a cryptographic device 20, when the computer program is executed by the processor, the electronic device can perform the steps of the following data processing method.

[0046] First embodiment

[0047] Please refer to Figure 3 The embodiment of the present application also provides a cryptographic unit creation method, which can be applied to the above-mentioned development terminal 10. The development terminal 10 executes or implements each step of the method. The method may include the following steps:

[0048] Step S110, obtaining a cryptographic component for performing a cryptographic processing operation;

[0049] Step S120, acquiring each type of target dependent component corresponding to the cryptographic component according to the dependency relationship between the cryptographic component and the dependent components;

[0050] Step S130, through a construction tool, the cryptographic component and each type of target dependent component are statically linked and packaged into a mirror file representing a cryptographic unit installation package, wherein the mirror file is a file including an operating system.

[0051] In the above-mentioned implementation, by separating the cryptographic component and the target dependent component, and then encapsulating them into a mirror file in a statically linked manner, the mirror file can implement the corresponding cryptographic operation at runtime. The cryptographic unit itself is a unit that includes an operating system. The cryptographic unit no longer needs a general Linux operating system to start and run, and can start and run independently to provide cryptographic services. That is, the cryptographic unit already includes the operating system functions necessary for startup and operation, so no additional operating system support is required, which is conducive to reducing the attack surface to improve data security. In addition, since the cryptographic unit includes few components of the operating system, the capacity of the cryptographic unit is small, which is conducive to improving the startup speed and recovery speed when using the cryptographic service function.

[0052] The following is a detailed description of each step of the method:

[0053] In step S110, when it is necessary to create a cryptographic unit, the development terminal can obtain various types of pre-prepared cryptographic components. A single cryptographic component can be used to perform cryptographic operations through a corresponding cryptographic operation strategy, or the data to be processed can be sent to a corresponding cryptographic operation component, and the cryptographic operation component performs cryptographic operations on the data to be processed through a corresponding cryptographic operation strategy. Among them, the type and quantity of the cryptographic components obtained by the development terminal can be determined according to actual conditions. The cryptographic operation strategy can be understood as an algorithm for implementing the cryptographic service function of encryption and decryption, which can be selected according to actual conditions. For example, the cryptographic operation strategy can be but is not limited to a digital signature, a character encryption and decryption algorithm, a data summary algorithm, etc. The cryptographic components include but are not limited to components that can be used to implement cryptographic operations such as digital signatures, character encryption and decryption algorithms, data summary algorithms, and components for sending the data to be processed to the corresponding cryptographic operation components.

[0054] Understandably, the cryptographic component itself can perform corresponding cryptographic operations on the data to be processed through the cryptographic operation strategy. Alternatively, the cryptographic component can be used as a transmission tool to transmit the data to be processed to the corresponding cryptographic operation component, so that the cryptographic operation component can perform cryptographic operations on the data to be processed according to the corresponding cryptographic operation strategy. At this time, the cryptographic component establishes a corresponding relationship with the corresponding cryptographic operation component, and the cryptographic operation component is a component used to perform cryptographic operations such as digital signature, character encryption and decryption algorithm, and data summary algorithm on the data.

[0055] In this embodiment, before executing step S110, the password components may be pre-stored in the server or in the local memory of the development terminal. When it is necessary to create a password unit, the password device may obtain various password components from the server or the local memory. As long as the password device can obtain the password components, there is no specific limitation on the source or method of obtaining the password components.

[0056] In step S120, the development terminal may pre-store the dependency relationship between the cryptographic component and the dependent component. The dependent component is a component required when installing or running the cryptographic unit. Various dependent components may be pre-stored in the server or development terminal in the form of a database. The dependency relationship between the cryptographic component and the dependent component may be determined according to actual conditions. After obtaining the cryptographic component, the development terminal may determine the dependent component corresponding to the cryptographic component as the target dependent component according to the dependency relationship between the cryptographic component and the dependent component, and then obtain the target dependent component as a component of the cryptographic unit.

[0057] In step S130, the construction tool may be, but is not limited to, IncludeOS tool, Unik tool, etc., which may be used to encapsulate the obtained cryptographic components and dependent components in the form of static links. That is, through construction tools such as IncludeOS tool or Unik tool, cryptographic components, dependent components, etc. may be linked together to generate an executable program. In this embodiment, the executable program is an image file representing the cryptographic unit installation package, which may be as follows: Figure 3 shown.

[0058] When the cryptographic unit is applied to a physical device (such as a personal computer or server), the system of the physical device can install an image file. During deployment, the image file can automatically install various contents into the corresponding installation directory of the physical device. After the image file is installed, a cryptographic unit can be formed.

[0059] When the cryptographic unit is applied to a virtualization scenario, for example, when the cryptographic unit is applied to a virtualization manager, the image file is an image file that can be compiled for the virtualization manager, and the virtualization manager can directly load the image file without installing the image file. By running the image file, it can be used as a cryptographic unit to encrypt and decrypt data. The form of the image file can correspond to the virtual disk supported by the virtualization manager (for example, a Vmdk file), and the image file contains the cryptographic components of the cryptographic unit and the required boot program, driver, etc.

[0060] In this embodiment, the cryptographic unit only includes a service component such as a cryptographic component, so the cryptographic unit only provides a logical interface for implementing cryptographic services and does not provide other interfaces to improve the security of data processing.

[0061] Understandably, the image file includes the components required for the operation of the password component, and can be directly operated without relying on the Linux system, which is convenient for the transplantation and installation of the password unit. In addition, the password unit only includes the service component of the password component, and does not involve the service components of other classes. For example, compared with the existing cryptographic machine, which needs to include the service component for realizing user management and the dependent components required for the service component, the password unit of the embodiment of the present application does not include the service component of user management, and does not need to add the dependent components required for the service component of user management. Therefore, the capacity of the password unit can be reduced to achieve the creation of a lightweight password unit. After the capacity of the password unit is reduced, it is conducive to the rapid startup of the password unit to shorten the time required for startup, and the recovery speed (the speed of closing the password unit) can also be improved. In addition, since the password unit only provides password services and does not provide user management, the logical interface for external interaction is reduced, which is conducive to reducing the attack surface, so as to improve the security of data processing.

[0062] As an optional implementation, step S110 may include: obtaining at least one type of cryptographic component of a first type of cryptographic component for performing cryptographic operations through a cryptographic operation strategy and a second type of cryptographic component for sending data to be processed to a corresponding cryptographic operation component.

[0063] Understandably, the cryptographic components can be divided according to the principle or algorithm for performing encryption and decryption operations. The algorithms used by different types of cryptographic components to perform encryption and decryption are usually different. In this embodiment, the first type of cryptographic components includes but is not limited to a first cryptographic component for performing cryptographic operations through digital signatures, a second cryptographic component for performing cryptographic operations through character encryption and decryption algorithms, and a third cryptographic component for performing cryptographic operations through data summary algorithms. The second type of cryptographic components may include a fourth cryptographic component for sending the data to be processed to the corresponding cryptographic operation component. When the data to be processed is sensitive data, the fourth cryptographic component may transmit the data to be processed to the corresponding cryptographic operation component through a preset password so that the cryptographic operation component performs corresponding cryptographic operations on the data to be processed.

[0064] The cryptographic component may also be a cryptographic component of other types. For example, the cryptographic component may include a cryptographic component for implementing hash function encryption and decryption. By acquiring a variety of cryptographic components, the method facilitates the selection of corresponding encryption and decryption methods according to requirements, thereby enriching the implementation methods of encryption and decryption.

[0065] In this embodiment, the cryptographic component can be pre-created by the designer. When creating the cryptographic component, the cryptographic component can be created according to the cryptographic function or algorithm. For example, the cryptographic function includes but is not limited to digital signature, character encryption and decryption, data summary, hash function, transmission of pending data, etc. When the cryptographic function is implemented, various cryptographic functions can be implemented by different programming languages, such as digital signature, character encryption and decryption, data summary, hash function, etc. Alternatively, the cryptographic function can be implemented by software, such as open source libraries such as OpenSSL or self-written code, or by other various cryptographic modules such as PCI cryptographic library, software cryptographic module or virtual cryptographic module.

[0066] Among them, the password function can be implemented on a physical machine (such as a personal computer) or on a virtual machine. When implemented on a physical machine, the corresponding hardware driver, such as a CPU driver, a motherboard driver, etc., can be selected according to the actual situation. When implemented on a virtual machine, the virtualized hardware is usually standard hardware. At this time, the corresponding virtualization software, such as VirtualBox, Xen, Qemu, VMWare, etc., can be selected according to the actual situation.

[0067] After the cryptographic function is implemented, it can be provided to the outside world in the form of network services. For example, based on the request / response mechanism of TCP, HTTP or HTTPS. Among them, when the cryptographic function is provided in the form of network services, the underlying operating system where the cryptographic unit is installed needs to provide TCP protocol stack and HTTP / HTTPS support. In addition, when the cryptographic unit serves multiple concurrent scenarios, the operating system also needs to support multi-threading, such as POSIX.

[0068] As an optional implementation, before step S120, the method may further include: creating a dependency relationship between the cryptographic component and dependent components, wherein the dependent components corresponding to the cryptographic component include basic dependent components, TCP protocol stack components, network support components, and programming language runtime components.

[0069] When creating a dependency relationship, the cryptographic component can be set with a unique code to represent the unique ID of the cryptographic component, and each type of dependent component can also be set with a unique code to represent the unique ID of the dependent component. Different dependent components have different IDs to facilitate distinction. When establishing a dependency relationship, the ID of the cryptographic component can be associated with the ID of the dependent component required by the cryptographic component, based on which the dependency relationship between the cryptographic component and the dependent component can be established. Among them, the dependent component required by the cryptographic component can be selected according to the actual situation, and is not specifically limited here.

[0070] Understandably, current embedded development systems and unikernel systems can provide various standard CPU drivers, motherboard drivers, boot programs, and disk management as the basic dependent component libOS.a. The designers of the cryptographic unit can identify various other dependent components, including TCP protocol stack components, network support components, mathematical library Libm, programming language runtime components (such as C language runtime library libc, C++ language runtime library libstdc++, multi-threaded support library posix and other components), and support software for the cryptographic components used, etc., which are components well known to those skilled in the art. Various components can be pre-stored on devices such as servers and development terminals. Alternatively, various components can be configured in the configuration file specified by the compilation and linking tool (such as the IncludeOS tool and Unik tool mentioned above).

[0071] When creating a dependency relationship, the program code of the cryptographic component can automatically identify the required dependent component, or link the cryptographic component with the required dependent component by specifying the link through a compile command line or a configuration file, so as to establish a dependency relationship.

[0072] In the above implementation, by obtaining dependent components of the cryptographic component and then encapsulating them, the cryptographic unit itself can include an operating system, which facilitates the transplantation and relocation of the cryptographic unit.

[0073] As an optional implementation, the method may execute steps S110 to S130 multiple times to obtain multiple image files, each of which is an installation package of a cryptographic unit.

[0074] Understandably, the number of image files created can be determined according to actual conditions. Among them, multiple image files are conducive to the construction of large-scale cryptographic units, so as to provide multiple cryptographic service lines to the outside world at the same time.

[0075] As an optional implementation, the method may further include: sending the obtained multiple image files to a cryptographic device, so that the cryptographic device constructs a cryptographic integration service system according to the multiple image files.

[0076] Understandably, the cryptographic integrated service system can provide multiple cryptographic service interfaces to the outside world at the same time, and can encrypt and decrypt multiple data, which is conducive to improving the efficiency of cryptographic processing. In addition, because the operating system contained in the image file is obtained through static linking, the cryptographic unit starts quickly, and the cryptographic integrated service system can achieve rapid dynamic expansion of cryptographic services and rapid resource recovery by quickly adding and deleting cryptographic units. That is, the dynamic horizontal expansion speed and dynamic resource recovery speed of the cryptographic integrated service system provided by the embodiment of the present application can be improved.

[0077] Please refer to Figure 3 Through the above-mentioned component tools, the basic dependent components, TCP protocol stack components, network card drivers, motherboard drivers and other dependent components can be encapsulated into a static library file Os.a; the mathematical library Libm, Libc, Libstdc++, Posix and other programming language runtime library components can be encapsulated into the Os basic library; the cryptographic operation strategy and key management components can be encapsulated into the Crypto.c file; the cryptographic service can be encapsulated into the Service.c file. Finally, the encapsulated files can be encapsulated into a mirror file.

[0078] In this embodiment, the constructed cryptographic unit, since it contains the content of the boot program and the basic computer system, when loaded by a physical machine or a virtual machine hypervisor such as Qemu or Xen, can find the boot program of the cryptographic unit to start the physical computer or virtual machine, drive the installed hardware such as the CPU, memory, disk, and bus, and then load the cryptographic components in the cryptographic unit, load the network driver and the network protocol stack, receive encryption requests through the cryptographic components, complete the encryption operation for the requester, or receive decryption requests, complete the decryption operation for the requester, or transmit the data to be processed to the corresponding cryptographic operation component to realize the transmission function.

[0079] In this embodiment, the cryptographic unit can be installed in cryptographic devices such as industrial computers and dedicated servers to become a hardware cryptographic device with fast startup and fast service features, while reducing the security risks brought by the complexity of the physical device itself.

[0080] In this embodiment, the cryptographic capabilities of the traditional hardware cryptographic machine can be replaced by several virtual lightweight cryptographic units. The cryptographic device can provide key management and cryptographic computing capabilities. The lightweight cryptographic unit created by this application encapsulates sensitive parameters of specific users such as visitor account passwords and security policies such as the maximum number of connections, thereby achieving the effect of secure sharing of the cryptographic device computing capabilities.

[0081] In this embodiment, the software module of the cryptographic unit (i.e., the above-mentioned image file) can be encapsulated in a lightweight virtual machine. Since the lightweight virtual machine has the characteristics of low complexity, small image size, low resource consumption, and high isolation, it can be quickly started and provide cryptographic services efficiently and securely.

[0082] In this embodiment, the constructed cryptographic units can form a large-scale cryptographic unit cluster through network-level planning to jointly improve cryptographic service capabilities. They can cooperate with various key management systems, digital certificate systems, identity authentication systems, electronic signature systems, etc. to complete the required complex cryptographic functions.

[0083] Based on the above design, it is possible to construct a cryptographic unit with a lower complexity than the various types of current dedicated cryptographic machines. In the cryptographic unit, only various components necessary for providing the operation and service of the cryptographic device are included, and all others are excluded. For example, the cryptographic unit does not include service components such as user management of the Linux system, Telnet remote connection service, SSH (Secure Shell) protocol service, etc., so that the designers, developers and managers of the cryptographic device do not need to carry out targeted defense design for the hidden risks of these service components, thereby reducing the complexity of the system and reducing the potential security risks of other service components.

[0084] When the cryptographic unit is applied to a virtual machine, it is different from the virtualization of a traditional cryptographic machine. Since the lightweight cryptographic unit created by this application has the characteristics of few dependencies, low complexity, small size, and few resources, a single cryptographic device can support virtualization into a large number of virtualized cryptographic units, and at the same time, it can be quickly started and quickly recycled.

[0085] Please refer to Figure 5 , the embodiment of the present application also provides a cryptographic unit creation device 200, which can be applied to the above-mentioned development terminal 10, and is used to execute or implement each step of the cryptographic unit creation method. The cryptographic unit creation device 200 includes at least one software function module that can be stored in the memory in the form of software or firmware (Firmware) or solidified in the operating system (OS) of the development terminal 10. The processor is used to execute the executable module stored in the memory, such as the software function module and computer program included in the cryptographic unit creation device 200.

[0086] The cryptographic unit creation device 200 may include a first acquisition module 210 , a second acquisition module 220 , and an encapsulation module 230 .

[0087] The first acquisition module 210 is used to acquire a cryptographic component for performing a cryptographic processing operation.

[0088] The second acquisition module 220 is used to acquire each type of target dependent component corresponding to the cryptographic component according to the dependency relationship between the cryptographic component and the dependent component.

[0089] The encapsulation module 230 is used to encapsulate the cryptographic component and each type of target dependent component into a mirror file representing the cryptographic unit installation package by static linking through a construction tool, and the mirror file is a file including an operating system.

[0090] Optionally, the first acquisition module 210 can also be used to: acquire at least one of a first type of cryptographic component for performing cryptographic operations through a cryptographic operation strategy and a second type of cryptographic component for sending data to be processed to a corresponding cryptographic operation component.

[0091] Optionally, the cryptographic unit creation device 200 may further include a creation module, which is used to create a dependency relationship between the cryptographic component and the dependent components before the second acquisition unit obtains each type of target dependent component corresponding to the cryptographic component based on the dependency relationship between the cryptographic component and the dependent components, wherein the dependent components corresponding to the cryptographic component include a basic dependent component, a TCP protocol stack component, a network support component, and a programming language runtime component.

[0092] Optionally, the cryptographic unit creation device 200 may further include a sending module, configured to send the obtained multiple image files to a cryptographic device, so that the cryptographic device constructs a cryptographic integrated service system according to the multiple image files.

[0093] It should be noted that technicians in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working process of the development terminal and the cryptographic unit creation device 200 described above can refer to the corresponding process of each step in the aforementioned method, and will not be repeated here.

[0094] Second embodiment

[0095] Please refer to Figure 5 The embodiment of the present application also provides a data processing method, which can be applied to the above-mentioned cryptographic device 20. The cryptographic device 20 stores the image file created by the first embodiment, and each step of the method can be executed or implemented by the cryptographic device 20. The method can include the following steps:

[0096] Step 310, obtaining a password processing request and data to be processed corresponding to the password processing request;

[0097] Step 320: According to the cryptographic operation strategy corresponding to the cryptographic processing request, a cryptographic operation is performed on the data to be processed by running the image file to obtain the data to be processed after the cryptographic operation.

[0098] In the second embodiment, the cryptographic operation strategy may be, but is not limited to, the above-mentioned digital signature, character encryption and decryption algorithm, data summary algorithm, diffusion function, transmission of data to be processed, etc. The cryptographic device may establish a communication connection with other devices for data exchange with other devices. Among them, the data sent to the cryptographic device is usually data to be processed. The data to be processed is data that needs to be subjected to cryptographic operations such as digital signature, character encryption and decryption algorithm, data summary algorithm, diffusion function, etc. For example, the user terminal may send the data to be processed to the cryptographic device, and the cryptographic device may encrypt the data to be processed using a character encryption and decryption algorithm, and then send the encrypted data to other terminals or servers.

[0099] When the user terminal sends the data to be processed to the cryptographic device, it needs to request the cryptographic device to provide the corresponding cryptographic service. For example, the user terminal can inform the cryptographic device by sending an encryption request or a decryption request to the cryptographic device, so that the cryptographic device performs an encryption operation on the data to be processed according to the encryption request, or performs a decryption operation on the data to be processed according to the decryption request. The encryption or decryption operation can be implemented by the above-mentioned cryptographic component itself, or the cryptographic component sends the data to be processed to the cryptographic operation unit, and the cryptographic operation unit implements the encryption or decryption operation.

[0100] For example, when the cryptographic processing request is an encryption request, the encryption request may include the type of encryption strategy, such as digital signature, character encryption and decryption algorithm, data summary algorithm, etc., so that the cryptographic unit performs encryption processing on the data to be processed according to the corresponding encryption strategy. Similarly, when the cryptographic processing request is a decryption request, the decryption request may include the corresponding decryption strategy, so that the cryptographic device performs corresponding decryption processing on the data to be processed.

[0101] In this embodiment, the cryptographic unit constructed by the first embodiment can provide cryptographic services in the form of a virtual image. When providing cryptographic services, except for the interface provided by the cryptographic service, no access path that may access the key and cryptographic function implementation program is included, and the image file does not contain any content that may threaten the security of the key and cryptographic function implementation. For example, other processes except the cryptographic service cannot be started in the image file, and the image file cannot be used for user access through the operating system. In this way, a barrier is built for the cryptographic unit to improve the security of the cryptographic unit data processing.

[0102] In a second embodiment, the cryptographic device can construct a cryptographic integrated service system based on multiple image files. For example, by building multiple cryptographic units through virtual machines, it is possible to support the construction of a large-scale, fast horizontally expanded cryptographic integrated service system. The image file constructed using the present application, as described above, can improve security and startup speed due to the reduced number of components contained in the image file, low complexity, and small size, so as to meet the startup within 10-20 milliseconds. This speed is faster than most of the current Docker-implemented cryptographic machines, and can start (load) hundreds of virtual cryptographic machine image files within seconds, and can be quickly shut down to recycle resources when not needed.

[0103] In addition, unlike embedded system development such as VxWork, the cryptographic unit provided by this application can be linked to a system image according to the microkernel mechanism, and can run on general mail or virtual layers such as VmWare and Qemu, rather than embedded hardware. Users can use a large number of PC servers to build a cryptographic integration service system without having to purchase a large number of dedicated cryptographic machines, thereby reducing the cost of building a cryptographic service system.

[0104] Please refer to Figure 6, the embodiment of the present application also provides a data processing device 400, which can be applied to the above-mentioned cryptographic device to implement each step in the data processing method. The data processing device 400 includes at least one software function module that can be stored in the memory of the cryptographic device in the form of software or firmware (Firmware) or solidified in the operating system (OS) of the cryptographic device. The processor is used to execute the executable module stored in the memory, such as the software function module and computer program included in the data processing device 400.

[0105] The data processing device 400 may include a third acquisition module 410 and a cryptographic operation module 420 .

[0106] A third acquisition module 410 is used to acquire a password processing request and data to be processed corresponding to the password processing request;

[0107] The cryptographic operation module 420 is used to perform a cryptographic operation on the data to be processed by running the image file according to the cryptographic operation strategy corresponding to the cryptographic processing request, so as to obtain the data to be processed after the cryptographic operation.

[0108] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the cryptographic device 20 and the data processing device 400 described above can refer to the corresponding processes of each step in the aforementioned method, and will not be elaborated herein.

[0109] In this embodiment, the processor, communication module, and memory in the electronic device are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0110] The processor can be an integrated circuit chip with signal processing capabilities. For example, the processor can be a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, which can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0111] The communication module is used to establish a communication connection between the electronic device and other devices (for example, a user terminal) through a network, and to send and receive data through the network.

[0112] The memory may be, but is not limited to, a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, etc. In this embodiment, the memory may be used to store cryptographic components, dependencies between cryptographic components and dependent components, etc. Of course, the memory may also be used to store programs, and the processor executes the program after receiving an execution instruction.

[0113] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is run on a computer, the computer executes the cryptographic unit creation method and the data processing method described in the above embodiment.

[0114] Through the description of the above implementation methods, technical personnel in this field can clearly understand that the present application can be implemented by hardware, and can also be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0115] In summary, the present application provides a cryptographic unit creation method, a data processing method, a device and an electronic device. The creation method includes: obtaining a cryptographic component for performing a cryptographic processing operation; obtaining each type of target dependent component corresponding to the cryptographic component according to the dependency relationship between the cryptographic component and the dependent component; and through a construction tool, encapsulating the cryptographic component and each type of target dependent component into a mirror file representing a cryptographic unit installation package in a statically linked manner, wherein the mirror file is a file including an operating system. In this solution, by separating the cryptographic component and the target dependent component, and then encapsulating them into a mirror file in a statically linked manner, the mirror file can implement the corresponding cryptographic operation at runtime. Based on this, the capacity of the cryptographic unit is relatively small, which is conducive to reducing the attack surface to improve the security of the data. In addition, due to the small capacity, it is conducive to improving the startup speed and recovery speed when using the cryptographic service function.

[0116] In the embodiments provided in the present application, it should be understood that the disclosed device, system and method can also be implemented in other ways. The above-described device, system and method embodiments are merely schematic, for example, the flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a part of a module, a program segment or a code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.

[0117] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for creating a cryptographic unit, characterized in that: Applied to a development terminal, the method includes: Obtaining a cryptographic component for performing encryption and decryption operations using an encryption and decryption strategy; Creating a dependency relationship between the cryptographic component and dependent components, wherein the dependent components corresponding to the cryptographic component include a basic dependent component, a TCP protocol stack component, a network support component, and a programming language runtime component; According to the dependency relationship between the cryptographic component and the dependent components, obtaining each type of target dependent component corresponding to the cryptographic component; By building a tool, the cryptographic component and each type of target dependent component are statically linked and encapsulated into an image file representing the cryptographic unit installation package; wherein the form of the image file corresponds to the virtual disk supported by the virtualization manager, and the image file includes the cryptographic component of the cryptographic unit and the required boot program and driver.

2. The method according to claim 1, characterized in that Get the cryptographic components used to perform encryption and decryption operations through the encryption and decryption policy, including: Obtain at least one type of cryptographic component from among a first cryptographic component for performing encryption and decryption operations through a digital signature, a second cryptographic component for performing encryption and decryption operations through a character encryption and decryption algorithm, and a third cryptographic component for performing encryption and decryption operations through a data summary algorithm.

3. The method according to claim 1, characterized in that By building a tool, the cryptographic component and each type of target dependent component are statically linked and packaged into a mirror file representing a cryptographic unit installation package, including: The cryptographic component and each type of target dependent component are packaged into a plurality of image files by static linking through the construction tool, and each of the image files is an installation package of a cryptographic unit.

4. The method according to claim 3, characterized in that The method further comprises: The multiple image files are sent to an encryption device, so that the encryption device constructs a password resource pool according to the multiple image files.

5. A data processing method, characterized in that: Applied to a cryptographic device, the cryptographic device storing an image file according to any one of claims 1 to 4, the method comprising: Obtaining a processing request and data to be processed corresponding to the processing request; When the processing request is an encryption request, running the image file according to the encryption request, and encrypting the data to be processed by using the first cryptographic component in the image file to obtain the encrypted data to be processed; When the processing request is a decryption request, the image file is run according to the decryption request, and the data to be processed is decrypted by the second cryptographic component in the image file to obtain the decrypted data to be processed.

6. A cryptographic unit creation device, characterized in that: Applied to the development terminal, the device comprises: A first acquisition module, used to acquire a cryptographic component used to perform encryption and decryption operations through an encryption and decryption strategy; The cryptographic unit creation device is further used to create a dependency relationship between the cryptographic component and dependent components, wherein the dependent components corresponding to the cryptographic component include a basic dependent component, a TCP protocol stack component, a network support component, and a programming language runtime component; A second acquisition module, configured to acquire each type of target dependent component corresponding to the cryptographic component according to the dependency relationship between the cryptographic component and the dependent component; The encapsulation module is used to statically link and encapsulate the cryptographic components and each type of target dependent components into an image file representing the cryptographic unit installation package through a construction tool; wherein the form of the image file corresponds to the virtual disk supported by the virtualization manager, and the image file includes the cryptographic components of the cryptographic unit and the required boot program and driver.

7. A data processing device, characterized in that: Applied to a cryptographic device, the cryptographic device storing a mirror file according to any one of claims 1 to 4, the device comprising: A third acquisition module is used to acquire a processing request and to-be-processed data corresponding to the processing request; an encryption module, for, when the processing request is an encryption request, running the image file according to the encryption request, and encrypting the data to be processed by using a first cryptographic component in the image file to obtain encrypted data to be processed; The decryption module is used to run the image file according to the decryption request when the processing request is a decryption request, and decrypt the data to be processed through the second cryptographic component in the image file to obtain the decrypted data to be processed.

8. An electronic device, characterized in that: The electronic device includes a memory and a processor coupled to each other, wherein the memory stores a computer program. When the computer program is executed by the processor, the electronic device executes the cryptographic unit creation method as described in any one of claims 1 to 4 or the data processing method as described in claim 5.

9. A computer-readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer executes the cryptographic unit creation method according to any one of claims 1 to 4 or the data processing method according to claim 5.