Dynamic key generation and application method and device, electronic equipment and computer program product

By generating dynamic keys and using base addresses, offsets, and fixed values ​​to update dynamic keys, the problem of existing encryption algorithms being easily reproduced and decrypted is solved, and the security of data transmission is enhanced.

CN120342613BActive Publication Date: 2025-10-17PEKING UNIV +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510751389.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-10-17
Estimated Expiration
2045-06-06

AI Technical Summary

Technical Problem

Existing encryption algorithms are easily reproduced and decrypted, and there is a lack of effective solutions.

Method used

By generating a dynamic key, using the base address, offset and fixed value updated in the preset update cycle, combined with the preset key conversion rules, a first dynamic key is generated, and the dynamic key is used for encryption or decryption when the client and the server transmit data.

Benefits of technology

It increases the difficulty of reproducing and decrypting the encryption and decryption algorithms, and enhances the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342613B_ABST
    Figure CN120342613B_ABST
Patent Text Reader

Abstract

The application discloses a dynamic key generation and application method and device, electronic equipment and computer program product. The method comprises the following steps: acquiring an updated base address, offset and fixed value according to a preset update period, wherein the base address and the fixed value are preset variables, and the offset is an update variable updated according to the preset update period; generating a dynamic termination key according to the base address, the offset and the fixed value; and converting the dynamic termination key into a first dynamic key according to a preset key conversion rule, wherein the first dynamic key is used for encrypting or decrypting data transmitted between a client and a server. The application solves the technical problem that the encryption algorithm in the prior art is easy to be reproduced and decrypted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer, in particular, to a dynamic key generation and application method and device, electronic equipment and computer program product. BACKGROUND

[0002] Current data stream encryption mode often uses conventional encryption mode, for example, DES and 3DES derivative, RSA, or AES, and another hash related encryption, for example, md5, sha1, sha128, sha256, etc.

[0003] However, even if the encryption algorithm is written by oneself, it is easy to be decrypted, and if it is a hash algorithm, the client and the server process the ciphertext communication matching, and the response data body will not be hashed, because it is not reversible, the commonly used DES, 3DES encryption data body, RSA re-encryption DEC encrypted data, although the transmission speed is faster, but also easy to reproduce.

[0004] In view of the problem that the encryption algorithm of the prior art is easy to be decrypted, no effective solution has been proposed so far. SUMMARY

[0005] The embodiments of the present application provide a dynamic key generation and application method, device, electronic equipment and computer program product, to at least solve the technical problem that the encryption algorithm of the prior art is easy to be decrypted.

[0006] According to an aspect of the embodiments of the present application, a dynamic key generation method is provided, comprising: acquiring an updated base address, offset and fixed value according to a preset update period, wherein the base address and the fixed value are preset variables, and the offset is an update variable updated according to the preset update period; generating a dynamic termination key according to the base address, the offset and the fixed value; and converting the dynamic termination key into a first dynamic key according to a preset key conversion rule, wherein the first dynamic key is used for encrypting or decrypting data transmitted by a client and a server.

[0007] Optionally, generating a dynamic termination key according to the base address, the offset and the fixed value comprises: determining the sum of the base address and the offset as an intermediate key; and determining the product of the intermediate key and the fixed value as the dynamic termination key.

[0008] Optionally, the method further comprises: obtaining a target font set number code randomly determined by the client, wherein the target font set number code is used to indicate the encoding of a corresponding target font file in a preset font file library, the preset font file library pre-storing a preset number of preset font files and a preset font set number code corresponding to each of the preset font files; converting the target font set number code into a font file set number key conforming to a preset encoding conversion rule according to a preset encoding conversion rule; and splicing the font file set number key and the first dynamic key to obtain a second dynamic key.

[0009] Optionally, after obtaining the target font set number code randomly determined by the client, the method further comprises: obtaining the target font file corresponding to the target font set number code from a plurality of preset font files recorded in the preset font file library; and extracting a conversion rule indicated in the target font file as the preset key conversion rule.

[0010] According to another aspect of the embodiment of the present application, a method for applying a dynamic key is also provided, comprising: obtaining the first dynamic key by using the method for generating a dynamic key; generating a data query request by a client; and encrypting the data query request by using the first dynamic key in a normal order as a first key in a target key rule to obtain an encrypted query request.

[0011] Optionally, the method further comprises: receiving an encrypted query result returned by a server through the client, wherein the server is used to generate the encrypted query result in response to the encrypted query request sent by the client; and decrypting the encrypted query result by using the first dynamic key in a reverse order as a second key in the target key rule to obtain a data query result corresponding to the data query request.

[0012] Optionally, the method further comprises: obtaining a font file set number key randomly determined by the client, wherein the font file set number key is obtained by converting a target font set number code by using a preset encoding conversion rule, the target font set number code is a preset font set number code corresponding to a target font file randomly selected by the client in a preset font file library, the preset font file library pre-storing a preset number of preset font files and the preset font set number code corresponding to each of the preset font files; and splicing the font file set number key and the encrypted query request to obtain a spliced query request.

[0013] Optionally, the method further comprises: receiving, by the client, a spliced query result returned by the server, wherein the spliced query result comprises a spliced font file set number feedback key and an encrypted query result, the server is configured to respond to the encrypted query request in the spliced query request, generate the encrypted query result, and use the font file set number key in the spliced query request responded by the server as the font file set number feedback key for splicing with the encrypted query result; performing consistency comparison on a first set number key and a second set number key, wherein the first set number key is the font file set number key in the spliced query request sent by the client, and the second set number key is the font file set number feedback key in the spliced query result received by the client; in the case that the first set number key and the second set number key are consistent, using the reverse order of the first dynamic key as a second key in the target key rule to decrypt the encrypted query result to obtain a data query result corresponding to the data query request.

[0014] According to another aspect of the embodiments of the present application, a method for applying a dynamic key is also provided, comprising: obtaining the first dynamic key by using the method for generating a dynamic key; receiving, by the server, an encrypted query request sent by the client; and decrypting the encrypted query request by using the normal order of the first dynamic key as a first key in the target key rule to obtain a data query request generated by the client.

[0015] Optionally, the method further comprises: generating, by the server, a data query result in response to the data query request; and encrypting the data query result by using the reverse order of the first dynamic key as a second key in the target key rule to obtain an encrypted query result in response to the encrypted query request.

[0016] Optionally, the method further comprises: receiving a spliced query request sent by the client, wherein the spliced query request comprises a spliced font file set number key and the encrypted query request, the font file set number key is obtained by converting a target font set number code by using a preset conversion rule, the target font set number code is a preset font set number code corresponding to a target font file randomly selected by the client in a preset font file library, the preset font file library has preset font files of preset set numbers and the preset font set number codes corresponding to each of the preset font files in advance; and splicing, by the server, the font file set number feedback key in the spliced query request with the encrypted query result generated by the server in response to the encrypted query request in the same spliced query request to obtain a spliced query result.

[0017] According to another aspect of the embodiments of the present application, a dynamic key generation device is also provided, comprising: an obtaining module, configured to obtain an updated base, offset and fixed value according to a preset update period, wherein the base and the fixed value are preset variables, and the offset is an update variable updated according to the preset update period; a generating module, configured to generate a dynamic termination key according to the base, the offset and the fixed value; and a converting module, configured to convert the dynamic termination key into a first dynamic key according to a preset key conversion rule, wherein the first dynamic key is used to encrypt or decrypt data transmitted between a client and a server.

[0018] According to another aspect of the embodiments of the present application, a dynamic key application device is also provided, comprising: a client obtaining module, configured to obtain the first dynamic key by using the dynamic key generation device; a client generating module, configured to generate a data query request by a client; and a client encryption module, configured to encrypt the data query request by using a positive sequence of the first dynamic key as a first key in a target key rule, to obtain an encrypted query request.

[0019] According to another aspect of the embodiments of the present application, a dynamic key application device is also provided, comprising: a service end obtaining module, configured to obtain the first dynamic key by using the dynamic key generation device; a service end receiving module, configured to receive an encrypted query request sent by a client by a service end; and a service end decryption module, configured to decrypt the encrypted query request by using a positive sequence of the first dynamic key as a first key in a target key rule, to obtain the data query request generated by the client.

[0020] According to another aspect of the embodiments of the present application, an electronic device is also provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the dynamic key generation method or the dynamic key application method by using the computer program.

[0021] According to another aspect of the embodiments of the present application, a computer program product is also provided, comprising computer instructions, which, when executed by a processor, implement the dynamic key generation method or the dynamic key application method.

[0022] The first dynamic key used for encrypting or decrypting the data transmitted by the client and the server in the above-mentioned embodiments of the present application is determined based on the base address, the offset, and the fixed value. Since the base address and the fixed value are preset variables and the offset is an updated variable updated according to a preset update period, the first dynamic key can be updated by updating the offset, and then the first dynamic key updated according to the preset update period is used for encryption, so that the technical effect of improving the difficulty of reproducing decryption of the encryption and decryption algorithm is achieved, and thus the technical problem that the encryption algorithm in the prior art is easy to reproduce decryption is solved. BRIEF DESCRIPTION OF DRAWINGS

[0023] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application. In the drawings:

[0024] Figure 1 is a flowchart of a dynamic key generation method according to an embodiment of the present application;

[0025] Figure 2 is a flowchart of a dynamic key application method according to an embodiment of the present application Figure 1 ;

[0026] Figure 3 is a flowchart of a dynamic key application method according to an embodiment of the present application Figure 2 ;

[0027] Figure 4 is a schematic diagram of a preset font file library according to an embodiment of the present application;

[0028] Figure 5 is a schematic diagram of a client / web transmitting data to a server according to an embodiment of the present application;

[0029] Figure 6 is a schematic diagram of a server receiving parameter data submitted by a client / web according to an embodiment of the present application;

[0030] Figure 7 is a schematic diagram of a dynamic key generation device according to an embodiment of the present application;

[0031] Figure 8 is a schematic diagram of a dynamic key application device according to an embodiment of the present application Figure 1 ;

[0032] Figure 9 is a schematic diagram of a dynamic key application device according to an embodiment of the present application Figure 2 ;

[0033] Figure 10 is a structural block diagram of a computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the personnel in the technical field better understand the present application scheme, the technical scheme in the embodiment of the present application will be described clearly and completely in combination with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, not all. Based on the embodiment in the present application, all other embodiments obtained by the person skilled in the art without creative labor should belong to the scope of protection of the present application.

[0035] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0036] According to an embodiment of the present application, an embodiment of a dynamic key generation method is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.

[0037] Figure 1 is a flowchart of a dynamic key generation method according to an embodiment of the present application, as shown in Figure 1 The method comprises the following steps:

[0038] Step S102, according to the preset update period, obtaining the updated base address, offset and fixed value, wherein the base address and fixed value are preset variables, and the offset is an update variable updated according to the preset update period;

[0039] Step S104, generating a dynamic termination key according to the base address, offset and fixed value;

[0040] Step S106, according to the preset key conversion rule, converting the dynamic termination key into a first dynamic key, wherein the first dynamic key is used to encrypt or decrypt the data transmitted between the client and the server.

[0041] The first dynamic key used for encrypting or decrypting the data transmitted by the client and the server in the above embodiments is determined based on the base, the offset, and the fixed value. Since the base and the fixed value are preset variables and the offset is an updated variable updated according to a preset update period, the first dynamic key can be updated by updating the offset, and then the data is encrypted by using the first dynamic key updated according to the preset update period, so that the technical effect of improving the difficulty of reproducing decryption of the encryption and decryption algorithm is achieved, and the technical problem that the encryption algorithm in the prior art is easy to reproduce decryption is solved.

[0042] In the above step S102, the preset update period can be one day.

[0043] In the above step S102, the offset can be a difference value for the set value. For example, the set value can be a preset date, and the offset can be a deviation number of days from the preset date.

[0044] For example, the preset date is 2024.11.13, and the current date is 2024.11.19, so the amount of offset is 6.

[0045] In the above step S102, the base and the fixed value can be changeable variables that are preselected. The variable values of the base and the fixed value can be different, and the base and the fixed value can be updated according to a preset update period.

[0046] In the above step S104, the dynamic termination key can be a combination of the base, the offset, and the fixed value.

[0047] In the above step S106, the first dynamic key can be a result of converting the dynamic termination key according to a preset key conversion rule. By converting the dynamic termination key according to the preset key conversion rule, the complexity of the key can be further improved, and the difficulty of reproducing decryption of the encryption algorithm is improved.

[0048] In the above step S106, the preset key conversion rule can convert the dynamic termination key into a specific form of string, such as a hash string.

[0049] For example, when the dynamic termination key is 6880965, the first dynamic key (FKey) obtained by converting the dynamic termination key is FKey = ef73f68aed96ed96f89ceb1ef68aeedd.

[0050] As an optional embodiment, generating the dynamic termination key according to the base address, the offset and the fixed value comprises: determining the sum of the base address and the offset as an intermediate key; and determining the product of the intermediate key and the fixed value as the dynamic termination key.

[0051] The above embodiments of the present application can improve the complexity of generating the dynamic termination key by combining the base address, the offset and the fixed value through addition operation and multiplication operation, and further improve the difficulty of reproducing decryption of the encryption algorithm.

[0052] Optionally, (base address+offset)*fixed value=dynamic termination key.

[0053] For example, the base address is 99, the offset is 6, and the fixed value is 65533, and then the dynamic termination key (DKey) is: DKey=(99+6)*65533=6880965.

[0054] As an optional embodiment, the method further comprises: obtaining a target font set number code randomly determined by the client, wherein the target font set number code is used to indicate the encoding of the corresponding target font file in a preset font file library, the preset font file library pre-stores a preset number of preset font files and a preset font set number code corresponding to each preset font file; converting the target font set number code into a font file set number key conforming to a preset length according to a preset encoding conversion rule; and splicing the font file set number key and the first dynamic key to obtain a second dynamic key.

[0055] The above embodiments of the present application pre-store a preset number of preset font files in the preset font file library, each preset font file is pre-provided with a corresponding preset font set number code, and then the client can randomly select a preset font file in the preset font file library to obtain a target font file, the preset font set number code corresponding to the target font file is the target font set number code, and then the font file set number key can be obtained by converting the target font set number code according to the preset encoding conversion rule, and the complexity of the key can be improved by combining the first dynamic key and the font file set number key, and the difficulty of reproducing decryption of the encryption algorithm is further improved.

[0056] Optionally, converting the target font set number code into a font file set number key conforming to a preset length according to a preset encoding conversion rule comprises: converting the target font set number code according to the preset encoding conversion rule to obtain a target font conversion string; and obtaining the font file set number key by intercepting a string conforming to the preset length in the target font conversion string.

[0057] Optionally, the preset length can be 4 bits, such as 4 character bits.

[0058] Optionally, the preset encoding conversion rule can be the same as the preset key conversion rule.

[0059] Optionally, the preset encoding conversion rule can be different from the preset key conversion rule.

[0060] Optionally, the content recorded in the preset font file can be a font conversion rule, and in the case where the preset encoding conversion rule is different from the preset key conversion rule, the converted font conversion rule in the preset font file can be used as the preset key conversion rule.

[0061] As an optional embodiment, after obtaining the target font set number encoding randomly determined by the client, the method further includes: obtaining a target font file corresponding to the target font set number encoding from a plurality of preset font files recorded in a preset font file library; and extracting the conversion rule indicated in the target font file as the preset key conversion rule.

[0062] The above embodiments of the application use the conversion rule indicated in the target font file as the preset key conversion rule, and convert the target font set number encoding corresponding to the target font file into a font file set number key, and combine the first dynamic key to obtain the second dynamic key, which can improve the complexity of the key and further improve the difficulty of the encryption algorithm to be decrypted.

[0063] According to the embodiments of the application, a method for applying a dynamic key is provided. It should be noted that the steps shown in the flowchart can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0064] Figure 2 is a flowchart of a method for applying a dynamic key according to an embodiment of the application Figure 1 As shown in Figure 2 the method includes the following steps:

[0065] Step S202, using the above-mentioned method for generating a dynamic key, obtaining a first dynamic key;

[0066] Step S204, generating a data query request by a client;

[0067] Step S206, using the first dynamic key in the target key rule as the first key, encrypting the data query request to obtain an encrypted query request.

[0068] In the above embodiments of the present application, when the client needs to send a data query request to the server, the client can obtain a first dynamic key generated based on a base address, an offset and a fixed value. Since the base address and the fixed value are preset variables and the offset is an updated variable updated according to a preset update period, the first dynamic key can be updated by updating the offset, and then the first dynamic key is used to obtain a first dynamic key used for encrypting the data query request. The data query request generated by the client can be encrypted to obtain an encrypted query request that is difficult to be decrypted by reproduction, thereby achieving the technical effect of improving the difficulty of decrypting the encryption and decryption algorithm by reproduction, and thereby solving the technical problem that the encryption algorithm in the prior art is easy to be decrypted by reproduction.

[0069] In the above step S206, the client can send a data query request to the server. In order to ensure the transmission security of the data query request, the first dynamic key in the positive order can be used as the key of the data query request for encryption.

[0070] Optionally, the data query request can be combined and encrypted by using the DES algorithm and the RSA algorithm.

[0071] It should be noted that the DES algorithm is a data encryption standard, and the DES algorithm needs to use an initial vector iv and a standard key key.

[0072] Optionally, the target key rule is the DES algorithm, and the first key is an initial vector iv and a standard key key required by the DES algorithm.

[0073] As an optional example, the first dynamic key in the positive order is used as the first key in the target key rule to encrypt the data query request to obtain an encrypted query request, which includes: in the case that the target key rule is the DES algorithm, the first dynamic key in the positive order is used as the initial vector iv and the standard key key required by the DES algorithm to encrypt the data query request to obtain a preset query request; and the preset query request is encrypted by using the RSA algorithm to obtain the encrypted query request.

[0074] Optionally, in the case of decrypting the encrypted query request combined and encrypted by using the DES algorithm and the RSA algorithm, the RSA algorithm can be used to decrypt the encrypted query request to obtain a preset query request; and the first dynamic key in the positive order is used as the initial vector iv and the standard key key required by the DES algorithm to decrypt the preset query request twice, and the data query request originally generated by the client can be obtained.

[0075] As an optional embodiment, the method further comprises: receiving, by the client, the encrypted query result returned by the server, wherein the server is configured to generate the encrypted query result in response to the encrypted query request sent by the client; and decrypting the encrypted query result by using the reverse order of the first dynamic key as the second key in the target key rule, to obtain the data query result corresponding to the data query request.

[0076] In the above embodiments of the application, the server can generate the encrypted query result in response to the encrypted query request sent by the client, and the encrypted query result is the result of encrypting the data query result generated by the server by using the reverse order of the first dynamic key as the second key in the target key rule. Therefore, after receiving the encrypted query result returned by the server, the client can decrypt the encrypted query result by using the reverse order of the first dynamic key as the second key in the target key rule, to obtain the data query result corresponding to the data query request, thereby realizing decryption of the encrypted query result.

[0077] As an optional embodiment, the method further comprises: obtaining a font file set number key randomly determined by the client, wherein the font file set number key is obtained by converting a target font set number code by using a preset encoding conversion rule, the target font set number code is a preset font set number code corresponding to a target font file randomly selected by the client from a preset font file library, the preset font file library pre-stores a preset number of preset font files and a preset font set number code corresponding to each preset font file; and splicing the font file set number key and the encrypted query request to obtain a spliced query request.

[0078] In the above embodiments of the application, when the data query request is generated, the client can also randomly determine the font file set number key, and then when the encrypted query request is generated based on the data query request, the font file set number key can be spliced with the encrypted query request to obtain the spliced query request, thereby improving the complexity of the key and further improving the difficulty of reproducing and decrypting the encryption algorithm.

[0079] Optionally, when the second dynamic key is applied, the second dynamic key comprises: the font file set number key and the first dynamic key, the first dynamic key can be directly extracted from the second dynamic key to encrypt the data query request to obtain the encrypted query request, and the font file set number key can be extracted from the second dynamic key to splice with the encrypted query request to obtain the spliced query request, thereby realizing combination and application of the font file set number key and the first dynamic key in the second dynamic key, thereby improving the complexity of the key and further improving the difficulty of reproducing and decrypting the encryption algorithm.

[0080] As an optional embodiment, the method further comprises: receiving, by the client, a splicing query result returned by the server, wherein the splicing query result comprises a spliced font file set number feedback key and an encrypted query result, the server is configured to respond to the encrypted query request in the splicing query request, generate the encrypted query result, and use the font file set number key in the splicing query request responded by the server as the font file set number feedback key for splicing with the encrypted query result; performing consistency comparison on the first set number key and the second set number key, wherein the first set number key is the font file set number key in the splicing query request sent by the client, and the second set number key is the font file set number feedback key in the splicing query result received by the client; and in the case that the first set number key and the second set number key are consistent, using the reverse order of the first dynamic key as a second key in a target key rule to decrypt the encrypted query result to obtain a data query result corresponding to the data query request.

[0081] In the above embodiments of the application, the font file set number key in the splicing query request is carried in the splicing query result returned by the server based on the splicing query request. The font file set number key carried in the splicing query result can be used as a font file set number feedback key. Then, after receiving the splicing query result returned by the server, the client can use the font file set number key in the splicing query request sent by the client as a first key, use the font file set number feedback key in the splicing query result returned by the server as a second key, perform consistency comparison on the first key and the second key, verify whether the splicing query result returned by the server is a response to the splicing query request sent by the client, and then use the reverse order of the first dynamic key as a second key in a target key rule to decrypt the encrypted query result in the splicing query result to obtain a data query result corresponding to the data query request.

[0082] Figure 3 is a flow of an application method of a dynamic key according to an embodiment of the application Figure 2 As shown in Figure 3 , the method comprises the following steps:

[0083] Step S302, using the above-mentioned dynamic key generation method, a first dynamic key is obtained;

[0084] Step S304, receiving, by the server, an encrypted query request sent by the client;

[0085] Step S306, using the forward order of the first dynamic key as a first key in a target key rule to decrypt the encrypted query request to obtain a data query request generated by the client.

[0086] In the above embodiments of the present application, in the case that the service end receives the encrypted query request sent by the client, the client can obtain the first dynamic key generated based on the base address, the offset and the fixed value. Since the base address and the fixed value are preset variables and the offset is an update variable updated according to a preset update period, the first dynamic key can be updated by updating the offset, and then the first dynamic key is used to obtain the first dynamic key used for encrypting the data query request. The data query request generated by the client can be encrypted to obtain an encrypted query request that is difficult to be decrypted by reproduction, thereby achieving the technical effect of improving the difficulty of reproducing and decrypting the encryption and decryption algorithm, and further solving the technical problem that the encryption algorithm in the prior art is easy to be reproduced and decrypted.

[0087] In the above step S306, the service end can respond to the data query request of the client. Since the data query request is transmitted after being encrypted by the client using the first dynamic key in the normal order as the first key, in order to extract the data query request from the encrypted query request, the service end needs to use the first dynamic key in the normal order as the first key in the target key rule to decrypt the encrypted query request.

[0088] As an optional embodiment, the method further includes: generating, by the service end in response to the data query request, a data query result; and encrypting, by the service end, the data query result using the first dynamic key in the reverse order as the second key in the target key rule to obtain an encrypted query result in response to the encrypted query request.

[0089] In the above embodiments of the present application, the service end can respond to the data query request to generate a data query result, and the data query result generated by the service end can be encrypted before being transmitted to the client. Then, the service end can use the first dynamic key in the reverse order as the second key in the target key rule to encrypt the data query result, so that the client and the service end use the first dynamic key in the normal order and the reverse order as the key respectively, which can improve the complexity of the key and further improve the difficulty of reproducing and decrypting the encryption algorithm.

[0090] As an optional example, encrypting the data query result using the first dynamic key in the reverse order as the second key in the target key rule to obtain an encrypted query result in response to the encrypted query request includes: in the case that the target key rule is a DES algorithm, using the first dynamic key in the reverse order as an initial vector iv and a standard key key required by the DES algorithm to encrypt the data query result to obtain a preset query result; and using an RSA algorithm to encrypt the preset query result to obtain the encrypted query result.

[0091] Optionally, in the case of decrypting the encrypted query result encrypted by combining the DES algorithm and the RSA algorithm, the RSA algorithm can be used to decrypt the encrypted query result to obtain a preset query result; and the reverse order of the first dynamic key is used as the initial vector iv and the standard key key required by the DES algorithm to perform secondary decryption on the preset query result, so that the data query result originally generated by the server can be obtained.

[0092] As an optional embodiment, the method further comprises: receiving a spliced query request sent by the client, wherein the spliced query request comprises: a spliced font file set number key and an encrypted query request, the font file set number key is obtained by converting the target font set number code using a preset encoding conversion rule, and the target font set number code is a preset font set number code corresponding to a target font file randomly selected by the client in a preset font file library, the preset font file library pre-stores a preset number of preset font files and a preset font set number code corresponding to each preset font file; and the font file set number key in the spliced query request is used as a font file set number feedback key to splice the encrypted query result generated by the server in response to the encrypted query request in the same spliced query request to obtain a spliced query result.

[0093] In the above embodiments of the application, the data query request sent by the client can be an encrypted encrypted query request, which can also carry a font file set number key generated by the client in advance, that is, the server can receive a spliced query request sent by the client, which splices the font file set number key and the encrypted query request, and then the server can decrypt the encrypted query request in the spliced query request to obtain a data query request, and respond to the data query request to generate a data query result, and then the server can encrypt the data query result to obtain an encrypted query result, and splice the font file set number key in the spliced query request as a font file set number feedback key with the encrypted query result to obtain a spliced query result, and then the server can send the spliced query result to the client to realize encrypted transmission of the data query result.

[0094] In the above embodiments of the application, the font file set number feedback key carried in the spliced query result returned by the server is the font file set number key in the spliced query request responded by the server, and then in the case that the client receives the spliced query result, the font file set number feedback key carried in the spliced query result can be used to detect the consistency with the font file set number key in the spliced query request sent by the client to determine whether the spliced query result is the response result of the spliced query request sent by the client by the server.

[0095] Optionally, the server can obtain the spliced font file set number key in the spliced query request by identifying the spliced query request, the font file set number key is a unique result obtained according to the target font set number coding corresponding to the target font file, so that the target font file can be determined through the font file set number key, and then the preset coding conversion rule of the key can be extracted according to the target font file, and then the server can generate a dynamic termination password after obtaining the base address, offset and fixed value updated according to the preset update period, and the preset coding conversion rule is used to convert the dynamic termination key, and the first dynamic key consistent with the client can be obtained, and then the first dynamic key can be used to decrypt the encrypted query request sent by the client.

[0096] The application also provides a preferred embodiment, which provides a data flow dynamic encryption method, which realizes dynamic update of data flow encryption by adding dynamic values on the basis of maintaining original regular encryption; and through dynamic encryption, the security of data transmission from url to data response data set can be ensured.

[0097] The technical scheme provided by the application sets a base address as a reference quantity, sets an offset, encrypts the data flow in the dynamic nature of the time dimension, sets a fixed value, and the set base address, offset and fixed value can be changed, then the base address, offset and fixed value are combined according to a formula to obtain a dynamic termination key, the combined key is standardized (i.e., converted according to the preset key conversion rule) through multiple sets of random font files to obtain a first dynamic key, and finally a number (such as a font file set number key) is added in front of the standardized one, and then encrypted through the font file.

[0098] Optionally, the number added in front of the standardized one represents that the server has randomly selected the font file set number key, and a string will be obtained, which is the key (such as the font file set number key).

[0099] Optionally, the server locally DES encrypts the id, splices the key, and then performs secondary encryption through the DES key (such as iv and key, i.e., the first dynamic key), and then transmits the RSA encrypted result to the client.

[0100] Optionally, the client obtains the encrypted value, performs RSA decryption, constructs the key through the font file, and then performs DES decryption to obtain the plaintext.

[0101] Optionally, according to the base address, offset and fixed value, the formula for generating the dynamic termination key is (base address + offset) * fixed value = termination address.

[0102] As an optional embodiment, the base address is a changeable variable set as 99, the offset is the offset from the set value, for example, the set value is 2024.11.13, the offset is 6 indicating 2024.11.19, the offset is 7 indicating 2024.11.20, the preset update period of the offset can be 1 day, the fixed value is a changeable variable set as 65533, and the dynamic termination key (DKey) is DKey=(99+6)*65533=6880965.

[0103] Figure 4 is a schematic diagram of a preset font file library according to an embodiment of the present application, as shown in Figure 4 10 sets of preset font files for random extraction are preset, and one set of preset font files is randomly extracted as a target font file.

[0104] Optionally, the 10 sets of preset font files can be pre-encoded (e.g., encoded as 0-9), that is, a preset font set number code corresponding to each preset font file is set, and the set number code can be used to determine which set of preset font files is randomly extracted.

[0105] It should be noted that the purpose of the randomly extracted preset font file is to generate random font encryption.

[0106] As an optional embodiment, as shown in Figure 4 assuming that the third set of font is extracted, then the final dynamic key (i.e., the first dynamic key FKey) is FKey=conversion of the third set of font (the conversion process takes the last four digits)+conversion of DKey.

[0107] Optionally, the conversion of the third set of font (the conversion process takes the last four digits), that is, the conversion result corresponding to the number "3" of the third set is ef73, the conversion result of the dynamic termination key DKey "6880965" (also the first dynamic key) is "f68aed96ed96f89ceb1ef68aeedd", and the second dynamic key FKey is ef73f68aed96ed96f89ceb1ef68aeedd.

[0108] As an optional example, the data transmitted between the client and the server can be first encrypted using the DES algorithm and then twice encrypted using the RSA algorithm.

[0109] Optionally, the encryption principle of the DES algorithm is plaintext+iv+key=ciphertext, and the decryption principle is ciphertext+iv+key=plaintext, where iv and key are keys that can be determined based on the first dynamic key.

[0110] Optionally, the encryption principle of the RSA algorithm is: plaintext + public key = ciphertext; and the decryption principle is: ciphertext + private key = plaintext.

[0111] Optionally, the data transmitted between the client and the server can be a data query request initiated by the client to the server, or a data query result returned by the server to the client.

[0112] Optionally, the data query request sent by the client to the server can be a Get request and a Post request, wherein the logic of the Get request is: submitting the parameter url (followed by the submitted data parameter) to obtain a data set; and the logic of the Post request is: submitting the parameter data to obtain a data set.

[0113] It should be noted that the GET request and the POST request are the two most commonly used request methods in the HTTP protocol, the GET request is used to request data from the server (such as loading a web page, querying a result), and the request parameters are usually attached after the URL; the POST request is used to send data to the server (such as submitting a form, uploading a file), and the request parameters are contained in the request body, and the URL is not visible.

[0114] As an optional example, the overall encryption logic is: first, generate a second dynamic key FKey, and then encrypt the data to be encrypted by DES, wherein if it is a request parameter data (such as a data query request), the iv value and the key value (i.e., the first key) are encrypted using the second dynamic key FKey generated from the fifth bit, and if it is a data body result set transmission (such as a data query result), the iv value and the key value (i.e., the second key) are encrypted using the reverse order of the second dynamic key FKey up to the fifth last bit (i.e., the reverse order of the first dynamic key); after encryption, RSA is used for secondary encryption to obtain the final encrypted result ciphertext (such as a spliced query request or a spliced query result).

[0115] As an optional example, the overall decryption logic is: given the second dynamic key FKey, first decrypt the encrypted result (such as a spliced query request or a spliced query result) by RSA, and then decrypt the RSA decryption result by DES twice, wherein if it is a request parameter data (such as a data query request), the iv value and the key value (i.e., the first key) are decrypted using the second dynamic key FKey generated from the fifth bit; and if it is a data body result set transmission (such as a data query result), the iv value and the key value (i.e., the second key) are decrypted using the reverse order of the second dynamic key FKey up to the fifth last bit (i.e., the reverse order of the first dynamic key), to obtain the plaintext (such as a data query request or a data query result).

[0116] Figure 5 is a schematic diagram of a client / web transmitting data to a server according to an embodiment of the present application, as shown in Figure 5 includes the following steps:

[0117] Step S501, when the client loads a page, first obtains a random set of font files (such as target font files) through obfuscation, for example, the third set of files and a set of corresponding sets of digital font files (such as target font set number coding), saved through a variable, and obtains a final value of a number after offset, that is, the offset is 6, the fixed value is 65533, and the base address is 99, which are saved in different places using obfuscated variables.

[0118] Step S502, the dynamic termination key of the day is obtained through the obfuscated variable formula: (99+6)*65533=6880965.

[0119] Step S503, the first dynamic key DKey of today is obtained by reading the target font file: f68aed96ed96f89ceb1ef68aeedd.

[0120] Step S504, the number of font file sets (such as target font set number coding) is obtained through the corresponding set of digital font files, and the font file set number key is: ef73.

[0121] Step S505, the final dynamic key (that is, the second dynamic key FKey) of today is obtained by combining: ef73f68aed96ed96f89ceb1ef68aeedd.

[0122] Step S506, the client constructs the parameter data (such as data query request) required to request the server, and encrypts the data using DES, wherein the key and iv of DES encryption (that is, the first key) use the second dynamic key FKey of today, and the first dynamic key is in normal order from the fifth bit, and 0 is added if the length is not enough.

[0123] Step S507, the DES-encrypted data (such as a preset query request) is encrypted again using RSA.

[0124] Step S508, the client submits the ciphertext of the final parameter (such as an encrypted query request or a spliced query request) to the server.

[0125] Figure 6 is a schematic diagram of a server receiving parameter data submitted by a client / web according to an embodiment of the present application, as shown in Figure 6 includes the following steps:

[0126] Step S601, the service end automatically generates the dynamic termination key of the day through the base, offset, fixed value every day; the service end receives the parameter ciphertext (such as splicing query request) submitted by the client, and simultaneously takes the first 4 bits (such as font file set number key) to decrypt through the corresponding set number of digital font file, determines the font encryption file set number of digital (such as target font set number code) to be used, reads the corresponding set number, converts the dynamic termination key of the day into the first dynamic key DKey, and finally obtains the second dynamic key FKey = font file set number ciphertext (such as font file set number key) + DKey.

[0127] Step S602, decrypted by RSA.

[0128] Step S603, decrypted by DES for the second time, wherein the key of DES and iv are supplemented with 0 (that is, the first dynamic key in the normal order) from the fifth bit of the second dynamic key DKey of the day.

[0129] Step S604, the service end obtains the final plaintext of the client (such as data query request).

[0130] Step S605, respond to the data (such as generate encrypted query result, or splicing query result) required by the client parameter.

[0131] As an optional example, the service end transmits data, including the following steps:

[0132] Step S611, the service end responds to the data required by the client parameter.

[0133] It should be noted that the plaintext (such as data query request) transmitted by the client has been obtained at this time.

[0134] Step S612, the data (such as data query result) to be responded to the client is encrypted by DES through the second dynamic key FKey in the parameter data (such as splicing query request) submitted by the client / web received by the service end (such as data query result), and the iv value and the key value of DES encryption are encrypted by the reverse order of the generated second dynamic key FKey up to the fifth last bit (such as the reverse order of the first dynamic query key).

[0135] Step S613, the encrypted result is further encrypted by RSA.

[0136] Step S614, the font file set number ciphertext (such as font file set number key, that is, font file set number feedback key) in the parameter data (such as splicing query request) received by the server from the client / web is spliced in front of the obtained ciphertext (such as encrypted query result), that is, font file set number ciphertext (such as font file set number feedback key) + encrypted ciphertext (such as encrypted query result) = final ciphertext (such as splicing query result).

[0137] Step S615, the final ciphertext (such as splicing query result) is transmitted to the client.

[0138] As an optional example, the client / web receives data, including the following steps:

[0139] Step S511, the client receives the final ciphertext (such as splicing query result) transmitted by the server.

[0140] Step S512, by reading the first four bits of the final ciphertext (such as font file set number feedback key), the font file (such as font file set number key) loaded by the client is compared, and if it is inconsistent, the data response is invalid.

[0141] Step S513, if consistent, then decrypted by RSA.

[0142] Step S514, decrypted by DES twice, wherein the key and iv value of DES are decrypted using the reverse order of FKey in the data (such as splicing query request) transmitted by the client / web to the server up to the fifth last bit (such as the reverse order of the first dynamic key) to fill 0 (such as the first dynamic key).

[0143] Step S515, the final data result set plaintext (such as data query result) is obtained and given to the user.

[0144] Compared with conventional encryption, the technical scheme provided by the application has higher security for dynamic encryption data stream, makes it more complex to reproduce and restore, and the base address, offset and fixed value in the application can be changed without affecting all encryption / decryption logic, but after changing, it can increase the tedious processing of data duplication and other operations after stealing data under large amount of data, further protect data privacy and leakage.

[0145] The technical scheme provided by the application has more complex dynamic key than fixed key, which greatly improves the protection of restoration and theft, and through the combination of hot encryption, even for large text data, it does not affect the server performance.

[0146] The technical solution provided in this application can automatically change the base address, fixed value and offset through periodic changes, which will not affect the business interaction results and data transmission results. However, it will greatly increase the difficulty of information theft. In the case of large data volumes, the difficulty of stealing the entire amount of data will also become complicated due to the change of the base address, fixed value and offset. If there is a data leak, it can also ensure that the degree of data leakage is minimized.

[0147] According to an embodiment of the present invention, an embodiment of a dynamic key generation device is also provided. It should be noted that the dynamic key generation device can be used to execute the dynamic key generation method in the embodiment of the present invention, and the dynamic key generation method in the embodiment of the present invention can be executed in the dynamic key generation device.

[0148] Figure 7 is a schematic diagram of a device for generating a dynamic key according to an embodiment of the present invention, such as Figure 7 As shown, the device may include: an acquisition module 72, used to obtain an updated base address, offset and fixed value according to a preset update cycle, wherein the base address and fixed value are pre-set preset variables, and the offset is an update variable updated according to a preset update cycle; a generation module 74, used to generate a dynamic termination key based on the base address, offset and fixed value; a conversion module 76, used to convert the dynamic termination key into a first dynamic key according to a preset key conversion rule, wherein the first dynamic key is used to encrypt or decrypt data transmitted between the client and the server.

[0149] It should be noted that the acquisition module 72 in this embodiment can be used to execute step S102 in the embodiment of the present application, the generation module 74 in this embodiment can be used to execute step S104 in the embodiment of the present application, and the conversion module 76 in this embodiment can be used to execute step S106 in the embodiment of the present application. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments.

[0150] In the above-mentioned embodiment of the present application, the first dynamic key used to encrypt or decrypt data transmitted between the client and the server is determined based on the base address, the offset and the fixed value, and since the base address and the fixed value are pre-set variables, and the offset is an update variable updated according to a preset update cycle, the first dynamic key can be updated by updating the offset, and then the first dynamic key updated according to the preset update cycle can be used for encryption, thereby achieving the technical effect of increasing the difficulty of the encryption and decryption algorithm to be reproduced and decrypted, thereby solving the technical problem that the encryption algorithm of the prior art is easily reproduced and decrypted.

[0151] As an optional embodiment, the generating module comprises: a first determining unit configured to determine the sum of the base address and the offset as an intermediate key; and a second determining unit configured to determine the product of the intermediate key and a fixed value as the dynamic termination key.

[0152] As an optional embodiment, the apparatus further comprises: an obtaining sub-module configured to obtain a target font set number code randomly determined by the client, wherein the target font set number code is used to indicate the encoding of the corresponding target font file in a preset font file library, the preset font file library pre-storing a preset number of preset font files and a preset font set number code corresponding to each preset font file; a conversion sub-module configured to convert the target font set number code into a font file set number key conforming to a preset encoding conversion rule; and a concatenating sub-module configured to concatenate the font file set number key and the first dynamic key to obtain the second dynamic key.

[0153] As an optional embodiment, the apparatus further comprises: an obtaining sub-unit configured to obtain, after obtaining the target font set number code randomly determined by the client, a target font file corresponding to the target font set number code from a plurality of preset font files recorded in the preset font file library; and an extracting sub-unit configured to extract the conversion rule indicated in the target font file as the preset key conversion rule.

[0154] According to an embodiment of the present application, an application apparatus of a dynamic key is further provided. It should be noted that the application apparatus of the dynamic key can be used to execute the application method of the dynamic key in the embodiment of the present application, and the application method of the dynamic key in the embodiment of the present application can be executed in the application apparatus of the dynamic key.

[0155] Figure 8 is a schematic diagram of an application apparatus of a dynamic key according to an embodiment of the present application Figure 1 As shown in Figure 8 the apparatus can comprise: a client obtaining module 82 configured to obtain the first dynamic key by using the above-mentioned generating apparatus of the dynamic key; a client generating module 84 configured to generate a data query request by the client; and a client encrypting module 86 configured to encrypt the data query request by using the positive order of the first dynamic key as the first key in the target key rule to obtain an encrypted query request.

[0156] It should be noted that the client obtaining module 82 in the embodiment can be used to execute the step S202 in the embodiment of the present application, the client generating module 84 in the embodiment can be used to execute the step S204 in the embodiment of the present application, and the client encrypting module 86 in the embodiment can be used to execute the step S206 in the embodiment of the present application. The above-mentioned modules and the examples and application scenarios realized by the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiments.

[0157] In the above embodiments of the present application, when the client needs to send a data query request to the server, the client can obtain a first dynamic key generated based on a base address, an offset and a fixed value. Since the base address and the fixed value are preset variables and the offset is an update variable updated according to a preset update period, the first dynamic key can be updated by updating the offset. Then, the first dynamic key is used to obtain a first dynamic key for encrypting the data query request. The data query request generated by the client can be encrypted to obtain an encrypted query request that is difficult to be decrypted by reproduction, thereby achieving the technical effect of improving the difficulty of decrypting the encryption and decryption algorithm by reproduction, and further solving the technical problem that the encryption algorithm in the prior art is easy to be decrypted by reproduction.

[0158] As an optional embodiment, the apparatus further includes: a client first receiving submodule configured to receive, by the client, an encrypted query result returned by the server, wherein the server is configured to generate the encrypted query result in response to the encrypted query request sent by the client; and a client first decryption submodule configured to use a reverse order of the first dynamic key as a second key in a target key rule to decrypt the encrypted query result to obtain a data query result corresponding to the data query request.

[0159] As an optional embodiment, the apparatus further includes: a client obtaining submodule configured to obtain a font file set number key randomly determined by the client, wherein the font file set number key is obtained by converting a target font set number code using a preset encoding conversion rule, the target font set number code is a preset font set number code corresponding to a target font file randomly selected by the client from a preset font file library, and the preset font file library pre-stores a preset number of preset font files and a preset font set number code corresponding to each preset font file; and a client concatenating submodule configured to concatenate the font file set number key and the encrypted query request to obtain a concatenated query request.

[0160] As an optional embodiment, the device also includes: a second receiving submodule of the client, which is used to receive the splicing query result returned by the server through the client, wherein the splicing query result includes: a spliced ​​font file set feedback key and an encrypted query result, and the server is used to respond to the encrypted query request in the splicing query request, generate an encrypted query result, and use the font file set key in the splicing query request responded by the server as the font file set feedback key spliced ​​with the encrypted query result; a client comparison submodule, which is used to perform a consistency comparison between the first set key and the second set key, wherein the first set key is the font file set key in the splicing query request issued by the client, and the second set key is the font file set feedback key in the splicing query result received by the client; a second decryption submodule of the client, which is used to use the reverse order of the first dynamic key as the second key in the target key rule to decrypt the encrypted query result when the first set key and the second set key are consistent, so as to obtain a data query result corresponding to the data query request.

[0161] Figure 9 This is a schematic diagram of a dynamic key application device according to an embodiment of the present invention. Figure 2 ,like Figure 9 As shown, the device may include: a server-side acquisition module 92, used to use the above-mentioned dynamic key generation device to obtain a first dynamic key; a server-side receiving module 94, used to receive an encrypted query request issued by a client through the server; a server-side decryption module 96, used to use the positive sequence of the first dynamic key as the first key in the target key rule to decrypt the encrypted query request to obtain a data query request generated by the client.

[0162] It should be noted that the server-side acquisition module 92 in this embodiment can be used to execute step S302 in the embodiment of the present application, the server-side receiving module 94 in this embodiment can be used to execute step S304 in the embodiment of the present application, and the server-side decryption module 96 in this embodiment can be used to execute step S306 in the embodiment of the present application. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments.

[0163] In the above embodiments of the present application, when the service end receives the encrypted query request sent by the client, the client can obtain the first dynamic key generated based on the base address, the offset and the fixed value. Since the base address and the fixed value are preset variables and the offset is an update variable updated according to a preset update period, the first dynamic key can be updated by updating the offset, and then the first dynamic key is used to obtain the first dynamic key used for encrypting the data query request. The data query request generated by the client can be encrypted to obtain an encrypted query request that is difficult to be decrypted by reproduction, thereby achieving the technical effect of improving the difficulty of decrypting the encryption and decryption algorithm by reproduction, and further solving the technical problem that the encryption algorithm in the prior art is easy to be decrypted by reproduction.

[0164] As an optional embodiment, the apparatus further comprises: a service end generation submodule, configured to generate a data query result by the service end in response to the data query request; and a service end encryption submodule, configured to encrypt the data query result using the reverse order of the first dynamic key as a second key in a target key rule to obtain an encrypted query result in response to the encrypted query request.

[0165] As an optional embodiment, the apparatus further comprises: a service end receiving submodule, configured to receive a spliced query request sent by the client, wherein the spliced query request comprises a spliced font file set number key and the encrypted query request, the font file set number key is obtained by converting the target font set number code using a preset encoding conversion rule, the target font set number code is a preset font set number code corresponding to a target font file randomly selected by the client in a preset font file library, and the preset font file library pre-stores a preset number of preset font files and a preset font set number code corresponding to each preset font file; and a service end splicing submodule, configured to splice the font file set number key in the spliced query request as a font file set number feedback key with the encrypted query result generated by the service end in response to the encrypted query request in the same spliced query request to obtain a spliced query result.

[0166] Embodiments of the present application can provide an electronic device, which can be a computer terminal, and the computer terminal can be any one of computer terminal devices in a computer terminal group. Alternatively, in the present embodiment, the above-mentioned computer terminal can also be replaced by a terminal device such as a mobile terminal.

[0167] Alternatively, in the present embodiment, the above-mentioned computer terminal can be located in at least one network device of a plurality of network devices of a computer network.

[0168] In the embodiment, the computer terminal can execute program codes of the following steps in the dynamic key generation method: obtaining an updated base, an offset and a fixed value according to a preset update period, wherein the base and the fixed value are preset variables, and the offset is an update variable updated according to the preset update period; generating a dynamic termination key according to the base, the offset and the fixed value; and converting the dynamic termination key into a first dynamic key according to a preset key conversion rule, wherein the first dynamic key is used for encrypting or decrypting data transmitted between the client and the server.

[0169] In the embodiment, the computer terminal can execute program codes of the following steps in the dynamic key application method: obtaining the first dynamic key by using the dynamic key generation method; generating a data query request by the client; and encrypting the data query request by using a first key in a target key rule as the first dynamic key in a normal order to obtain an encrypted query request.

[0170] In the embodiment, the computer terminal can execute program codes of the following steps in the dynamic key application method: obtaining the first dynamic key by using the dynamic key generation method; receiving the encrypted query request sent by the client by the server; and decrypting the encrypted query request by using the first key in the target key rule as the first dynamic key in the normal order to obtain the data query request generated by the client.

[0171] Figure 10 is a structural block diagram of a computer terminal according to an embodiment of the application, as shown in Figure 10 The computer terminal 1000 can include one or more (only one is shown in the figure) processors 1002 and a memory 1004.

[0172] The memory can be used to store software programs and modules, such as program instructions / modules corresponding to the dynamic key generation method and device and the dynamic key application method and device in the embodiments of the application. The processor executes various functions, applications and data processing by running the software programs and modules stored in the memory, that is, implements the dynamic key generation and application methods described above. The memory can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged relative to the processor, which can be connected to the terminal 1000 through a network. Examples of the network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0173] The processor can call information and application programs stored in the memory through the transmission device to execute the following steps: obtaining an updated base address, offset and fixed value according to a preset update period, wherein the base address and the fixed value are preset variables, and the offset is an update variable updated according to the preset update period; generating a dynamic termination key according to the base address, the offset and the fixed value; and converting the dynamic termination key into a first dynamic key according to a preset key conversion rule, wherein the first dynamic key is used for encrypting or decrypting data transmitted between the client and the server.

[0174] Optionally, the processor can further execute program codes of the following steps: determining a sum of the base address and the offset as an intermediate key; and determining a product of the intermediate key and the fixed value as the dynamic termination key.

[0175] Optionally, the processor can further execute program codes of the following steps: obtaining a target font set number code randomly determined by the client, wherein the target font set number code is used to indicate an encoding of a corresponding target font file in a preset font file library, the preset font file library pre-stores a preset number of preset font files and a preset font set number code corresponding to each preset font file; converting the target font set number code into a font file set number key conforming to a preset length according to a preset encoding conversion rule; and splicing the font file set number key and the first dynamic key to obtain a second dynamic key.

[0176] Optionally, the processor can further execute program codes of the following steps: obtaining a target font file corresponding to the target font set number code from a plurality of preset font files recorded in the preset font file library; and extracting a conversion rule indicated in the target font file as the preset key conversion rule.

[0177] The processor can call information and application programs stored in the memory through the transmission device to execute the following steps: obtaining the first dynamic key by using the above-mentioned dynamic key generation method; generating a data query request through the client; and encrypting the data query request by using a positive order of the first dynamic key as a first key in a target key rule to obtain an encrypted query request.

[0178] Optionally, the processor can further execute program codes of the following steps: receiving an encrypted query result returned by the server through the client, wherein the server is used to respond to the encrypted query request issued by the client to generate the encrypted query result; and decrypting the encrypted query result by using a reverse order of the first dynamic key as a second key in the target key rule to obtain a data query result corresponding to the data query request.

[0179] Optionally, the processor can further execute program codes of the following steps: obtaining a font file set number key randomly determined by the client, wherein the font file set number key is obtained by converting a target font set number code using a preset conversion rule, the target font set number code is a preset font set number code corresponding to a target font file randomly selected by the client from a preset font file library, the preset font file library pre-stores preset font files of preset set numbers and preset font set number codes corresponding to each preset font file; and splicing the font file set number key and the encrypted query request to obtain a spliced query request.

[0180] Optionally, the processor can further execute program codes of the following steps: receiving, by the client, a spliced query result returned by the server, wherein the spliced query result includes a spliced font file set number feedback key and an encrypted query result, the server is configured to respond to the encrypted query request in the spliced query request, generate the encrypted query result, and use the font file set number key in the spliced query request responded by the server as the font file set number feedback key for splicing with the encrypted query result; performing consistency comparison on a first set number key and a second set number key, wherein the first set number key is the font file set number key in the spliced query request sent by the client, and the second set number key is the font file set number feedback key in the spliced query result received by the client; and in the case that the first set number key and the second set number key are consistent, using a reverse order of the first dynamic key as a second key in a target key rule to decrypt the encrypted query result to obtain a data query result corresponding to the data query request.

[0181] The processor can call information and application programs stored in the memory through the transmission device to execute the following steps: obtaining a first dynamic key using the generation method of the dynamic key; receiving, by the server, an encrypted query request sent by the client; and using a forward order of the first dynamic key as a first key in a target key rule to decrypt the encrypted query request to obtain a data query request generated by the client.

[0182] Optionally, the processor can further execute program codes of the following steps: generating, by the server, a data query result in response to the data query request; and using a reverse order of the first dynamic key as a second key in a target key rule to encrypt the data query result to obtain an encrypted query result in response to the encrypted query request.

[0183] Optionally, the processor can further execute program codes of the following steps: receiving a splicing query request sent by the client, wherein the splicing query request comprises a spliced font file set number key and an encrypted query request, the font file set number key is obtained by converting the target font set number code using a preset encoding conversion rule, the target font set number code is a preset font set number code corresponding to a target font file randomly selected by the client in a preset font file library, the preset font file library pre-stores preset font files of preset set numbers and preset font set number codes corresponding to each preset font file; and splicing the font file set number key in the splicing query request as a font file set number feedback key with an encrypted query result generated by the server in response to the encrypted query request in the same splicing query request to obtain a splicing query result.

[0184] Those skilled in the art can understand that, Figure 10 The structure shown is only schematic, and the computer terminal can also be a smart phone (such as , a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and other terminal devices. Figure 10 It does not limit the structure of the electronic device. For example, the computer terminal 1000 can further include more or fewer components (such as a network interface, a display device, etc.) than those shown in Figure 10 , or have a different configuration than that shown in Figure 10 .

[0185] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device by the computer program, and the computer program can be stored in a non-volatile medium, which can include a flash disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, etc.

[0186] Embodiments of the application also provide a non-volatile storage medium. Optionally, in the present embodiment, the non-volatile storage medium can be used to save the program codes executed by the dynamic key generation method provided by the above embodiments.

[0187] Optionally, in the present embodiment, the non-volatile storage medium can be located in any one of the computer terminal group in the computer network or in any one of the mobile terminal group.

[0188] Optionally, in the embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining an updated base address, offset and fixed value according to a preset update period, wherein the base address and the fixed value are preset variables, and the offset is an update variable updated according to the preset update period; generating a dynamic termination key according to the base address, the offset and the fixed value; and converting the dynamic termination key into a first dynamic key according to a preset key conversion rule, wherein the first dynamic key is used for encrypting or decrypting data transmitted between the client and the server.

[0189] Optionally, in the embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining a sum of the base address and the offset as an intermediate key; and determining a product of the intermediate key and the fixed value as the dynamic termination key.

[0190] Optionally, in the embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining a target font set number code randomly determined by the client, wherein the target font set number code is used to indicate an encoding of a corresponding target font file in a preset font file library, and the preset font file library has a preset number of preset font files and a preset font set number code corresponding to each preset font file; converting the target font set number code into a font file set number key conforming to a preset length according to a preset encoding conversion rule; and splicing the font file set number key and the first dynamic key to obtain a second dynamic key.

[0191] Optionally, in the embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining a target font file corresponding to the target font set number code from a plurality of preset font files recorded in the preset font file library; and extracting a conversion rule indicated in the target font file as the preset key conversion rule.

[0192] Embodiments of the application also provide a non-volatile storage medium. Optionally, in the embodiment, the non-volatile storage medium can be used to save program code executed by the application method of the dynamic key provided by the above-mentioned embodiments.

[0193] Optionally, in the embodiment, the non-volatile storage medium can be located in any one of a group of computer terminals in a computer network or in any one of a group of mobile terminals.

[0194] Optionally, in the embodiment, the nonvolatile storage medium is configured to store program code for performing the following steps: obtaining the first dynamic key by using the generation method of the dynamic key; generating a data query request by the client; encrypting the data query request by using the first dynamic key as the first key in the target key rule, to obtain an encrypted query request.

[0195] Optionally, in the embodiment, the nonvolatile storage medium is configured to store program code for performing the following steps: receiving the encrypted query result returned by the server by the client, wherein the server is configured to generate the encrypted query result in response to the encrypted query request issued by the client; decrypting the encrypted query result by using the reverse order of the first dynamic key as the second key in the target key rule, to obtain the data query result corresponding to the data query request.

[0196] Optionally, in the embodiment, the nonvolatile storage medium is configured to store program code for performing the following steps: obtaining the font file set number key randomly determined by the client, wherein the font file set number key is obtained by converting the target font set number code by using a preset encoding conversion rule, the target font set number code is the preset font set number code corresponding to the target font file randomly selected by the client in the preset font file library, the preset font file library pre-stores a preset number of preset font files and the preset font set number code corresponding to each preset font file; and splicing the font file set number key and the encrypted query request to obtain a spliced query request.

[0197] Optionally, in the embodiment, the nonvolatile storage medium is configured to store program code for performing the following steps: receiving the spliced query result returned by the server by the client, wherein the spliced query result includes the spliced font file set number feedback key and the encrypted query result, the server is configured to generate the encrypted query result in response to the encrypted query request in the spliced query request, and use the font file set number key in the spliced query request responded by the server as the font file set number feedback key for splicing with the encrypted query result; performing consistency comparison on the first set number key and the second set number key, wherein the first set number key is the font file set number key in the spliced query request issued by the client, and the second set number key is the font file set number feedback key in the spliced query result received by the client; and in the case that the first set number key and the second set number key are consistent, decrypting the encrypted query result by using the reverse order of the first dynamic key as the second key in the target key rule, to obtain the data query result corresponding to the data query request.

[0198] Optionally, in the embodiment, the nonvolatile storage medium is configured to store program code for performing the following steps: obtaining the first dynamic key by using the generation method of the dynamic key; receiving the encrypted query request sent by the client through the server; and decrypting the encrypted query request by using the first key in the target key rule as the first key of the first dynamic key, to obtain the data query request generated by the client.

[0199] Optionally, in the embodiment, the nonvolatile storage medium is configured to store program code for performing the following steps: generating the data query result by the server in response to the data query request; and encrypting the data query result by using the reverse order of the first dynamic key as the second key in the target key rule, to obtain the encrypted query result in response to the encrypted query request.

[0200] Optionally, in the embodiment, the nonvolatile storage medium is configured to store program code for performing the following steps: receiving the splicing query request sent by the client, wherein the splicing query request includes: a spliced font file set number key and an encrypted query request, the font file set number key is obtained by converting the target font set number code by using a preset encoding conversion rule, the target font set number code is the preset font set number code corresponding to the target font file randomly selected by the client in a preset font file library, the preset font file library pre-stores preset font files of preset set numbers and preset font set number codes corresponding to each preset font file; and splicing the font file set number key in the splicing query request as the font file set number feedback key with the encrypted query result generated by the server in response to the encrypted query request in the same splicing query request, to obtain the splicing query result.

[0201] The embodiment of the application further provides a computer program product, including a computer program. Optionally, in the embodiment, the computer program is executed by the processor to realize the steps of the generation method of the dynamic key provided in the above-described embodiments, or realize the steps of the application method of the dynamic key provided in the above-described embodiments.

[0202] The above-described serial numbers of the embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0203] In the above-described embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0204] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other manners. For example, the described unit embodiments are merely schematic, and the division of units can be different from the above. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, and electrical or other forms.

[0205] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.

[0206] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can be physically present separately, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0207] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a non-volatile storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a non-volatile storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned non-volatile storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0208] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled persons in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A method for generating a dynamic key, characterized in that: include: According to a preset update cycle, an updated base address, an offset, and a fixed value are obtained, wherein the base address and the fixed value are preset variables, and the offset is an updated variable updated according to the preset update cycle; generating a dynamic termination key according to the base address, the offset and the fixed value; According to a preset key conversion rule, the dynamic termination key is converted into a first dynamic key, wherein the first dynamic key is used to encrypt or decrypt data transmitted between the client and the server; The method further comprises: Obtaining a target font set code randomly determined by the client, wherein the target font set code is used to indicate the code of the corresponding target font file in a preset font file library, wherein the preset font file library pre-stores a preset set of preset font files and a preset font set code corresponding to each preset font file; According to a preset encoding conversion rule, the target font set code is converted into a font file set key with a preset length; The font file set key and the first dynamic key are concatenated to obtain a second dynamic key.

2. The method according to claim 1, characterized in that Generating a dynamic termination key according to the base address, the offset, and the fixed value includes: Determine the sum of the base address and the offset as an intermediate key; The product of the intermediate key and the fixed value is determined as the dynamic termination key.

3. The method according to claim 1, characterized in that After obtaining the target font set code randomly determined by the client, the method further includes: Acquire the target font file corresponding to the target font set code from the plurality of preset font files recorded in the preset font file library; The conversion rule indicated in the target font file is extracted as the preset key conversion rule.

4. A method for applying a dynamic key, characterized in that: include: Using the dynamic key generation method according to any one of claims 1 to 3, obtaining the first dynamic key; Generate data query requests through the client; The data query request is encrypted using the positive sequence of the first dynamic key as the first key in the target key rule to obtain an encrypted query request.

5. The method according to claim 4, characterized in that The method further comprises: Receiving, through the client, an encrypted query result returned by the server, wherein the server is used to respond to the encrypted query request issued by the client and generate the encrypted query result; The encrypted query result is decrypted using the reverse order of the first dynamic key as the second key in the target key rule to obtain a data query result corresponding to the data query request.

6. The method according to claim 5, characterized in that The method further comprises: Obtaining a font file set key randomly determined by the client, wherein the font file set key is obtained by converting a target font set code using a preset code conversion rule, the target font set code is a preset font set code corresponding to a target font file randomly selected by the client in a preset font file library, the preset font file library pre-stores a preset number of preset font files, and the preset font set code corresponding to each of the preset font files; The font file set key and the encrypted query request are concatenated to obtain a concatenated query request.

7. The method according to claim 6, characterized in that The method further comprises: Receiving, via the client, a concatenated query result returned by the server, wherein the concatenated query result includes: a concatenated font file set count feedback key and an encrypted query result; the server responding to the encrypted query request in the concatenated query request, generating the encrypted query result, and using the font file set count key in the concatenated query request responded by the server as the font file set count feedback key for concatenation with the encrypted query result; Performing a consistency comparison between a first set key and a second set key, wherein the first set key is the font file set key in the splicing query request issued by the client, and the second set key is the font file set feedback key in the splicing query result received by the client; When the first set of keys and the second set of keys are consistent, the first dynamic key in reverse order is used as the second key in the target key rule to decrypt the encrypted query result to obtain the data query result corresponding to the data query request.

8. A method for applying a dynamic key, characterized in that: include: Using the dynamic key generation method according to any one of claims 1 to 3, obtaining the first dynamic key; Receive the encrypted query request from the client through the server; The encrypted query request is decrypted using the positive sequence of the first dynamic key as the first key in the target key rule to obtain the data query request generated by the client.

9. The method according to claim 8, characterized in that The method further comprises: Generate a data query result by the server in response to the data query request; The data query result is encrypted using the reverse order of the first dynamic key as the second key in the target key rule to obtain an encrypted query result in response to the encrypted query request.

10. The method according to claim 9, characterized in that The method further comprises: Receive a concatenated query request issued by the client, wherein the concatenated query request includes: a concatenated font file set key and the encrypted query request, the font file set key is obtained by converting a target font set code using a preset code conversion rule, the target font set code is a preset font set code corresponding to a target font file randomly selected by the client in a preset font file library, the preset font file library pre-stores a preset number of preset font files, and the preset font set code corresponding to each of the preset font files; The font file set number key in the splicing query request is used as a font file set number feedback key, and is spliced ​​with the encrypted query result generated by the server in response to the encrypted query request in the same splicing query request to obtain a splicing query result.

11. A device for generating a dynamic key, characterized in that: include: an acquisition module, configured to acquire an updated base address, an offset, and a fixed value according to a preset update cycle, wherein the base address and the fixed value are preset variables, and the offset is an updated variable updated according to the preset update cycle; A generating module, configured to generate a dynamic termination key according to the base address, the offset and the fixed value; a conversion module, configured to convert the dynamic termination key into a first dynamic key according to a preset key conversion rule, wherein the first dynamic key is used to encrypt or decrypt data transmitted between the client and the server; Wherein, the device further includes: an acquisition submodule, configured to acquire a target font set code randomly determined by a client, wherein the target font set code is used to indicate the code of the corresponding target font file in a preset font file library, wherein the preset font file library pre-stores a preset set of preset font files and a preset font set code corresponding to each preset font file; A conversion submodule, configured to convert the target font set code into a font file set key having a preset length according to a preset code conversion rule; The splicing submodule is used to splice the font file set key with the first dynamic key to obtain a second dynamic key.

12. A dynamic key application device, characterized in that: include: A client acquisition module, configured to obtain the first dynamic key using the dynamic key generation device according to claim 11; A client generation module, used to generate data query requests through the client; The client encryption module is configured to encrypt the data query request by using the positive sequence of the first dynamic key as the first key in the target key rule to obtain an encrypted query request.

13. A dynamic key application device, characterized in that: include: a server-side acquisition module, configured to obtain the first dynamic key using the dynamic key generation device according to claim 11; The server receiving module is used to receive the encrypted query request sent by the client through the server; The server-side decryption module is configured to use the positive sequence of the first dynamic key as the first key in the target key rule to decrypt the encrypted query request to obtain the data query request generated by the client.

14. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method for generating a dynamic key according to any one of claims 1 to 3, or execute the method for applying a dynamic key according to any one of claims 4 to 10, through the computer program.

15. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method for generating a dynamic key described in any one of claims 1 to 3 is implemented, or the method for applying a dynamic key described in any one of claims 4 to 10 is implemented.

Citation Information

Patent Citations

  • Intelligent device security access method and system

    CN106330456A

  • Dynamic cipher key acquisition method, dynamic cipher key acquisition device, terminal equipment, and storage medium

    CN108462686A

  • File encryption method and device, system platform and file decryption method

    CN114329568A

  • Key variable generator for an encryption / decryption device

    US4369332A

  • Cryptographic isolator using multiplication

    US6804354B1