Encryption and decryption control method, electronic equipment, readable medium and program product

By calling the encryption and decryption control method of static libraries or dynamic libraries in the business processing process, the flexibility of encryption and decryption requirements between different networks and security domains is solved, and efficient and flexible encryption and decryption processing is achieved, reducing the difficulty of development.

CN119538283APending Publication Date: 2025-02-28BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411581886.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

When the prior art transmits data between different networks and security domains, it is difficult to flexibly respond to different encryption and decryption needs, resulting in low flexibility in encryption and decryption processing and high development difficulty.

Method used

Provides an encryption and decryption control method, which calls a static library or a dynamic library through a business processing process for encryption and decryption processing. The static library is coupled with the business processing process, which is suitable for businesses with high real-time requirements and large data volume; the dynamic library encryption and decryption process is decoupled with the business processing process, which is suitable for businesses with low real-time requirements and small data volume.

Benefits of technology

It realizes the selection of static libraries or dynamic libraries for encryption and decryption processing according to different business needs, improves the flexibility of encryption and decryption processing, meets diverse encryption and decryption needs, and reduces development difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538283A_ABST
    Figure CN119538283A_ABST
Patent Text Reader

Abstract

The invention provides an encryption and decryption control method. The method comprises the steps that a service processing process receives service data; under a first condition, the service processing process calls a static library coupled with the service processing process, and encrypts and decrypts the service data according to encryption and decryption parameters to obtain an encrypted and decrypted data result; under a second condition, the service processing process sends the service data and the encryption and decryption parameters to a dynamic library encryption and decryption process; the dynamic library encryption and decryption process encrypts and decrypts the service data according to the encryption and decryption parameters to obtain an encrypted and decrypted data result; and the dynamic library encryption and decryption process returns the data encryption and decryption result to the service processing process. The disclosure also provides an electronic device, a computer readable medium, and a computer program product. According to the invention, diversified encryption and decryption requirements can be met, the encryption and decryption processing time is saved, and the encryption and decryption processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to an encryption and decryption control method, an electronic device, a computer-readable medium, and a computer program product. Background Art

[0002] When data is transmitted between different networks and different security domains, it is necessary to encrypt the transmitted data. This requires ensuring that the transmitted data can be encrypted and decrypted normally between different platforms and different languages ​​to meet different security requirements. For example, a one-way network gatekeeper is a physical isolation device between different networks and different security domains, which only allows data to be transmitted in one direction without feedback. For networks with high data security requirements, in order to prevent important data from being leaked, data in the external network can only be transmitted in one direction to the internal network. The external network and internal network corresponding to the one-way network gatekeeper are usually based on different platforms and have different encryption requirements.

[0003] The flexibility to meet different encryption requirements needs to be improved, and the development of encryption and decryption processing is relatively difficult. Summary of the invention

[0004] The embodiments of the present disclosure provide an encryption and decryption control method, an electronic device, a computer-readable medium, and a computer program product.

[0005] In a first aspect, an embodiment of the present disclosure provides an encryption and decryption control method, including: a business processing process receives business data; under a first condition, the business processing process calls a static library coupled to the business processing process, and performs encryption and decryption processing on the business data according to encryption and decryption parameters to obtain encryption and decryption data results; under a second condition, the business processing process sends the business data and the encryption and decryption parameters to a dynamic library encryption and decryption process; the dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters to obtain encryption and decryption data results; the dynamic library encryption and decryption process returns the encryption and decryption data results to the business processing process.

[0006] In some embodiments, under the second condition, the business processing process sends the business data and encryption and decryption parameters to the dynamic library encryption and decryption process, including: the business processing process generates an encryption and decryption request message according to a private protocol format, and the encryption and decryption request message carries the business data and the encryption and decryption parameters; the business processing process sends the encryption and decryption request message to the dynamic library encryption and decryption process.

[0007] In some embodiments, the dynamic library encryption and decryption process encrypts and decrypts the business data according to the encryption and decryption parameters to obtain an encryption and decryption data result, including: the dynamic library encryption and decryption process parses the received encryption and decryption request message according to the private protocol format to obtain the business data and the encryption and decryption parameters; the dynamic library encryption and decryption process calls a dynamic library coupled to the dynamic library encryption and decryption process, encrypts and decrypts the business data according to the encryption and decryption parameters to obtain an encryption and decryption data result.

[0008] In some embodiments, the dynamic library encryption and decryption process returns the encryption and decryption data result to the business processing process, including: the dynamic library encryption and decryption process generates an encryption and decryption response message according to the private protocol format, and the encryption and decryption response message carries the encryption and decryption data result and the encryption and decryption parameters; the dynamic library encryption and decryption process sends the encryption and decryption response message to the business processing process; the encryption and decryption control method also includes: the business processing process parses the received encryption and decryption response message according to the private protocol format to obtain the encryption and decryption data result.

[0009] In some embodiments, the encryption and decryption parameters include: business platform information, which represents the type of business platform corresponding to the business data; encryption and decryption language information, which represents the programming language used when encrypting and decrypting the business data; encryption and decryption algorithm information, which represents the encryption and decryption algorithm used when encrypting and decrypting the business data.

[0010] In some embodiments, the private protocol format includes: a sequence number field, used to identify the encryption and decryption request message and the corresponding encryption and decryption response message; a category field, used to identify the message as an encryption and decryption request message or an encryption and decryption response message; an operation field, used to indicate whether to perform encryption or decryption processing on the business data; a platform field, used to carry the business platform information; a language field, used to carry the encryption and decryption language information; an algorithm field, used to carry the encryption and decryption algorithm information; a data content field, used to carry the business data; and a data length field, used to indicate the length of the data content field.

[0011] In some embodiments, the encryption and decryption control method also includes: obtaining encryption and decryption parameters of the new service according to the encryption and decryption requirements of the new service; generating an encryption and decryption script of the new service in a dynamic library according to the encryption and decryption parameters of the new service, so that the dynamic library encryption and decryption process can call the dynamic library to perform encryption and decryption processing on the business data of the new service.

[0012] In some embodiments, the encryption and decryption control method also includes: when the business requirements of the target business change, obtaining the encryption and decryption script of the target business from the dynamic library; coupling the encryption and decryption script of the target business to the static library so that the business processing process can call the static library to perform encryption and decryption processing on the business data of the target business.

[0013] In a second aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a memory on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the encryption and decryption control method described in the first aspect of the embodiment of the present disclosure.

[0014] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, the encryption and decryption control method described in the first aspect of the embodiment of the present disclosure is implemented.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the encryption and decryption control method described in the first aspect of the embodiment of the present disclosure.

[0016] In the disclosed embodiment, under the first condition, the business processing process calls the static library coupled with the business processing process to directly perform encryption and decryption processing on the business data; under the second condition, the business processing process sends the business data and encryption and decryption parameters to the dynamic library encryption and decryption process, and the dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters. The static library is coupled with the business processing process, and the business processing efficiency is relatively high; the dynamic library encryption and decryption process and the business processing process perform inter-process communication, and the business processing efficiency is relatively low. During the encryption and decryption processing, the static library or dynamic library can be selected for encryption and decryption processing according to the encryption requirements of different businesses, making the encryption and decryption processing more flexible, meeting the diverse encryption and decryption requirements, and also reducing the difficulty of development. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of an encryption and decryption control method in an embodiment of the present disclosure;

[0018] Figure 2 is a schematic diagram of an architecture of encryption and decryption control in an embodiment of the present disclosure;

[0019] Figure 3 It is a schematic diagram of a private protocol format for implementing a dynamic library encryption and decryption process in an embodiment of the present disclosure;

[0020] Figure 4 It is a schematic diagram of the composition of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the technical solution of the present disclosure is described in detail below with reference to the accompanying drawings.

[0022] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.

[0023] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0024] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0025] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.

[0026] The inventors have found that in order to meet the different requirements for encryption and decryption between different networks and different security domains, static libraries and dynamic libraries need to cooperate to complete the encryption and decryption process. However, static libraries and dynamic libraries are usually coupled with the business processing process. The business processing process directly calls static libraries or dynamic libraries to encrypt and decrypt business data, and cannot distinguish between businesses with high real-time requirements and large data volumes and businesses with low real-time requirements and small data volumes. The flexibility of encryption and decryption processing is low; static libraries and dynamic libraries are usually coupled with the business processing process, resulting in modifications to static libraries or dynamic libraries during development. The business processing process needs to be modified, which makes development difficult.

[0027] In view of this, firstly, refer to Figure 1 , the present disclosure provides an encryption and decryption control method, including:

[0028] S1, the business processing process receives business data;

[0029] S2. Under the first condition, the business processing process calls a static library coupled to the business processing process, performs encryption and decryption processing on the business data according to encryption and decryption parameters, and obtains encryption and decryption data results;

[0030] S3. Under the second condition, the business processing process sends the business data and the encryption and decryption parameters to the dynamic library encryption and decryption process;

[0031] S4, the dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters to obtain encryption and decryption data results;

[0032] S5. The dynamic library encryption and decryption process returns the encryption and decryption data result to the business processing process.

[0033] In the embodiment of the present disclosure, the first condition and the second condition correspond to different business requirements. For example, the business requirement corresponding to the first condition is to process business data with high real-time requirements and large data volume; the business requirement corresponding to the second condition is to process business data with low real-time requirements and small data volume.

[0034] In the disclosed embodiment, coupling with the business processing process refers to writing a static library or a dynamic library directly into the business processing process, and the business processing process can directly call the static library or the dynamic library when performing encryption and decryption processing on the business data. In the disclosed embodiment, the static library is coupled with the business processing process, and when the static library needs to be used for encryption and decryption processing, the business processing process can directly call the static library to perform encryption and decryption processing on the business data. In the disclosed embodiment, the dynamic library is coupled with the dynamic library encryption and decryption process, that is, the dynamic library is decoupled from the business processing process, and when the dynamic library needs to be used for encryption and decryption processing, the business processing process needs to communicate with the dynamic library encryption and decryption process, and the dynamic library encryption and decryption process directly calls the dynamic library to perform encryption and decryption processing on the business data.

[0035] In the disclosed embodiment, for the business data of the business that meets the first condition, the business processing process directly calls the static library for encryption and decryption processing; for the business data of the business that meets the second condition, the business processing communicates with the dynamic library encryption and decryption process, and the dynamic library encryption and decryption process calls the dynamic library for encryption and decryption processing. In this way, the business data for different business needs can be processed differently. For example, for businesses with high real-time requirements and large data volumes, encryption and decryption processing is performed locally in the business processing process to ensure processing timeliness; for businesses with low real-time requirements and small data volumes, encryption and decryption processing is performed in the dynamic library encryption and decryption process, which can also meet its timeliness requirements.

[0036] Figure 2 Schematic diagram of an encryption and decryption control architecture in an embodiment of the present disclosure. Figure 2In the architecture shown, the business processing process includes a business processing module, a static library, and a dynamic library encryption and decryption communication module. For the business data of the business that meets the first condition, the business processing process performs encryption and decryption processing on the business data by calling the static library coupled with the business processing process; for the business data of the business that meets the second condition, the business processing process sends the business data and encryption and decryption parameters to the dynamic library encryption and decryption process through the dynamic library encryption and decryption communication module, and the dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters. In the disclosed embodiment, the dynamic library is decoupled from the business processing process. When the dynamic library needs to be modified according to new business requirements, only the dynamic library encryption and decryption process needs to be modified, and there is no need to modify the business processing process. The processing logic of the business processing process does not need to be changed, which reduces the development difficulty. At the same time, the static library remains coupled with the business processing process, and the encryption and decryption processing efficiency is high, which can meet business requirements with high real-time requirements and large data volumes.

[0037] In the disclosed embodiments, encryption and decryption processing includes encryption processing and decryption processing. Static libraries and dynamic libraries are public codes compiled into library files that can be repeatedly used by processing processes. Static libraries embed the code and data in the library into executable files during compilation; the code and data in the dynamic library will only be loaded at runtime. Encryption and decryption parameters include business platform, encryption and decryption language, encryption and decryption algorithm, etc., which are used to characterize the information used when the business data is encrypted and decrypted.

[0038] The encryption and decryption control method provided in the embodiments of the present disclosure can be applied to network security devices. Common network security devices include WAF application firewalls, IDS intrusion detection systems, IPS intrusion prevention systems, VPN virtual private networks, one-way firewalls, etc.

[0039] In some embodiments, the network security device is a one-way network switch, and the hardware architecture of the one-way optical switch is a 2+1 architecture, that is, it is composed of an external terminal, an internal terminal and an isolation component, and the one-way isolation component is composed of two one-way isolation cards connected by a one-way optical fiber. The external terminal and the internal terminal provide services to the outside as a whole machine, respectively run agent software, and the external terminal and the internal terminal communicate physically in one direction. The encryption and decryption control method provided in the embodiment of the present disclosure can be applied to the external terminal and / or the internal terminal.

[0040] In the disclosed embodiment, under the first condition, the business processing process calls the static library coupled with the business processing process to directly perform encryption and decryption processing on the business data; under the second condition, the business processing process sends the business data and encryption and decryption parameters to the dynamic library encryption and decryption process, and the dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters. The static library is coupled with the business processing process, so that the business processing process is more efficient in encrypting and decrypting the business data; the dynamic library encryption and decryption process and the business processing process perform inter-process communication, and the efficiency of encryption and decryption processing of the business data is relatively low. During the encryption and decryption processing, static libraries or dynamic libraries can be selected for encryption and decryption processing according to the encryption and decryption requirements of different businesses, making the encryption and decryption processing more flexible, meeting the diverse encryption and decryption requirements, and also reducing the difficulty of development.

[0041] In some embodiments, under the second condition, the business processing process sends the business data and encryption and decryption parameters to the dynamic library encryption and decryption process, including:

[0042] The business processing process generates an encryption and decryption request message according to a private protocol format, wherein the encryption and decryption request message carries the business data and the encryption and decryption parameters;

[0043] The business processing process sends the encryption and decryption request message to the dynamic library encryption and decryption process.

[0044] In the disclosed embodiment, the business processing process is not directly coupled to the dynamic library encryption and decryption process, and the business data is encrypted and decrypted after being sent to the dynamic library encryption and decryption process. The dynamic library encryption and decryption process encrypts and decrypts the business data according to the encryption and decryption parameters. In the disclosed embodiment, a private protocol format for communication between the business processing process and the dynamic library encryption and decryption process is defined, so that the business processing process can encapsulate the business data and encryption and decryption parameters according to the private protocol format, generate an encryption and decryption request message, and thus the dynamic library encryption and decryption process can decapsulate the encryption and decryption request message according to the private protocol format and obtain the business data and encryption and decryption parameters.

[0045] In some embodiments, the dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters to obtain encryption and decryption data results, including:

[0046] The dynamic library encryption and decryption process parses the received encryption and decryption request message according to the private protocol format to obtain the business data and the encryption and decryption parameters;

[0047] The dynamic library encryption and decryption process calls a dynamic library coupled with the dynamic library encryption and decryption process, performs encryption and decryption processing on the business data according to the encryption and decryption parameters, and obtains encryption and decryption data results.

[0048] In the disclosed embodiment, the dynamic library encryption and decryption process is an independent process, and the business processing process sends the encryption and decryption request message to the dynamic library encryption and decryption process through inter-process communication, so that the dynamic library encryption and decryption process can perform encryption and decryption processing on the business data according to the encryption and decryption parameters. When receiving the encryption and decryption request message sent by the business processing process, the dynamic library encryption and decryption process parses the encryption and decryption request message according to the private protocol format, obtains the business data and encryption and decryption parameters, and then the dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters by calling the dynamic library to obtain the encryption and decryption data result.

[0049] The disclosed embodiments do not specifically limit the manner in which the business processing process communicates with the dynamic library encryption and decryption process. For example, in some embodiments, the business processing process communicates with the dynamic library encryption and decryption process by establishing a UDP socket. When the dynamic library encryption and decryption process is started, the UDP listening service is also started to respond to encryption and decryption requests sent by the business processing process at any time. Communication between the business processing process and the dynamic library encryption and decryption process can also be achieved through shared memory, message queues, etc. It should be noted that no matter which communication method is used, it is necessary to satisfy the above-mentioned private protocol format.

[0050] In some embodiments, the dynamic library encryption and decryption process returns the encryption and decryption data result to the business processing process, including:

[0051] The dynamic library encryption and decryption process generates an encryption and decryption response message according to the private protocol format, and the encryption and decryption response message carries the encryption and decryption data result and the encryption and decryption parameters;

[0052] The dynamic library encryption and decryption process sends the encryption and decryption response message to the business processing process;

[0053] The encryption and decryption control method further includes:

[0054] The business processing process parses the received encryption and decryption response message according to the private protocol format to obtain the encryption and decryption data result.

[0055] In the disclosed embodiment, after the dynamic library encryption and decryption process completes the encryption and decryption processing of the business data, it is necessary to generate an encryption and decryption response message according to a private protocol format for the encryption and decryption data result and the encryption and decryption parameters, so that the encryption and decryption data result and the encryption and decryption parameters can be sent to the business processing process through the encryption and decryption response message, so that the business processing process can parse the encryption and decryption response message according to the private protocol format to obtain the encryption and decryption data result.

[0056] In some embodiments, the encryption and decryption parameters include: business platform information, which represents the type of business platform corresponding to the business data, for example, Arm platform, X86 platform, etc.; encryption and decryption language information, which represents the programming language used when encrypting and decrypting business data, for example, C language, Go language, Java language, Python language, etc.; encryption and decryption algorithm information, which represents the encryption and decryption algorithm used when encrypting and decrypting business data, for example, AES algorithm, DES algorithm, RSA algorithm, Blowfish algorithm, etc.

[0057] In some embodiments, the private protocol format includes: a sequence number field, used to identify the encryption and decryption request message and the corresponding encryption and decryption response message; a category field, used to identify the message as an encryption and decryption request message or an encryption and decryption response message; an operation field, used to indicate encryption or decryption processing of business data; a platform field, used to carry business platform information; a language field, used to carry encryption and decryption language information; an algorithm field, used to carry encryption and decryption algorithm information; a data content field, used to carry business data; and a data length field, used to indicate the length of the data content field.

[0058] Figure 3 It is a schematic diagram of the private protocol format for implementing the dynamic library encryption and decryption process in the embodiment of the present disclosure. In the embodiment of the present disclosure, the business platform information carried by the platform field includes but is not limited to Arm and X86; the encryption and decryption language information carried by the language field includes but is not limited to C, Go, Java, and Python; the encryption and decryption algorithm information carried by the algorithm field includes but is not limited to AES, DES, RSA, and Blowfish.

[0059] In some embodiments, the encryption and decryption control method further includes:

[0060] According to the encryption and decryption requirements of the newly added service, obtain the encryption and decryption parameters of the newly added service;

[0061] An encryption and decryption script for the new service is generated in the dynamic library according to the encryption and decryption parameters of the new service, so that the encryption and decryption process of the dynamic library can call the dynamic library to perform encryption and decryption processing on the service data of the new service.

[0062] In the embodiments of the present disclosure, when business needs are increased, the encryption and decryption process of the dynamic library is updated by adding the encryption and decryption script of the business in the dynamic library without changing the business processing process. The encryption and decryption processing of the business data of the newly added business can be conveniently and quickly implemented, which is easy to update and meet business needs.

[0063] In some embodiments, the encryption and decryption control method further includes:

[0064] When the business requirements of the target business change, the encryption and decryption scripts of the target business are obtained from the dynamic library;

[0065] The encryption and decryption script of the target business is coupled to the static library, so that the business processing process can call the static library to perform encryption and decryption processing on the business data of the target business.

[0066] In the disclosed embodiment, the encryption and decryption processing method of the dynamic library is written into the static library in a version iteration manner, which can meet diverse encryption and decryption requirements.

[0067] Second, refer to Figure 4 , an embodiment of the present disclosure provides an electronic device, comprising:

[0068] One or more processors 101;

[0069] A memory 102, on which one or more programs are stored. When the one or more programs are executed by one or more processors, the one or more processors implement the encryption and decryption control method described in the first aspect of the embodiment of the present disclosure;

[0070] One or more I / O interfaces 103 are connected between the processor and the memory and are configured to implement information exchange between the processor and the memory.

[0071] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU) and the like; the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus) and the like.

[0072] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.

[0073] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the encryption and decryption control method described in the first aspect of the embodiment of the present disclosure is implemented.

[0074] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the encryption and decryption control method described in the first aspect of the embodiment of the present disclosure.

[0075] In a fifth aspect, an embodiment of the present disclosure provides an encryption and decryption control device, including:

[0076] A business processing module, configured to receive business data for a business processing process;

[0077] The static library encryption and decryption module is configured such that under a first condition, the business processing process calls a static library coupled to the business processing process, performs encryption and decryption processing on the business data according to encryption and decryption parameters, and obtains an encryption and decryption data result;

[0078] The dynamic library encryption and decryption module is configured such that under a second condition, the business processing process sends the business data and the encryption and decryption parameters to the dynamic library encryption and decryption process; the dynamic library encryption and decryption process encrypts and decrypts the business data according to the encryption and decryption parameters to obtain an encryption and decryption data result; and the dynamic library encryption and decryption process returns the encryption and decryption data result to the business processing process.

[0079] In some embodiments, the dynamic library encryption and decryption module is also configured for the business processing process to generate an encryption and decryption request message according to a private protocol format, and the encryption and decryption request message carries the business data and the encryption and decryption parameters; the business processing process sends the encryption and decryption request message to the dynamic library encryption and decryption process.

[0080] In some embodiments, the dynamic library encryption and decryption module is also configured so that the dynamic library encryption and decryption process parses the received encryption and decryption request message according to the private protocol format to obtain the business data and the encryption and decryption parameters; the dynamic library encryption and decryption process calls the dynamic library coupled with the dynamic library encryption and decryption process, encrypts and decrypts the business data according to the encryption and decryption parameters to obtain the encryption and decryption data results.

[0081] In some embodiments, the dynamic library encryption and decryption module is further configured so that the dynamic library encryption and decryption process generates an encryption and decryption response message according to the private protocol format, and the encryption and decryption response message carries the encryption and decryption data result and the encryption and decryption parameters; the dynamic library encryption and decryption process sends the encryption and decryption response message to the business processing process;

[0082] The business processing module is also configured so that the business processing process parses the received encryption and decryption response message according to the private protocol format to obtain the encryption and decryption data result.

[0083] In some embodiments, the static library encryption and decryption module is also configured so that the encryption and decryption parameters include: business platform information, representing the type of business platform corresponding to the business data; encryption and decryption language information, representing the programming language used when encrypting and decrypting the business data; encryption and decryption algorithm information, representing the encryption and decryption algorithm used when encrypting and decrypting the business data.

[0084] In some embodiments, the business processing module is also configured as a private protocol format including: a sequence number field, used to identify the encryption and decryption request message and the corresponding encryption and decryption response message; a category field, used to identify the message as an encryption and decryption request message or an encryption and decryption response message; an operation field, used to indicate encryption or decryption of the business data; a platform field, used to carry the business platform information; a language field, used to carry the encryption and decryption language information; an algorithm field, used to carry the encryption and decryption algorithm information; a data content field, used to carry the business data; and a data length field, used to indicate the length of the data content field.

[0085] In some embodiments, the dynamic library encryption and decryption module is also configured to obtain the encryption and decryption parameters of the new business according to the encryption and decryption requirements of the new business; generate the encryption and decryption script of the new business in the dynamic library according to the encryption and decryption parameters of the new business, so that the dynamic library encryption and decryption process can call the dynamic library to perform encryption and decryption processing on the business data of the new business.

[0086] In some embodiments, the static library encryption and decryption module is also configured to obtain the encryption and decryption script of the target business from the dynamic library when the business requirements of the target business change; and couple the encryption and decryption script of the target business to the static library so that the business processing process can call the static library to perform encryption and decryption on the business data of the target business.

[0087] In order to enable those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the technical solutions provided by the embodiments of the present disclosure are described in detail below through specific embodiments:

[0088] The disclosed embodiment is applied to a one-way network firewall. The hardware architecture of the one-way network firewall is composed of an external terminal, an internal terminal and a one-way isolation component. The one-way isolation component is composed of two one-way isolation cards connected by a one-way optical fiber. The external terminal and the internal terminal provide services to the outside as a whole machine, respectively running proxy software, and the external terminal and the internal terminal communicate physically in one direction. In the one-way network firewall, the external terminal interacts with the external network and the internal terminal interacts with the internal network, and both need to encrypt and decrypt the business data.

[0089] Embodiment 1

[0090] In the embodiments of the present disclosure, it is assumed that the external network service requirements are the Arm platform, Java language, and AES encryption and decryption algorithm, and the service data is data with high real-time requirements and large data volume. A specific description is given by taking the external terminal of a one-way network gateway as an example.

[0091] The encryption and decryption control of business data includes the following processes:

[0092] 1) The business processing process receives business data;

[0093] 2) The business processing process calls the static library coupled with the business processing process to obtain the Arm platform information, Java language information, and AES encryption and decryption algorithm information corresponding to the business data;

[0094] 3) The business processing process encrypts and decrypts the business data based on the acquired Arm platform information, Java language information, and AES encryption and decryption algorithm information to obtain the encrypted and decrypted data results.

[0095] Embodiment 2

[0096] In the embodiments of the present disclosure, it is assumed that the external network service requirements are the Arm platform, Java language, and AES encryption and decryption algorithm, and the service data is data with low real-time performance and small data volume. A specific description is given by taking the external terminal of a one-way network gateway as an example.

[0097] The encryption and decryption control of business data includes the following processes:

[0098] 1) The business processing process receives business data;

[0099] 2) The business processing process generates an encryption and decryption request message according to the private protocol format. The encryption and decryption request message carries business data, Arm platform information, Java language information, and AES encryption and decryption algorithm information;

[0100] 3) The business processing process establishes a UDP socket connection with the dynamic library encryption and decryption process and sends the encryption and decryption request message to the dynamic library encryption and decryption process;

[0101] 4) The dynamic library encryption and decryption process receives the encryption and decryption request message, parses the encryption and decryption request message according to the private protocol format, and obtains business data, Arm platform information, Java language information, and AES encryption and decryption algorithm information;

[0102] 5) The dynamic library encryption and decryption process calls the dynamic library coupled with the dynamic library encryption and decryption process, encrypts and decrypts the business data according to the Arm platform information, Java language information and AES encryption and decryption algorithm information, and obtains the encryption and decryption data result;

[0103] 6) The dynamic library encryption and decryption process generates an encryption and decryption response message according to the private protocol format. The encryption and decryption response message carries the encryption and decryption data results, Arm platform information, Java language information, and AES encryption and decryption algorithm information;

[0104] 7) The dynamic library encryption and decryption process sends the encryption and decryption response message to the business processing process through the UDP socket;

[0105] 8) The business processing process receives the encryption and decryption response message, parses the encryption and decryption response message according to the private protocol format, and obtains the encryption and decryption data result.

[0106] Embodiment 3

[0107] In the embodiments of the present disclosure, it is assumed that the external network service requirements are changed from the original Arm platform, Java language, and AES encryption and decryption algorithm to the X86 platform, C language, and DES encryption and decryption algorithm, and the service data is low in real-time and small in volume. A specific description is given using the external terminal of a one-way network gateway as an example.

[0108] The encryption and decryption control of business data includes the following processes:

[0109] 1) According to the encryption and decryption requirements of the business, obtain the encryption and decryption parameters of the business, which include X86 platform information, C language information, and DES encryption and decryption algorithm information;

[0110] 2) Generate the encryption and decryption script of the service in the dynamic library according to the encryption and decryption parameters;

[0111] 3) The business processing process receives business data;

[0112] 4) The business processing process generates an encryption and decryption request message according to the private protocol format. The encryption and decryption request message carries business data, X86 platform information, C language information, and DES encryption and decryption algorithm information;

[0113] 5) The business processing process establishes a UDP socket connection with the dynamic library encryption and decryption process and sends the encryption and decryption request message to the dynamic library encryption and decryption process;

[0114] 6) The dynamic library encryption and decryption process receives the encryption and decryption request message, parses the encryption and decryption request message according to the private protocol format, and obtains business data, X86 platform information, C language information, and DES encryption and decryption algorithm information;

[0115] 7) The dynamic library encryption and decryption process calls the dynamic library coupled with the dynamic library encryption and decryption process, encrypts and decrypts the business data according to the X86 platform information, C language information and DES encryption and decryption algorithm information, and obtains the encryption and decryption data result;

[0116] 8) The dynamic library encryption and decryption process generates an encryption and decryption response message according to the private protocol format. The encryption and decryption response message carries the encryption and decryption data results, X86 platform information, C language information, and DES encryption and decryption algorithm information;

[0117] 9) The dynamic library encryption and decryption process sends the encryption and decryption response message to the business processing process through the UDP socket;

[0118] 10) The business processing process receives the encryption and decryption response message, parses the encryption and decryption response message according to the private protocol format, and obtains the encryption and decryption data result.

[0119] Embodiment 4

[0120] In the embodiments of the present disclosure, it is assumed that the external network service requirements are changed from the original Arm platform, Java language, and AES encryption and decryption algorithm to the X86 platform, C language, and DES encryption and decryption algorithm, and the service data is highly real-time and large in volume. A specific description is given using the external terminal of a one-way network gateway as an example.

[0121] The encryption and decryption control of business data includes the following processes:

[0122] 1) Obtain the encryption and decryption script containing X86 platform information, C language information, and DES encryption and decryption algorithm information from the dynamic library;

[0123] 2) Coupling the encryption and decryption script containing X86 platform information, C language information, and DES encryption and decryption algorithm information into the static library;

[0124] 3) The business processing process receives business data;

[0125] 4) The business processing process calls the static library coupled with the business processing process to obtain the X86 platform information, C language information, and DES encryption and decryption algorithm information corresponding to the business data;

[0126] 5) The business processing process encrypts and decrypts the business data according to the obtained X86 platform information, C language information, and DES encryption and decryption algorithm information to obtain the encryption and decryption data results.

[0127] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0128] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. An encryption and decryption control method, comprising: The business processing process receives business data; Under the first condition, the business processing process calls a static library coupled to the business processing process, performs encryption and decryption processing on the business data according to encryption and decryption parameters, and obtains encryption and decryption data results; Under the second condition, the business processing process sends the business data and the encryption and decryption parameters to the dynamic library encryption and decryption process; The dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters to obtain encryption and decryption data results; The dynamic library encryption and decryption process returns the encryption and decryption data result to the business processing process.

2. The encryption and decryption control method according to claim 1, wherein: Under the second condition, the business processing process sends the business data and encryption and decryption parameters to the dynamic library encryption and decryption process, including: The business processing process generates an encryption and decryption request message according to a private protocol format, wherein the encryption and decryption request message carries the business data and the encryption and decryption parameters; The business processing process sends the encryption and decryption request message to the dynamic library encryption and decryption process.

3. The encryption and decryption control method according to claim 2, wherein: The dynamic library encryption and decryption process performs encryption and decryption processing on the business data according to the encryption and decryption parameters to obtain encryption and decryption data results, including: The dynamic library encryption and decryption process parses the received encryption and decryption request message according to the private protocol format to obtain the business data and the encryption and decryption parameters; The dynamic library encryption and decryption process calls a dynamic library coupled with the dynamic library encryption and decryption process, performs encryption and decryption processing on the business data according to the encryption and decryption parameters, and obtains encryption and decryption data results.

4. The encryption and decryption control method according to claim 3, wherein: The dynamic library encryption and decryption process returns the encryption and decryption data result to the business processing process, including: The dynamic library encryption and decryption process generates an encryption and decryption response message according to the private protocol format, and the encryption and decryption response message carries the encryption and decryption data result and the encryption and decryption parameters; The dynamic library encryption and decryption process sends the encryption and decryption response message to the business processing process; The encryption and decryption control method further includes: The business processing process parses the received encryption and decryption response message according to the private protocol format to obtain the encryption and decryption data result.

5. The encryption and decryption control method according to any one of claims 1 to 4, wherein: The encryption and decryption parameters include: Business platform information, indicating the type of business platform corresponding to the business data; Encryption and decryption language information, representing the programming language used when encrypting and decrypting the business data; The encryption and decryption algorithm information represents the encryption and decryption algorithm used when encrypting and decrypting the business data.

6. The encryption and decryption control method according to claim 5, wherein: Private protocol formats include: A sequence number field is used to identify the encryption and decryption request message and the corresponding encryption and decryption response message; Category field, used to identify whether the message is an encryption / decryption request message or an encryption / decryption response message; An operation field, used to indicate whether to perform encryption or decryption processing on the service data; The platform field is used to carry the service platform information; A language field, used to carry the encryption and decryption language information; Algorithm field, used to carry the encryption and decryption algorithm information; A data content field, used to carry the service data; The data length field is used to indicate the length of the data content field.

7. The encryption and decryption control method according to any one of claims 1 to 4, wherein: The encryption and decryption control method further includes: According to the encryption and decryption requirements of the newly added service, obtain the encryption and decryption parameters of the newly added service; An encryption and decryption script for the new service is generated in the dynamic library according to the encryption and decryption parameters of the new service, so that the encryption and decryption process of the dynamic library can call the dynamic library to perform encryption and decryption processing on the service data of the new service.

8. The encryption and decryption control method according to any one of claims 1 to 4, wherein: The encryption and decryption control method further includes: When the business requirements of the target business change, the encryption and decryption scripts of the target business are obtained from the dynamic library; The encryption and decryption script of the target business is coupled to the static library, so that the business processing process can call the static library to perform encryption and decryption processing on the business data of the target business.

9. An electronic device, comprising: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the encryption and decryption control method according to any one of claims 1 to 8.

10. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the encryption and decryption control method according to any one of claims 1 to 8.

11. A computer program product, comprising a computer program or an instruction, wherein when the computer program or the instruction is executed by a processor, the encryption and decryption control method according to any one of claims 1 to 8 is implemented.