Data transmission method and device

By using the secure identity authentication information between the client and the server in the car control App, using basic elements and algorithms to generate signature strings, and signing and encrypting the transmitted data, it solves the problem that the security solutions in the existing technology cannot be customized and Timeliness issues, achieving a balance between the security and timeliness of data transmission.

CN118611928AActive Publication Date: 2024-09-06CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410708583.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-06
Estimated Expiration
2044-06-03

AI Technical Summary

Technical Problem

Existing security solutions cannot be customized for specific products. Simple encryption algorithms are easy to be attacked, while complex encryption algorithms will affect timeliness. Especially in car control apps, the secure transmission of user privacy information is an urgent problem that needs to be solved.

Method used

Using the secure identity authentication information synchronized between the client and the server, a signature string is generated through basic elements, permutation and combination methods, representation methods, replacement algorithms and bit selection algorithms to sign and encrypt the transmitted data to ensure the security of data transmission. security, and the level of security can be adjusted according to business needs.

Benefits of technology

It achieves customized security for data transmission in car control apps, ensures data security during network transmission, adapts to the security needs of different clients, and avoids the impact of encryption algorithm complexity on timeliness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118611928A
    Figure CN118611928A
Patent Text Reader

Abstract

The embodiment of the invention provides a data transmission method and device, and the method comprises the steps: obtaining a plurality of basic elements of a client when the client transmits data to a server; combining the basic elements in a permutation and combination mode to obtain composite basic elements, and combining the composite basic elements with the basic elements and / or the composite basic elements to obtain a character string; representing the character string in a representation mode to obtain a target character string; replacing part of characters of the target character string by adopting a replacement algorithm to obtain a replacement character string; selecting a part of characters from the replacement character string as an input source by adopting a bit selection algorithm, and generating a signature character string according to the input source; and signing and encrypting the transmission data according to the signature character string to obtain encrypted transmission data, and putting the encrypted transmission data into the network request so as to send the encrypted transmission data to the server through the network request. The embodiment of the invention adapts to security requirements of various clients on transmission data, and realizes security customization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a data transmission method, a data transmission device, an electronic device, and a computer-readable storage medium. Background Art

[0002] At present, the security solutions on the market vary greatly and cannot be customized for a certain product. If you simply call a conventional encryption algorithm or signature algorithm, it is easy to be attacked. However, if it is too complicated, it is difficult to guarantee the timeliness of the request, because the more complex the encryption algorithm, the longer the decryption time.

[0003] As we all know, vehicle control apps (Applications) place great importance on user information. Each vehicle control command carries a large amount of user privacy information, which involves the safety of both the user and the vehicle. Therefore, how to design a secure identity authentication solution suitable for the client to protect the security of data transmitted during network transmission has become an urgent problem to be solved. Summary of the invention

[0004] The purpose of the embodiment of the present invention is to provide a data transmission method to protect the security of transmitted data during network transmission. The specific technical solution is as follows:

[0005] In a first aspect of the present invention, a data transmission method is provided, wherein security identity authentication information used when synchronizing data transmission between a client and a server, the security identity authentication information at least includes basic elements, permutation and combination methods, representation methods, replacement algorithms, and position selection algorithms, and the method includes:

[0006] When the client transmits data to the server, obtaining several basic elements of the client;

[0007] Combining the basic elements by using the permutation and combination method to obtain a composite basic element, and combining the composite basic element with the basic element and / or the composite basic element to obtain a character string;

[0008] Representing the character string in the representation manner to obtain a target character string;

[0009] Using the replacement algorithm to replace some characters of the target string to obtain a replacement string;

[0010] Selecting some characters from the replacement character string as an input source using the position selection algorithm, and generating a signature character string according to the input source;

[0011] The transmission data is signed and encrypted according to the signature string to obtain encrypted transmission data, and the encrypted transmission data is placed in a network request to send the encrypted transmission data to the server through the network request; wherein the execution order and number of the signature and encryption are configurable.

[0012] The embodiment of the present invention also discloses a data transmission method, wherein the security identity authentication information used when synchronizing data transmission between a client and a server includes at least basic elements, a permutation and combination method, a representation method, a replacement algorithm, and a position selection algorithm. The method includes:

[0013] When receiving a network request sent by the client, extracting encrypted transmission data from the network request,

[0014] Obtaining several basic elements of the client;

[0015] Combining the basic elements by using the permutation and combination method to obtain a composite basic element, and combining the composite basic element with the basic element and / or the composite basic element to obtain a character string;

[0016] Representing the character string in the representation manner to obtain a target character string;

[0017] Using the replacement algorithm to replace some characters of the target string to obtain a replacement string;

[0018] Selecting some characters from the replacement character string as an input source using the position selection algorithm, and generating a signature character string according to the input source;

[0019] The encrypted transmission data is decrypted and authenticated according to the signature character string to obtain the transmission data.

[0020] The embodiment of the present invention further discloses a data transmission device, wherein the security identity authentication information used when synchronizing data transmission between a client and a server includes at least basic elements, a permutation and combination method, a representation method, a replacement algorithm, and a position selection algorithm. The device includes:

[0021] A first acquisition module, used for acquiring several basic elements of the client when the client transmits data to the server;

[0022] A first combining module, configured to combine the basic elements by using the permutation and combination method to obtain a composite basic element, and to combine the composite basic element with the basic element and / or the composite basic element to obtain a character string;

[0023] A first representation module, used for representing the character string in the representation mode to obtain a target character string;

[0024] A first replacement module, used for replacing some characters of the target string with the replacement algorithm to obtain a replacement string;

[0025] A first position selection module, configured to select some characters from the replacement character string as an input source by using the position selection algorithm, and generate a signature character string according to the input source;

[0026] A signature encryption module is used to sign and encrypt the transmission data according to the signature string to obtain encrypted transmission data, and put the encrypted transmission data into a network request to send the encrypted transmission data to the service through the network request; wherein the execution order and number of the signature and encryption are configurable.

[0027] The embodiment of the present invention further discloses a data transmission device, wherein the security identity authentication information used when synchronizing data transmission between a client and a server includes at least basic elements, a permutation and combination method, a representation method, a replacement algorithm, and a position selection algorithm. The device includes:

[0028] an extraction module, configured to extract the encrypted transmission data from the network request when receiving the network request sent by the client,

[0029] A second acquisition module, used to acquire several basic elements of the client;

[0030] A second combining module is used to combine the basic elements by using the permutation and combination method to obtain a composite basic element, and to combine the composite basic element with the basic element and / or the composite basic element to obtain a character string;

[0031] A second representation module, used for representing the character string in the representation mode to obtain a target character string;

[0032] A second replacement module, used for replacing some characters of the target string with the replacement algorithm to obtain a replacement string;

[0033] A second position selection module, used to select some characters from the replacement character string as an input source by using the position selection algorithm, and generate a signature character string according to the input source;

[0034] The decryption module is used to decrypt and authenticate the encrypted transmission data according to the signature string to obtain the transmission data.

[0035] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the above-mentioned data transmission methods.

[0036] In yet another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned data transmission methods.

[0037] Compared with the related art, the embodiments of the present invention have at least the following advantages:

[0038] A data transmission method provided by an embodiment of the present invention, wherein a client and a server pre-synchronize security identity authentication information used in data transmission, wherein the security identity authentication information at least includes basic elements, permutation and combination methods, representation methods, replacement algorithms and position selection algorithms, and when a client transmits data to a server, several basic elements of the client are obtained, the basic elements are combined in a permutation and combination method to obtain a composite basic element, and the composite basic element is combined again with the basic element and / or the composite basic element to obtain a character string, the character string is represented in the representation method to obtain a target character string, a replacement algorithm is used to replace part of the characters of the target character string to obtain a replacement character string, and a position selection algorithm is used to select part of the characters from the replacement character string as an input source to generate a signature character string according to the input source, and then the transmission data can be signed and encrypted according to the signature character string to obtain encrypted transmission data, and the encrypted transmission data is put into a network request to send the encrypted transmission data to the server through the network request; wherein the execution order and number of signatures and encryptions are configurable. The embodiments of the present invention can generate the configuration of variables for the signature string based on the security identity authentication information synchronized between the client and the server, so as to flexibly adjust the security level of data transmission between the client and the server, and can adapt to the security requirements of various clients for data transmission, thereby achieving the purpose of security customization. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0040] Figure 1 is a flowchart of a data transmission method provided in an embodiment of the present invention;

[0041] Figure 2 is a schematic diagram of a feasible storage format of identity information provided in an embodiment of the present invention;

[0042] Figure 3is a schematic diagram of interaction between a client and a server based on an encryptor provided in an embodiment of the present invention;

[0043] Figure 4 is a schematic diagram of generating a certificate based on an encryptor provided in an embodiment of the present invention;

[0044] Figure 5 is another schematic diagram of interaction between a client and a server based on an encryptor provided in an embodiment of the present invention;

[0045] Figure 6 is a flowchart of another data transmission method provided in an embodiment of the present invention;

[0046] Figure 7 is a structural block diagram of a data transmission device provided in an embodiment of the present invention;

[0047] Figure 8 is a structural block diagram of another data transmission device provided in an embodiment of the present invention;

[0048] Fig. 9 The present invention is a block diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0050] Reference Figure 1 , is a flowchart of a data transmission method provided in an embodiment of the present invention, such as Figure 1 As shown, the security identity authentication information used when synchronizing data transmission between the client and the server, the security identity authentication information at least includes basic elements, permutation and combination methods, representation methods, replacement algorithms and position selection algorithms, and the method may specifically include the following steps:

[0051] Step 101: When the client transmits data to the server, several basic elements of the client are obtained.

[0052] Among them, the client can also be called App (Application), the client can be other types of clients such as a vehicle control client for vehicle control, and the server (server) can also be other types of clients such as a server for vehicle control. The embodiment of the present invention can be applied to a client or an encryptor. When applied to a client, the client and the server communicate directly with each other; when applied to an encryptor, the client and the server communicate through the encryptor. When the client communicates with the server, it is necessary to sign each transmitted communication data (transmission data) to achieve secure identity authentication and ensure the security of the transmitted data.

[0053] In a specific implementation, HTTP (Hypertext Transfer Protocol) communication can be performed between the client and the server. There are many types of HTTP requests (network requests), such as get requests and post requests. The embodiment of the present invention mainly uses get requests and post requests.

[0054] This is explained with examples, but in fact, the embodiments of the present invention can be applied to other HTTP requests such as delete requests and put requests in addition to get requests and post requests. Exemplarily, in an HTTP request, the most important data is the business data carried by the get request and the post request, which is data specific to the get request and the post request, and these data can be stored in the business data dictionary; of course, the url (uniform resource locator) of each get request and post request is also unique, and the time of the request (timestamp) is also unique, which can be used as a mark to distinguish an HTTP request. Therefore, in the embodiments of the present invention, it is appropriate to use the above-mentioned partial data about the HTTP request, such as the business data dictionary, url, and timestamp as the original data (basic elements) for generating the signature string. These basic elements can basically mark an HTTP request, and there are many ways to combine these basic elements.

[0055] In addition, the embodiment of the present invention can also use the identity identification information (AppKey) used by the client to represent its own identity as a basic element. Specifically, the AppKey is a temporarily fixed value, which is assigned by the server to the client to represent its own identity. Different servers can assign different AppKeys according to different clients. For example, the AppKey assigned by the TSP server (TSP server is a type of vehicle control service, mainly used for vehicle control) to the vehicle control client can be "12345", and the AppKey assigned by the OTA server (OTA server is a type of vehicle control service, mainly used for vehicle software update) to the vehicle control client can be "abcde", and the AppKey assigned by the TSP server to the overseas version of the vehicle control client can be "444444", and the AppKey assigned by the OTA server to the overseas version of the vehicle control client can be "cccccc".

[0056] In the embodiment of the present invention, for a request, there may be the following basic elements: A: url; B: business data dictionary, C: timestamp; D: AppKey agreed upon by a server and a client. When the client and the server transmit data, the client or encryptor may use the above basic elements to generate a signature (signature string), and then the server or encryptor may implement secure identity authentication of the client based on the signature to ensure data security.

[0057] It should be noted that the above basic elements are only the most basic elements of a request. According to business requirements, the basic elements can be increased or decreased. For example, the following basic elements can be added on the basis of the above basic elements: E: unique ID (identifie) assigned to each interface; H: separator, where the separator is the separator between basic elements. The separator can be any agreed character, and the content and length are arbitrary, such as &, or *, or 111... etc. It can be seen that in the embodiment of the present invention, the number of basic elements and the content of each basic element are variable, so the embodiment of the present invention takes the basic element as one of the variables, which is described as variable 1 here.

[0058] In the embodiment of the present invention, before the client and the server transmit data, the client and the server pre-synchronize the security identity authentication information used in the data transmission, wherein the security identity authentication information may at least include basic elements, permutation and combination methods, representation methods, replacement algorithms, and position selection algorithms, etc. It should be noted that the security identity authentication information in the embodiment of the present invention can be used to generate the signature string in its entirety, or part of the security identity authentication information can be selected to generate the signature string, and the security identity authentication information can be increased or decreased according to business needs, and the embodiment of the present invention does not need to be limited to this.

[0059] Step 102: Combining the basic elements in the permutation and combination manner to obtain a composite basic element, and combining the composite basic element with the basic element and / or the composite basic element to obtain a character string.

[0060] In an embodiment of the present invention, after the basic elements are obtained, the basic elements can be combined in a permutation and combination manner to obtain a composite basic element. For example, assuming that the basic elements are A, B, C, D, E, and H, these basic elements can be combined in pairs or in multiple combinations, such as ABCDEH, ACBD, AC, CA, BD, etc. There are many combinations of permutations and combinations based only on the order of the basic elements, and the embodiment of the present invention can also shuffle the order of the basic elements before permutations and combinations. Each combination is desirable. Further, the embodiment of the present invention can also combine the basic elements to obtain a composite basic element, and the composite basic element can be combined with other basic elements or composite basic elements, such as (AB)D, (CD)A, (DE)D, where the composite basic element is in brackets. In addition, the basic elements of the embodiment of the present invention can also be repeated and combined, such as AHAHAHB, ABCDABCD, etc. The embodiment of the present invention does not need to limit the combination of the basic elements. In an embodiment of the present invention, the permutation and combination of the basic elements is variable, so the embodiment of the present invention uses the permutation and combination as one of the variables, which is described as variable 2 here.

[0061] In the embodiment of the present invention, after the basic elements are combined in a permutation and combination manner, a character string can be obtained, for example, the character string:

[0062] "https: / / domain.com / getCarInfo***userid=123&carid=432***timestamp=483839292***ccccccc".

[0063] Step 103: Use the representation method to represent the character string to obtain a target character string.

[0064] In practical applications, strings can be expressed in a variety of ways, such as string expression, binary expression, ASCII code expression, base64 expression, etc. Different expressions can further convert strings into target strings.

[0065] For example, suppose the string obtained by combining the basic elements in a permutation and combination manner is:

[0066] "https: / / domain.com / getCarInfo***userid=123&carid=432***timestamp=483839292***ccccccc".

[0067] If the above string is viewed in string expression, the above string is: "https: / / domain.com / getCarInfo***userid=123&carid=432***timestamp=483839292***ccccccc";

[0068] If the above string is viewed in binary expression, it is: 110100011101...;

[0069] If the above string is viewed in ASCII code, it is: h; t; t; p...

[0070] If the above string is viewed in base64 expression, the above string is: aHR0cHM6Ly9kb21haW4uY29tL2dldENhckluZ…….

[0071] In the embodiment of the present invention, the expression of the character string is variable, so the embodiment of the present invention uses the expression as one of the variables, which is described as variable 3 here.

[0072] Step 104: Use the replacement algorithm to replace some characters of the target character string to obtain a replacement character string.

[0073] In an embodiment of the present invention, after obtaining the target string, certain bits therein may be replaced. Specifically, which bits, what content is replaced, and what the replacement algorithm is are variable. Therefore, the embodiment of the present invention takes the replacement algorithm as one of the variables, which is described here as variable 4.

[0074] For example, suppose the target string is

[0075] "https: / / domain.com / getCarInfo***userid=123&carid=432***timestamp=483839292***c cccccc", replace the 1st, 4th, 6th, and 8th digits of the target string, among which the 1st digit

[0076] Replace the first digit with "s", the fourth digit with "a", and the sixth and eighth digits with "124", then the replacement string after replacing some characters is obtained:

[0077] "sttas124 / 124domain.com / getCarInfo***userid=123&carid=432***timestamp=483839292***c cccccc".

[0078] Step 105: Use the position selection algorithm to select some characters from the replacement character string as an input source, and generate a signature character string according to the input source.

[0079] In an embodiment of the present invention, after obtaining the replacement string for generating the signature string, a position selection algorithm can be used to select some characters therein as an input source for generating the signature string. The embodiment of the present invention provides a position selection algorithm, that is, determining a string of numbers, performing a position selection algorithm based on the numbers, and obtaining an input source. Among them, since the position selection digit is variable, the embodiment of the present invention uses the position selection digit generated by the position selection algorithm as one of the variables, which is described as variable 5 here.

[0080] For example, assuming that a string of selected digits determined based on the position selection algorithm is: 1, 2, 5, 9, 18, then the 1st, 2nd, 5th, 9th, and 18th digits of the replacement string can be taken as the input source.

[0081] For example, suppose the replacement string for the string representation is:

[0082] "sttas124 / 124domain.com / getCarInfo***userid=123&carid=432***timestamp=483839292***c cccccc"

[0083] Then the input source obtained after selecting the position from the replacement string based on the selected digit is: sts / n.

[0084] Assume the replacement string in binary representation is:

[0085] "101101010110111110001111101011...", then the input source obtained after selecting the position from the replacement string based on the selected digit is: 10000.

[0086] Optionally, if the replacement string itself is not that long, for example, there is no 18th digit, the 18th digit can be directly ignored, and the 1st, 2nd, 5th, and 9th digits in the replacement string can be taken.

[0087] Step 106: Sign and encrypt the transmission data according to the signature string to obtain encrypted transmission data, and put the encrypted transmission data into a network request to send the encrypted transmission data to the server through the network request; wherein the execution order and number of the signature and encryption are configurable.

[0088] In the embodiment of the present invention, the basic elements are processed based on the security identity authentication information to obtain

[0089] To the input source for generating the signature string, next, when the client interacts with the server, such as the client requests data from the server, the server sends data to the client, etc., each time data is transmitted, it is necessary to sign the transmitted data with a signature string to obtain encrypted transmission data, wherein the signing method is to select a popular signature algorithm on the market, such as MD5 (Message Digest Algorithm 5), and attach it to the Header of the network request to send the encrypted transmission data to the server through the network request. The server or encryptor can authenticate and decrypt the encrypted transmission data according to the security identity authentication information, thereby completing the data transmission between the client and the server.

[0090] A data transmission method provided by an embodiment of the present invention, wherein a client and a server pre-synchronize security identity authentication information used in data transmission, wherein the security identity authentication information at least includes basic elements, permutation and combination methods, representation methods, replacement algorithms and position selection algorithms, and when a client transmits data to a server, several basic elements of the client are obtained, the basic elements are combined in a permutation and combination method to obtain a composite basic element, and the composite basic element is combined again with the basic element and / or the composite basic element to obtain a character string, the character string is represented in the representation method to obtain a target character string, a replacement algorithm is used to replace part of the characters of the target character string to obtain a replacement character string, and a position selection algorithm is used to select part of the characters from the replacement character string as an input source to generate a signature character string according to the input source, and then the transmission data can be signed and encrypted according to the signature character string to obtain encrypted transmission data, and the encrypted transmission data is put into a network request to send the encrypted transmission data to the server through the network request; wherein the execution order and number of signatures and encryptions are configurable. The embodiments of the present invention can generate the configuration of variables for the signature string based on the security identity authentication information synchronized between the client and the server, so as to flexibly adjust the security level of data transmission between the client and the server, and can adapt to the security requirements of various clients for data transmission, thereby achieving the purpose of security customization.

[0091] In an embodiment of the present invention, in step 101, when the client transmits data to the server, before obtaining several basic elements of the client, the method further includes:

[0092] When the client is started, synchronizing the security identity authentication information used by the client and the server for data transmission;

[0093] After the client is started, the mapping relationship is obtained, and the client is updated according to the mapping relationship.

[0094] The security identity authentication information used by the client and the server for data transmission; wherein the mapping relationship is the mapping relationship between the server and the permutation and combination method, the representation method, the replacement algorithm and the position selection algorithm;

[0095] After the client is started, an update frequency is obtained, and the security identity authentication information used by the client and the server for data transmission is updated according to the update frequency; wherein the update frequency is predetermined or temporarily determined according to business needs.

[0096] In the embodiment of the present invention, the selection of the digit, i.e., the determination of variable 5, is critical, because a third-party attacker must not be allowed to obtain any information about variable 5, otherwise it may be attacked in various ways (man-in-the-middle attack, replay, tampering, etc.). Therefore, this information cannot be transmitted in the ordinary way of communication between the client and the server at the beginning (that is, the client and the server synchronize the variable 5), otherwise variable 5 will be intercepted.

[0097] After the embodiment of the present invention provides security identity authentication information including multiple optional algorithms, it is ensured that the middleman cannot obtain variable 5. There is no distinction between good and bad algorithms in the security identity authentication information. The algorithms in the security identity authentication information here are temporarily referred to as x algorithms.

[0098] Before introducing the x algorithm, let's first explain the timing of calling the x algorithm: at the beginning of the App (client), before all server interfaces are requested, the client can call the x algorithm once and synchronize all the information used in the security policy with the server (including variables 1-5), so that the server and the client can reach an agreement on the generation and proofreading of the signature. It should be noted that the client is not the only end that can initiate the x algorithm, the server can also initiate the x algorithm, so the A end and the B end are used to refer to the server and the client.

[0099] Moreover, in the subsequent communication between the client and the server, the x algorithm can also be called at any time, that is: the client and the server can update all the information used in the security policy (including variables 1-variable 5) at any time, further ensuring security. This is because if all the information used in the security policy is not updated for a long time, there will be a risk of being eavesdropped and guessing the variables. In an embodiment of the present invention, as long as the client or the server initiates a request and executes the x algorithm, both parties can synchronize to the latest variables. For example, assuming that the x algorithm has (1) permutation and combination methods, (2) representation methods, (3) replacement algorithms and (4) selection algorithms, the following four methods of the x algorithm can be used alternately or replaced based on the mapping relationship. For example: for the OTA server, because there is a lot of key data,

[0100] Methods (1) and (2) can be used. For community servers that have slightly lower data security requirements, methods (3) and (4) can be used. Alternatively, for OTA servers, method (1) can be used for a period of time, and method (2) can be used for a period of time. For community servers, method (1) or (2) with higher security can be used for a period of time, and method (3) or (4) can be used for a period of time. In the embodiment of the present invention, the mapping relationship between the server and the x algorithm is described as variable 6.

[0101] In an embodiment of the present invention, the update frequency of the x algorithm can be obtained, wherein the update frequency is predetermined or temporarily determined according to business needs. For example, the update frequency is predetermined by business needs: for example, the rule is to update once every y minutes (fixed time update); or to call once every y minutes, and then add / subtract n minutes the next time (dynamic time update); or to update after a random time (random time update), and so on. The update frequency is temporarily determined by business needs: if an emergency event suddenly occurs, such as a malicious attack, a major security incident, etc., it will be updated immediately 1 to multiple times. In an embodiment of the present invention, the update frequency is described as variable 7.

[0102] In one embodiment of the present invention, the step 105 of selecting some characters from the replacement string as input sources using the position selection algorithm includes:

[0103] Obtaining several flags generated by the client and the server after mutual identity authentication based on an agreed identity identifier; wherein the flag is generated by the client or the server, and the client and the server use a preset encryption and decryption algorithm to encrypt and decrypt when transmitting the flag, and the encryption and decryption algorithm is provided by the client or the server, or the client and the server each use their own encryption and decryption algorithms, or the client and the server interact with each other and use the encryption and decryption algorithms provided by each other;

[0104] A selection number is generated according to the flag, and part of the characters are selected from the replacement character string as an input source according to the selection number.

[0105] In the embodiment of the present invention, there are many ways to determine the selected digit, that is, the variable 5.

[0106] In an optional manner, variable 5 can be based on a number of flags generated after the client and the server authenticate each other based on the agreed identity identifier, and generate a selection number based on the flag, so that the selection number can be used to select some characters from the replacement string as the input source, and then generate a signature string. Among them, there can be multiple flags, which can be generated by the client or the server. When the client and the server transmit the flag, they need to use a preset encryption and decryption algorithm (which can be referred to as an encryption algorithm for short) for encryption.

[0107] Encryption and decryption avoid plain text transmission. The encryption and decryption algorithm is provided by the client, or by the server, or the client and the server each use their own encryption and decryption algorithms, or the client and the server interact with each other and use the encryption and decryption algorithms provided by each other. The embodiments of the present invention do not need to be limited to this.

[0108] Among them, the generating of the selected digit according to the flag includes: combining the flags by the permutation and combination method to obtain a composite flag, and combining the composite flag with the flag and / or the composite flag to obtain a flag string; expressing the flag string by the representation method to obtain a target flag string; replacing part of the characters of the target flag string by the replacement algorithm to obtain a replacement flag string; generating the selected digit according to the replacement flag string; wherein, if the selected digits have repeated digits, the selected digits are deduplicated or the digits are weighted.

[0109] In a specific example of the present invention, end A and end B may represent a client and a server, and the specific steps of the first generation method of variable 5 are as follows:

[0110] (1-1) End A sends a request to End B. The attached information is:

[0111] A sign (encrypted by an encryption algorithm) is referred to as sign 1 for ease of reference, wherein the sign may be implemented in the form of, but not limited to, numbers, strings, and the like.

[0112] Encryption algorithm 1 at end A. Encryption algorithm 1 can be a commonly used symmetric or asymmetric encryption algorithm on the market. Encryption algorithm 1 is used to encrypt flag 1 to prevent it from being transmitted in plain text.

[0113] Encryption algorithm 2 of end A. Encryption algorithm 2 and encryption algorithm 1 can be one or the same. Any subsequent data transmission between end A and end B needs to avoid plain text transmission, so it may also be necessary to confirm an encryption algorithm for the data, that is, encryption algorithm 2 (encryption algorithm 2 can be the same as encryption algorithm 1 or different).

[0114] The identity information (identity identifier) ​​of the A side. There are many optional schemes for the identity information of the A side, such as the AppKey mentioned above, or other original agreements, such as a unique device identifier, a unique service identifier, a digital certificate, etc. It only needs to be a unique identity information agreed in advance, and the embodiments of the present invention do not need to be limited to this.

[0115] (1-2) End B receives data and sends data to End A.

[0116] End B checks the data sent by End A. If the identity authentication is successful based on the identity identifier, it stores the data sent by End A and returns its own identity information and a flag to End A.

[0117] The returned content is:

[0118] Identity information of the B side. There are many optional schemes, such as the AppKey mentioned above, or other original agreements, such as a unique device identifier, a unique service identifier, a digital certificate, etc. It only needs to be unique identity information agreed in advance, and the embodiments of the present invention do not need to be limited to this.

[0119] A sign (encrypted by an encryption algorithm). For ease of reference, it is called sign 2. The encryption algorithm can be encryption algorithm 1 or encryption algorithm 2 of end A, as long as end A can successfully decrypt the sign.

[0120] (1-3) End A receives data and sends data to End B.

[0121] End A checks the data sent by end B. If the authentication is successful, it stores the data sent by end B and returns a flag to end B: a flag (encrypted by the encryption algorithm), which is called flag 3 for convenience of reference.

[0122] (1-4) gets variable 5.

[0123] After the above three steps, end A and end B confirm the validity of each other's identity and obtain three signs. These three signs can directly generate variable 5 according to a pre-agreed algorithm. Among them, there are many pre-agreed algorithms, so they can also be used as a variable, called variable 8. The pre-agreed algorithm can be formulated according to business needs.

[0124] To facilitate understanding by those skilled in the art, the embodiments of the present invention list the following three examples: for example, flag 1, flag 2, and flag 3 are respectively 123, 456, and 789. Select one or some of them, such as 123, and use all of them in a simple permutation and combination manner. There are 6 types in total, such as 123456789, 123789456, 789123456... Using the custom algorithm (x algorithm) mentioned above, referring to the variables 1-4 mentioned above, the steps of generating variables can be used in the generation of selected digits. Specifically, flag 1, flag 2, and flag 3 are regarded as basic elements. After the basic elements are combined in a permutation and combination manner, a representation method is selected, some bits are replaced, some bits are selected, and finally processed to obtain variable 5.

[0125] For example: flag string 123456789 (permutation and combination method) -> target flag string 111010110111100110100010101 (select binary representation) -> replacement flag string 111011111000100111101110101 (replacement algorithm replaces some bits) -> 11101111100010011110111010 (selection algorithm takes the first x bits), and the variable 5 is

[0126] 11101111100010011110111010, converted to decimal, the selected digits are 62793658.

[0127] Optionally, if there are repeated selected digits in variable 5, duplicate removal or digit weighting can be performed. If the selected digit is 62793658, the duplicated digits are 6279358, and the duplicated digits are 6, 2, 7, 9, 3, 65, 8. Therefore, for the replacement string, the duplicated digits can be taken as the input source for generating the signature string, and the duplicated digits can be taken as the input source for generating the signature string.

[0128] In a specific example of the present invention, end A and end B may represent a client and a server, and the specific steps of the second generation method of variable 5 are as follows:

[0129] According to the previous (1), the encryption algorithm is provided by one end, which is not secure enough. It is more secure if both ends (A and B) use their own encryption algorithms, or if they use each other's encryption algorithms to transmit data. Based on this, the following improvements are made:

[0130] (1-1) End A sends a request to End B. The attached information is:

[0131] A sign 1 (encrypted by algorithm 1.A);

[0132] The encryption algorithm of end A is 1.A;

[0133] Encryption algorithm 2.A at end A;

[0134] Identity information of end A.

[0135] (1-2) End B receives data and sends data to End A.

[0136] End B checks the data sent by End A. If the identity authentication is successful, it stores the data sent by End A and returns its own identity information and a flag to End A. The specific return content is:

[0137] The identity information of the B side;

[0138] Encryption algorithm of end B 1.B;

[0139] Encryption algorithm 2.B of the B side;

[0140] A flag 2 (encrypted by algorithm 1.B).

[0141] (1-3) End A receives data and sends data to End B.

[0142] End A checks the data sent by End B. If the authentication is successful, it stores the data sent by End B and returns a flag to End B:

[0143] A sign 3 (encrypted by encryption algorithm 1.A or encryption algorithm 1.B. When encryption algorithm 1.A is used, encryption is used interactively, while when encryption algorithm 1.B is used, each uses its own encryption).

[0144] (1-4) get variable 5

[0145] After the above three steps, end A and end B confirm the validity of each other's identity and obtain three marks, which can directly generate variable 5 according to a pre-agreed algorithm. The pre-agreed algorithm will not be described in detail here.

[0146] From then on, A and B can use their own encryption algorithms, or interactively use each other's encryption algorithms to transmit data.

[0147] In a specific example of the present invention, end A and end B may represent a client and a server, and the specific steps of the third generation method of variable 5 are as follows:

[0148] In an embodiment of the present invention, before obtaining the plurality of flags generated after the client and the server authenticate each other based on the agreed identity identifier, the method further includes:

[0149] Determine the current network environment;

[0150] The number of times the client and the server generate a flag after mutual identity authentication based on an agreed identity identifier is determined according to the current network environment.

[0151] According to the previous (1) and (2), there are three interactions between the two ends (A and B). The purpose of this is to prevent both parties from forging identities, so they need to authenticate each other's identities. While obtaining variable 5, it can also prevent man-in-the-middle attacks and ensure some additional security measures. However, if the network environment is relatively secure, such as an intranet, or when the project is first launched, in order to simplify the steps, the three interactions can be reduced to one: End A signs the tag, and then sends the tag + signature to End B. End B obtains the tag through regular signature verification.

[0152] In one embodiment of the present invention, the step 105 of selecting some characters from the replacement string as input sources using the position selection algorithm includes:

[0153] Obtaining a random number used in a one-way / two-way authentication phase between the client and the server;

[0154] The random number is used as a selection digit, and some characters are selected from the replacement character string as an input source according to the selection digit.

[0155] In the specific implementation, at the transport layer, there is a one-way / two-way authentication stage between the client and the server. For example, HTTPS has a one-way / two-way authentication stage. In this stage, there is a random number R, and the random number R is synchronized to the client and the server in a secure way.

[0156] If the random number R is directly obtained at the application layer, and then the aforementioned processing is slightly performed or not performed, the selected digit generated based on the random number R can be obtained, that is, variable 5. The method based on random numbers is the fourth method for generating variable 5.

[0157] In an embodiment of the present invention, in step 101, when the client transmits data to the server, before obtaining several basic elements of the client, the method further includes:

[0158] Writing the identity information of the client into a specified file in the installation package of the client; wherein the suffix of the specified file is modified;

[0159] When installing the client based on the installation package, reading the identity information identifier from the specified file and storing the identity information identifier in a memory;

[0160] A preset encryption algorithm is called to encrypt the identity information, and the encrypted identity information is stored in a sandbox.

[0161] In the embodiment of the present invention, information such as the identity information of AppKey is very important data. As a client, AppKey can only be pre-installed in the installation package, but AppKey cannot be in plain text, otherwise it is easy to be decompiled and attacked.

[0162] In view of the above problems, the embodiment of the present invention provides a strategy to prevent the identity information leakage caused by the decompilation of the client installation package, and then the leakage of the signature string. Of course, the idea of ​​the strategy provided by the embodiment of the present invention is also feasible to be applied to the server, because the server should also not store information such as identity information in plain text in the code.

[0163] Specifically, taking the client as an example, the identity information can be processed in the following ways:

[0164] 1. Write the identity information AppKey to the specified file;

[0165] The specific format of the specified file includes but is not limited to plist (Property List), xml (eXtensible Markup Language) and other formats. Taking the plist file as an example, different AppKey key-value pairs can be set for different servers. Figure 2 , is a schematic diagram of a feasible storage format of identity information provided in an embodiment of the present invention. Specifically,

[0166] The first-level key-value pairs: prod, uat, test, dev are server environments formulated according to business requirements: prod is the production environment, uat is the pre-production environment, test is the test environment, and dev is the development environment; the next-level key-value pairs: OP, TSP, OTA, BigData are different server ends, some of which have been mentioned before, and each server end has a different appKey; the next-level key-value pairs: secretKey, accessKey: are the detailed implementation of AppKey.

[0167] 2. Create the corresponding program model (data model)

[0168] The program also creates classes or structures corresponding to the data in the plist.

[0169]

[0170] If business needs add another environment in the future, since the key-value pairs have been assigned, adding and deleting them are very convenient. You only need to change the corresponding two places (the file and the model).

[0171] 3. Encrypt the plist file

[0172] Writing the identity information into the plist file only solves the problem of obtaining the plaintext AppKey by decompiling the code, but the content in the plist file is still equivalent to plaintext.

[0173] The plist file is also encrypted in one step to ensure that even if it is decompiled (so that the source code can be seen) or the device is rooted (so that the contents of the sandbox can be seen), the corresponding information cannot be obtained, which is very safe.

[0174] (1) Change the suffix of the plist file in the pre-installation package to other misleading names, such as "aaaa", "tmp1924483823", etc. That is, suffixes such as plist, xml, and txt must be removed.

[0175] (2) When the client is installed for the first time, the plist file, that is, the content of the source file, is read out, and the identity information is stored in the memory in the form of a string;

[0176] (3) Call common encryption algorithms on the market, such as symmetric encryption, AES / DES, etc., pass in a string as an input parameter, and obtain the encrypted output parameter.

[0177] (4) Store the encrypted output parameters back in the sandbox and name the file with deceptive names, such as "aaaa", "tmp1924483823", etc. In short, suffixes such as plist, xml, and txt must be removed.

[0178] 4. Read from plist to model (data model)

[0179] Then, at an appropriate time, such as when the client is started, the system API (Application Programming Interface) is called to read the identity information of the encrypted plist file into the memory and decrypt it.

[0180] The decrypted string is converted into a model through the API provided by the system or the API of a third-party tool library, and the identity information such as AppKey stored in these models is used in the aforementioned security signing step.

[0181] In one embodiment of the present invention, when applied to the encryptor, the client and the server include an authentication certificate assigned by the encryptor to the client, and the authentication certificate is obtained by the client requesting the encryptor, or the client requesting the encryptor through the server;

[0182] The step of signing and encrypting the transmission data according to the signature string to obtain encrypted transmission data, and putting the encrypted transmission data into a network request to send the encrypted transmission data to the server through the network request includes:

[0183] Receiving the transmission data sent by the client and the authentication certificate of the client;

[0184] According to the signature string and the authentication certificate, the transmission data is signed and encrypted to obtain encrypted transmission data, and the encrypted transmission data is sent to the client so that the client

[0185] The client sends the encrypted transmission data to the server.

[0186] In the embodiment of the present invention, in addition to data storage such as identity information, data transmission (data transmission) is also the focus of the security strategy of the embodiment of the present invention. In view of the above problems, the embodiment of the present invention designs an encryptor, which has much higher security than the traditional symmetric encryption and de-signing of data by end A and end B. Specifically, the core idea of ​​the encryptor is as follows:

[0187] As a manager, the encryptor is responsible for all encryption, decryption and signing. The encryptor is a black box mode. The outside world does not know the algorithm it selects (for example, which x algorithm is selected), and there is no way to guess. The interaction between end A and end B does not directly encrypt or decrypt, and does not synchronize keys. It is only responsible for transmitting data. The encryptor encrypts and signs the data at one end (such as end A), and decrypts and authenticates the data at the other end (such as end B).

[0188] For example, refer to Figure 3 , is a schematic diagram of an interaction between a client and a server based on an encryptor provided in an embodiment of the present invention, and the specific implementation steps are as follows:

[0189] 1. End A and End B request the encryptor's certificate

[0190] To facilitate understanding by those skilled in the art, end A can be regarded as a client and end B as a server, but it should be noted that end A can also be a server and end B can also be a client; because end A and end B are fair and equal in position and advantage in the embodiment of the present invention, end A can request data from end B and end B can also send data to end A. It should be noted that the encryptor can of course be developed by itself, so the algorithm in the encryptor is transparent.

[0191] Prerequisite: The encryptor has pre-assigned unique identity information (identity information) to end A and end B. The identity information is used to identify the identity of end A. The secure storage of the identity information can refer to the storage method of AppKey above, which will not be repeated here.

[0192] At the appropriate time, end A and end B request a certificate (authentication certificate) from the encryptor. This appropriate time may be when all mapping relationships are prepared for the first time. For example, if the mapping relationship is: identity information identifier, the first time to prepare this identity information is when the client is started, the identity information is stored, and the identity information is read; if the mapping relationship is: identity information identifier + user id, the first time to prepare these two pieces of information may be after the user logs in.

[0193] (1) When appropriate, end A requests a certificate from the encryptor.

[0194] End A uses the identity information to generate a p10 certificate request and requests an authentication certificate from the encryptor.

[0195] Of course, the identity information may not be the only mapping relationship generated by the certificate. The A end (understood as the client) can pass in multiple mapping relationships and request multiple certificates according to different dimensions.

[0196] For example:

[0197] (1.1) Only the identity information is transmitted to obtain the certificate. The certificate and identity information, or the client, are in a one-to-one correspondence, and the certificates of all devices and all users are the same.

[0198] (1.2) Pass in the identity information + the user ID obtained after the user logs in on the client to obtain the certificate. The certificate and the user are in a one-to-one correspondence. User A and user B have two different certificates.

[0199] (1.3) Pass in the identity information + device ID to get the certificate. The certificate and the device are in a one-to-one correspondence. iphoneA and iphoneB are two different certificates.

[0200] (1.4) Input the identity information + device ID + user ID to get the certificate. The certificate and device + user are in a one-to-one correspondence.

[0201] Of course, in actual applications, there may be other identifiers that can be formulated according to business needs. For example, each business module may be assigned an ID so that the certificates of different business modules are also different.

[0202] In addition, since the certificate is a third-party certificate, it can also be used as a two-way authentication certificate for HTTPS.

[0203] In a specific implementation, the encryptor may generate a certificate according to a commonly used certificate generation method. Figure 4, is a schematic diagram of generating a certificate based on an encryptor provided in an embodiment of the present invention. The encryptor signs the above-mentioned mapping relationship (mapping information) passed into the A end with its own private key, and then puts it together with the mapping relationship, which is called a certificate.

[0204] (2) When appropriate, end B requests a certificate from the encryptor.

[0205] Similarly, according to the business requirements, end B passes in the mapping information described above and also obtains the certificate assigned by the encryptor.

[0206] (3) A can entrust B to carry out

[0207] End A can directly send a request to End B, passing in the corresponding mapping information, and then End B calls the encryptor (equivalent to End B applying for a certificate on behalf of End A), obtains End A's certificate, and End B then transmits End A's certificate to End A.

[0208] Whether end B needs to apply for a certificate from the encryptor is determined by business needs. If there is no such business need (for example, end B actively contacts end A), there is no need to apply for an end A certificate through end B.

[0209] In this way, end A will not have any contact with the encryptor. The advantage of this is that end A does not know the existence of the encryptor, reducing the risk of a man-in-the-middle attacking the encryptor (the man-in-the-middle also does not know the existence of the encryptor). Since the final operation is encrypted by the encryptor, a man-in-the-middle attack on end B will not affect this business. And end B also knows the certificate and related mapping information of end A, so it can do other things besides the encryptor, such as interaction between end A and end B, two-way authentication, etc. For example, refer to Figure 5 , is another schematic diagram of interaction between a client and a server based on an encryptor provided in an embodiment of the present invention.

[0210] 2. The encryptor encrypts and signs the data

[0211] When end A and end B communicate, the party initiating the communication (such as end A) calls the encryptor, passes in the data to be transmitted (transmission data), and lets the encryptor encrypt + sign the transmission data, obtains the encrypted transmission data, and sends it to end B.

[0212] The specific steps of the encryptor are:

[0213] (1) Accepting participants

[0214] The input parameters include:

[0215] Certificate of end A: The certificate contains the unique identity information of end A and mapping information of business requirements (such as user ID, device ID, module ID, etc.). The encryptor can take them out one by one to know the certificate of the client or server.

[0216] Data to be transmitted by end A

[0217] (2) Signature

[0218] The encryptor generates a signature string using the aforementioned method to sign the transmitted data.

[0219] (3) Encryption

[0220] The signature string obtained in the first step can be used as an encryption key to encrypt the transmitted data.

[0221] This is just the simplest processing method. For the generation of the key, any rule can be customized, and the embodiment of the present invention does not need to be limited to this. For example, the key can also be generated in the following manner:

[0222] (3.1)Signature string + timestamp + special reserved characters

[0223] (3.2)Signature string + certificate string

[0224] (3.3) Extract certain parts of the certificate string + timestamp

[0225] (3.4) Timestamp + signature string + ...

[0226] …

[0227] It can be seen that the example of the present invention can perform permutations and combinations of the signature string, timestamp, special predetermined characters, certain parts extracted from the certificate string, etc., replace certain bits, and finally confirm the algorithm to obtain a key.

[0228] Therefore, in summary, the process of generating a signature string can be refined into an algorithm (function or module), which can accept variables 1, 2, 3, 4, 5, and 8 as input parameters. In different business needs and business situations, the values ​​of these input parameters are different. For example, when generating a signature string for transmission data mentioned above, the values ​​of these input parameters are xxx; when obtaining variable 5, these input parameters are ddd; when generating the key here, the values ​​of these input parameters are yyy.

[0229] (4) Configurable items

[0230] Steps (2) and (3) are interchangeable, there is no restriction on the order, and they can be repeated.

[0231] For example, you can encrypt the transmitted data twice and then verify the signature; or use the string signed twice as the key and then encrypt it. The order and number of signatures and encryptions are configurable, for example:

[0232] (4.1) The string signed n times is used as the key to encrypt the transmitted data m times. There may be other steps between signing and encryption, such as replacement and partial bit extraction.

[0233] (4.2) Encrypt m times, then sign n times. Similarly, there can be other steps between encryption and signing. The configuration of these steps and their order is called variable 9.

[0234] 3. End A sends encrypted + signed data to End B

[0235] Now, no matter the length of the data to be transmitted or what format it is in, it is already encrypted data, where the data format can be binary, directly putting the binary data into the body of the HTTP request, or sending the transmission data to the B side through a socket (a communication mechanism).

[0236] 4. The receiving end decrypts the data and verifies the signature

[0237] After receiving the data, the receiving end (such as end B) may not decrypt it, but call the encryptor's external API (Application Programming Interface) to perform

[0238] Decryption is performed by the encryptor. The encryptor decrypts the transmitted data in reverse order according to the order and method of encryption and signature verification (by reading the value of the variable, you can know all the order and steps).

[0239] In summary, the variables involved in the embodiments of the present invention are:

[0240] Variable 1: How many basic elements of the signature are there and what each one is;

[0241] Variable 2: The way the basic elements of the signature are arranged and combined;

[0242] Variable 3: Select a representation method after signature combination;

[0243] Variable 4: Transposition after signature combination: which bits are replaced, what are they replaced with, and what is the replacement algorithm;

[0244] Variable 5: Get the input parameter (input source) of the final signature;

[0245] Variable 6: mapping between servers and x algorithms;

[0246] Variable 7: update frequency of the x algorithm;

[0247] Variable 8: In the x algorithm, we finally get the algorithm of variable 5;

[0248] Variable 9: the encryption + signing steps and order of the encryptor;

[0249] In the embodiment of the present invention, a configuration file can be established to configure the values ​​of variables in different situations. In addition, these variables can be modified in real time according to the feedback situation, and multi-terminal synchronization can be performed at the same time.

[0250] Here are some examples:

[0251] When the client detects that the network is slow, the encryption algorithm should be simplified, so the complexity of the variable values ​​is reduced and synchronized to multiple terminals. The degree of reduction can be determined by a variety of algorithms, such as decreasing, increasing (decreasing or increasing a small fixed value each time), sharp decrease, sharp increase (increasing or decreasing by 1 / 3 or 1 / 2 each time), etc.

[0252] When the client detects that the network is good, it restores the values ​​of these variables to the average level, where the average level is the value obtained through repeated daily operation, feedback and statistics.

[0253] In some extreme cases, the client needs to increase the variable value to a safe level, which means more complex calculations.

[0254] The embodiment of the present invention is customized according to the security requirements of the vehicle control client, making three-party attacks very difficult without consuming too many computing resources. The embodiment of the present invention can flexibly adjust the security level by configuring variables, and appropriately increase or decrease the security level according to needs and temporary situations.

[0255] The computational complexity is reduced, achieving the purpose of customization while ensuring data security.

[0256] Reference Figure 6 , is a flowchart of another data transmission method provided in an embodiment of the present invention. Figure 6 As shown, the security identity authentication information used when synchronizing data transmission between the client and the server, the security identity authentication information at least includes basic elements, permutation and combination methods, representation methods, replacement algorithms and position selection algorithms, and the method may specifically include the following steps:

[0257] Step 601: upon receiving a network request sent by the client, extracting encrypted transmission data from the network request;

[0258] Step 602: Obtain several basic elements of the client;

[0259] Step 603: Combining the basic elements in the permutation and combination manner to obtain a composite basic element, and combining the composite basic element with the basic element and / or the composite basic element to obtain a character string;

[0260] Step 604: Represent the character string in the representation mode to obtain a target character string;

[0261] Step 605: Use the replacement algorithm to replace some characters of the target string to obtain a replacement string;

[0262] Step 606: using the position selection algorithm to select some characters from the replacement string as input sources, and generating a signature string according to the input sources;

[0263] Step 607: Decrypt and authenticate the encrypted transmission data according to the signature string to obtain transmission data.

[0264] In one embodiment of the present invention, when applied to the encryptor, the client and the server include an authentication certificate assigned by the encryptor to the client; the step 607, decrypting and authenticating the encrypted transmission data according to the signature string to obtain the transmission data, includes:

[0265] Receiving the encrypted transmission data sent by the server;

[0266] The encrypted transmission data is decrypted and authenticated according to the signature string and the authentication certificate to obtain transmission data, and the transmission data is sent to the server.

[0267] The embodiments of the present invention can be applied to a server or an encryptor. When applied to a server, the client and the server communicate directly with each other; when applied to an encryptor, the client and the server communicate through the encryptor. For example, if applied to a server, after receiving the encrypted transmission data sent by the client, the server can use the authentication certificate of the client stored locally and the basic

[0268] After generating a signature string based on the basic elements of the client, the encrypted transmission data can be decrypted and authenticated according to the signature string and the authentication certificate to obtain the transmission data. If applied to the encryptor, after the server receives the encrypted transmission data sent by the client and sends the encrypted transmission data to the encryptor, the encryptor can generate a signature string based on the authentication certificate of the client stored locally and the basic elements of the client, and then the encrypted transmission data can be decrypted and authenticated according to the signature string and the authentication certificate to obtain the transmission data. Finally, the encryptor sends the transmission data to the server. When the client communicates with the server, it is necessary to sign each transmission of communication data (transmission data) to achieve secure identity authentication and ensure the security of the transmission data.

[0269] Among them, since the decryption method of the server or encryptor for the received transmission data is the reverse process of the above-mentioned embodiment of signing and decrypting the transmission data, it will not be described in detail.

[0270] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0271] Reference Figure 7 , is a structural block diagram of a data transmission device provided in an embodiment of the present invention, such as Figure 7 As shown, the security identity authentication information used when synchronizing data transmission between the client and the server, the security identity authentication information at least includes basic elements, permutation and combination methods, representation methods, replacement algorithms and selection algorithms. The device may specifically include the following modules:

[0272] A first acquisition module 701, used to acquire several basic elements of the client when the client transmits data to the server;

[0273] A first combining module 702 is used to combine the basic elements in the permutation and combination manner to obtain a composite basic element, and to combine the composite basic element with the basic element and / or the composite basic element to obtain a character string;

[0274] A first representation module 703, configured to use the representation method to represent the character string to obtain a target character string;

[0275] The first replacement module 704 is used to replace part of the target string using the replacement algorithm

[0276] Characters get the replacement string;

[0277] A first position selection module 705, configured to select some characters from the replacement character string as an input source by using the position selection algorithm, and generate a signature character string according to the input source;

[0278] The signature encryption module 706 is used to sign and encrypt the transmission data according to the signature string to obtain encrypted transmission data, and put the encrypted transmission data into a network request to send the encrypted transmission data to the service through the network request; wherein the execution order and number of the signature and encryption are configurable.

[0279] In an embodiment of the present invention, the device further comprises: a synchronization module, configured to:

[0280] When the client is started, synchronizing the security identity authentication information used by the client and the server for data transmission;

[0281] After the client is started, a mapping relationship is obtained, and according to the mapping relationship, security identity authentication information used by the client and the server for data transmission is updated; wherein the mapping relationship is a mapping relationship between the server and the permutation and combination method, the representation method, the replacement algorithm and the position selection algorithm;

[0282] After the client is started, an update frequency is obtained, and the security identity authentication information used by the client and the server for data transmission is updated according to the update frequency; wherein the update frequency is predetermined or temporarily determined according to business needs.

[0283] In an embodiment of the present invention, the first position selection module 705 is used to:

[0284] Obtaining several flags generated by the client and the server after mutual identity authentication based on an agreed identity identifier; wherein the flag is generated by the client or the server, and the client and the server use a preset encryption and decryption algorithm to encrypt and decrypt when transmitting the flag, and the encryption and decryption algorithm is provided by the client or the server, or the client and the server each use their own encryption and decryption algorithms, or the client and the server interact with each other and use the encryption and decryption algorithms provided by each other;

[0285] Generate a selection number according to the flag, and select some characters from the replacement character string as an input source according to the selection number;

[0286] The first position selection module 705 is used to:

[0287] The symbols are combined by the permutation and combination method to obtain a composite symbol, and the

[0288] The composite flag is combined with the flag and / or the composite flag to obtain a flag string;

[0289] Representing the flag character string in the representation manner to obtain a target flag character string;

[0290] Using the replacement algorithm to replace some characters of the target mark string to obtain a replacement mark string;

[0291] Generate a selected digit according to the replacement mark character string; wherein, if there are repeated digits in the selected digits, remove the repeated digits or add the repeated digits to the selected digits;

[0292] Alternatively, the adopting the position selection algorithm to select some characters from the replacement character string as the input source includes:

[0293] Obtaining a random number used in a one-way / two-way authentication phase between the client and the server;

[0294] The random number is used as a selection digit, and some characters are selected from the replacement character string as an input source according to the selection digit.

[0295] In one embodiment of the present invention, the device further includes: a configuration module, configured to:

[0296] Determine the current network environment;

[0297] The number of times the client and the server generate a flag after mutual identity authentication based on an agreed identity identifier is determined according to the current network environment.

[0298] In one embodiment of the present invention, the device further comprises: a storage module, configured to:

[0299] Writing the identity information of the client into a specified file in the installation package of the client; wherein the suffix of the specified file is modified;

[0300] When installing the client based on the installation package, reading the identity information identifier from the specified file and storing the identity information identifier in a memory;

[0301] Calling a preset encryption algorithm to encrypt the identity information, and storing the encrypted identity information in a sandbox;

[0302] Wherein, the method is applied to a client or an encryptor; when applied to the client, the client and the server communicate directly with each other; when applied to the encryptor, the client and the server communicate through the encryptor.

[0303] In one embodiment of the present invention, when applied to the encryptor, the client and the server include an authentication certificate assigned by the encryptor to the client, and the authentication certificate is

[0304] The client requests the encryptor to obtain the signature, or the client requests the encryptor through the server; the signature encryption module 706 is used to:

[0305] Receiving the transmission data sent by the client and the authentication certificate of the client;

[0306] The transmission data is signed and encrypted according to the signature string and the authentication certificate to obtain encrypted transmission data, and the encrypted transmission data is sent to the client, so that the client sends the encrypted transmission data to the server.

[0307] Reference Figure 8 , is a structural block diagram of a data transmission device provided in an embodiment of the present invention, such as Figure 8 As shown, the security identity authentication information used when synchronizing data transmission between the client and the server, the security identity authentication information at least includes basic elements, permutation and combination methods, representation methods, replacement algorithms and selection algorithms. The device may specifically include the following modules:

[0308] The extraction module 801 is used to extract the encrypted transmission data from the network request when receiving the network request sent by the client.

[0309] The second acquisition module 802 is used to acquire several basic elements of the client;

[0310] A second combining module 803 is used to combine the basic elements in the permutation and combination manner to obtain a composite basic element, and to combine the composite basic element with the basic element and / or the composite basic element to obtain a character string;

[0311] A second representation module 804, configured to use the representation method to represent the character string to obtain a target character string;

[0312] A second replacement module 805, configured to use the replacement algorithm to replace some characters of the target string to obtain a replacement string;

[0313] A second position selection module 806, configured to select some characters from the replacement character string as an input source by using the position selection algorithm, and generate a signature character string according to the input source;

[0314] The decryption module 807 is used to decrypt and authenticate the encrypted transmission data according to the signature string to obtain the transmission data.

[0315] In one embodiment of the present invention, the method is applied to a server or an encryptor; when applied to the server, the client and the server communicate directly with each other; when applied to the encryptor, the client and the server communicate through the encryptor;

[0316] When applied to the encryptor, the client and the server include the encryptor as

[0317] The authentication certificate assigned by the client; the decryption module 807 is used to:

[0318] Receiving the encrypted transmission data sent by the server;

[0319] The encrypted transmission data is decrypted and authenticated according to the signature string and the authentication certificate to obtain transmission data, and the transmission data is sent to the server.

[0320] As for the above-mentioned device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0321] The embodiment of the present invention further provides an electronic device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0322] Memory 903, used for storing computer programs;

[0323] The processor 901 is configured to implement any of the data transmission methods described in the above embodiments when executing the program stored in the memory 903:

[0324] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0325] The communication interface is used for communication between the above terminal and other devices.

[0326] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0327] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0328] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the data transmission method described in any one of the above embodiments.

[0329] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the data transmission method described in any one of the above embodiments.

[0330] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0331] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0332] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0333] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A data transmission method, characterized in that: Security identity authentication information used when synchronously transmitting data between a client and a server, the security identity authentication information at least including basic elements, permutation and combination methods, representation methods, replacement algorithms and position selection algorithms, the method comprising: When the client transmits data to the server, obtaining several basic elements of the client; Combining the basic elements by using the permutation and combination method to obtain a composite basic element, and combining the composite basic element with the basic element and / or the composite basic element to obtain a character string; Representing the character string in the representation manner to obtain a target character string; Using the replacement algorithm to replace some characters of the target string to obtain a replacement string; Selecting some characters from the replacement character string as an input source using the position selection algorithm, and generating a signature character string according to the input source; The transmission data is signed and encrypted according to the signature string to obtain encrypted transmission data, and the encrypted transmission data is placed in a network request to send the encrypted transmission data to the server through the network request; wherein the execution order and number of the signature and encryption are configurable.

2. The method according to claim 1, characterized in that: When the client transmits data to the server, before obtaining several basic elements of the client, the method further includes: When the client is started, synchronizing the security identity authentication information used by the client and the server for data transmission; After the client is started, a mapping relationship is obtained, and according to the mapping relationship, security identity authentication information used by the client and the server for data transmission is updated; wherein the mapping relationship is a mapping relationship between the server and the permutation and combination method, the representation method, the replacement algorithm and the position selection algorithm; After the client is started, an update frequency is obtained, and the security identity authentication information used by the client and the server for data transmission is updated according to the update frequency; wherein the update frequency is predetermined or temporarily determined according to business needs.

3. The method according to claim 1 or 2, characterized in that: The step of using the position selection algorithm to select some characters from the replacement character string as input sources includes: Obtaining several flags generated by the client and the server after mutual identity authentication based on an agreed identity identifier; wherein the flag is generated by the client or the server, and the client and the server use a preset encryption and decryption algorithm to encrypt and decrypt when transmitting the flag, and the encryption and decryption algorithm is provided by the client or the server, or the client and the server each use their own encryption and decryption algorithms, or the client and the server interact with each other and use the encryption and decryption algorithms provided by each other; A selection number is generated according to the flag, and part of the characters are selected from the replacement character string as an input source according to the selection number.

4. The method according to claim 3, characterized in that The step of generating a selected digit according to the flag comprises: Combining the flags by using the permutation and combination method to obtain a composite flag, and combining the composite flag with the flag and / or the composite flag to obtain a flag character string; Representing the flag character string in the representation manner to obtain a target flag character string; Using the replacement algorithm to replace some characters of the target mark string to obtain a replacement mark string; The selected digits are generated according to the replacement mark character string; wherein, if there are repeated digits in the selected digits, the selected digits are de-duplicated or the digits are emphasized.

5. The method according to claim 1 or 2, characterized in that: The step of using the position selection algorithm to select some characters from the replacement character string as input sources includes: Obtaining a random number used in a one-way / two-way authentication phase between the client and the server; The random number is used as a selection digit, and some characters are selected from the replacement character string as an input source according to the selection digit.

6. The method according to claim 3, characterized in that Before obtaining the plurality of marks generated after the client and the server authenticate each other based on the agreed identity identifier, the method further includes: Determine the current network environment; The number of times the client and the server generate a flag after mutual identity authentication based on an agreed identity identifier is determined according to the current network environment.

7. The method according to claim 1, characterized in that When the client transmits data to the server, before obtaining several basic elements of the client, the method further includes: Writing the identity information of the client into a specified file in the installation package of the client; wherein the suffix of the specified file is modified; When installing the client based on the installation package, reading the identity information identifier from the specified file and storing the identity information identifier in a memory; A preset encryption algorithm is called to encrypt the identity information, and the encrypted identity information is stored in a sandbox.

8. The method according to claim 1, characterized in that The method is applied to a client or an encryptor; when applied to the client, the client and the server communicate with each other directly; when applied to the encryptor, the client and the server communicate with each other through the encryptor.

9. The method according to claim 8, characterized in that When applied to the encryptor, the client and the server include an authentication certificate assigned by the encryptor to the client, and the authentication certificate is obtained by the client requesting the encryptor, or the client requesting the encryptor through the server; The step of signing and encrypting the transmission data according to the signature string to obtain encrypted transmission data, and putting the encrypted transmission data into a network request to send the encrypted transmission data to the server through the network request includes: Receiving the transmission data sent by the client and the authentication certificate of the client; The transmission data is signed and encrypted according to the signature string and the authentication certificate to obtain encrypted transmission data, and the encrypted transmission data is sent to the client, so that the client sends the encrypted transmission data to the server.

10. A data transmission method, characterized in that: Security identity authentication information used when synchronously transmitting data between a client and a server, the security identity authentication information at least including basic elements, permutation and combination methods, representation methods, replacement algorithms and position selection algorithms, the method comprising: When receiving a network request sent by the client, extracting encrypted transmission data from the network request; Obtaining several basic elements of the client; Combining the basic elements in the permutation and combination manner to obtain a composite basic element, and combining the composite basic element with the basic element and / or the composite basic element to obtain a character string; Representing the character string in the representation manner to obtain a target character string; Using the replacement algorithm to replace some characters of the target string to obtain a replacement string; Selecting some characters from the replacement character string as an input source using the position selection algorithm, and generating a signature character string according to the input source; The encrypted transmission data is decrypted and authenticated according to the signature character string to obtain the transmission data.

11. The method according to claim 10, characterized in that The method is applied to a server or an encryptor; when applied to the server, the client and the server communicate directly with each other; when applied to the encryptor, the client and the server communicate through the encryptor; When applied to the encryptor, the client and the server include an authentication certificate assigned by the encryptor to the client; The decrypting and authenticating the encrypted transmission data according to the signature string to obtain the transmission data includes: Receiving the encrypted transmission data sent by the server; The encrypted transmission data is decrypted and authenticated according to the signature string and the authentication certificate to obtain transmission data, and the transmission data is sent to the server.

12. A data transmission device, characterized in that: Security identity authentication information used when synchronously transmitting data between a client and a server, the security identity authentication information at least including basic elements, permutation and combination methods, representation methods, replacement algorithms and position selection algorithms, the device includes: A first acquisition module, used for acquiring several basic elements of the client when the client transmits data to the server; A first combining module, configured to combine the basic elements by using the permutation and combination method to obtain a composite basic element, and to combine the composite basic element with the basic element and / or the composite basic element to obtain a character string; A first representation module, used for representing the character string in the representation mode to obtain a target character string; A first replacement module, used for replacing some characters of the target string with the replacement algorithm to obtain a replacement string; A first position selection module, used to select some characters from the replacement character string as an input source by using the position selection algorithm, and generate a signature character string according to the input source; A signature encryption module is used to sign and encrypt the transmission data according to the signature string to obtain encrypted transmission data, and put the encrypted transmission data into a network request to send the encrypted transmission data to the service through the network request; wherein the execution order and number of the signature and encryption are configurable.

13. A data transmission device, characterized in that: Security identity authentication information used when synchronously transmitting data between a client and a server, the security identity authentication information at least including basic elements, permutation and combination methods, representation methods, replacement algorithms and position selection algorithms, the device includes: an extraction module, configured to extract the encrypted transmission data from the network request when receiving the network request sent by the client, A second acquisition module, used to acquire several basic elements of the client; A second combining module is used to combine the basic elements by using the permutation and combination method to obtain a composite basic element, and to combine the composite basic element with the basic element and / or the composite basic element to obtain a character string; A second representation module, used for representing the character string in the representation mode to obtain a target character string; A second replacement module, used for replacing some characters of the target string with the replacement algorithm to obtain a replacement string; A second position selection module, used to select some characters from the replacement character string as an input source by using the position selection algorithm, and generate a signature character string according to the input source; The decryption module is used to decrypt and authenticate the encrypted transmission data according to the signature string to obtain the transmission data.

14. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1-11 when executing a program stored in a memory.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Encryption method, system and storage medium for ciphertext with policy hiding function

    CN108989339A

  • API request encryption method and device

    CN110611670A

  • Object storage service signature generation method suitable for Flutter application

    CN115459927A

  • Data communication method and communication system

    CN116318691A

  • Data transmission method and device

    CN117499041A