Quantum enhanced dynamic key management method based on session identifier
Through the quantum enhanced dynamic key management method based on session identification, using quantum random number generator and RSA asymmetric key technology, the problem of insufficient security and flexibility of the existing encryption mechanism is solved, and high security and automation are achieved. Key management adapts to complex network environments.
Patent Information
- Application Number
- CN202411040589.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-11
AI Technical Summary
Existing encryption mechanisms have problems of low security and poor flexibility. They cannot effectively deal with static key leaks and quantum computing threats, and the dynamic key generation process is not automated and flexible enough.
Adopt a quantum-enhanced dynamic key management method based on session identification, generate a dynamic key through a quantum random number generator, and dynamically encapsulate it in the session identification, combined with RSA asymmetric key encryption and decryption to achieve automatic expiration of the key and automatically generated.
It improves communication security, has the ability to resist quantum attacks, ensures that each communication uses an independent key, reduces the risk of manual intervention and errors, and improves the level of information security.
Smart Images

Figure CN118764189A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication security technology, and in particular to a quantum enhanced dynamic key management method based on session identification. Background Art
[0002] In existing network communications, encryption is an important means to ensure the security of data transmission. However, traditional encryption methods usually use fixed keys. Once the key is leaked, attackers can easily decrypt intercepted requests, causing serious security risks. Therefore, how to improve the security of keys has become an important issue in the field of network security.
[0003] In the prior art, different encryption mechanisms have the following defects:
[0004] Static key mechanism: Traditional encryption systems usually use static keys, which poses a security risk. Since static keys remain unchanged for a long time, once leaked, a large amount of communication data using the key will be decrypted. Therefore, the static key mechanism poses a security risk and cannot effectively protect data security.
[0005] Static key update: Some systems implement regular updates of static keys, but this method still requires manual intervention, and the update process may be delayed or erroneous, affecting data security. The static key update process is not automated and flexible enough to adapt to complex and changing network environments.
[0006] Dynamic key generation: Some systems implement dynamic key generation, but they may lack the ability to resist quantum computing, or have deficiencies in security, automation, and flexibility. As a result, existing dynamic key generation mechanisms cannot effectively respond to the threat of quantum computing and have limitations in practical applications. Summary of the invention
[0007] The purpose of the present invention is to solve the problems of low security and poor flexibility of the current encryption mechanism, and to propose a quantum enhanced dynamic key management method based on session identification with enhanced security and flexibility, which can adapt to complex and changeable network environments, so as to protect the security of data transmission.
[0008] To achieve the above object, the present invention proposes a quantum enhanced dynamic key management method based on session identification, comprising the following steps:
[0009] S1. The client obtains the key package sent by the server;
[0010] S2. The client obtains the dynamic key in the key package and puts the key package into the session identifier;
[0011] S3. The client encrypts the HTTP request based on the dynamic key and sends the HTTP request to the server's API interface;
[0012] S4. After receiving the HTTP request from the client, the server API interface obtains the session identifier from the COOKIES in the HTTP request;
[0013] S5. The API interface of the server verifies the legitimacy of the session identifier. When the verification passes, the key encapsulation in the session identifier is obtained;
[0014] S6. The API interface of the server decrypts the key package obtained from the session identifier using a fixed key to obtain a dynamic key;
[0015] S7. The API interface of the server decrypts the HTTP request sent by the client based on the dynamic key, and encrypts the response of the server after the server responds.
[0016] Preferably, step S1 further comprises the following steps:
[0017] S11, the client initiates an RSA key generation request, the server responds to the RSA key generation request, generates a server RSA public key and a server RSA private key, and sends the server RSA public key to the client;
[0018] S12. After issuing an RSA key generation request, the client also generates a pair of client RSA public key and client RSA private key. Based on the received server RSA public key, the client encrypts the client login credentials and the client RSA private key, and sends the encrypted keys to the server.
[0019] S13, the server decrypts the encrypted information sent by the client through the server RSA private key, and obtains the client login credentials and the client RSA private key;
[0020] S14. After verifying the client login credentials, the server uses the acquired client RSA private key to encrypt the key package generated by the server, and sends the encrypted key package to the client;
[0021] S15. The client decrypts the encrypted key package based on the client RSA public key to obtain the key package.
[0022] Preferably, the client login credentials are login name and password information entered by the user at the client.
[0023] Preferably, in step S14, the server generates a key package as follows:
[0024] S141, generating a dynamic key;
[0025] S142, generating a fixed key by a key random algorithm;
[0026] S143, using the fixed key to encrypt the dynamic key to obtain a key package;
[0027] There is no particular order in which steps S141 and S142 are performed.
[0028] Preferably, in step S141, a dynamic key is generated based on a quantum random number returned by a quantum random number generator, or a dynamic key is generated based on a quantum enhanced random number generated by a simulated quantum random number generator.
[0029] Preferably, the process of simulating a quantum random number generator to generate quantum enhanced random numbers is as follows:
[0030] Generate traditional random numbers; simulate quantum bit generation; simulate quantum gate operations, operate the state of the simulated quantum bits, and prepare more complex quantum superposition states; simulate quantum measurement operations to obtain quantum bit states as random numbers; mix the traditional random numbers and the random numbers obtained by simulating quantum measurement operations to generate quantum enhanced random numbers.
[0031] Preferably, before step S2, the expiration time of the key encapsulation is set as the expiration time of the session identifier, and the expiration time difference of the key encapsulation is set as the expiration time difference of the session identifier.
[0032] Preferably, in step S3, on the client's login page, the client sends a login HTTP request to the server's API interface.
[0033] Preferably, in step S4, when the API interface of the server recognizes that the COOKIES of the HTTP request does not contain a session identifier, the API interface redirects the HTTP request to the login interface of the client.
[0034] Preferably, in step S5, when the API interface verifies that the session identifier is illegal, the API interface redirects the HTTP request to the login interface of the client.
[0035] Compared with the prior art, the technical solution of the present invention has at least the following advantages and beneficial effects:
[0036] The technical solution of the present invention uses quantum enhanced random numbers to improve communication security, has the ability to resist quantum attacks, helps prevent information leakage and data tampering, and thus protects the privacy and rights of users; this method can be applied to encryption technology in multiple industries, improving the overall information security level;
[0037] This scheme uses a quantum random number generator to generate quantum random numbers with high randomness, unpredictability and uncertainty, which can resist quantum computer attacks and greatly improve communication security;
[0038] This solution dynamically generates session keys based on session identifiers, ensuring that each communication has an independent key, improving key security;
[0039] The key in this solution is bound to the session identifier, automatically expires, and is automatically generated, without the need for manual maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of a quantum enhanced dynamic key management method based on session identification of the present invention;
[0041] Figure 2 The figure is a flow chart of generating quantum enhanced random numbers in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The technical solutions, structural features, achieved objectives and effects of the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0043] It should be noted that the drawings are in a very simplified form and use non-precise proportions. They are only used to conveniently and clearly assist in explaining the embodiments of the present invention, and are not used to limit the conditions for the implementation of the present invention. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size, without affecting the effects and purposes that can be achieved by the present invention, should still fall within the scope of the technical content disclosed by the present invention.
[0044] It should be noted that, in the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only the elements explicitly listed, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0045] The embodiment of the present invention provides a quantum enhanced dynamic key management method based on session identification, such as Figure 1 As shown, the following steps are included:
[0046] S1. The client obtains the key encapsulation KEY_INFO sent by the server;
[0047] S2. The client obtains the dynamic key KEY in the key encapsulation KEY_INFO and puts the key encapsulation KEY_INFO into the session identifier JWT;
[0048] S3. The client encrypts the HTTP request based on the dynamic key KEY and sends the HTTP request to the server's API (Application Programming Interface);
[0049] S4. After receiving the HTTP request from the client, the server API interface obtains the session identifier JWT from the COOKIES of the HTTP request;
[0050] S5. The API interface of the server verifies the legitimacy of the session identifier JWT. When the verification passes, the key encapsulation KEY_INFO in the session identifier JWT is obtained;
[0051] S6. The API interface of the server decrypts the key encapsulation KEY_INFO obtained from the session identifier JWT by using the fixed key AES_KEY to obtain the dynamic key KEY;
[0052] S7. The API interface of the server decrypts the HTTP request sent by the client based on the dynamic key KEY, and encrypts the response of the server after the server responds.
[0053] Each step is explained in detail below.
[0054] Wherein, step S1 specifically includes the following steps:
[0055] S11, the client initiates an RSA key generation request, the server responds to the RSA key generation request, generates a server-side RSA public key RsaPublicServerKey and a server-side RSA private key RsaPrivateServerKey, and sends the server-side RSA public key RsaPublicServerKey to the client;
[0056] S12. After issuing an RSA key generation request, the client also generates a pair of client RSA public key RsaPublicClientKey and client RSA private key RsaPrivateClientKey. Based on the received server RSA public key RsaPublicServerKey, the client encrypts the client login credentials and the client RSA private key RsaPrivateClientKey, and sends them to the server after encryption.
[0057] S13. The server decrypts the encrypted information sent by the client through the server-side RSA private key RsaPrivateServerKey, and obtains the client login credentials and the client RSA private key RsaPrivateClientKey;
[0058] S14. After verifying the client login credentials, the server uses the client RSA private key RsaPrivateClientKey to encrypt the key package KEY_INFO generated by the server, and sends the encrypted key package KEY_INFO to the client.
[0059] S15. The client decrypts the encrypted key encapsulation KEY_INFO based on the client RSA public key RsaPublicClientKey to obtain the key encapsulation KEY_INFO.
[0060] The server RSA public key RsaPublicServerKey and the server private key RsaPrivateServerKey, as well as the client RSA public key RsaPublicClientKey and the client RSA private key RsaPrivateClientKey, are RSA asymmetric key encryption algorithms, which are asymmetric encryption algorithms that use different keys for encryption and decryption, one for the public key and the other for the corresponding private key. The content encrypted by the public key can only be decrypted by the private key, and vice versa, the content encrypted by the private key can only be decrypted by the public key, that is, the content encrypted by one party can only be decrypted by the other party. Therefore, the content encrypted by the server RSA public key RsaPublicServerKey can only be decrypted by the server private key RsaPrivateServerKey, and vice versa; the content encrypted by the client RSA public key RsaPublicClientKey can only be decrypted by the client RSA private key RsaPrivateClientKey, and vice versa.
[0061] The client login credentials are information such as the login name and password entered by the user on the client.
[0062] In the above steps, the client login credentials, the client RSA private key RsaPrivateClientKey and the key package KEY_INFO are encrypted with RSA asymmetric keys before transmission, which further enhances the security of information transmission.
[0063] Among them, in S14, the steps for the server to generate the key encapsulation body KEY_INFO are as follows:
[0064] S141, generating a dynamic key KEY;
[0065] Generate a dynamic key KEY based on the quantum random number QuantumEnhancedRandom returned by the quantum random number generator;
[0066] Specifically, the server's API interface sends a quantum random number acquisition request to the quantum random number generator through the gateway; the quantum random number generator generates a quantum random number QuantumEnhancedRandom and returns it to the API interface through the gateway. Based on the quantum random number QuantumEnhancedRandom, the interface API generates a dynamic key KEY.
[0067] In the above process, the quantum random number QuantumEnhancedRandom is obtained and verified by the API interface, and access control is performed to ensure that the quantum random number QuantumEnhancedRandom cannot be illegally obtained. Compared with the key scheme generated by pseudo-random numbers used in the prior art that is easy to predict and cause attacks, the security of the request is improved and the ability to resist quantum attacks is possessed.
[0068] Furthermore, a simulated quantum random number generator can be used to generate quantum enhanced random numbers, and a dynamic key can be generated based on the quantum enhanced random number. The simulated quantum random number generator is built into the server. Compared with the traditional quantum random number that relies on quantum hardware, the simulated quantum random number generator can generate quantum enhanced random numbers by simulating the quantum bits, quantum gates, and quantum measurement operations of the quantum random number generator without quantum hardware support and without using an API interface to obtain quantum random numbers. The generated quantum enhanced random number has higher uncertainty and stronger randomness than traditional random numbers.
[0069] like Figure 2 As shown, the process of simulating a quantum random number generator to generate a quantum enhanced random number specifically includes:
[0070] Generate traditional random numbers; simulate quantum bit generation; simulate quantum gate operations, operate the state of the simulated quantum bits, and prepare more complex quantum superposition states; simulate quantum measurement operations to obtain quantum bit states as random numbers; mix the traditional random numbers and the random numbers obtained by simulating quantum measurement operations to generate quantum enhanced random numbers.
[0071] Among them, traditional random number generation usually uses the java.util.Random class java.lang.Math.random() method and the more secure and more random java.security.SecureRandom class algorithm.
[0072] Among them, qubit is the basic concept in quantum computing and the basic unit of quantum computing. The characteristic of qubit that it can exist in a superposition state of multiple states at the same time is the root of quantum randomness. This method strengthens the randomness and security of random numbers by simulating the generation of qubits.
[0073] Among them, the quantum gate operation is the basic operation in quantum computing. Complex quantum superposition states can be prepared through quantum gate operations. In a quantum random number generator, the randomness of the quantum system can be directly used to generate random numbers. This method manipulates the state of quantum bits by simulating quantum gate operations to prepare complex quantum superposition states, so that the final generated quantum enhanced random numbers have stronger randomness and security.
[0074] The quantum measurement is a core concept in quantum computing. Quantum measurement is a way to obtain the state of a quantum bit. When a quantum bit is measured, the quantum bit changes from a superposition state to a specific state, and which state it changes to is random. This method obtains random numbers by simulating quantum measurement operations.
[0075] S142, generate a fixed key AES_KEY;
[0076] The fixed key AES_KEY is generated by a key random algorithm, which is a common algorithm in the technical field. This embodiment is not described in detail here. The following only shows a step of generating a fixed key AES_KEY by a key random algorithm adopted in this embodiment:
[0077] Define the random number sampling value BASE_RANDOM_CHAR:
[0078] String BASE_RANDOM_CHA="abcdefghijklmnopqrstuvwxyz".toUpperCase()+"abcdefghijklmnopqrstuvwxyz0123456789"+"@#$%^&*!";
[0079] Get the fixed key AES_KEY through random number sampling value:
[0080] StringBuilder sb=new StringBuilder(16);
[0081] int baseLength=BASE_RANDOM_CHAR.length();
[0082] for(int i=0; i <length;++i){
[0083] int number=ThreadLocalRandom.current().nextInt(baseLength);
[0084] sb.append(baseString.charAt(number));
[0085] }
[0086] String AES_KEY=sb.toString()
[0087] S143. Use the fixed key AES_KEY to encrypt the dynamic key KEY to obtain the key encapsulation body KEY_INFO.
[0088] There is no particular order in which steps S141 and S142 are performed.
[0089] Compared with a single-layer key, the key encapsulation KEY_INFO obtained by this multi-level key encryption design further enhances the security of the request.
[0090] In the HTTP protocol, COOKIES is a mechanism that allows the server to store information on the client and send the stored information back to the server in subsequent requests. Session identifier JWT refers to JSON Web Token, which is a compact, self-contained mechanism defined by open standards for transmitting authentication information between the client and the server. In this embodiment, the session identifier JWT is stored in COOKIES.
[0091] In step S2, the key encapsulation KEY_INFO is placed in the session identifier JWT. Compared with the technical solutions of using fixed keys or regularly changing keys in the prior art, the technical solution of the present application improves the security of the request, realizes the automation of key management, and reduces complexity.
[0092] Furthermore, before step S2, that is, before the key encapsulation body KEY_INFO is placed in the session identifier JWT, the expiration time ExpirationTime of the key encapsulation body KEY_INFO is set to the expiration time of the session identifier JWT, and the expiration time difference TimeDiff of the key encapsulation body KEY_INFO is set to the expiration time difference of the session identifier JWT. In the subsequent steps, when the client obtains the response of the server, it will check whether the key encapsulation body KEY_INFO is still within the expiration time. If the key encapsulation body KEY_INFO has exceeded the expiration time, that is, it has expired, the client will no longer use the dynamic key KEY in this key encapsulation body KEY_INFO to decrypt the response of the server, thereby improving security. The expiration time difference refers to the time when the client obtains the key encapsulation body KEY_INFO as a reference. After a certain period of time, the key encapsulation body KEY_INFO is considered to be expired. This time is the expiration time difference. By setting the expiration time difference, the client can still correctly verify whether the key encapsulation body KEY_INFO is expired when the time is inaccurate, thereby further improving security.
[0093] In this embodiment, the expiration time ExpirationTime of the key encapsulation KEY_INFO is set to 86400s, and the expiration time difference TimeDiff of the key encapsulation KEY_INFO is set to 86400s.
[0094] Step S3 may be: on the client's login interface, the client sends a login HTTP request to the server's API interface. Specifically, the client sends the HTTP request to the server's API interface through a gateway.
[0095] Regarding step S4, in other embodiments, when the API interface of the server recognizes that the COOKIES of the HTTP request does not contain the session identifier JWT, the API interface redirects the HTTP request to the login interface of the client.
[0096] Regarding step S5, in other embodiments, when the API interface verifies that the session identifier JWT is illegal, the API interface redirects the HTTP request to the login interface of the client.
[0097] For step S7, the server's response is encrypted using the dynamic key KEY. After the client receives the server's response, the response is decrypted using the dynamic key KEY. After the client receives the server's response, it is necessary to check whether the key package KEY_INFO is still within the expiration time. If the key package KEY_INFO has exceeded the expiration time, that is, it has expired, the client no longer uses the dynamic key KEY in the key package KEY_INFO to decrypt the server's response.
[0098] It should be noted that in S1, after the server sends the key package KEY_INFO to the client, the server does not save the key package KEY_INFO, so in S5, the server needs to obtain the key package KEY_INFO of the client.
[0099] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be appreciated that the above description should not be considered as a limitation of the present invention. After reading the above content, it will be apparent to those skilled in the art that various modifications and substitutions of the present invention will occur. Therefore, the protection scope of the present invention should be limited by the appended claims.
Claims
1. A quantum enhanced dynamic key management method based on session identification, characterized in that: The following steps are involved: S1. The client obtains the key package sent by the server; S2. The client obtains the dynamic key in the key package and puts the key package into the session identifier; S3. The client encrypts the HTTP request based on the dynamic key and sends the HTTP request to the server's API interface; S4. After receiving the HTTP request from the client, the server API interface obtains the session identifier from the COOKIES in the HTTP request; S5. The API interface of the server verifies the legitimacy of the session identifier. When the verification passes, the key encapsulation in the session identifier is obtained; S6. The API interface of the server decrypts the key package obtained from the session identifier using a fixed key to obtain a dynamic key; S7. The API interface of the server decrypts the HTTP request sent by the client based on the dynamic key, and encrypts the response of the server after the server responds.
2. The method for quantum-enhanced dynamic key management based on session identification according to claim 1, characterized in that: Step S1 further comprises the following steps: S11, the client initiates an RSA key generation request, the server responds to the RSA key generation request, generates a server RSA public key and a server RSA private key, and sends the server RSA public key to the client; S12. After issuing an RSA key generation request, the client also generates a pair of client RSA public key and client RSA private key. Based on the received server RSA public key, the client encrypts the client login credentials and the client RSA private key, and sends the encrypted keys to the server. S13, the server decrypts the encrypted information sent by the client through the server RSA private key, and obtains the client login credentials and the client RSA private key; S14. After verifying the client login credentials, the server uses the acquired client RSA private key to encrypt the key package generated by the server, and sends the encrypted key package to the client; S15. The client decrypts the encrypted key package based on the client RSA public key to obtain the key package.
3. The method for quantum-enhanced dynamic key management based on session identification according to claim 2, characterized in that: Client login credentials are the login name and password information entered by the user on the client.
4. The method for quantum-enhanced dynamic key management based on session identification according to claim 2, characterized in that: In step S14, the server generates a key package as follows: S141, generating a dynamic key; S142, generating a fixed key by a key random algorithm; S143, using the fixed key to encrypt the dynamic key to obtain a key package; There is no particular order in which steps S141 and S142 are performed.
5. The method for quantum-enhanced dynamic key management based on session identification according to claim 4, characterized in that: In step S141, a dynamic key is generated based on the quantum random number returned by the quantum random number generator, or a dynamic key is generated based on the quantum enhanced random number generated by a simulated quantum random number generator.
6. The method for quantum-enhanced dynamic key management based on session identification according to claim 5, characterized in that: The process of simulating a quantum random number generator to generate quantum enhanced random numbers is as follows: Generate traditional random numbers; simulate quantum bit generation; simulate quantum gate operations, manipulate the state of the simulated quantum bits, and prepare more complex quantum superposition states; The quantum measurement operation is simulated to obtain the quantum bit state as a random number; the traditional random number and the random number obtained by simulating the quantum measurement operation are mixed to generate a quantum enhanced random number.
7. The method for quantum-enhanced dynamic key management based on session identification according to claim 4, characterized in that: Before step S2, the expiration time of the key package is set to the expiration time of the session identifier, and the expiration time difference of the key package is set to the expiration time difference of the session identifier.
8. The method for quantum-enhanced dynamic key management based on session identification according to claim 4, characterized in that: In step S3, on the client's login page, the client sends a login HTTP request to the server's API interface.
9. The method for quantum-enhanced dynamic key management based on session identification according to claim 8, characterized in that: In step S4, when the API interface of the server recognizes that the COOKIES of the HTTP request does not contain a session identifier, the API interface redirects the HTTP request to the login interface of the client.
10. The method for quantum-enhanced dynamic key management based on session identification according to claim 8, characterized in that: In step S5, when the API interface verifies that the session identifier is illegal, the API interface redirects the HTTP request to the login interface of the client.
Citation Information
Cited By
Mobile communication method, mobile terminal and server
CN119767300A
