Data processing method and device, equipment, medium and product

By configuring international and domestic standard encryption algorithms in electronic devices and dynamically switching encryption algorithms according to different environmental requirements, the problem of encryption compatibility in cross-border data transmission is solved, and the security and flexibility of data transmission are improved.

CN121125339APending Publication Date: 2025-12-12CHINA MOBILE (XIONGAN) ICT CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511592084.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-03
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing technologies cannot meet the encryption requirements of different application environments, resulting in security risks for electronic devices during cross-border data transmission.

Method used

International and domestic standard encryption algorithms are pre-configured in electronic devices. The target encryption algorithm type is determined based on the device location, service type, or encryption algorithm indication parameters, and a corresponding encryption key is generated for flexible encryption processing of data.

Benefits of technology

It enables switching between encryption algorithms in different application environments, meets various encryption needs, improves the security and compatibility of data transmission, and avoids the security risks of a single encryption algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125339A_ABST
    Figure CN121125339A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and apparatus, a device, a medium and a product. The method comprises the steps of obtaining to-be-transmitted data; in pre-configured encryption algorithm types, determining a target encryption algorithm type corresponding to the to-be-transmitted data, the encryption algorithm types including an international standard encryption algorithm and a domestic standard encryption algorithm; generating an encryption key based on the target encryption algorithm type and an adaptive parameter corresponding to the target encryption algorithm type; performing encryption processing on the to-be-transmitted data based on the encryption key through an encryption algorithm of the target encryption algorithm type to obtain encrypted data; and transmitting the encrypted data to a target device. By setting the international standard encryption algorithm and the domestic standard encryption algorithm, different encryption requirements of the to-be-transmitted data are met in the encryption process of the to-be-transmitted data, the encryption algorithms are flexibly switched, and the compatibility is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a data processing method, apparatus, device, medium, and product. Background Technology

[0002] To improve data security, data is encrypted during transmission. Currently, various encryption algorithms exist that can encrypt data.

[0003] With the continuous development of computer technology, the application environment of electronic devices such as terminal equipment is no longer limited to the domestic market; they can be sold and used abroad. Different application environments have different requirements and standards for encryption processes during data transmission. Currently, the data processing technology of electronic devices cannot meet the encryption needs of different application environments. Summary of the Invention

[0004] This disclosure provides a data processing method, apparatus, device, medium, and product to improve the compatibility of multiple encryption protocols, enable switching between encryption algorithms in different application scenarios, avoid the security risks associated with a single encryption algorithm, offer high flexibility, and meet diverse encryption needs.

[0005] According to one aspect of this disclosure, a data processing method is provided, comprising:

[0006] Get the data to be transmitted;

[0007] Among the pre-configured encryption algorithm types, the target encryption algorithm type corresponding to the data to be transmitted is determined, and the encryption algorithm type includes international standard encryption algorithms and domestic standard encryption algorithms;

[0008] An encryption key is generated based on the target encryption algorithm type and the adaptive parameters corresponding to the target encryption algorithm type;

[0009] The data to be transmitted is encrypted using the encryption algorithm of the target encryption algorithm type and based on the encryption key to obtain encrypted data;

[0010] The encrypted data is transmitted to the target device.

[0011] Optionally, determining the target encryption algorithm type corresponding to the data to be transmitted includes at least one of the following:

[0012] The target encryption algorithm type is determined based on the service type of the data to be transmitted;

[0013] The target encryption algorithm type is determined based on the device location information;

[0014] The target encryption algorithm type is determined based on the encryption algorithm indication parameters pre-stored in the encryption algorithm indication field.

[0015] Optionally, the international standard encryption algorithm includes the AES encryption algorithm, and the encryption key corresponding to the AES encryption algorithm is generated based on the following formula: K=AES_KEY_GEN(N,L), where N is a random number and L is the key length, and the random number and the key length are adaptive parameters corresponding to the AES encryption algorithm.

[0016] Optionally, the domestic standard encryption algorithm includes the SM2 encryption algorithm, and the encryption key corresponding to the SM2 encryption algorithm is generated based on the following formula: K=SM2_KEY_GEN(N), where N is a random number, and the random number is the adaptive parameter corresponding to the SM2 encryption algorithm.

[0017] Optionally, the method further includes: sending a decryption key to the target device according to the key distribution protocol corresponding to the target encryption algorithm type, so that the target device can decrypt the encrypted data based on the decryption key.

[0018] According to another aspect of this disclosure, a data processing method is provided, comprising:

[0019] Receive encrypted data, wherein the encrypted data carries identification information of the target encryption algorithm type;

[0020] Receive the decryption key distributed by the sending device;

[0021] Based on the identification information, the target decryption algorithm type is determined. Using the decryption algorithm of the target decryption algorithm type, the encrypted data is decrypted based on the decryption key to obtain plaintext data.

[0022] According to another aspect of this disclosure, a data processing apparatus is provided, comprising:

[0023] The data acquisition module is used to acquire the data to be transmitted.

[0024] The encryption algorithm type determination module is used to determine the target encryption algorithm type corresponding to the data to be transmitted from a pre-configured encryption algorithm type, wherein the encryption algorithm type includes international standard encryption algorithms and domestic standard encryption algorithms;

[0025] A key generation module is used to generate an encryption key based on the target encryption algorithm type and the adaptive parameters corresponding to the target encryption algorithm type.

[0026] The encryption module is used to encrypt the data to be transmitted based on the encryption key using an encryption algorithm of the target encryption algorithm type to obtain encrypted data.

[0027] The data transmission module is used to transmit the encrypted data to the target device.

[0028] According to another aspect of this disclosure, a data processing apparatus is provided, comprising:

[0029] A decryption data receiving module is used to receive encrypted data, wherein the encrypted data carries identification information of the target encryption algorithm type;

[0030] The key receiving module is used to receive the decryption key distributed by the sending device;

[0031] The decryption module is used to determine the target decryption algorithm type based on the identification information, and to decrypt the encrypted data using the decryption algorithm of the target decryption algorithm type and the decryption key to obtain plaintext data.

[0032] According to another aspect of this disclosure, an electronic device is provided, the electronic device comprising:

[0033] At least one processor; and

[0034] A memory communicatively connected to the at least one processor; wherein,

[0035] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the data processing method described in any embodiment of this disclosure.

[0036] According to another aspect of this disclosure, a computer-readable storage medium is provided that stores computer instructions for causing a processor to execute and implement the data processing method described in any embodiment of this disclosure.

[0037] According to another aspect of this disclosure, a computer program product is provided, which, when executed by a processor, implements the data processing method as described in any of the embodiments of this disclosure.

[0038] The technical solution provided in this disclosure pre-configures international standard encryption algorithms and domestic standard encryption algorithms in electronic devices to support encryption processing in different application environments, providing an algorithmic foundation for meeting diverse encryption needs. For data to be transmitted, a target encryption algorithm type suitable for the data to be transmitted is determined from the international and domestic standard encryption algorithms. An encryption key corresponding to the encryption algorithm of the target encryption algorithm type is generated, and the data to be transmitted is encrypted to obtain encrypted data. The encryption process for the data to be transmitted meets the encryption requirements of the data to be transmitted. The encryption algorithm can be flexibly switched, exhibiting strong compatibility and avoiding the problem that electronic devices supporting only a single type of encryption algorithm cannot meet the data encryption needs of different user environments.

[0039] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0040] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this disclosure and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is a flowchart of a data processing method according to an embodiment of this disclosure;

[0042] Figure 2 This is a flowchart of a data processing method according to an embodiment of this disclosure;

[0043] Figure 3 This is a schematic diagram of the structure of a data processing device according to an embodiment of the present disclosure;

[0044] Figure 4 This is a schematic diagram of the structure of a data processing device according to an embodiment of the present disclosure;

[0045] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation

[0046] To enable those skilled in the art to better understand the present disclosure, the technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present disclosure.

[0047] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0048] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0049] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this disclosure. This embodiment is applicable to situations supporting multiple encryption algorithms and can flexibly switch between encryption algorithms according to encryption requirements to meet different encryption needs. This method can be executed by a data processing device in this disclosure, which can be implemented in software and / or hardware and can be integrated into electronic devices such as terminal devices, computer devices, and servers. Figure 1 As shown, the method specifically includes the following steps:

[0050] S110, Obtain the data to be transmitted.

[0051] S120. Among the pre-configured encryption algorithm types, determine the target encryption algorithm type corresponding to the data to be transmitted. The encryption algorithm type includes international standard encryption algorithms and domestic standard encryption algorithms.

[0052] S130. Generate an encryption key based on the target encryption algorithm type and the adaptive parameters corresponding to the target encryption algorithm type.

[0053] S140. Using the encryption algorithm of the target encryption algorithm type, the data to be transmitted is encrypted based on the encryption key to obtain encrypted data.

[0054] S150. The encrypted data is transmitted to the target device.

[0055] In this embodiment, the data transmission application scenario can be data transmission between terminal devices or data transmission between a terminal device and a server. In the transmission scenario, the data initiator is the sending device, and the data receiver is the target device. For example, when a terminal device uploads data to a server, the terminal device is the sending device, and the server is the target device. The terminal device encrypts the data to be transmitted before transmitting it to the server. Alternatively, when a terminal device requests data from a server, and the server returns the query result to the terminal device, the server is the sending device, and the terminal device is the target device. The server encrypts the query result before transmitting it to the terminal device. It is understood that the data to be transmitted can be in the form of text, images, audio, video, etc. The form of the data to be transmitted is not limited here but determined according to business requirements.

[0056] Electronic devices are pre-configured with encryption algorithms to meet the needs of different application environments. These include international standard encryption algorithms and domestic standard encryption algorithms. International standard encryption algorithms can be understood as encryption algorithm standards developed by international standardization organizations and recognized and adopted globally. They are characterized by strong universality and a high degree of internationalization, suitable for cross-border data transmission, international cooperation scenarios, or businesses requiring compatibility with global systems. International standard encryption algorithms may include, but are not limited to, at least one of the following: AES (Advanced Encryption Standard), RSA (Rivest-Shamir-Adleman), ECC (Elliptic Curve Cryptography), and SHA (Secure Hash Algorithm). Domestic standard encryption algorithms can be understood as encryption algorithms developed by the State Cryptography Administration of China that comply with Chinese information security regulations and standards. They are applicable to scenarios involving national security and sensitive information, such as domestic critical information infrastructure, government systems, and the financial sector. Domestic standard encryption algorithms include, but are not limited to, SM2 (SM2 Elliptic Curve Public Key Cryptographic Algorithm), SM3 (SM3 Cryptographic Hash Algorithm), and SM4 (SM4 Block Cipher Algorithm).

[0057] By configuring encryption algorithms in electronic devices to meet the needs of different application environments, a foundation is provided for data encryption and data transmission in various application environments, thus satisfying the encryption requirements of different application environments. It can be understood that application environments can include domestic processing environments and international processing environments, or different application environments can be understood as environments with different encryption standards.

[0058] When electronic devices have data transmission requirements, the target encryption algorithm type corresponding to the data to be transmitted is determined from the pre-configured encryption algorithm types according to the encryption requirements of the data to be transmitted, so as to flexibly switch between international standard encryption algorithms or domestic standard encryption algorithms according to encryption requirements.

[0059] In some embodiments of this disclosure, determining the target encryption algorithm type corresponding to the data to be transmitted includes: determining the target encryption algorithm type based on device location information. Specifically, device location information is obtained, which can be determined by the positioning module of an electronic device. The target encryption algorithm type is determined based on the location classification of the device location information. Specifically, if the device location information is within the application scope corresponding to a domestic standard encryption algorithm, then the target encryption algorithm type is a domestic standard encryption algorithm; if the device location information is within the application scope corresponding to an international standard encryption algorithm, then the target encryption algorithm type is an international standard encryption algorithm. The application scope corresponding to the international standard encryption algorithm or the domestic standard encryption algorithm is pre-stored, or can be read from a server.

[0060] In some embodiments of this disclosure, determining the target encryption algorithm type corresponding to the data to be transmitted includes: determining the target encryption algorithm type based on encryption algorithm indication parameters pre-stored in the encryption algorithm indication field. The electronic device stores an encryption algorithm indication field in its storage space. The content of this field is an encryption algorithm indication parameter, which can be understood as indicating the encryption algorithm type during the encryption process. Specifically, the encryption algorithm indication parameter is a first parameter indicating that the target encryption algorithm type is an international standard encryption algorithm, and a second parameter indicating that the target encryption algorithm type is a domestic standard encryption algorithm. The first and second parameters are different parameter values, for example, they can be 0 or 1. The specific forms of the first and second parameters are not limited here.

[0061] In some embodiments of this disclosure, determining the target encryption algorithm type corresponding to the data to be transmitted includes: determining the target encryption algorithm type based on the service type of the data to be transmitted. It is understood that the electronic device can process data of at least one service type, and data of different service types can use the same or different encryption algorithm types. The process involves obtaining the correspondence between service types and encryption algorithm types, obtaining the service type corresponding to the data to be transmitted, and matching the service type corresponding to the data to be transmitted with the above correspondence to determine the target encryption algorithm type corresponding to the data to be transmitted. The data to be transmitted may carry an identifier representing the service type.

[0062] In some embodiments of this disclosure, the target encryption algorithm type can be determined based on at least one of the service type of the data to be transmitted, device location information, and encryption algorithm indication parameters pre-stored in the encryption algorithm indication field. If the encryption algorithm type determined based on any one of the service type of the data to be transmitted, device location information, and encryption algorithm indication parameters pre-stored in the encryption algorithm indication field is an international standard encryption algorithm, then the target encryption algorithm type is determined to be an international standard encryption algorithm; if the encryption algorithm type determined based on each of the service type of the data to be transmitted, device location information, and encryption algorithm indication parameters pre-stored in the encryption algorithm indication field is a domestic standard encryption algorithm, then the target encryption algorithm type is determined to be a domestic standard encryption algorithm.

[0063] Optionally, if the encryption algorithm types determined based on the service type of the data to be transmitted, the device location information, and the encryption algorithm indication parameters pre-stored in the encryption algorithm indication field are different, the target encryption algorithm type can be determined to include international standard encryption algorithms or domestic standard encryption algorithms. In this way, the data to be transmitted can be double-encrypted using both international standard encryption algorithms and domestic standard encryption algorithms to meet different encryption requirements.

[0064] Once the target encryption algorithm type is determined, an encryption key corresponding to that type is generated. This encryption key is used to execute the encryption process of the data to be transmitted using the target encryption algorithm. Optionally, international standard encryption algorithms may include multiple encryption algorithms, and domestic standard encryption algorithms may also include multiple encryption algorithms. When the target encryption algorithm type is determined, an encryption algorithm under that type can be randomly selected to improve the randomness of the encryption algorithm and data security.

[0065] The adaptive parameters used to generate the encryption key can be different for different encryption algorithms. The adaptive parameters are determined according to the encryption algorithm type of the target encryption algorithm, and the encryption key is generated accordingly.

[0066] Optionally, the international standard encryption algorithm includes the AES encryption algorithm. The encryption key corresponding to the AES encryption algorithm is generated based on the following formula: K = AES_KEY_GEN(N,L), where N is a random number and L is the key length. The random number and the key length are adaptive parameters corresponding to the AES encryption algorithm. The random number can be generated by a random number generator, and the key length can be determined according to the encryption requirements of the AES encryption algorithm, for example, the key length can be 128 or 256. The length of the random number is greater than or equal to the key length.

[0067] The encryption key for the AES encryption algorithm can be generated by either truncating the first L bits of a random number as the encryption key, or by randomly truncating L bits of a random number as the encryption key.

[0068] Optionally, the domestic standard encryption algorithm includes the SM2 encryption algorithm. The encryption key corresponding to the SM2 encryption algorithm is generated based on the following formula: K = SM2_KEY_GEN(N), where N is a random number, which is the adaptive parameter corresponding to the SM2 encryption algorithm. This random number N can be generated by a random number generator.

[0069] The encryption key corresponding to the SM2 encryption algorithm can include a key pair consisting of a public key and a private key. The private key is generated by determining whether a random number lies within the range [1, n-1]. If it does, the random number is used as the private key; otherwise, the random value is updated by adjusting the modulo or regenerating the random number until a random number within the range [1, n-1] is obtained, which is then used as the private key. Here, n is the order of the SM2 standard elliptic curve base point G. The public key is generated by performing a dot product operation between the private key and the SM2 standard elliptic curve base point G.

[0070] Understandably, for the encryption algorithms included in international standard encryption algorithms and domestic standard encryption algorithms, the key generation rules for each encryption algorithm can be preset, and the key generation rules for the target encryption algorithm type can be called to generate an encryption key for encrypting the data to be transmitted.

[0071] Based on the above embodiments, the electronic device also stores the encryption protocol for each encryption algorithm, and encrypts the data to be transmitted based on the encryption key to obtain encrypted data. In some embodiments, before encrypting the data to be transmitted, a hash verification of the encryption key is also performed to avoid the risk of tampering during the generation of the encryption key.

[0072] Taking the AES algorithm as an example, the encryption process can be represented as: E=AES(K,P), where K is the encryption key, P is the plaintext, i.e. the data to be transmitted, and E is the encrypted data.

[0073] The encrypted data is transmitted to the target device, completing the data encryption and transmission. The target device receives the encrypted data, decrypts it to obtain decrypted data, and performs subsequent operations on the decrypted data, which are not limited here.

[0074] The method further includes: sending a decryption key to the target device according to the key distribution protocol corresponding to the target encryption algorithm type, so that the target device can decrypt the encrypted data based on the decryption key.

[0075] The process of generating the decryption key can differ depending on the encryption algorithm. For example, in the AES algorithm, the encryption and decryption keys are the same; the encryption key is used as the decryption key. In the SM2 algorithm, the encryption key is the private key, and the decryption key is the public key.

[0076] By sending the decryption key to the target device, the target device can decrypt the received encrypted data. Specifically, the electronic device stores a key distribution protocol corresponding to each encryption algorithm. This key distribution protocol can be understood as a set of rules and procedures for enabling two or more communicating parties to securely share keys. Different encryption algorithms can correspond to different key distribution protocols. The correspondence between encryption algorithms and key distribution protocols is pre-built, and the corresponding key distribution protocol is invoked according to the above correspondence. For example, the key distribution protocol corresponding to the AES algorithm may include, but is not limited to, key exchange protocols (Diffie-Hellman, DH), Needham-Schroeder protocols, and Kerberos protocols, etc., and the key distribution protocol corresponding to the SM2 algorithm may include, but is not limited to, the STS protocol (Station-to-Station), etc.

[0077] In some embodiments, to avoid leakage of the decryption key, an adaptive parameter for generating the key can be transmitted to the target device through a key distribution protocol, so that the target device can generate a decryption key based on the adaptive parameter and decrypt the encrypted data based on the decryption encryption.

[0078] The technical solution provided in this disclosure pre-configures international standard encryption algorithms and domestic standard encryption algorithms in electronic devices to support encryption processing in different application environments, providing an algorithmic foundation for meeting diverse encryption needs. For data to be transmitted, a target encryption algorithm type suitable for the data to be transmitted is determined from the international and domestic standard encryption algorithms. An encryption key corresponding to the encryption algorithm of the target encryption algorithm type is generated, and the data to be transmitted is encrypted to obtain encrypted data. The encryption process for the data to be transmitted meets the encryption requirements of the data to be transmitted. The encryption algorithm can be flexibly switched, exhibiting strong compatibility and avoiding the problem that electronic devices supporting only a single type of encryption algorithm cannot meet the data encryption needs of different user environments.

[0079] Figure 2 This is a flowchart of a data processing method provided in an embodiment of this disclosure.

[0080] The method specifically includes:

[0081] S210. Receive encrypted data, wherein the encrypted data carries identification information of the target encryption algorithm type.

[0082] S220: Receive the decryption key distributed by the transmitting device.

[0083] S230. Based on the identification information, determine the target decryption algorithm type, and use the decryption algorithm of the target decryption algorithm type to decrypt the encrypted data based on the decryption key to obtain plaintext data.

[0084] The target encryption algorithm type includes international standard encryption algorithms and domestic standard encryption algorithms. The encrypted data may carry identification information of the encryption algorithm type of the target encryption algorithm, such as AES or SM2. By parsing the identification information of the target encryption algorithm type from the encrypted data, the encryption algorithm of the target encryption algorithm type corresponding to the encrypted data can be identified, and thus the decryption algorithm of the target encryption algorithm type can be determined.

[0085] The target device stores decryption algorithms corresponding to international standard encryption algorithms and domestic standard encryption algorithms. By calling the decryption algorithm of the target decryption algorithm type, the encrypted data is decrypted based on the decryption key to obtain the decrypted plaintext data.

[0086] Taking encrypted data using the AES algorithm as an example, the decryption process of encrypted data can be represented as: D=AES(K,E), where K is the decryption key, E is the encrypted data, and D is the decrypted data.

[0087] The technical solution provided in this embodiment, when the encrypted data is flexibly encrypted using international standard encryption algorithms or domestic standard encryption algorithms, carries identification information of the target encryption algorithm type in the encrypted data, so that the target device can determine the decryption algorithm of the target decryption algorithm type based on the above identification information, and perform decryption processing on the encrypted data to achieve decryption of the encrypted data obtained by the flexible encryption algorithm.

[0088] Figure 3 This is a schematic diagram of a data processing apparatus provided in an embodiment of the present disclosure. The apparatus can be implemented using software and / or hardware, such as… Figure 3 As shown, the device specifically includes: a data acquisition module 310, an encryption algorithm type determination module 320, a key generation module 330, an encryption module 340, and a data transmission module 350.

[0089] The data acquisition module 310 is used to acquire the data to be transmitted.

[0090] The encryption algorithm type determination module 320 is used to determine the target encryption algorithm type corresponding to the data to be transmitted from the pre-configured encryption algorithm types. The encryption algorithm types include international standard encryption algorithms and domestic standard encryption algorithms.

[0091] The key generation module 330 is used to generate an encryption key based on the target encryption algorithm type and the adaptive parameters corresponding to the target encryption algorithm type.

[0092] Encryption module 340 is used to encrypt the data to be transmitted based on the encryption key using an encryption algorithm of the target encryption algorithm type to obtain encrypted data;

[0093] The data transmission module 350 is used to transmit the encrypted data to the target device.

[0094] This disclosure discloses an embodiment that pre-configures international standard encryption algorithms and domestic standard encryption algorithms in an electronic device to support encryption processing in different application environments, providing an algorithmic foundation for meeting diverse encryption needs. For data to be transmitted, a target encryption algorithm type suitable for the data to be transmitted is determined from the international and domestic standard encryption algorithms. An encryption key corresponding to the encryption algorithm of the target encryption algorithm type is generated, and the data to be transmitted is encrypted to obtain encrypted data. The encryption process for the data to be transmitted meets the encryption requirements of the data to be transmitted. The encryption algorithm can be flexibly switched, exhibiting strong compatibility and avoiding the problem that electronic devices supporting only a single type of encryption algorithm cannot meet the data encryption needs of different user environments.

[0095] Based on the above embodiments, optionally, the encryption algorithm type determination module 320 is used to perform at least one of the following:

[0096] The target encryption algorithm type is determined based on the service type of the data to be transmitted;

[0097] The target encryption algorithm type is determined based on the device location information;

[0098] The target encryption algorithm type is determined based on the encryption algorithm indication parameters pre-stored in the encryption algorithm indication field.

[0099] Based on the above embodiments, optionally, the international standard encryption algorithm includes the AES encryption algorithm, and the encryption key corresponding to the AES encryption algorithm is generated based on the following formula: K=AES_KEY_GEN(N,L), where N is a random number, L is the key length, and the random number and the key length are adaptive parameters corresponding to the AES encryption algorithm.

[0100] Based on the above embodiments, optionally, the domestic standard encryption algorithm includes the SM2 encryption algorithm, and the encryption key corresponding to the SM2 encryption algorithm is generated based on the following formula: K=SM2_KEY_GEN(N), where N is a random number, and the random number is the adaptive parameter corresponding to the SM2 encryption algorithm.

[0101] Optionally, based on the above embodiments, the device further includes a key distribution module, configured to send a decryption key to the target device according to a key distribution protocol corresponding to the target encryption algorithm type, so that the target device can decrypt the encrypted data based on the decryption key.

[0102] The above-described products can perform the methods provided in any embodiment of this disclosure, and have the corresponding functional modules and beneficial effects for performing the methods.

[0103] Figure 4 This is a schematic diagram of a data processing apparatus provided in an embodiment of the present disclosure. The apparatus can be implemented using software and / or hardware, such as… Figure 4 As shown, the device specifically includes: a decrypted data receiving module 410, a key receiving module 420, and a decryption module 430. Among them,

[0104] The decryption data receiving module 410 is used to receive encrypted data, wherein the encrypted data carries identification information of the target encryption algorithm type;

[0105] The key receiving module 420 is used to receive the decryption key distributed by the sending device;

[0106] The decryption module 430 is used to determine the target decryption algorithm type based on the identification information, and to decrypt the encrypted data using the decryption algorithm of the target decryption algorithm type and the decryption key to obtain plaintext data.

[0107] The above-described products can perform the methods provided in any embodiment of this disclosure, and have the corresponding functional modules and beneficial effects for performing the methods.

[0108] Figure 5 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0109] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0110] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0111] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as data processing methods.

[0112] In some embodiments, the data processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data processing method by any other suitable means (e.g., by means of firmware).

[0113] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0114] Computer programs used to implement the methods of this disclosure may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0115] In the context of this disclosure, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0116] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0117] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0118] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0119] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.

[0120] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method according to any embodiment of this disclosure.

[0121] In implementing a computer program product, computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0122] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A data processing method, characterized in that, include: Get the data to be transmitted; Among the pre-configured encryption algorithm types, the target encryption algorithm type corresponding to the data to be transmitted is determined, and the encryption algorithm type includes international standard encryption algorithms and domestic standard encryption algorithms; An encryption key is generated based on the target encryption algorithm type and the adaptive parameters corresponding to the target encryption algorithm type; The data to be transmitted is encrypted using the encryption algorithm of the target encryption algorithm type and based on the encryption key to obtain encrypted data; The encrypted data is transmitted to the target device.

2. The method according to claim 1, characterized in that, Determine the target encryption algorithm type corresponding to the data to be transmitted, including at least one of the following: The target encryption algorithm type is determined based on the service type of the data to be transmitted; The target encryption algorithm type is determined based on the device location information; The target encryption algorithm type is determined based on the encryption algorithm indication parameters pre-stored in the encryption algorithm indication field.

3. The method according to claim 1, characterized in that, The international standard encryption algorithm includes the AES encryption algorithm, and the encryption key corresponding to the AES encryption algorithm is generated based on the following formula: K = AES_KEY_GEN(N,L), where N is a random number and L is the key length. The random number and the key length are adaptive parameters corresponding to the AES encryption algorithm.

4. The method according to claim 1, characterized in that, The domestic standard encryption algorithm includes the SM2 encryption algorithm, and the encryption key corresponding to the SM2 encryption algorithm is generated based on the following formula: K = SM2_KEY_GEN(N), where N is a random number, and the random number is the adaptive parameter corresponding to the SM2 encryption algorithm.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: According to the key distribution protocol corresponding to the target encryption algorithm type, the decryption key is sent to the target device so that the target device can decrypt the encrypted data based on the decryption key.

6. A data processing method, characterized in that, include: Receive encrypted data, wherein the encrypted data carries identification information of the target encryption algorithm type; Receive the decryption key distributed by the sending device; Based on the identification information, the target decryption algorithm type is determined. Using the decryption algorithm of the target decryption algorithm type, the encrypted data is decrypted based on the decryption key to obtain plaintext data.

7. A data processing apparatus, characterized in that, include: The data acquisition module is used to acquire the data to be transmitted. The encryption algorithm type determination module is used to determine the target encryption algorithm type corresponding to the data to be transmitted from a pre-configured encryption algorithm type, wherein the encryption algorithm type includes international standard encryption algorithms and domestic standard encryption algorithms; A key generation module is used to generate an encryption key based on the target encryption algorithm type and the adaptive parameters corresponding to the target encryption algorithm type; The encryption module is used to encrypt the data to be transmitted based on the encryption key using an encryption algorithm of the target encryption algorithm type to obtain encrypted data. The data transmission module is used to transmit the encrypted data to the target device.

8. A data processing apparatus, characterized in that, include: A decryption data receiving module is used to receive encrypted data, wherein the encrypted data carries identification information of the target encryption algorithm type; The key receiving module is used to receive the decryption key distributed by the sending device; The decryption module is used to determine the target decryption algorithm type based on the identification information, and to decrypt the encrypted data using the decryption algorithm of the target decryption algorithm type and the decryption key to obtain plaintext data.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the data processing method according to any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the data processing method according to any one of claims 1-6.

11. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the data processing method according to any one of claims 1-6.