Data encryption method and device

By dividing the data into public information fields and personal information fields, and determining the characters in the third field according to preset rules, SM4-128bit encryption is not performed on it, and only the fourth field is encrypted, solving the problem that the encrypted field length is too long. problems, improving the application efficiency and security of data.

CN114980087BActive Publication Date: 2024-08-23CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110218192.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-26
Publication Date
2024-08-23
Estimated Expiration
2041-02-26

AI Technical Summary

Technical Problem

When the existing technology uses the SM4-128bit encryption algorithm to encrypt data such as Mobile Subscriber International Number (MSISDN), International Mobile Subscriber Identity (IMSI) and International Mobile Equipment Identity (IMEI), the length of the encrypted fields is too long. It takes up too much storage space and cannot obtain the user's public information during decryption, which reduces the application efficiency and security of the data.

Method used

By dividing the data into public information fields and personal information fields, and determining the characters in the third field according to preset rules, SM4-128bit encryption is not performed on it, and only the fourth field is encrypted, shortening the length of the encrypted data and reducing storage occupy space and obtain users’ public information without decrypting it.

Benefits of technology

It effectively shortens the length of encrypted data, reduces storage space occupation, improves data application efficiency, and enhances the security of encrypted data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114980087B
    Figure CN114980087B
Patent Text Reader

Abstract

The present application provides a method and device for data encryption, which relates to the field of communications and can solve the problem that the encrypted field length is long and the required storage space is large. The method includes: determining first data, the first data includes a first field, the first field includes a public information field and a personal information field; determining second data according to the first data; the second data includes a second field, a third field and a fourth field, the second field is a public information field, the third field includes one or more characters determined according to a preset rule in the personal information field, and the fourth field includes characters other than the one or more characters determined according to the preset rule in the personal information field; encrypting the fourth field in the second data according to a preset encryption algorithm to determine the third data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a method and device for data encryption. Background Art

[0002] Currently, data such as the Mobile Subscriber International Number (MSISDN), the International Mobile Subscriber Identity (IMSI), and the International Mobile Equipment Identity (IMEI) need to be encrypted according to the SM4-128bit encryption algorithm to protect the user's personal information. However, this method will make the encrypted field length too long, which will cause the encrypted field to occupy too much storage space. Summary of the invention

[0003] The present application provides a method and device for data encryption, which can solve the problem that the encryption field length is long and the required storage space is large.

[0004] In order to achieve the above objectives, this application adopts the following technical solutions:

[0005] In a first aspect, the present application provides a method for data encryption, the method comprising: determining first data, the first data including a first field, the first field including a public information field and a personal information field; determining second data based on the first data; the second data including a second field, a third field and a fourth field, the second field being a public information field, the third field including one or more characters determined according to preset rules in the personal information field, and the fourth field including characters in the personal information field other than the one or more characters determined according to the preset rules; encrypting the fourth field in the second data according to a preset encryption algorithm to determine the third data.

[0006] Based on the above technical solution, an embodiment of the present application provides a data encryption method, which avoids encrypting the entire data by encrypting part of the fields in the data used to represent personal information, thereby shortening the length of the data encryption and reducing the storage space required for the encrypted data.

[0007] In a possible implementation, the preset rule includes: determining that in the personal information field, the characters indicated by the first indication information are characters in the third field. The preset rule is used to determine the characters in the third field, wherein the characters in the third field can be formed according to the characters indicated by the first indication information, so that the SM4-128bit encryption algorithm is not used for the characters in the third field, thereby shortening the length of the encrypted data.

[0008] In a possible implementation, the personal information field includes N characters, and the third field includes M characters, where M and N are both positive integers, and M is less than N; the first indication information includes M positive integers, the M positive integers are not equal to each other and are all less than or equal to N; the preset rules specifically include: determining the serial number of each character in the personal information field, where the serial number of the character is used to represent the position of the character in the field; and determining that the character whose serial number is equal to any one of the M positive integers is the character in the third field.

[0009] When the first indication information includes M positive integers, the characters in the third field are characters indicated by the first indication information, so there is no need to use the SM4-128bit encryption algorithm for the characters in the third field, thereby shortening the length of the encrypted data.

[0010] In a possible implementation, the first field includes at least one of the following: an international mobile subscriber number MSISDN field, an international mobile subscriber identity IMSI field, and an international mobile equipment identity IMEI field; the public information field of the MSISDN field includes the first to seventh characters in the MSISDN field, and the personal information field of the MSISDN field includes the eighth to eleventh characters in the MSISDN field; the public information field of the IMSI field includes the first to fifth characters in the IMSI field, and the personal information field of the IMSI field includes the sixth to fifteenth characters in the IMSI field; the public information field of the IMEI field includes the first to seventh characters in the IMEI field, and the personal information field of the IMEI field includes the eighth to fifteenth characters in the IMEI field. In this specific implementation, the MSISDN field, the IMSI field, and the IMEI field are divided into a public information field and a personal information field, and the public information field of the above three fields is not encrypted, so that the user's public information can be obtained without decrypting the above three fields, thereby improving the application efficiency of the data.

[0011] In a second aspect, the present application provides a data encryption device, which includes: a processing unit; the processing unit is used to: determine first data, the first data includes a first field, the first field includes a public information field and a personal information field; determine second data based on the first data; the second data includes a second field, a third field and a fourth field, the second field is a public information field, the third field includes one or more characters in the personal information field determined according to preset rules, and the fourth field includes characters in the personal information field other than the one or more characters determined according to the preset rules; according to a preset encryption algorithm, encrypt the fourth field in the second data to determine the third data.

[0012] In a possible implementation, the preset rule includes: determining that in the personal information field, the characters indicated by the first indication information are characters in the third field. The preset rule is used to determine the characters in the third field, wherein the characters in the third field can be formed according to the characters indicated by the first indication information, so that the SM4-128bit encryption algorithm is not used for the characters in the third field, thereby shortening the length of the encrypted data.

[0013] In a possible implementation, the personal information field includes N characters, and the third field includes M characters, where M and N are both positive integers, and M is less than N; the first indication information includes M positive integers, the M positive integers are not equal to each other and are all less than or equal to N; the preset rules specifically include: determining the serial number of each character in the personal information field, where the serial number of the character is used to represent the position of the character in the field; and determining that the character whose serial number is equal to any one of the M positive integers is the character in the third field.

[0014] When the first indication information includes M positive integers, the characters in the third field are characters indicated by the first indication information, so there is no need to use the SM4-128bit encryption algorithm for the characters in the third field, thereby shortening the length of the encrypted data.

[0015] In a possible implementation, the first field includes at least one of the following: an international mobile subscriber number MSISDN field, an international mobile subscriber identity IMSI field, and an international mobile equipment identity IMEI field; the public information field of the MSISDN field includes the first to seventh characters in the MSISDN field, and the personal information field of the MSISDN field includes the eighth to eleventh characters in the MSISDN field; the public information field of the IMSI field includes the first to fifth characters in the IMSI field, and the personal information field of the IMSI field includes the sixth to fifteenth characters in the IMSI field; the public information field of the IMEI field includes the first to seventh characters in the IMEI field, and the personal information field of the IMEI field includes the eighth to fifteenth characters in the IMEI field. In this specific implementation, the MSISDN field, the IMSI field, and the IMEI field are divided into a public information field and a personal information field, and the public information field of the above three fields is not encrypted, so that the user's public information can be obtained without decrypting the above three fields, thereby improving the application efficiency of the data.

[0016] It can be understood that the data encryption device provided above is used to execute the method corresponding to the first aspect provided above. Therefore, the beneficial effects that can be achieved can refer to the method corresponding to the first aspect above and the beneficial effects of the corresponding scheme in the specific implementation method below, which will not be repeated here.

[0017] In a third aspect, the present application provides a data encryption device, comprising: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the data encryption method described in the first aspect and any possible implementation method of the first aspect.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal, the terminal executes the data encryption method described in the first aspect and any possible implementation of the first aspect.

[0019] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions. When the computer program product is run on a data encryption device, the data encryption device executes the data encryption method as described in the first aspect and any possible implementation of the first aspect.

[0020] In a sixth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the data encryption method as described in the first aspect and any possible implementation method of the first aspect.

[0021] Specifically, the chip provided in the embodiment of the present application also includes a memory for storing computer programs or instructions. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of the architecture of a communication system;

[0023] Figure 2 A flowchart of a data encryption method provided in an embodiment of the present application;

[0024] Figure 3 A flowchart of another data encryption method provided in an embodiment of the present application;

[0025] Figure 4 A schematic diagram of a data structure provided in an embodiment of the present application;

[0026] Figure 5 A schematic diagram of another data structure provided in an embodiment of the present application;

[0027] Figure 6 A schematic diagram of another data structure provided in an embodiment of the present application;

[0028] Figure 7 A schematic diagram of the structure of a data encryption device provided in an embodiment of the present application;

[0029] Figure 8 A schematic diagram of the structure of another data encryption device provided in an embodiment of the present application;

[0030] Fig. 9 A schematic diagram of the structure of another data encryption device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The data encryption method and device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0032] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0033] The terms "first" and "second" and the like in the specification and drawings of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.

[0034] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0035] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0036] In the description of the present application, unless otherwise specified, “plurality” means two or more.

[0037] The following explains the terms involved in the embodiments of the present application to facilitate the reader's understanding.

[0038] (1) SM4-128bit encryption algorithm: This algorithm is a symmetric grouping algorithm that can be used to encrypt fields in call record data. This encryption algorithm uses a 32-round nonlinear iterative structure, that is, the data is split into groups of 16 characters (i.e. 32 bytes) for group encryption. Each encryption transforms the transformation function once, and the decryption algorithm of this algorithm has the same structure as the encryption algorithm, except that the order of round keys is reversed. The decryption round key is the reverse order of the encryption round key.

[0039] (2) MSISDN: refers to the number that a calling user needs to dial when calling a mobile user. It is a number that uniquely identifies a mobile user in the public telephone network switching network numbering plan.

[0040] (3) IMSI: It is a symbol that distinguishes mobile users. It is stored in the subscriber identity module (SIM) card and can be used to distinguish valid information of mobile users. Its total length does not exceed 15 digits.

[0041] (4) IMEI: It is equivalent to the ID number of a mobile phone and is used to identify each individual mobile phone in the global system for mobile communications (GSM) mobile network.

[0042] (5) The relationship between data, fields, and characters: Data can include one or more fields, and a field can include one or more characters.

[0043] The above is a brief introduction to some concepts involved in the embodiments of this application.

[0044] like Figure 1 As shown, Figure 1 FIG. 1 is a schematic diagram showing a structure of a communication system 100 provided in an embodiment of the present application. The communication system 100 includes: one or more terminals 10 and one or more servers 20 providing services to the terminals 10. It should be understood that Figure 1 One terminal 10 and one server 20 are shown.

[0045] Need to explain, Figure 1 In the embodiment, the terminal 10 can communicate with the server 20 via a wired method (for example, a universal serial bus (USB), type-c), etc. Of course, the terminal 10 can also communicate with the server 20 via a wireless method. For example, the terminal 10 communicates with the server 20 via a network, such as wireless fidelity (WiFi).

[0046] It should be noted that the server 20 may be a physical server of a communication operator, or a virtual server of a communication operator, such as a cloud server.

[0047] The server 20 is used to encrypt the call bill data and send the encrypted call bill data to the terminal 10. The server 20 is also used to store the encrypted call bill data.

[0048] The terminal 10 is used to receive and store the encrypted call bill data, and is also used to decrypt the encrypted call bill data.

[0049] The terminal 10 in the embodiment of the present application may be a wireless terminal, or it may be a wired terminal. A wireless terminal may be a device that provides voice and / or data connectivity to a user, a handheld device with a wireless connection function, or other processing devices connected to a wireless modem. The terminal and the access network device communicate with each other using a certain air interface technology (such as NR technology or LTE technology). Terminals may also communicate with each other using a certain air interface technology (such as NR technology or LTE technology). The wireless terminal may communicate with one or more core network devices via the access network device, such as communicating with AMF, SMF, etc. The wireless terminal can be a mobile terminal (such as a mobile phone), a smart phone, a satellite wireless device, a wireless modem card, a computer with a mobile terminal (for example, a laptop, a portable, a pocket-sized, a handheld, a computer-built-in or a vehicle-mounted mobile device), a personal communication service (PCS) phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), virtual reality (VR) glasses, augmented reality (AR) glasses, a machine type communication terminal, an Internet of Things terminal, a road side unit (RSU), a communication device mounted on a drone, etc. A wireless terminal may also be called user equipment (UE), terminal equipment, subscriber unit, subscriber station, mobile station, mobile, remote station, access point, access terminal, user terminal, user agent, etc.

[0050] In addition, the communication system 100 described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the emergence of new communication systems, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0051] The SM4-128bit encryption algorithm is a 16-character block encryption algorithm. When the server encrypts data according to the SM4-128bit encryption algorithm, the data to be encrypted needs to include 16 or more characters. If the number of characters in the data to be encrypted is less than 16, the server needs to fill the field with additional fields so that the number of characters in the field to be encrypted is 16. After that, the server encrypts the filled field according to the SM4-128bit encryption algorithm.

[0052] Exemplarily, when the current server sends call bill data to the terminal, the fields in the call bill data that need to be encrypted using the SM4-128bit encryption algorithm may include: MSISDN field, IMSI field, IMEI field, and MSISDN field.

[0053] Among them, the length of the MSISDN field is 11 bytes (that is, the field includes 11 characters), the length of the IMSI field is 15 bytes (that is, the field includes 15 characters), and the length of the IMEI field is 16 bytes (that is, the field includes 11 characters).

[0054] The server uses the SM4-128bit encryption algorithm to encrypt the MSISDN field, IMSI field, and IMEI field separately. Specifically:

[0055] The server inserts 5 characters into the MSISDN field to obtain the MSISDN field after the characters are inserted. The server encrypts the MSISDN field after the characters are inserted using the SM4-128bit encryption algorithm to obtain the encrypted MSISDN field. The server converts the encrypted MSISDN field into a hexadecimal field to obtain a 32-bit MSISDN field.

[0056] The server inserts one character into the IMSI field to obtain the IMSI field after the characters are inserted. The server uses the SM4-128bit encryption algorithm to encrypt the IMSI field after the characters are inserted to obtain the encrypted IMSI field. The server converts the encrypted IMSI field into a hexadecimal field to obtain a 32-bit IMSI field.

[0057] The IMEI field length is 16 characters, which meets the requirements of the SM4-128bit encryption algorithm for the character length of the encryption field. The server does not need to add characters to the IMEI field, but directly encrypts the IMEI field to obtain the encrypted IMEI field. The server converts the encrypted IMEI field into a hexadecimal field to obtain a 32-bit IMEI field.

[0058] According to the above records, after the server encrypts and transcodes the MSISDN field, IMSI field, and IMEI field, the length of the three fields increases from the original 42 bytes to 96 bytes, which will cause the encrypted and transcoded fields to occupy too much storage space.

[0059] In addition, each field is encrypted as a whole, which means that some basic user information (such as country, province, operator, terminal brand, terminal model) cannot be obtained from the field without decrypting the field, which reduces the efficiency of data use. In addition, a key needs to be obtained to decrypt the data every time information is obtained, which will cause the key to be distributed more times, thereby increasing the risk of decryption key leakage and reducing data security.

[0060] In order to solve the above problems, the present application embodiment proposes a data encryption method, which can not only shorten the length of encrypted data and reduce the storage space required for encrypted data, but also optimize the application efficiency of data and improve the security of encrypted data. Figure 2 As shown, the method includes:

[0061] S201. The server determines first data.

[0062] The first data includes a first field, and the first field includes a public information field and a personal information field.

[0063] In one example, the first field includes at least one of the following: an MSISDN field, an IMSI field, and an IMEI field, wherein the above three fields all include a public information field and a personal information field.

[0064] The public information field of the MSISDN field includes the 1st to 7th characters in the MSISDN field, which is used to represent the information of the province to which the user's mobile phone number belongs; the personal information field of the MSISDN field includes the 8th to 11th characters in the MSISDN field, which is used to represent the user's personal mobile phone number.

[0065] The public information field of the IMSI field includes the 1st to 5th characters in the IMSI field, which is used to represent the information of the user's country and operator; the personal information field of the IMSI field includes the 6th to 15th characters in the IMSI field, which is used to represent the user's personal identity information in the mobile communication network.

[0066] The public information field of the IMEI field includes the 1st to 7th characters in the IMEI field, which is used to represent the information of the terminal brand and model; the personal information field of the IMEI field includes the 8th to 15th characters in the IMEI field, which is used to represent the unique identity information of the terminal (for example, the production sequence number).

[0067] S202: The server determines second data according to the first data.

[0068] The second data includes a second field, a third field, and a fourth field.

[0069] Among them, the second field is a public information field, the third field includes one or more characters determined in the personal information field according to preset rules; and the fourth field includes characters in the personal information field other than the one or more characters determined according to preset rules.

[0070] In combination with the above example, the second field includes at least one of the following: a public information field of the MSISDN field, a public information field of the IMSI field, and a public information field of the IMEI field.

[0071] The third field is 8 characters determined according to preset rules after the personal information field of the MSISDN field, the personal information field of the IMSI field, and the personal information field of the IMEI field are combined.

[0072] The fourth field is 16 characters in the combined field of the personal information field of the MSISDN field, the personal information field of the IMSI field, and the personal information field of the IMEI field, except for the 8 characters determined according to the preset rules.

[0073] S203. The server encrypts the fourth field in the second data according to a preset encryption algorithm to determine the third data.

[0074] In a possible implementation, the server encrypts the fourth field according to the SM4-128bit encryption algorithm to determine the third data.

[0075] It should be noted that when the server encrypts the fourth field according to the SM4-128bit encryption algorithm, the fourth field may be a field including 16 characters. In this way, the server does not need to fill characters in the fourth field, thereby reducing the storage space occupied by the third data obtained after encryption.

[0076] Specifically, the process of the server encrypting the fourth field according to the SM4-128bit encryption algorithm includes: the server first encrypts the fourth field using the SM4-128bit encryption algorithm, and then performs hexadecimal conversion on the encrypted fourth field to finally obtain the encrypted fourth field. For example, when the fourth field is 16 bytes, the encrypted fourth field is 32 bytes.

[0077] The third data includes the encrypted fourth field, the second field and the third field.

[0078] The data encryption method provided by the present application shortens the length of data to be encrypted twice when the server encrypts call record data. The first shortening of the length of the data to be encrypted is by not encrypting the public information field in the data, thereby shortening the length of the encrypted data, thereby reducing the storage space required for the encrypted data, and also making it possible to obtain some users' public information without decrypting the data, thereby optimizing the application efficiency of the data; the second shortening of the length of the data to be encrypted is by determining the third field in the data according to a preset rule, and only encrypting the characters in the data except the third field, thereby further shortening the length of the encrypted data, thereby further shortening the length of the data to be encrypted, and reducing the storage space required for the encrypted data.

[0079] In order to make the implementation process of S202 clearer, combined with Figure 2 ,like Figure 3 As shown, the above S202 can be specifically determined through the following S301 to S304.

[0080] S301. The server splits the first field in the first data to obtain fourth data.

[0081] In one possible implementation, Figure 4 As shown, the first field in the first data includes: an MSISDN field, an IMSI field, and an IMEI field for specific description:

[0082] The server splits the MSISDN field into: a public information field of the MSISDN field and a personal information field of the MSISDN field.

[0083] like Figure 5 As shown, the server determines the second field according to the public information field of the MSISDN field, the public information field of the IMSI, and the public information field of the IMEI.

[0084] The fifth field is determined based on the personal information field of the MSISDN field, the personal information field of the IMSI, and the personal information field of the IMEI.

[0085] In combination with the above example, the second field includes: the 1st to 7th characters in the MSISDN field, the 1st to 5th characters in the IMSI field, and the 1st to 7th characters in the IMEI field.

[0086] In combination with the above example, the fifth field includes: the 8th to 11th characters in the MSISDN field, the 6th to 15th characters in the IMSI field, and the 8th to 15th characters in the IMEI field. The fifth field may also be described as a personal information field below.

[0087] It should be noted that if Figure 4 As shown, the first data may also include other fields, which are not limited in this application. The processing process of other fields can be understood by referring to the processing process of the MSISDN field (or IMSI field, or IMEI field), which will not be described in detail here. Among them, when other fields exist in the first data, the characters in other fields also exist in the other data subsequently determined based on the first data. The specific determination process can be understood by referring to the determination process of the MSISDN field (or IMSI field, or IMEI field), which will not be described in detail here.

[0088] S302: The server determines a preset rule.

[0089] The preset rule includes: the server determines that in the fifth field (ie, the personal information field), the characters indicated by the first indication information are characters in the third field.

[0090] S303: The server determines the third field and the fourth field from the fifth field (ie, the personal information field) according to a preset rule.

[0091] Wherein, when the fifth field (i.e., the personal information field) includes N characters, the third field includes M characters, M and N are both positive integers, and M is less than N; the first indication information includes M positive integers, the M positive integers are not equal to each other and are all less than or equal to N;

[0092] The preset rules specifically include: the server determines the serial number of each character in the fifth field (i.e., the personal information field), and the serial number of the character is used to represent the position of the character in the field; the server determines that the character whose serial number is equal to any positive integer among M positive integers is the character in the third field.

[0093] Exemplarily, the first indication information indicates that the characters in the fifth field (ie, the personal information field) may be indicated in the form of parameter k:

[0094] When the fifth field (i.e., the personal information field) includes 22 characters and the third field includes 6 characters, then the parameter k includes 6 positive integers, and the 6 positive integers are not equal to each other. For example, the 6 positive integers included in the parameter k are 1, 3, 5, 8, 11, and 21.

[0095] Correspondingly, the preset rules specifically include: the server determines the serial number of each character in the fifth field (i.e., the personal information field), and the serial number of the character is used to represent the position of the character in the field; the server determines that the characters whose serial numbers are equal to 1, 3, 5, 8, 11, and 21 are the characters in the third field.

[0096] After the server determines the third field according to the preset rules, it is obvious that the characters in the fifth field (i.e., the personal information field) except the third field constitute the fourth segment, that is, the server determines that the characters in the fifth field (i.e., the personal information field) whose serial numbers are equal to 2, 4, 6, 7, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, and 20 are the characters in the fourth field.

[0097] It can be seen that the setting of preset rules can improve the security of encrypted data, that is, even if the key is leaked, the entire data cannot be obtained without knowing the preset rules.

[0098] It should be noted that the above parameter k is only an exemplary description. The format of parameter k can be x1_x2_x3_x4_x5_x6, which must satisfy that x1, x2, x3, x4, x5, and x6 are not equal to each other. Among them, the number of characters indicated by parameter k can be determined by the operator based on the number of characters in the fifth field of the combination (i.e., the personal information field), so that the number of characters in the combined personal information field other than the characters indicated by parameter k is 16. In this case, when using the SM4-128bit encryption algorithm, no additional characters will be added, and the field length can be minimized.

[0099] S304. The server determines the second data according to the second field, the third field, and the fourth field.

[0100] like Figure 6 As shown, the second data includes a second field, a third field, and a fourth field.

[0101] The embodiment of the present application can divide the base station into functional modules or functional units according to the above method example. For example, each functional module or functional unit can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules or functional units. Among them, the division of modules or units in the embodiment of the present application is schematic, which is only a logical function division, and there may be other division methods in actual implementation.

[0102] like Figure 7 FIG. 1 is a schematic diagram of a data encryption device provided in an embodiment of the present application, the device comprising:

[0103] The processing unit 701 is used to control and manage the actions of the data encryption device. For example, the processing unit 701 is used to execute Figure 2 201-203 of Figure 3 Actions performed by the data encryption device in 201, 301-304, 203, and / or other processes described in the embodiments of the present application.

[0104] Optionally, the data encryption device provided in the embodiment of the present application may further include a communication unit 702, the communication unit 702 may be integrated on the communication interface, and the processing unit 701 may be integrated on the processor. Figure 7 shown.

[0105] Figure 8 Another possible structural diagram of the data encryption device involved in the above embodiment is shown. The data encryption device includes: a processor 802. The processor 802 is used to control and manage the actions of the data encryption device, for example, to execute the steps performed by the above processing unit 701, and / or to execute other processes of the technology described in this article. The data encryption device may also include a communication interface 803, a memory 801 and a bus 804, and the memory 801 is used to store program code and data of the data encryption device.

[0106] Among them, the memory 801 can be a memory in a data encryption device, etc. The memory can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory can also include a combination of the above types of memory.

[0107] The processor 802 may be a processor that implements or executes various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the present application. The processor may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The processor may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0108] The bus 804 may be an Extended Industry Standard Architecture (EISA) bus, etc. The bus 304 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0109] Fig. 9 9 is a schematic diagram of the structure of a chip 90 provided in an embodiment of the present application. The chip 90 includes one or more than two (including two) processors 901 .

[0110] Optionally, the chip 90 may also include a communication interface 903 and a memory 904 .

[0111] The memory 904 may include a read-only memory and a random access memory, and provides operation instructions and data to the processor 901. A portion of the memory 904 may also include a non-volatile random access memory (NVRAM).

[0112] In some implementations, the memory 904 stores the following elements, execution modules or data structures, or a subset thereof, or an extended set thereof.

[0113] In the embodiment of the present application, the corresponding operation is performed by calling the operation instruction stored in the memory 904 (the operation instruction may be stored in the operating system).

[0114] Among them, the above-mentioned processor 901 can implement or execute various exemplary logic blocks, units and circuits described in conjunction with the disclosure of this application. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, units and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of DSP and microprocessors, etc.

[0115] The memory 904 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above types of memory.

[0116] The bus 902 may be an Extended Industry Standard Architecture (EISA) bus, etc. The bus 902 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.

[0117] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0118] An embodiment of the present application provides a computer program product including instructions. When the computer program product is run on a computer, the computer is enabled to execute the data encryption method in the above method embodiment.

[0119] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the data encryption method in the method flow shown in the above method embodiment.

[0120] Among them, the computer-readable storage medium, for example, can be but not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (Random Access Memory, RAM), a read-only memory (Read-Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM), a register, a hard disk, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0121] An embodiment of the present invention provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the following Figures 2 to 3 The data encryption method described in .

[0122] Since the data encryption device, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above method, the technical effects that can be obtained can also refer to the above method embodiments, and the embodiments of the present invention will not be repeated here.

[0123] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0124] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0125] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0126] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data encryption method, characterized in that: include: Determine first data, wherein the first data includes a first field, the first field includes a public information field and a personal information field; the personal information field includes N characters; Determine the second data according to the first data; the second data includes a second field, a third field and a fourth field, the second field is the public information field, the third field includes one or more characters determined according to a preset rule in the personal information field, the third field includes M characters, M and N are both positive integers, and M is less than N; The fourth field includes characters in the personal information field other than the one or more characters determined according to the preset rule; the preset rule includes: determining that the character indicated by the first indication information in the personal information field is the character in the third field; the first indication information includes M positive integers, the M positive integers are not equal to each other and are all less than or equal to N; the preset rule specifically includes: determining the sequence number of each character in the personal information field, the sequence number of the character is used to represent the position of the character in the field; determining that the character whose sequence number is equal to any one of the M positive integers is the character in the third field; According to a preset encryption algorithm, the fourth field in the second data is encrypted to determine third data, wherein the third data includes the encrypted fourth field, the second field, and the third field.

2. The method according to claim 1, characterized in that The first field includes at least one of the following: a mobile user international number MSISDN field, an international mobile user identity IMSI field, and an international mobile equipment identity IMEI field; The public information field of the MSISDN field includes the first to seventh characters in the MSISDN field, and the personal information field of the MSISDN field includes the eighth to eleventh characters in the MSISDN field; The public information field of the IMSI field includes the first to fifth characters in the IMSI field, and the personal information field of the IMSI field includes the sixth to fifteenth characters in the IMSI field; The public information field of the IMEI field includes the 1st to 7th characters in the IMEI field, and the personal information field of the IMEI field includes the 8th to 15th characters in the IMEI field.

3. A data encryption device, characterized in that: include: A processing unit; the processing unit is used to: Determine first data, wherein the first data includes a first field, the first field includes a public information field and a personal information field; the personal information field includes N characters; Determine the second data according to the first data; the second data includes a second field, a third field and a fourth field, the second field is the public information field, the third field includes one or more characters determined according to a preset rule in the personal information field, the third field includes M characters, M and N are both positive integers, and M is less than N; The fourth field includes characters in the personal information field other than the one or more characters determined according to the preset rule; the preset rule includes: determining that the character indicated by the first indication information in the personal information field is the character in the third field; the first indication information includes M positive integers, the M positive integers are not equal to each other and are all less than or equal to N; the preset rule specifically includes: determining the sequence number of each character in the personal information field, the sequence number of the character is used to represent the position of the character in the field; determining that the character whose sequence number is equal to any one of the M positive integers is the character in the third field; According to a preset encryption algorithm, the fourth field in the second data is encrypted to determine third data, wherein the third data includes the encrypted fourth field, the second field, and the third field.

4. The device according to claim 3, characterized in that The first field includes at least one of the following: a mobile user international number MSISDN field, an international mobile user identity IMSI field, and an international mobile equipment identity IMEI field; The public information field of the MSISDN field includes the first to seventh characters in the MSISDN field, and the personal information field of the MSISDN field includes the eighth to eleventh characters in the MSISDN field; The public information field of the IMSI field includes the first to fifth characters in the IMSI field, and the personal information field of the IMSI field includes the sixth to fifteenth characters in the IMSI field; The public information field of the IMEI field includes the 1st to 7th characters in the IMEI field, and the personal information field of the IMEI field includes the 8th to 15th characters in the IMEI field.

5. A data encryption device, characterized in that: include: A processor and a communication interface; the communication interface is coupled to the processor, and the processor is used to run a computer program or instruction to implement the data encryption method as described in claim 1 or 2.

6. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, characterized in that: When a computer executes the instruction, the computer executes the data encryption method described in claim 1 or 2.