Single sign-on method, system and device based on quantum key, equipment and medium
Encryption and decryption of tokens by quantum keys, the problems of low security and poor convenience in existing single sign-on solutions are solved, and single sign-on for multiple applications is achieved without opening the main application, which improves the token security and user experience.
Patent Information
- Application Number
- CN202411101862.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-03
AI Technical Summary
The existing single sign-on token storage solution between multiple applications needs to check whether the main application is started when logging in, and the permissions are sensitive, resulting in low security and inconvenience, reducing the credibility of the application.
The token is encrypted and decrypted using quantum keys. By querying whether the token encrypted by quantum keys exists when the user logs in, if it exists, the quantum key is obtained from the cryptographic service platform for decryption and login. If it does not exist, it is authenticated from the identity. The platform acquires the token and encrypts the storage.
It greatly enhances the security of tokens, making single sign-on more convenient and efficient, and provides users with a safe and convenient login experience.
Smart Images

Figure CN119071038A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of quantum key application technology, and in particular to a single sign-on method, system, device and medium based on quantum key. Background Art
[0002] Single Sign-On (SSO) between multiple applications is a technology that allows users to access multiple related applications by logging in only once. With SSO, after the user logs in to the main application for the first time, the system will generate a security token that can be shared among other related applications, thus avoiding the need for users to enter their usernames and passwords multiple times.
[0003] The existing single sign-on token storage solution between multiple applications requires permission to detect whether the main application is started when logging in. If it is started, the token is shared through inter-process communication. However, most users are sensitive to permissions. This approach has low security and is not convenient enough, which greatly reduces the credibility of the application. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a quantum key-based single sign-on method, a quantum key-based single sign-on system, and a quantum key-based single sign-on device that overcome the above problems or at least partially solve the above problems.
[0005] According to a first aspect of an embodiment of the present invention, a single sign-on method based on a quantum key is provided, the method comprising:
[0006] When a user logs into an application, query whether there is a token corresponding to the user encrypted by a quantum key;
[0007] If there is a token corresponding to the user, obtaining the quantum key from the cryptographic service platform;
[0008] decrypting the token according to the quantum key;
[0009] Log into the application using the token.
[0010] Optionally, the method further includes:
[0011] If the token corresponding to the user does not exist, obtain the token corresponding to the user from the identity authentication platform;
[0012] Obtaining a quantum key from the cryptographic service platform;
[0013] Encrypting a token corresponding to the user according to the quantum key;
[0014] The encrypted token corresponding to the user is stored.
[0015] Optionally, the querying whether there is a token corresponding to the user encrypted by a quantum key includes:
[0016] In the shared memory, check whether there is a token corresponding to the user.
[0017] Optionally, the storing of the encrypted token corresponding to the user includes:
[0018] The encrypted token corresponding to the user is stored in the shared memory.
[0019] Optionally, obtaining a quantum key from the cryptographic service platform includes:
[0020] Sending a session identifier of the user to the password service platform, where the session identifier is obtained according to the user information of the user;
[0021] A quantum key sent by the cryptographic service platform is received; the quantum key is obtained according to the session identifier of the user.
[0022] According to a second aspect of the present invention, there is provided a single sign-on system based on quantum key, the system comprising: a user terminal, an identity authentication platform and a password service platform;
[0023] The user terminal is used to query whether there is a token corresponding to the user encrypted by the quantum key when the user logs in to the application; if there is a token corresponding to the user, obtain the quantum key from the cryptographic service platform; decrypt the token according to the quantum key; and log in to the application using the token;
[0024] The identity authentication platform is used to send a token corresponding to the user to the user terminal;
[0025] The cryptographic service platform is used to send the quantum key to the user terminal.
[0026] Optionally, the user terminal is further used to obtain the token corresponding to the user from the identity authentication platform if the token corresponding to the user does not exist; obtain the quantum key from the cryptographic service platform; encrypt the token corresponding to the user according to the quantum key; and store the encrypted token corresponding to the user.
[0027] Optionally, the user terminal is further used to query whether there is a token corresponding to the user in the shared memory.
[0028] Optionally, the user terminal is also used to store the encrypted token corresponding to the user in the shared memory.
[0029] Optionally, the user terminal is also used to send a session identifier of the user to the cryptographic service platform, where the session identifier is obtained based on the user information of the user; and receive a quantum key sent by the cryptographic service platform; the quantum key is obtained based on the session identifier of the user.
[0030] According to a third aspect of an embodiment of the present invention, a single sign-on device based on a quantum key is provided, the device comprising:
[0031] A first query module is used to query whether there is a token corresponding to the user encrypted by the quantum key when the user logs into the application;
[0032] A first acquisition module, configured to acquire a quantum key from a cryptographic service platform if a token corresponding to the user exists;
[0033] A first decryption module, used to decrypt the token according to the quantum key;
[0034] The first login module is used to log in to the application program using the token.
[0035] Optionally, the device further comprises:
[0036] A second acquisition module is used to acquire the token corresponding to the user from the identity authentication platform if the token corresponding to the user does not exist;
[0037] A third acquisition module is used to obtain a quantum key from the cryptographic service platform;
[0038] A first encryption module, used to encrypt a token corresponding to the user according to the quantum key;
[0039] The first storage module is used to store the encrypted token corresponding to the user.
[0040] Optionally, the first query module includes:
[0041] The first query submodule is used to query whether there is a token corresponding to the user in the shared memory.
[0042] Optionally, the first storage module includes:
[0043] The first storage submodule is used to store the encrypted token corresponding to the user in the shared memory.
[0044] Optionally, the third acquisition module includes:
[0045] A first sending submodule, configured to send a session identifier of the user to the password service platform, wherein the session identifier is obtained according to the user information of the user;
[0046] The first receiving submodule is used to receive the quantum key sent by the cryptographic service platform; the quantum key is obtained according to the session identifier of the user.
[0047] According to a fourth aspect of the present invention, an electronic device is provided, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the single sign-on method based on quantum key as described above is implemented.
[0048] According to a fifth aspect of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the single sign-on method based on quantum keys as described above.
[0049] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:
[0050] The embodiment of the present invention provides a single sign-on method based on quantum key, which includes querying whether there is a token corresponding to the user encrypted by quantum key when the user logs into the application; if there is a token corresponding to the user, obtaining the quantum key from the cryptographic service platform; decrypting the token according to the quantum key; and logging into the application using the token. After the embodiment of the present invention encrypts the token by quantum key, the token can be decrypted according to the quantum key when logging in to complete the login. Single sign-on of multiple applications can be completed without opening the main application. This method not only greatly enhances the security of the token, but also makes single sign-on more convenient and efficient, providing users with a login experience that is both safe and convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a flowchart of a single sign-on method based on quantum keys provided by an embodiment of the present invention;
[0052] Figure 2 is a flowchart of another single sign-on method based on quantum keys provided by an embodiment of the present invention;
[0053] Figure 3 This is a timing diagram of single sign-on based on quantum key provided by an embodiment of the present invention;
[0054] Figure 4 It is a structural block diagram of a single sign-on system based on quantum key provided by an embodiment of the present invention;
[0055] Figure 5 It is a structural block diagram of a single sign-on device based on quantum key provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] One of the core concepts of the embodiments of the present invention is that single sign-on (SSO) between multiple applications is a technology that allows users to access multiple related applications by logging in only once. With single sign-on, after the user logs in to the main application for the first time, the system will generate a security token that can be shared among other related applications, thereby avoiding the need for the user to enter the username and password multiple times.
[0058] The existing single sign-on token storage solution between multiple applications requires permission to detect whether the main application is started when logging in. If it is started, the token is shared through inter-process communication. However, most users are sensitive to permissions, and the operation is complicated when multiple applications share tokens, making the existing solution insecure and inconvenient, greatly reducing the credibility of the application.
[0059] To this end, after the embodiment of the present invention encrypts the token with a quantum key, the token can be decrypted according to the quantum key during login to complete the login. Single sign-on for multiple applications can be completed without opening the main application. This method not only greatly enhances the security of the token, but also makes single sign-on more convenient and efficient, providing users with a login experience that is both safe and convenient.
[0060] Reference Figure 1 , shows a flowchart of a single sign-on method based on quantum key provided by an embodiment of the present invention, and the method may specifically include the following steps:
[0061] Step 101, when a user logs into an application, query whether there is a token corresponding to the user encrypted by a quantum key;
[0062] A token is a security credential used for identity authentication. The token mechanism using quantum key encryption provides an additional layer of security because it relies not only on traditional password authentication, but also on the unbreakable nature of quantum keys. Due to the special properties of quantum keys, even if the token is intercepted, it is difficult for attackers to decrypt the original authentication information, thus ensuring the security of user data.
[0063] Quantum key distribution technology uses the principles of quantum mechanics to generate and distribute keys. These keys are theoretically unbreakable and can provide adequate protection even against future quantum computer attacks. When a user logs in for the first time, the system can use quantum keys to encrypt the user's login credentials and store the encrypted token. Later, when the user logs in again, the system will check whether there is a token encrypted by the user's quantum key. If so, it means that the user's credentials have been successfully verified before and these credentials have been securely stored. Querying whether there is a token corresponding to the user encrypted by a quantum key when the user logs in to the application can enhance security and protect the user's privacy information.
[0064] Step 102: if there is a token corresponding to the user, obtain the quantum key from the cryptographic service platform;
[0065] The cryptographic service platform is a platform for obtaining and managing quantum keys. If the token corresponding to the current user exists, it means that the user has successfully passed the identity authentication before and its authentication status is still valid. The user can access the corresponding resources and services without logging in again, ensuring that the user can use his permissions seamlessly in a multi-service environment. Go to the cryptographic service platform to apply for quantum keys to further enhance security and ensure confidentiality and integrity during data transmission.
[0066] Step 103, decrypting the token according to the quantum key;
[0067] By using the quantum key to decrypt the token, it can be ensured that even if the token is intercepted during transmission, only the recipient with the correct quantum key can decrypt and verify the validity of the token, thereby protecting the user's sensitive information from being accessed by unauthorized third parties.
[0068] Step 104: Log into the application using the token.
[0069] When the query shows that a token exists, it means that the user's credentials have been successfully verified before and these credentials have been securely stored. For secure login, the quantum key is obtained from the password service platform, and the token decrypted by the quantum key is used to log in to the application. The system can quickly verify the user's identity when the user logs in again without having to re-enter the password or sensitive information each time. This approach not only reduces the security risks caused by password leaks, but also provides a smoother user experience, while taking advantage of the unbreakable nature of quantum keys to protect user privacy and data security.
[0070] Reference Figure 2 , shows a flowchart of another single sign-on method based on quantum key provided by an embodiment of the present invention, the method may specifically include the following steps:
[0071] Step 201, when a user logs into an application, query whether there is a token corresponding to the user encrypted by a quantum key;
[0072] When a user logs in for the first time, the system can encrypt the user's login credentials using a quantum key and store the encrypted token. Later, when the user logs in again, the system checks whether there is a token encrypted by the user's quantum key. If so, it means that the user's credentials have been successfully verified before and they are securely stored. Querying whether there is a token corresponding to the user encrypted by a quantum key when the user logs in to the application can enhance security and protect the user's privacy information.
[0073] In one embodiment, step 201 may include, for example, the following sub-steps:
[0074] Sub-step S11, querying in the shared memory whether there is a token corresponding to the user.
[0075] Shared memory is an inter-process communication mechanism that allows a process to write data to a shared memory area, and other processes can access and modify the data by mapping this area. Go to SharedMemory to query whether the token corresponding to the current user exists in order to ensure that the user's identity status can be shared between various services or processes.
[0076] Step 202: if the token corresponding to the user does not exist, obtain the token corresponding to the user from the identity authentication platform;
[0077] An identity authentication platform is a system or service that centrally manages and performs user authentication. Such platforms are usually used in multi-service environments to achieve unified identity management, authentication, and authorization. The main goal of an identity authentication platform is to ensure that only verified users can access specific resources and to provide consistent security policies across multiple applications and services.
[0078] If the token corresponding to the current user does not exist, it means that the user has not passed the identity authentication or the previous authentication information has expired or invalid. In this case, the user needs to go to the identity authentication platform to log in to verify the user's identity, update the authentication status, and issue a new token to ensure that the user is legitimate and has the right to access the requested resources, while meeting the basic requirements of information security.
[0079] Step 203, obtaining a quantum key from the cryptographic service platform;
[0080] The reason for obtaining quantum keys from a cryptographic service platform is that quantum key distribution can provide theoretically unbreakable security, ensuring that encryption keys cannot be eavesdropped or copied by third parties.
[0081] In one embodiment, the step 203 may include, for example, the following sub-steps:
[0082] Sub-step S31, sending the user's session identifier to the password service platform, where the session identifier is obtained based on the user information of the user;
[0083] To ensure security and continuity, after a user successfully logs in, the system generates a unique session ID based on the user's specific information. This session ID is then sent to the password service platform to verify the user's identity in subsequent interactions without having to repeat the entire login process. This ensures that sensitive user information does not need to be resubmitted or verified on each request, which improves the user experience and enhances the security of the system.
[0084] Sub-step S32, receiving the quantum key sent by the cryptographic service platform; the quantum key is obtained according to the session identifier of the user.
[0085] The purpose of receiving quantum keys sent by the cryptographic service platform is to ensure data security and privacy protection during the communication process. Quantum keys are generated based on the principles of quantum mechanics and are used to encrypt and decrypt information. They are extremely secure because any attempt to eavesdrop on the key will be detected immediately and will result in a change in the key, making it impossible for the eavesdropper to obtain the original information content. Therefore, by using quantum keys, users can be sure that their communications will not be intercepted or cracked by unauthorized third parties, thus achieving highly secure data exchange.
[0086] Step 204, encrypting the token corresponding to the user according to the quantum key;
[0087] Encrypting the user's token according to the quantum key is to ensure the security and confidentiality of the token. In many security systems, the token is an important part of user authentication and needs to be prevented from being intercepted or tampered with during transmission. Encrypting the token with a quantum key can ensure that even if the token is intercepted by a third party during transmission, it cannot be deciphered because the quantum key has a unique security property - any attempt to measure or copy the key will change the state of the key and be detected by the sender and receiver. In this way, even if the token is intercepted, the attacker cannot use it for unauthorized access, thereby effectively protecting the user's identity information and the security of the system.
[0088] Step 205: store the encrypted token corresponding to the user.
[0089] The encrypted user-specific token is stored to protect the security and privacy of user data, ensuring that even if the token is accessed without authorization, it cannot be interpreted or abused, thereby protecting the user's login information and personal data from the threat of attackers.
[0090] In one embodiment, the step 205 may include, for example, the following sub-steps:
[0091] Sub-step S51, storing the encrypted token corresponding to the user in the shared memory.
[0092] Storing the encrypted token corresponding to the user in the shared memory is to ensure that the login status can be shared safely and efficiently between multiple applications. By storing the token in the shared memory, the process of re-verifying the user's identity every time the application is switched can be avoided, thereby improving the user experience and reducing the server load. At the same time, the token encrypted with quantum key can ensure that even if the shared memory is accessed without authorization, the token content will not be cracked, thereby protecting the security and privacy of user data.
[0093] Step 205 also returns to login 208 to log into the application.
[0094] Step 206: If there is a token corresponding to the user, obtain the quantum key from the cryptographic service platform;
[0095] If the token corresponding to the current user exists, it means that the user has successfully passed the identity authentication before and its authentication status is still valid. The user can access the corresponding resources and services without logging in again, ensuring that the user can use his permissions seamlessly in a multi-service environment. Go to the cryptographic service platform to apply for quantum keys to further enhance security and ensure confidentiality and integrity during data transmission.
[0096] Step 207, decrypting the token according to the quantum key;
[0097] The token is decrypted using a quantum key to ensure that even if the token is intercepted during transmission, only the recipient with the correct quantum key can decrypt and verify the validity of the token, thereby protecting the user's sensitive information from being accessed by unauthorized third parties.
[0098] Step 208: Log into the application using the token.
[0099] When the query shows that there is no token, it means that the user is logging in for the first time. After obtaining the token from the identity authentication platform, the quantum key is obtained from the cryptographic service platform to encrypt and store the token in order to log in to the application. When the query shows that the token exists, it means that the user's credentials have been successfully verified before and these credentials have been securely stored. For a secure login, the quantum key is obtained from the cryptographic service platform, and the token decrypted by the quantum key is used to log in to the application.
[0100] The embodiment of the present invention provides a single sign-on method based on quantum key, which includes querying whether there is a token corresponding to the user encrypted by quantum key when the user logs into the application; if there is a token corresponding to the user, obtaining the quantum key from the cryptographic service platform; decrypting the token according to the quantum key; and logging into the application using the token. After the embodiment of the present invention encrypts the token by quantum key, the token can be decrypted according to the quantum key when logging in to complete the login. Single sign-on of multiple applications can be completed without opening the main application. This method not only greatly enhances the security of the token, but also makes single sign-on more convenient and efficient, providing users with a login experience that is both safe and convenient.
[0101] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0102] Reference Figure 3 , showing a single sign-on timing diagram based on quantum key provided by an embodiment of the present invention;
[0103] In the figure, application A and application B are used as examples. Shared memory is represented by SharedMemory and token is represented by token.
[0104] When logging into application A:
[0105] S1: The user opens application A and logs in through application A;
[0106] S2: Application A goes to SharedMemory to check whether the token corresponding to the current user exists;
[0107] S3: SharedMemory finds that the token corresponding to the current user does not exist, and returns the query result to application A;
[0108] S4: Application A goes to the identity authentication platform to log in;
[0109] S5: The identity authentication platform returns the logged-in token to application A;
[0110] S6: Apply for a quantum key from the cryptographic service platform according to the user information, specifically, obtain a session identifier according to the user information, send the user's session identifier to the cryptographic service platform, and the cryptographic service platform generates a quantum key according to the user's session identifier;
[0111] S7: The cryptographic service platform returns the quantum key to application A;
[0112] S8: Application A encrypts the token based on the quantum key;
[0113] S9: Application A stores the user account and encrypted token in SharedMemory;
[0114] S10: SharedMemory returns the storage result to application A;
[0115] S11: User logs in to application A successfully;
[0116] When logging into application A:
[0117] S12: The user opens application B and logs in through application B;
[0118] S13: Application A goes to SharedMemory to check whether the token corresponding to the current user exists;
[0119] S14: SharedMemory finds that the token corresponding to the current user already exists, and returns the query result to application B;
[0120] S15: Application B goes to the cryptographic service platform to apply for the quantum key;
[0121] S16: The cryptographic service platform returns the quantum key to application B;
[0122] S17: Application B decrypts the token using the quantum key;
[0123] S18: The user logs in to application B successfully.
[0124] Reference Figure 4 , shows a structural block diagram of a single sign-on system based on quantum key provided in an embodiment of the present invention.
[0125] The system includes: a user terminal 401, an identity authentication platform 402 and a password service platform 403;
[0126] The user terminal 401 is used to query whether there is a token corresponding to the user encrypted by the quantum key when the user logs in to the application; if there is a token corresponding to the user, obtain the quantum key from the cryptographic service platform; decrypt the token according to the quantum key; and log in to the application using the token;
[0127] When a user logs into the application, query whether there is a token corresponding to the user encrypted by the quantum key. This practice can enhance security and protect the user's privacy information. If the token corresponding to the current user exists, it means that the user has successfully passed the identity authentication before and his authentication status is still valid. The user can access the corresponding resources and services without logging in again, ensuring that the user can use his permissions seamlessly in a multi-service environment. Go to the cryptographic service platform to apply for a quantum key to further enhance security and ensure confidentiality and integrity during data transmission.
[0128] By using the quantum key to decrypt the token, it can be ensured that even if the token is intercepted during transmission, only the recipient with the correct quantum key can decrypt and verify the validity of the token, thereby protecting the user's sensitive information from unauthorized third parties. When the query is for the existence of a token, it means that the user's credentials have been successfully verified before and these credentials have been securely stored. For secure login, the quantum key is obtained from the password service platform, and the token decrypted by the quantum key is used to log in to the application.
[0129] The identity authentication platform 402 is used to send a token corresponding to the user to the user terminal;
[0130] The identity authentication platform is a system responsible for verifying the user's identity and sending authentication tokens to the user's terminal, ensuring that the user can securely access protected resources and services. The identity authentication platform sends the user's corresponding token to the user's terminal. This process ensures the effective verification of the user's identity and provides a basis for subsequent secure access.
[0131] The cryptographic service platform 403 is used to send the quantum key to the user terminal.
[0132] The cryptographic service platform is a platform used to obtain and manage quantum keys. The cryptographic service platform sends quantum keys to user terminals to protect user information security.
[0133] In one embodiment, the user terminal 401 is further used to obtain the token corresponding to the user from the identity authentication platform if the token corresponding to the user does not exist; obtain the quantum key from the cryptographic service platform; encrypt the token corresponding to the user according to the quantum key; and store the encrypted token corresponding to the user.
[0134] If the token corresponding to the current user does not exist, it means that the user has not passed the identity authentication or the previous authentication information has expired or invalidated. In this case, the user needs to go to the identity authentication platform to log in to verify the user's identity, update the authentication status, and issue a new token to ensure that the user is legitimate and has the right to access the requested resources while meeting the basic requirements of information security. Then obtain the quantum key from the cryptographic service platform because quantum key distribution can provide theoretically unbreakable security to ensure that the encryption key cannot be eavesdropped or copied by a third party.
[0135] In many security systems, tokens are an important part of user authentication and need to be protected from interception or tampering during transmission. Using quantum key encryption to encrypt tokens can ensure that even if the token is intercepted by a third party during transmission, it cannot be deciphered because quantum keys have unique security properties - any attempt to measure or copy the key will change the state of the key and be detected by the sender and receiver. In this way, even if the token is intercepted, attackers cannot use it for unauthorized access, thereby effectively protecting the user's identity information and the security of the system.
[0136] In one embodiment, the user terminal 401 is further used to query whether there is a token corresponding to the user in the shared memory.
[0137] Shared memory is an inter-process communication mechanism that allows a process to write data to a shared memory area, and other processes can access and modify the data by mapping this area. Go to SharedMemory to query whether the token corresponding to the current user exists in order to ensure that the user's identity status can be shared between various services or processes.
[0138] In one embodiment, the user terminal 401 is further used to store the encrypted token corresponding to the user in the shared memory.
[0139] Storing the encrypted token corresponding to the user in the shared memory is to ensure that the login status can be shared safely and efficiently between multiple applications. By storing the token in the shared memory, the process of re-authenticating the user identity every time the application is switched can be avoided, thereby improving the user experience and reducing the server load.
[0140] In one embodiment, the user terminal 401 is also used to send a session identifier of the user to the cryptographic service platform, where the session identifier is obtained based on the user information of the user; receive a quantum key sent by the cryptographic service platform; and the quantum key is obtained based on the session identifier of the user.
[0141] To ensure security and continuity, after a user successfully logs in, the system generates a unique session ID based on the user's specific information. This session ID is then sent to the password service platform to verify the user's identity in subsequent interactions without having to repeat the entire login process. This ensures that sensitive user information does not need to be resubmitted or verified on each request, which improves the user experience and enhances the security of the system.
[0142] The purpose of receiving quantum keys sent by the cryptographic service platform is to ensure data security and privacy protection during the communication process. Quantum keys are generated based on the principles of quantum mechanics and are used to encrypt and decrypt information. They are extremely secure because any attempt to eavesdrop on the key will be detected immediately and will result in a change in the key, making it impossible for the eavesdropper to obtain the original information content. Therefore, by using quantum keys, users can be sure that their communications will not be intercepted or cracked by unauthorized third parties, thus achieving highly secure data exchange.
[0143] Reference Figure 5 , shows a structural block diagram of a single sign-on device based on quantum key provided in an embodiment of the present invention.
[0144] A first query module 501 is used to query whether there is a token corresponding to the user encrypted by a quantum key when the user logs into the application;
[0145] When a user logs in for the first time, the system can encrypt the user's login credentials using a quantum key and store the encrypted token. Later, when the user logs in again, the system checks whether there is a token encrypted by the user's quantum key. If so, it means that the user's credentials have been successfully verified before and they are securely stored. Querying whether there is a token corresponding to the user encrypted by a quantum key when the user logs in to the application can enhance security and protect the user's privacy information.
[0146] A first acquisition module 502 is configured to acquire a quantum key from a cryptographic service platform if a token corresponding to the user exists;
[0147] If the token corresponding to the current user exists, it means that the user has successfully passed the identity authentication before and its authentication status is still valid. The user can access the corresponding resources and services without logging in again, ensuring that the user can use his permissions seamlessly in a multi-service environment. Go to the cryptographic service platform to apply for quantum keys to further enhance security and ensure confidentiality and integrity during data transmission.
[0148] A first decryption module 503, configured to decrypt the token according to the quantum key;
[0149] By using the quantum key to decrypt the token, it can be ensured that even if the token is intercepted during transmission, only the recipient with the correct quantum key can decrypt and verify the validity of the token, thereby protecting the user's sensitive information from being accessed by unauthorized third parties.
[0150] The first login module 504 is used to log in to the application program using the token.
[0151] When the query shows that a token exists, it means that the user's credentials have been successfully verified before and these credentials have been securely stored. For secure login, the quantum key is obtained from the cryptographic service platform and the token decrypted by the quantum key is used to log in to the application.
[0152] In one embodiment, the device further comprises:
[0153] A second acquisition module is used to acquire the token corresponding to the user from the identity authentication platform if the token corresponding to the user does not exist;
[0154] If the token corresponding to the current user does not exist, it means that the user has not passed the identity authentication or the previous authentication information has expired or invalid. In this case, the user needs to go to the identity authentication platform to log in to verify the user's identity, update the authentication status, and issue a new token to ensure that the user is legitimate and has the right to access the requested resources, while meeting the basic requirements of information security.
[0155] A third acquisition module is used to obtain a quantum key from the cryptographic service platform;
[0156] The reason for obtaining quantum keys from a cryptographic service platform is that quantum key distribution can provide theoretically unbreakable security, ensuring that encryption keys cannot be eavesdropped or copied by third parties.
[0157] A first encryption module, used to encrypt a token corresponding to the user according to the quantum key;
[0158] Encrypting the user's token according to the quantum key is to ensure the security and confidentiality of the token. In many security systems, the token is an important part of user authentication and needs to be prevented from being intercepted or tampered with during transmission. Encrypting the token with a quantum key can ensure that even if the token is intercepted by a third party during transmission, it cannot be deciphered because the quantum key has a unique security property - any attempt to measure or copy the key will change the state of the key and be detected by the sender and receiver. In this way, even if the token is intercepted, the attacker cannot use it for unauthorized access, thereby effectively protecting the user's identity information and the security of the system.
[0159] The first storage module is used to store the encrypted token corresponding to the user.
[0160] The encrypted user-specific token is stored to protect the security and privacy of user data, ensuring that even if the token is accessed without authorization, it cannot be interpreted or abused, thereby protecting the user's login information and personal data from the threat of attackers.
[0161] In one embodiment, the first query module 501 includes:
[0162] The first query submodule is used to query whether there is a token corresponding to the user in the shared memory.
[0163] Shared memory is an inter-process communication mechanism that allows a process to write data to a shared memory area, and other processes can access and modify the data by mapping this area. Go to SharedMemory to query whether the token corresponding to the current user exists in order to ensure that the user's identity status can be shared between various services or processes.
[0164] In one embodiment, the first storage module includes:
[0165] The first storage submodule is used to store the encrypted token corresponding to the user in the shared memory.
[0166] Storing the encrypted token corresponding to the user in the shared memory is to ensure that the login status can be shared safely and efficiently between multiple applications. By storing the token in the shared memory, the process of re-verifying the user's identity every time the application is switched can be avoided, thereby improving the user experience and reducing the server load. At the same time, the token encrypted with quantum key can ensure that even if the shared memory is accessed without authorization, the token content will not be cracked, thereby protecting the security and privacy of user data.
[0167] In one embodiment, the second acquisition module includes:
[0168] A first sending submodule, configured to send a session identifier of the user to the password service platform, wherein the session identifier is obtained according to the user information of the user;
[0169] To ensure security and continuity, after a user successfully logs in, the system generates a unique session ID based on the user's specific information. This session ID is then sent to the password service platform to verify the user's identity in subsequent interactions without having to repeat the entire login process. This ensures that sensitive user information does not need to be resubmitted or verified on each request, which improves the user experience and enhances the security of the system.
[0170] The first receiving submodule is used to receive the quantum key sent by the cryptographic service platform; the quantum key is obtained according to the session identifier of the user.
[0171] The purpose of receiving quantum keys sent by the cryptographic service platform is to ensure data security and privacy protection during the communication process. Quantum keys are generated based on the principles of quantum mechanics and are used to encrypt and decrypt information. They are extremely secure because any attempt to eavesdrop on the key will be detected immediately and will result in a change in the key, making it impossible for the eavesdropper to obtain the original information content. Therefore, by using quantum keys, users can be sure that their communications will not be intercepted or cracked by unauthorized third parties, thus achieving highly secure data exchange.
[0172] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0173] An embodiment of the present invention further provides an electronic device, including:
[0174] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned quantum key-based single sign-on method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0175] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned quantum key-based single sign-on method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0176] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0177] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0178] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0179] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0180] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0181] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0182] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0183] The above is a detailed introduction to a single sign-on method based on quantum key, a single sign-on system based on quantum key and a single sign-on device based on quantum key provided by the present invention. Specific examples are used herein to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A single sign-on method based on quantum key, characterized in that: include: When a user logs into an application, query whether there is a token corresponding to the user encrypted by a quantum key; If there is a token corresponding to the user, obtaining the quantum key from the cryptographic service platform; decrypting the token according to the quantum key; The token is used to log into the application.
2. The method according to claim 1, characterized in that Also includes: If the token corresponding to the user does not exist, obtain the token corresponding to the user from the identity authentication platform; Obtaining a quantum key from the cryptographic service platform; Encrypting a token corresponding to the user according to the quantum key; The encrypted token corresponding to the user is stored.
3. The method according to claim 2, characterized in that The querying whether there is a token corresponding to the user encrypted by a quantum key comprises: In the shared memory, check whether there is a token corresponding to the user.
4. The method according to claim 3, characterized in that The storing of the encrypted token corresponding to the user includes: The encrypted token corresponding to the user is stored in the shared memory.
5. The method according to claim 2, characterized in that: The obtaining of the quantum key from the cryptographic service platform comprises: Sending a session identifier of the user to the password service platform, where the session identifier is obtained according to the user information of the user; A quantum key sent by the cryptographic service platform is received; the quantum key is obtained according to the session identifier of the user.
6. A single sign-on system based on quantum key, characterized in that: include: User terminals, identity authentication platforms and password service platforms; The user terminal is used to query whether there is a token corresponding to the user encrypted by the quantum key when the user logs into the application; If there is a token corresponding to the user, obtaining a quantum key from the cryptographic service platform; decrypting the token according to the quantum key; Logging into the application using the token; The identity authentication platform is used to send a token corresponding to the user to the user terminal; The cryptographic service platform is used to send the quantum key to the user terminal.
7. The system according to claim 6, characterized in that The user terminal is further configured to obtain a token corresponding to the user from an identity authentication platform if the token corresponding to the user does not exist; Obtaining a quantum key from the cryptographic service platform; encrypting a token corresponding to the user according to the quantum key; The encrypted token corresponding to the user is stored.
8. The system according to claim 7, characterized in that The user terminal is further used to query whether there is a token corresponding to the user in the shared memory.
9. The system according to claim 8, characterized in that The user terminal is also used to store the encrypted token corresponding to the user in the shared memory.
10. The system according to claim 7, characterized in that The user terminal is also used to send the session identifier of the user to the cryptographic service platform, where the session identifier is obtained based on the user information of the user; receive the quantum key sent by the cryptographic service platform; and the quantum key is obtained based on the session identifier of the user.
11. A single sign-on device based on quantum key, characterized in that: include: A first query module is used to query whether there is a token corresponding to the user encrypted by the quantum key when the user logs into the application; A first acquisition module, configured to acquire a quantum key from a cryptographic service platform if a token corresponding to the user exists; A first decryption module, used to decrypt the token according to the quantum key; The first login module is used to log in to the application program using the token.
12. The device according to claim 11, characterized in that Also includes: A second acquisition module is used to acquire the token corresponding to the user from the identity authentication platform if the token corresponding to the user does not exist; A third acquisition module is used to obtain a quantum key from the cryptographic service platform; A first encryption module, used to encrypt a token corresponding to the user according to the quantum key; The first storage module is used to store the encrypted token corresponding to the user.
13. The device according to claim 12, characterized in that The first query module includes: The first query submodule is used to query whether there is a token corresponding to the user in the shared memory.
14. The device according to claim 13, characterized in that The first storage module comprises: The first storage submodule is used to store the encrypted token corresponding to the user in the shared memory.
15. The device according to claim 11, characterized in that The third acquisition module includes: A first sending submodule, configured to send a session identifier of the user to the password service platform, wherein the session identifier is obtained according to the user information of the user; The first receiving submodule is used to receive the quantum key sent by the cryptographic service platform; the quantum key is obtained according to the session identifier of the user.
16. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the single sign-on method based on quantum keys as described in any one of claims 1 to 5 are implemented.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the single sign-on method based on quantum keys as described in any one of claims 1 to 5 are implemented.
Citation Information
Cited By
Communication encryption method and device, equipment and storage medium
CN120750531A
