Login bill acquisition method and device, equipment and storage medium

By generating multiple key pairs in the office application system and encrypting and transmitting login tickets, the problem of insufficient security during ticket transmission is solved and higher security and risk reduction are achieved.

CN118646545AActive Publication Date: 2024-09-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
CN202310261555.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2024-09-13
Estimated Expiration
2043-03-13

AI Technical Summary

Technical Problem

In the existing technology, bills in office application systems are easily contaminated or hijacked during transmission, and single-point bill leakage will affect the security of the entire system. There is a lack of effective security mechanisms to ensure the security of bill transmission.

Method used

By generating multiple key pairs between the client and the server, and using the downstream key to encrypt the preset login ticket, transmit the encryption result, and enable the client to decrypt and obtain the ticket through key negotiation, ensuring that the ticket is transmitted during the transmission process. security in.

Benefits of technology

It reduces the risk of ticket exposure during transmission, avoids global security risks caused by the leakage of a single ticket, and improves the security of the business system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646545A
    Figure CN118646545A
Patent Text Reader

Abstract

The invention belongs to the technical field of computers, and particularly relates to a login bill acquisition method and device, equipment and a storage medium. The method comprises the following steps: a client sends a login request to a server; the server determines at least two preset login bills in response to the login request, and generates at least two key pairs based on a server private key and a client public key; the server encrypts each preset login bill based on a downlink key in the key pair corresponding to each preset login bill to obtain a bill encryption result; the server sends the bill encryption result and the server public key to the client; the client obtains at least two key pairs based on the server public key and the client private key; and the client decrypts the bill encryption result based on the downlink key in each key pair to obtain a preset login bill. By encrypting the preset login bill, the exposure risk of the preset login bill in the transmission process is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to a login ticket acquisition method, device, equipment and storage medium. Background Art

[0002] With the continuous development of mobile terminals and network technology, as well as the increasing popularity of mobile office, enterprises and government agencies have developed office application systems that include various businesses. These office application systems usually integrate a large number of internal businesses.

[0003] Single Sign On (SSO) is a commonly used solution for achieving enterprise business integration. In single sign-on, a user only needs to log in once to access all mutually trusted application systems in multiple application systems. The key to single sign-on is to use tickets for identity authentication. In related technologies, when using tickets for identity authentication, the tickets as authentication credentials are usually transmitted in plain text, which increases the risk of the tickets being contaminated, hijacked or exposed during the transmission process. In addition, all businesses in the current application system can use the same ticket for authentication. When the ticket is leaked, it may affect the security of the entire application system. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a login ticket acquisition method, device, equipment and storage medium. By using downlink key pairs in different key pairs to encrypt at least two preset login tickets respectively, the exposure risk of the preset login tickets during transmission is reduced; and the business system sets multiple preset login tickets for the client, avoiding the global security risk caused by the leakage of a single preset login ticket.

[0005] On the one hand, the present application proposes a login ticket acquisition method, the method comprising:

[0006] In response to a login request sent by a local client, at least two preset login tickets are determined; the login request carries a client public key; the client public key is generated based on preset parameters negotiated between the client and the local server; the preset login ticket is the login credential of the client in a preset business system or the login credential of a target business site in the preset business system;

[0007] Generate at least two key pairs based on the server private key and the client public key; the server private key is generated based on preset parameters; each key pair corresponds to a preset login ticket; each key pair includes a downlink key; the downlink key is used to encrypt data sent from the local server to the client;

[0008] Encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result;

[0009] The ticket encryption result and the server public key are sent to the client, so that the client can obtain at least two key pairs based on the server public key and the client private key, and decrypt the ticket encryption result based on the downlink key in each key pair to obtain the preset login ticket; the server public key and the client private key are generated based on preset parameters.

[0010] On the other hand, an embodiment of the present application provides a method for obtaining a login ticket, the method comprising:

[0011] Send a login request to a local server, so that the server responds to the login request, determines at least two preset login tickets, and generates a key pair corresponding to each preset login ticket based on the server private key and the client public key, and enables the server to encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result; the login request carries the client public key; the client public key is generated based on the preset parameters negotiated between the local client and the server; the preset login ticket is the login credential of the local client in the preset business system or the login credential of the target business site in the preset business system; the server private key is generated based on the preset parameters; each key pair includes a downlink key; the downlink key is used to encrypt data sent by the server to the local client;

[0012] Receive the encrypted ticket result and the server public key sent by the server; the server public key is generated based on preset parameters;

[0013] At least two key pairs are obtained based on the server public key and the client private key; the client private key is generated based on preset parameters;

[0014] The ticket encryption result is decrypted based on the downlink key in each key pair to obtain the preset login ticket.

[0015] On the other hand, an embodiment of the present application provides a login ticket acquisition device, the device comprising:

[0016] A preset login ticket acquisition module is used to determine at least two preset login tickets in response to a login request sent by a local client; the login request carries a client public key; the client public key is generated based on preset parameters negotiated between the client and the local server; the preset login ticket is the login credential of the client in the preset business system or the login credential of the target business site in the preset business system;

[0017] A key pair generation module is used to generate at least two key pairs based on a server private key and a client public key; the server private key is generated based on preset parameters; each key pair corresponds to a preset login ticket; each key pair includes a downlink key; the downlink key is used to encrypt data sent from the local server to the client;

[0018] An encryption module, used to encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result;

[0019] The sending module is used to send the ticket encryption result and the server public key to the client, so that the client can obtain at least two key pairs based on the server public key and the client private key, and the client can decrypt the ticket encryption result based on the downlink key in each key pair to obtain the preset login ticket; the server public key and the client private key are generated based on preset parameters.

[0020] On the other hand, an embodiment of the present application provides a login ticket acquisition device, the device comprising:

[0021] A login request sending module, used to send a login request to a local server, so that the server responds to the login request, determines at least two preset login tickets, and generates a key pair corresponding to each preset login ticket based on the server private key and the client public key, and enables the server to encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result; the login request carries the client public key; the client public key is generated based on the preset parameters negotiated between the local client and the server; the preset login ticket is the login credential of the local client in the preset business system or the login credential of the target business site in the preset business system; the server private key is generated based on the preset parameters; each key pair includes a downlink key; the downlink key is used to encrypt data sent by the server to the local client;

[0022] A receiving module, used to receive the ticket encryption result and the server public key sent by the server; the server public key is generated based on preset parameters;

[0023] A key pair determination module, used to obtain at least two key pairs based on a server public key and a client private key; the client private key is generated based on preset parameters;

[0024] The decryption module is used to decrypt the ticket encryption result based on the downlink key in each key pair to obtain a preset login ticket.

[0025] On the other hand, the present application proposes an electronic device for obtaining login tickets, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the login ticket acquisition method as described above.

[0026] On the other hand, the present application proposes a computer-readable storage medium, which stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the login ticket acquisition method as described above.

[0027] On the other hand, the present application proposes a computer program product, which implements the login ticket acquisition method as described above when the computer program is executed by a processor.

[0028] The login ticket acquisition method, device, electronic device and storage medium proposed in the embodiment of the present application, when the client initiates a login request, generates multiple key pairs, and uses the downlink key in the multiple key pairs to encrypt the at least two preset login tickets respectively, and then transmits the encryption result to the client, and uses the key negotiation method to enable the client to obtain multiple key pairs, so that the client can decrypt the encryption result to obtain the preset login ticket. This method transmits the preset login ticket in an encrypted manner, reducing the risk of exposure of the preset login ticket during the transmission process, thereby improving the security of the business system. In addition, by setting multiple preset login tickets for the client that initiates the login request, the global security risk caused by the leakage of a single preset login ticket can be avoided, further improving the security of the business system. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0030] Figure 1 The present invention is a schematic diagram of an implementation environment of a login ticket acquisition method according to an exemplary embodiment.

[0031] Figure 2 The following is a flow diagram of a method for obtaining a login ticket according to an exemplary embodiment. Figure 1 .

[0032] Figure 3 A schematic diagram of a login ticket process according to an exemplary embodiment Figure 2.

[0033] Figure 4 The present invention is a flowchart showing a method for obtaining a login ticket with a server as the execution subject according to an exemplary embodiment.

[0034] Figure 5 The present invention is a flowchart showing a method for obtaining a login ticket with a client as the execution subject according to an exemplary embodiment.

[0035] Figure 6 The present invention is a block diagram of a login ticket acquisition device according to an exemplary embodiment.

[0036] Figure 7 The figure is a block diagram of another login ticket acquisition device according to an exemplary embodiment.

[0037] Figure 8 The present invention is a hardware structure block diagram of a server of a login ticket acquisition method provided according to an exemplary embodiment. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0040] In order to make the purpose, technical solution and advantages disclosed in the embodiments of the present application more clear, the embodiments of the present application are further described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present application and are not used to limit the embodiments of the present application.

[0041] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0042] Office Automation (OA) can be linked to daily affairs through specific processes or specific links, so that the efficiency of official documents in circulation, approval, and release can be improved, office management and information can be standardized, and the operating costs of enterprises can be reduced. In the authentication system of the OA system, bills are usually used for identity authentication and equipment security authentication. In the related technology, in the process of bill authentication when accessing the business, the bills used as identity authentication are mostly transmitted in plain text, which increases the risk of the bill transmission process being contaminated and hijacked, thereby exposing the bill. At present, in addition to the use of secure transmission protocols at the transmission protocol level, such as Hypertext Transfer Protocol Secure (HTTPS) and Transport Layer Security (TLS), there is a lack of other security mechanisms to ensure the transmission security of bills. In addition, in the OA system, all businesses can use the same bill for authentication without bill isolation, which increases the global risk caused by single point leakage.

[0043] In view of this, the embodiments of the present application provide a method, device, electronic device and storage medium for obtaining a login ticket. When a client initiates a login request, multiple key pairs are generated, and the downlink keys in the multiple key pairs are used to encrypt at least two preset login tickets respectively, and then the encryption results are transmitted to the client, and the client is enabled to obtain multiple key pairs by using the key negotiation method, so that the client can decrypt the encryption results to obtain the preset login ticket. By generating multiple pairs of parallel key pairs, the encrypted transmission between different preset login tickets can be met in the case of multi-level parallel of the client and multiple pairs of parallel preset login tickets of the same level. Moreover, in the case of unidentified transmission of preset login tickets, the function of completing the authentication of the preset login ticket is realized through the encryption / decryption negotiation process between the client and the background, which reduces the exposure risk of the preset login ticket during the transmission process, enhances the security of the preset login ticket, and thus improves the security of the business system. In addition, by setting multiple preset login tickets for the client that initiates the login request, the global security risk caused by the leakage of a single preset login ticket can be avoided, and the security of the business system can be further improved.

[0044] Figure 1FIG. 1 is a schematic diagram showing an implementation environment of a method for obtaining a login ticket according to an exemplary embodiment. Figure 1 As shown, the implementation environment may at least include a client 01 and a server 02. The client 01 and the server 2 may be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitation thereto.

[0045] In an embodiment of the present application, the client 01 can be used to send a login request to the server 02, so that the server 02 responds to the login request, determines at least two preset login tickets, and generates a key pair corresponding to each preset login ticket based on the server private key and the client public key, and enables the server 02 to encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result. The client 01 can also be used to receive the ticket encryption result sent by the server 02 and the server public key; the server public key is generated based on preset parameters, and at least two pairs of key pairs are obtained based on the server public key and the client private key, and the ticket encryption result is decrypted based on the downlink key in each pair of key pairs to obtain a preset login ticket. Optionally, the client 01 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, an intelligent voice interaction device, a smart home appliance, a smart watch, a vehicle terminal, an aircraft, etc., but is not limited to this.

[0046] In the embodiment of the present application, the server 02 can be used to respond to the login request sent by the client 01, determine at least two preset login tickets, and generate at least two key pairs based on the server private key and the client public key. The server 02 can also be used to encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket, obtain the ticket encryption result, and send the ticket encryption result and the server public key to the client 01, so that the client 01 can obtain at least two key pairs based on the server public key and the client private key, and decrypt the ticket encryption result based on the downlink key in each key pair to obtain the preset login ticket. Optionally, the server 02 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0047] It should be noted that Figure 1 This is just an example. In other scenarios, other implementation environments may also be included.

[0048] Figure 2 The following is a flow diagram of a method for obtaining a login ticket according to an exemplary embodiment. Figure 1 This method can be used for Figure 1 In the implementation environment of . This specification provides the operation steps of the login ticket acquisition method as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only execution order. When the actual system or server product is executed, the login ticket acquisition method shown in the embodiment or the accompanying drawings can be executed sequentially or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, Figure 2 As shown, the method may include:

[0049] S101: The client sends a login request to the server.

[0050] In an embodiment of the present application, when the client user first logs in to the target business site in the preset business system to perform business processing, a login request can be initiated to the server through the web page or application corresponding to the preset business system in the client to log in to the preset business system. Optionally, the preset business system can be an office automation system that provides a login function, or it can be a social software, shopping website, or video application that provides a login function. The preset business system may include multiple business sites that can provide business services. The target business site is one or more of the multiple business sites in the preset business system. For example, the preset business system is an automated office system, and the preset business system can provide business services, such as administrative approval, announcement release, meeting reservation, etc. The site corresponding to each business service is the business site.

[0051] In an embodiment of the present application, there may be multiple methods for the client to send a login request to the server, such as sending a login request by entering an account number and password on a login interface of a preset business system, or sending a login request by entering a text message verification code on a login interface of a preset business system, or sending a login request by scanning a QR code on a login interface of a preset business system. The embodiments of the present application do not impose too many restrictions on this.

[0052] S103: The server determines at least two preset login tickets in response to the login request, and generates at least two key pairs based on the server private key and the client public key.

[0053] In the embodiment of the present application, the login request carries login information, which may be an account number and password, or the device information of the client. After receiving the login request sent by the client, the server obtains the login information by parsing the login request, and then verifies the login information. If the verification fails, the server rejects the client's login request. If the verification passes, the server generates a preset login ticket for the client. The preset login ticket is the login credential of the client in the preset business system or the login credential of the target business site in the preset business system. By setting the preset login ticket, the login efficiency and the client user experience can be improved. When the client user object uses or accesses the target business site in the preset business system for the first time, it can log in by entering the account number and password. In order to avoid the need to enter the account number and password every time the client user object uses or accesses the target business site in the future, the preset login ticket corresponding to the preset business system and the preset login ticket corresponding to the target business site can be generated after the client user object successfully logs in for the first time. These preset login tickets may include the login credentials of the client user object in the preset business system and the login credentials of the target business site of the client user object in the preset business system. In this way, after the initial login is successful, when the client user needs to log in again, they can log in quickly and conveniently through these preset login tickets.

[0054] In some embodiments, after receiving the login request sent by the client, the server can also identify the login authority of the client user object based on the login information carried in the login request, and then generate different preset login tickets for the client user object according to the login authority of the client user object. Specifically, the server determines whether the client user object has the login authority of the preset business system and the login authority of each business site in the preset business system based on the login information. When the server determines that the client user object has the login authority of the preset business system, it generates a first-level login ticket for the client user object, and the client user object can subsequently log in to the preset business system quickly and conveniently through the first-level login ticket. When the server determines that the client user object has the login authority of the preset business system and has the authority to log in to a business site in the preset business system, it generates a second-level login ticket corresponding to the business site for the client user object, and the client user object can subsequently log in to the business site quickly and conveniently through the second-level login ticket.

[0055] In the embodiment of the present application, the preset login ticket corresponding to the client generated by the server needs to be sent to the client, so that the client can access the target business site in the preset business system again through the preset login ticket. In order to avoid the preset login ticket from being exposed during the transmission process, the preset login ticket can be encrypted by a high-security key to ensure the transmission security of the preset login ticket. Accordingly, when the server uses a high-security key to encrypt the preset login ticket, the client needs to obtain the key for decryption to obtain the preset login ticket.

[0056] In an embodiment of the present application, a key negotiation method can be used between the server and the client to negotiate a high-security key. The key negotiation between the server and the client can be performed before the client initiates a login request to the server, or the key negotiation can be performed simultaneously when the client initiates a login request to the server. As an example, before the client logs in to the preset business system, such as when the client registers an account in the server, the client negotiates with the server on the encryption / decryption method of the preset login ticket. When the server and the client perform key negotiation, the client can send a key negotiation request to the server. Accordingly, after the server receives the key negotiation request, the server generates preset parameters in response to the key negotiation request and sends the preset parameters to the client. The server can generate a server public key and a server private key based on the preset parameters. The server public key is used to be sent to the client so that the client obtains at least two key pairs. The server private key is used to enable the server to generate at least two key pairs based on the client public key and the server private key. The client can generate a client public key and a client private key based on the preset parameters. The client public key is used to be sent to the server, so that the server generates at least two key pairs based on the client public key. The client private key is used to enable the client to obtain at least two key pairs based on the server public key and the client private key. The server and the client obtain the key pair used to encrypt / decrypt the preset login ticket through key negotiation, which can improve the security of the preset login ticket during transmission.

[0057] In an embodiment of the present application, when the server sends preset parameters to the client, it can also send the algorithm related to key generation to the client at the same time, so that the client can calculate the key according to the preset parameters and the key generation algorithm. The algorithm related to the key negotiation between the server and the client may include a key generation algorithm. Optionally, the key generation algorithm may be an elliptic curve algorithm, such as the X25519 elliptic curve algorithm. The 25519 elliptic curve has excellent security performance and can ensure the security of the key negotiation mechanism. The server generates preset parameters based on the key exchange algorithm, and then generates the server public key and the server private key based on the preset parameters. As an example, the preset parameters generated by the server based on the key exchange algorithm are p and g. Among them, the preset parameter p is a large prime number, and the preset parameter g is an integer less than p. Then the server selects an integer a as the server private key, and calculates the server public key based on the preset parameters and the server private key. The specific calculation formula is: (g^a) mod p.

[0058] In the embodiment of the present application, after receiving the preset parameters sent by the client, the client can generate a client private key and a client public key based on the key exchange algorithm. As an example, the preset parameters received by the client are p and g. Then the client selects an integer b as the client private key, and calculates the client public key based on the preset parameters and the client private key, and the specific calculation formula is: (g^b) mod p.

[0059] In some embodiments, the server and the client negotiate the encryption / decryption key of the preset login ticket, which can also be performed after the server generates the preset ticket. That is, after the server generates the preset login ticket, the server generates the preset parameters based on the selected key generation algorithm, and then sends the preset parameters to the client.

[0060] In the embodiment of the present application, when the server encrypts the preset login ticket, it needs to determine the key pair based on the client public key of the client, and then encrypt the preset login ticket based on the key pair. Specifically, when the client sends a login request to the server, the login request carries the client public key generated based on the preset parameters negotiated between the client and the server, and then the server generates at least two key pairs based on the server private key and the client public key.

[0061] In an embodiment of the present application, when the server generates at least two pairs of key pairs based on the server private key and the client public key, in order to make the obtained key pairs have higher security, a shared key is first generated based on the server private key and the client public key, and then the shared key is derived based on a preset key derivation algorithm to obtain at least two pairs of key pairs. As an example, the calculation method for the server to generate a shared key based on the server private key and the client public key is: (((g^b)mod p)^a)mod p. The preset key derivation algorithm is obtained by negotiation between the server and the client, so that the client can also calculate the key pair through the preset key derivation algorithm. Optionally, the preset key derivation algorithm can be a key derivation algorithm, such as the HKDF (HMAC-based Key Derivation Function) algorithm. The shared key generated based on the server private key and the client public key is derived by the preset key derivation algorithm, while ensuring randomness, and one or more key pairs that can achieve cryptographic strength are derived, thereby ensuring the transmission security of the preset login ticket.

[0062] As an optional implementation, the preset key derivation algorithm includes a first preset key derivation algorithm and a second preset key derivation algorithm. When the server derives the shared key based on the preset key derivation algorithm, the server first performs key extraction and expansion processing on the shared key based on the first preset key derivation algorithm to obtain a master key. Then the server derives the master key based on the second preset key derivation algorithm to obtain at least two key pairs. In this implementation, the first preset key derivation algorithm and the second preset key derivation algorithm can be the same or different. Optionally, the first preset key derivation algorithm and the second preset key derivation algorithm can both be HKDF algorithms. When the shared key is derivatized based on the first preset key derivation algorithm, two processes can be included: an extraction process and an expansion process. The extraction process is to use the shared key to derive a pseudo-random key that meets the cryptographic strength. The expansion process is to use the pseudo-random key extracted by the extraction process step to expand a master key of a specified length while ensuring randomness. When the master key is derivatized based on the second preset key derivation algorithm, the master key can be expanded using the expansion process method in the HKDF algorithm, so that multiple key pairs can be obtained. By deriving the shared key in sequence through the first preset key derivation algorithm and the second preset key derivation algorithm, multiple pairs of key pairs with high security can be obtained, thereby realizing the encryption of multiple preset login tickets separately, thereby avoiding the global security risks brought about by the single point leakage of the preset login tickets.

[0063] In an embodiment of the present application, the number of key pairs derived from the shared key can be the same as the number of preset login tickets that currently need to be transmitted, that is, each preset login ticket that currently needs to be transmitted corresponds to a pair of key pairs. Each pair of key pairs includes an uplink key and a downlink key. Among them, the downlink key is used to encrypt data sent by the server to the client. The uplink key is used to encrypt data sent by the client to the server. By using the uplink key and the downlink key to encrypt the preset login tickets transmitted between the client and the server respectively, it can be achieved that the encryption failure is not caused by the key being leaked during the transmission process, thereby improving the security of the preset login tickets transmitted between the client and the server.

[0064] In some embodiments, the number of key pairs derived from the shared key may be greater than the number of preset login tickets that need to be transmitted. Theoretically, the preset business system includes multiple business sites, and for each business site, the server can generate a corresponding preset login ticket for the client. For the preset login tickets corresponding to all business sites in the preset business system, each preset login ticket needs to be encrypted / decrypted using a pair of key pairs during the transmission process. These key pairs can be generated by the server at the same time, and according to the encryption / decryption needs, some or all of these key pairs can be used to encrypt / decrypt the preset login tickets.

[0065] S105: The server encrypts each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result.

[0066] In an embodiment of the present application, after determining multiple key pairs, the server can encrypt the preset login ticket based on the downlink key in each key pair before sending the preset login ticket to the client to obtain a ticket encryption result, and then send the encrypted result to the client, thereby ensuring the security of the transmission of the preset login ticket.

[0067] In the embodiment of the present application, since the preset login tickets corresponding to different business sites in the preset business system are different, when encrypting different preset tickets, it is necessary to encrypt based on the key pair corresponding to each preset ticket. Specifically, at least two preset login tickets include a first preset login ticket and at least one second preset login ticket. The first preset login ticket is the login credential of the client in the preset business system. The second login ticket is the login credential of the client in the target business site. At least two pairs of key pairs include a first key pair and at least one pair of second key pairs. The first key pair corresponds to the first preset login ticket, and the second key pair corresponds to the second preset login ticket one by one. When the server encrypts each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket, the first preset login ticket is encrypted based on the downlink key in the first key pair, thereby obtaining a first encryption result. Based on the downlink key in each pair of second key pairs, the second preset login ticket corresponding to each pair of second key pairs is encrypted, thereby obtaining a second encryption result. Then the server combines the first encryption result and the second encryption result to obtain a ticket encryption result. For each preset login ticket that needs to be transmitted, a corresponding downlink key is used for encryption, thereby avoiding the global security risks caused by a single point of leakage of the preset login ticket.

[0068] S107: The server sends the ticket encryption result and the server public key to the client.

[0069] In the embodiment of the present application, after the server uses the downlink key in the key pair to encrypt the preset ticket to obtain the ticket encryption result, the ticket encryption result is sent to the client so that the client can obtain the preset login ticket. After receiving the ticket encryption result sent by the server, the client needs to obtain the key pair to decrypt the ticket encryption result to obtain the preset login ticket. When the client determines the key pair, it needs to obtain the server public key for calculation. Therefore, when the server sends the ticket encryption result to the client, it can also send the server public key to the client at the same time.

[0070] S109: The client obtains at least two key pairs based on the server public key and the client private key.

[0071] In an embodiment of the present application, after obtaining the server public key, the client performs key calculation based on the server public key and the client private key generated by the client itself, thereby obtaining at least two key pairs. Specifically, when the client obtains at least two key pairs based on the server public key and the client private key, the client first determines the shared key based on the server public key and the client private key. The calculation method of the shared key is a key generation algorithm. As an example, the calculation method for the client to generate the shared key based on the server public key and the client private key is: (((g^a)mod p)^b)mod p. After the client calculates the shared key, the client derives the shared key based on a preset key derivation algorithm to obtain at least two key pairs. Among them, the preset key derivation algorithm is obtained by negotiation between the client and the server, and can be sent by the server to the client in response to a key negotiation request. Optionally, the preset key derivation algorithm can be a key derivation algorithm, such as the HKDF algorithm. The shared key generated based on the server private key and the client public key is derived through a preset key derivation algorithm. Under the premise of ensuring randomness, one or more key pairs with cryptographic strength are derived, thereby ensuring the transmission security of the preset login ticket.

[0072] As an optional implementation, the preset key derivation algorithm includes a first preset key derivation algorithm and a second preset key derivation algorithm. When the client derives the shared key based on the preset key derivation algorithm, the client performs key extraction and expansion processing on the shared key based on the first preset key derivation algorithm to obtain a master key. Then the client derives the master key based on the second preset key derivation algorithm to obtain at least two key pairs. In this implementation, the first preset key derivation algorithm and the second preset key derivation algorithm can be the same or different. Optionally, the first preset key derivation algorithm and the second preset key derivation algorithm can both be HKDF algorithms. When the shared key is derivatized based on the first preset key derivation algorithm, two processes can be included: an extraction process and an expansion process. The extraction process is to use the shared key to derive a pseudo-random key that meets the cryptographic strength. The expansion process is to use the pseudo-random key extracted by the extraction process step to expand a master key of a specified length while ensuring randomness. When the master key is derivatized based on the second preset key derivation algorithm, the master key can be expanded using the expansion process method in the HKDF algorithm, so that multiple key pairs can be obtained. By deriving the shared key in sequence through the first preset key derivation algorithm and the second preset key derivation algorithm, multiple pairs of key pairs with high security can be obtained, thereby realizing the encryption of multiple preset login tickets separately, thereby avoiding the global security risks brought about by the single point leakage of the preset login tickets.

[0073] S111: The client decrypts the ticket encryption result based on the downlink key in each key pair to obtain a preset login ticket.

[0074] In an embodiment of the present application, after obtaining the key pair, the client decrypts the ticket encryption result based on the downlink key in the key pair, thereby obtaining a preset login ticket. Specifically, the key pair obtained by the client is consistent with the key pair generated by the server. The ticket encryption result may include encryption results corresponding to multiple preset login tickets. After obtaining the key pair, the client uses the downlink key in the obtained key pair to decrypt the encryption results corresponding to the multiple preset login tickets sent by the server one by one, thereby obtaining these preset login tickets. In some embodiments, the encryption results corresponding to the multiple preset login tickets sent by the server include the type identification of each preset login ticket. When decrypting the ticket encryption result, the client can determine the corresponding key pair according to the type identification of each preset login ticket, and then use the downlink key in the corresponding key pair to decrypt the encryption results corresponding to each preset login ticket, thereby obtaining all preset login tickets.

[0075] In some embodiments, the server may also first negotiate a key with the client, so that both the server and the client obtain multiple key pairs. The server then uses the downlink key in the key pair to encrypt the preset login ticket, obtain the encryption result, and then send the encrypted result to the client. The client can use the downlink key in the key pair to decrypt the received encryption result to obtain the preset login ticket.

[0076] In the embodiment of the present application, after the client obtains the preset login ticket, when the client needs to log in to the target business site in the preset business system again, the client can quickly log in based on the preset login ticket corresponding to the preset business system and the target business site. When the client logs in based on the preset login ticket corresponding to the preset business system and the target business site, it is necessary to use the uplink key in the key pair corresponding to each preset login ticket to encrypt the preset login ticket, and then transmit the encryption result to the server for verification. Specifically, the client sends an access request for the target business site to the server, and the access request carries the encryption result to be verified obtained by encrypting the preset login ticket based on the uplink key. The server responds to the access request and decrypts the encryption result to be verified based on the uplink key in each key pair to obtain the preset login ticket. Then the server verifies the preset login ticket, and if the verification passes, the server executes the client's access operation for the target business site. By setting the uplink key to encrypt the preset login ticket sent by the client to the server, the security of the preset login ticket during the uplink transmission process is guaranteed. In addition, by setting the uplink key and the downlink key to encrypt the transmission of the preset login ticket in different transmission directions respectively, the security risk caused by the leakage of a certain key to the preset business system can be reduced.

[0077] In the embodiment of the present application, Figure 3 A schematic diagram of a login ticket process according to an exemplary embodiment Figure 2 ,like Figure 3As shown, the client and the server determine to use the X25519 elliptic curve algorithm to determine the shared key through key negotiation. The client generates the client public key and the client private key based on the X25519 elliptic curve algorithm. For example, the client generates a pair of random X25519 key pairs (pk 1, secret 1). The server generates the server public key and the server private key based on the X25519 elliptic curve algorithm. For example, the server generates a pair of random x25519 key pairs (pk 2, secret 2). Optionally, the preset parameters based on which the client and the server generate their respective public keys and private keys can be sent by the server to the client or by the client to the server. When the client sends a login request to the server, the client public key can be carried in the login request. The server receives the login request sent by the client, verifies the login information in the login request, and generates a preset login ticket corresponding to the client when the verification passes. Optionally, the server may generate multiple preset login tickets corresponding to the client, and different preset login tickets are used as login credentials for the client in the preset business system, or as login credentials for different business sites in the preset business system. After the server generates the preset login ticket corresponding to the client, it may first determine the shared key based on the client public key and the server private key. In order to further ensure the transmission security of the preset login ticket, the server derives the shared key once or multiple times based on the shared key, thereby obtaining a key pair with a higher security factor. Figure 3As shown, the server can derive the shared key to obtain the master key, and then derive the master key to obtain multiple key pairs. Each key pair contains an uplink key and a downlink key, wherein the uplink key is used to decrypt the encrypted data sent by the client to the server, and the downlink key is used to encrypt the data sent by the server to the client. Among these key pairs, different key pairs are used to encrypt / decrypt different preset login tickets. The server uses the downlink keys in these key pairs to encrypt the corresponding preset login tickets respectively, so as to obtain the encryption result corresponding to each preset ticket. The server then sends the encryption result corresponding to each preset ticket and the server public key to the client. The server derives a key pair for encrypting / decrypting different preset login tickets based on the master key. Different preset login tickets can be login tickets used in different scenarios. For example, the key pairs derived by the server based on the master key include main_key_up / down, ngn_key_up / down, and web_key_up / down. Among them, main_key_up / down is used to encrypt / decrypt the preset login ticket corresponding to the preset business system, ngn_key_up / down is used to encrypt / decrypt the preset login ticket corresponding to the ngn (next generation network) business site in the preset business system, and web_key_up / down is used to encrypt / decrypt the preset login ticket corresponding to the web (Internet) business site in the preset business system. After receiving the encryption result corresponding to each preset ticket and the server public key, the client will first calculate the shared key based on the server public key and the client private key, and then derive the shared key according to the preset key derivation algorithm negotiated with the server during the key negotiation process, thereby obtaining multiple key pairs. The key pair obtained by the client is the same as the key pair obtained by the server, so that the client can decrypt the encryption result corresponding to each preset ticket based on the downlink key in the key pair, thereby obtaining the corresponding preset login ticket. When the client needs to access the target business site in the preset business system again, the preset login ticket corresponding to the preset business system and the target business site can be encrypted by the uplink key in the multiple key pairs, and then the encryption result is sent to the server. The server only decrypts the encryption result by using the uplink key in the multiple key pairs to obtain the preset login ticket.

[0078] In the embodiment of the present application, the server can also set a certain validity period for the preset login ticket. In addition, different validity periods can be set for different preset login tickets. For example, the preset login ticket corresponding to the preset business system can have a longer validity period, while the preset login ticket corresponding to the business site in the preset business system can have a shorter validity period. When the preset login ticket exceeds the validity period, the client needs to re-execute the above preset ticket acquisition method to obtain the preset login ticket.

[0079] The login ticket acquisition method described in the embodiment of the present application generates multiple pairs of parallel key pairs to meet the encrypted transmission between different preset login tickets in the case of multi-level parallel client and multiple pairs of parallel preset login tickets of the same level. In addition, in the case of unknown text transmission of preset login tickets, the function of completing the preset login ticket authentication is realized through the encryption / decryption negotiation process between the client and the background, thereby enhancing the security of the preset login ticket.

[0080] Based on the above description, the following introduces a specific embodiment of a login ticket acquisition method of the present application with the server as the execution subject. Figure 4 is a flow chart showing a method for obtaining a login ticket with a server as the execution subject according to an exemplary embodiment. Figure 4 As shown, the method may include:

[0081] S201: In response to a login request sent by a local client, determine at least two preset login tickets; the login request carries a client public key; the client public key is generated based on preset parameters negotiated between the client and the local server; the preset login ticket is the login credential of the client in the preset business system or the login credential of the target business site in the preset business system.

[0082] S203: Generate at least two key pairs based on the server private key and the client public key; the server private key is generated based on preset parameters; each key pair corresponds to a preset login ticket; each key pair includes a downlink key; the downlink key is used to encrypt data sent by the local server to the client.

[0083] S205: Encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result.

[0084] S207: Send the ticket encryption result and the server public key to the client, so that the client can obtain at least two key pairs based on the server public key and the client private key, and decrypt the ticket encryption result based on the downlink key in each key pair to obtain the preset login ticket; the server public key and the client private key are generated based on preset parameters.

[0085] In some optional embodiments, before determining at least two preset login tickets in response to the login request sent by the client, the method further includes:

[0086] In response to a key negotiation request sent by the client, generate preset parameters, and send the preset parameters to the client, so that the client generates a client public key and a client private key based on the preset parameters;

[0087] A server public key and a server private key are generated based on preset parameters; the server public key is used to be sent to the client so that the client obtains at least two key pairs; the server private key is used to enable the local server to generate at least two key pairs based on the client public key and the server private key.

[0088] In some optional embodiments, at least two key pairs are generated based on the server private key and the client public key, including:

[0089] Generate a shared key based on the server private key and the client public key;

[0090] The shared key is derived based on a preset key derivation algorithm to obtain at least two key pairs; the preset key derivation algorithm is obtained through negotiation between the local server and the client.

[0091] In some optional embodiments, the preset key derivation algorithm includes a first preset key derivation algorithm and a second preset key derivation algorithm; the shared key is derivatized based on the preset key derivation algorithm to obtain at least two key pairs, including:

[0092] Perform key extraction and expansion processing on the shared key based on a first preset key derivation algorithm to obtain a master key;

[0093] The master key is derived based on a second preset key derivation algorithm to obtain at least two key pairs.

[0094] In some optional embodiments, the at least two preset login tickets include a first preset login ticket and at least one second preset login ticket; the first preset login ticket is a login credential of the client in the preset business system; the second preset login ticket is a login credential of the client in the target business site; the at least two key pairs include a first key pair and at least one second key pair; the first key pair corresponds to the first preset login ticket, and the second key pair corresponds to the second preset login ticket one by one; based on the downlink key in the key pair corresponding to each preset login ticket, each preset login ticket is encrypted to obtain a ticket encryption result, including:

[0095] Encrypting the first preset login ticket based on the downlink key in the first key pair to obtain a first encryption result;

[0096] Based on the downlink key in each pair of the second key pairs, encrypt the second preset login ticket corresponding to each pair of the second key pairs to obtain a second encryption result;

[0097] The ticket encryption result is obtained based on the first encryption result and the second encryption result.

[0098] In some optional embodiments, each key pair also includes an uplink key; after sending the ticket encryption result and the server public key to the client so that the client obtains at least two key pairs based on the server public key and the client private key, and the client decrypts the ticket encryption result based on the downlink key in each key pair to obtain the preset login ticket, the method further includes:

[0099] Receive an access request for logging into a preset business system sent by a client; the access request carries an encryption result to be verified obtained by encrypting a preset login ticket based on an uplink key;

[0100] Decrypt the encrypted result to be verified based on the uplink key in each key pair to obtain a preset login ticket;

[0101] Verify the preset login ticket and obtain the verification result;

[0102] If the verification result is that the verification is passed, the client's access operation to the preset business system is executed.

[0103] Based on the above description, the following introduces a specific embodiment of a login ticket acquisition method of the present application with the client as the execution subject. Figure 5 is a flow chart showing a method for obtaining a login ticket with a client as the execution subject according to an exemplary embodiment. Figure 5 As shown, the method may include:

[0104] S301: Send a login request to the local server, so that the server responds to the login request, determines at least two preset login tickets, and generates a key pair corresponding to each preset login ticket based on the server private key and the client public key, and enables the server to encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result; the login request carries the client public key; the client public key is generated based on the preset parameters negotiated between the local client and the server; the preset login ticket is the login credential of the local client in the preset business system or the login credential of the target business site in the preset business system; the server private key is generated based on the preset parameters; each key pair includes a downlink key; the downlink key is used to encrypt data sent by the server to the local client.

[0105] S303: Receive the ticket encryption result and the server public key sent by the server; the server public key is generated based on preset parameters.

[0106] S305: Obtain at least two key pairs based on the server public key and the client private key; the client private key is generated based on preset parameters.

[0107] S307: Decrypt the ticket encryption result based on the downlink key in each key pair to obtain a preset login ticket.

[0108] In some optional embodiments, before sending the login request to the server, the method further includes:

[0109] Sending a key negotiation request to the server, so that the server generates preset parameters in response to the key negotiation request;

[0110] Receive preset parameters sent by the server;

[0111] A client public key and a client private key are generated based on the received preset parameters; the client public key is used to be sent to the server so that the server generates at least two key pairs based on the client public key; the client private key is used to enable the local client to obtain at least two key pairs based on the server public key and the client private key.

[0112] In some optional embodiments, at least two key pairs are obtained based on the server public key and the client private key, including:

[0113] Determine a shared key based on the server public key and the client private key;

[0114] The shared key is derived based on a preset key derivation algorithm to obtain at least two key pairs; the preset key derivation algorithm is obtained through negotiation between the local client and the server.

[0115] In some optional embodiments, the preset key derivation algorithm includes a first preset key derivation algorithm and a second preset key derivation algorithm; the shared key is derivatized based on the preset key derivation algorithm to obtain at least two key pairs, including:

[0116] Perform key extraction and expansion processing on the shared key based on a first preset key derivation algorithm to obtain a master key;

[0117] The master key is derived based on a second preset key derivation algorithm to obtain at least two key pairs.

[0118] The embodiment of the present application also discloses a login ticket acquisition device, Figure 6 FIG. 1 is a block diagram of a login ticket acquisition device according to an exemplary embodiment. Figure 6 As shown, the device may include at least:

[0119] The preset login ticket determination module 401 is used to determine at least two preset login tickets in response to a login request sent by a local client; the login request carries a client public key; the client public key is generated based on preset parameters negotiated between the client and the local server; the preset login ticket is the login credential of the client in the preset business system or the login credential of the target business site in the preset business system;

[0120] The key pair generation module 403 is used to generate at least two key pairs based on the server private key and the client public key; the server private key is generated based on preset parameters; each key pair corresponds to a preset login ticket; each key pair includes a downlink key; the downlink key is used to encrypt data sent by the local server to the client;

[0121] The encryption module 405 is used to encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result;

[0122] Sending module 407 is used to send the ticket encryption result and the server public key to the client, so that the client can obtain at least two key pairs based on the server public key and the client private key, and enable the client to decrypt the ticket encryption result based on the downlink key in each key pair to obtain a preset login ticket; the server public key and the client private key are generated based on preset parameters.

[0123] In some optional embodiments, the device further comprises:

[0124] A preset parameter generation module, used to generate preset parameters in response to a key negotiation request sent by a client, and send the preset parameters to the client, so that the client generates a client public key and a client private key based on the preset parameters;

[0125] The local server key generation module is used to generate a server public key and a server private key based on preset parameters; the server public key is used to be sent to the client so that the client obtains at least two key pairs; the server private key is used to enable the local server to generate at least two key pairs based on the client public key and the server private key.

[0126] In some optional embodiments, the key pair generation module includes:

[0127] A shared key generation submodule is used to generate a shared key based on the server private key and the client public key;

[0128] The key derivation submodule is used to derive the shared key based on a preset key derivation algorithm to obtain at least two key pairs; the preset key derivation algorithm is negotiated between the local server and the client.

[0129] In some optional embodiments, the preset key derivation algorithm includes a first preset key derivation algorithm and a second preset key derivation algorithm; and the key derivation submodule includes:

[0130] A master key determination unit, configured to perform key extraction processing and expansion processing on the shared key based on a first preset key derivation algorithm to obtain a master key;

[0131] The key pair determination unit is used to derive the master key based on a second preset key derivation algorithm to obtain at least two key pairs.

[0132] In some optional embodiments, the at least two preset login tickets include a first preset login ticket and at least one second preset login ticket; the first preset login ticket is a login credential of the client in the preset business system; the second preset login ticket is a login credential of the client in the target business site; the at least two pairs of key pairs include a first key pair and at least one pair of second key pairs; the first key pair corresponds to the first preset login ticket, and the second key pair corresponds to the second preset login ticket one by one; the encryption module includes:

[0133] A first encryption result determining unit, configured to encrypt the first preset login ticket based on the downlink key in the first key pair to obtain a first encryption result;

[0134] A second encryption result determination unit, configured to encrypt the second preset login ticket corresponding to each pair of the second key pairs based on the downlink key in each pair of the second key pairs to obtain a second encryption result;

[0135] The bill encryption result determining unit is used to obtain the bill encryption result based on the first encryption result and the second encryption result.

[0136] In some optional embodiments, each key pair further includes an uplink key; and the device further includes:

[0137] An access request receiving module is used to receive an access request sent by a client to log in to a preset business system; the access request carries an encryption result to be verified obtained by encrypting a preset login ticket based on an uplink key;

[0138] A decryption module, used to decrypt the encryption result to be verified based on the uplink key in each key pair to obtain a preset login ticket;

[0139] A verification module is used to verify the preset login ticket and obtain the verification result;

[0140] The login module is used to execute the client's access operation to the preset business system when the verification result is passed.

[0141] It should be noted that the login ticket acquisition device embodiment provided in the embodiment of the present application and the login ticket acquisition method embodiment with the server as the execution subject are based on the same inventive concept.

[0142] The embodiment of the present application also discloses a login ticket acquisition device, Figure 7 FIG. 1 is a block diagram of another login ticket acquisition device according to an exemplary embodiment. Figure 7 As shown, the device may include at least:

[0143] The login request sending module 501 is used to send a login request to the server, so that the server responds to the login request, determines at least two preset login tickets, and generates a key pair corresponding to each preset login ticket based on the server private key and the client public key, and encrypts each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result; the login request carries the client public key; the client public key is generated based on the preset parameters negotiated between the local client and the server; the preset login ticket is the login credential of the local client in the preset business system or the login credential of the target business site in the preset business system; the server private key is generated based on the preset parameters; each key pair includes a downlink key; the downlink key is used to encrypt data sent by the server to the local client;

[0144] Receiving module 503, used to receive the ticket encryption result and the server public key sent by the server; the server public key is generated based on preset parameters;

[0145] A key pair determination module 505, configured to obtain at least two key pairs based on a server public key and a client private key; the client private key is generated based on preset parameters;

[0146] The decryption module 507 is used to decrypt the ticket encryption result based on the downlink key in each key pair to obtain a preset login ticket.

[0147] In some optional embodiments, the device further comprises:

[0148] A key negotiation request sending module, used to send a key negotiation request to a server, so that the server generates preset parameters in response to the key negotiation request;

[0149] A preset parameter receiving module, used to receive the preset parameters sent by the server;

[0150] A local client key generation module is used to generate a client public key and a client private key based on the received preset parameters; the client public key is used to be sent to the server so that the server generates at least two key pairs based on the client public key; the client private key is used to enable the local client to obtain at least two key pairs based on the server public key and the client private key.

[0151] In some optional embodiments, the key pair determination module includes:

[0152] A shared key determination submodule, used to determine a shared key based on a server public key and a client private key;

[0153] The key derivation submodule is used to derive the shared key based on a preset key derivation algorithm to obtain at least two key pairs; the preset key derivation algorithm is negotiated between the local client and the server.

[0154] In some optional embodiments, the preset key derivation algorithm includes a first preset key derivation algorithm and a second preset key derivation algorithm; and the key derivation submodule includes:

[0155] A master key determination unit, configured to perform key extraction processing and expansion processing on the shared key based on a first preset key derivation algorithm to obtain a master key;

[0156] The key pair determination unit is used to derive the master key based on a second preset key derivation algorithm to obtain at least two key pairs.

[0157] It should be noted that the login ticket acquisition device embodiment provided in the embodiment of the present application and the login ticket acquisition method embodiment with the client as the execution subject are based on the same inventive concept.

[0158] It should be noted that the login ticket acquisition device embodiment provided in the embodiment of the present application and the above-mentioned login ticket acquisition method embodiment are based on the same inventive concept.

[0159] An embodiment of the present application also provides an electronic device for obtaining a login ticket, the electronic device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement a login ticket obtaining method as provided in any of the above embodiments.

[0160] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a terminal to store at least one instruction or at least one program for implementing a login ticket acquisition method in a method embodiment, and the at least one instruction or at least one program is loaded and executed by a processor to implement the login ticket acquisition method provided in the above method embodiment.

[0161] Optionally, in the embodiment of this specification, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the above storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0162] The memory of the embodiment of this specification can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, applications required for functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0163] The embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the login ticket acquisition method provided in the above method embodiment.

[0164] The login ticket acquisition method embodiment provided in the embodiment of the present application can be executed in a terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Figure 8 FIG. 1 is a hardware structure diagram of a server of a login ticket acquisition method provided according to an exemplary embodiment. Figure 8As shown, the server 600 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 610 (the central processing unit 610 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 630 for storing data, and one or more storage media 620 (such as one or more mass storage devices) for storing application programs 623 or data 622. Among them, the memory 630 and the storage medium 620 can be short-term storage or permanent storage. The program stored in the storage medium 620 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 610 can be configured to communicate with the storage medium 620 and execute a series of instruction operations in the storage medium 620 on the server 600. The server 600 may also include one or more power supplies 660, one or more wired or wireless network interfaces 650, one or more input and output interfaces 640, and / or one or more operating systems 621, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0165] The input / output interface 640 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 600. In one example, the input / output interface 640 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 640 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0166] It can be understood by those skilled in the art that Figure 8 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 8 More or fewer components as shown, or with Figure 8 Different configurations shown.

[0167] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

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

[0169] A person skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0170] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for obtaining a login ticket, characterized in that: The method comprises: In response to a login request sent by a client, at least two preset login tickets are determined; the login request carries a client public key; the client public key is generated based on preset parameters negotiated between the client and the local server; the preset login ticket is the login credential of the client in a preset business system or the login credential of a target business site in the preset business system; At least two key pairs are generated based on the server private key and the client public key; the server private key is generated based on the preset parameters; each key pair corresponds to one of the preset login tickets; each key pair includes a downlink key; the downlink key is used to encrypt data sent by the local server to the client; Encrypting each of the preset login tickets based on the downlink key in the key pair corresponding to each of the preset login tickets to obtain a ticket encryption result; The ticket encryption result and the server public key are sent to the client, so that the client obtains at least two pairs of the key pairs based on the server public key and the client private key, and the client decrypts the ticket encryption result based on the downlink key in each pair of the key pairs to obtain the preset login ticket; the server public key and the client private key are generated based on the preset parameters.

2. The method according to claim 1, characterized in that Before determining at least two preset login tickets in response to the login request sent by the client, the method further includes: In response to the key negotiation request sent by the client, generating the preset parameters, and sending the preset parameters to the client, so that the client generates the client public key and the client private key based on the preset parameters; The server public key and the server private key are generated based on the preset parameters; the server public key is used to be sent to the client so that the client obtains at least two pairs of the key pairs; the server private key is used to enable the local server to generate the at least two pairs of the key pairs based on the client public key and the server private key.

3. The method according to claim 1, characterized in that: The generating at least two key pairs based on the server private key and the client public key includes: Generate a shared key based on the server private key and the client public key; The shared key is derived based on a preset key derivation algorithm to obtain at least two key pairs; the preset key derivation algorithm is obtained by negotiation between the local server and the client.

4. The method according to claim 3, characterized in that The preset key derivation algorithm includes a first preset key derivation algorithm and a second preset key derivation algorithm; The step of deriving the shared key based on a preset key derivation algorithm to obtain at least two key pairs includes: Performing key extraction and expansion processing on the shared key based on the first preset key derivation algorithm to obtain a master key; The master key is derivatized based on the second preset key derivation algorithm to obtain at least two key pairs.

5. The method according to claim 1, characterized in that The at least two preset login tickets include a first preset login ticket and at least one second preset login ticket; the first preset login ticket is the login credential of the client in the preset business system; The second preset login ticket is the login credential of the client in the target business site; The at least two key pairs include a first key pair and at least one second key pair; the first key pair corresponds to the first preset login ticket, and the second key pair corresponds to the second preset login ticket one by one; The step of encrypting each of the preset login tickets based on the downlink key in the key pair corresponding to each of the preset login tickets to obtain a ticket encryption result includes: Encrypting the first preset login ticket based on the downlink key in the first key pair to obtain a first encryption result; Based on the downlink key in each pair of the second key pairs, encrypt the second preset login ticket corresponding to each pair of the second key pairs to obtain a second encryption result; The ticket encryption result is obtained based on the first encryption result and the second encryption result.

6. The method according to any one of claims 1 to 5, characterized in that: Each pair of the key pairs also includes an uplink key; after sending the ticket encryption result and the server public key to the client so that the client obtains at least two pairs of the key pairs based on the server public key and the client private key, and decrypting the ticket encryption result based on the downlink key in each pair of the key pairs to obtain the preset login ticket, the method further includes: receiving an access request for logging into the preset business system sent by the client; the access request carries an encryption result to be verified obtained by encrypting the preset login ticket based on the uplink key; Decrypting the encrypted result to be verified based on the uplink key in each pair of the key pairs to obtain the preset login ticket; Verifying the preset login ticket to obtain a verification result; When the verification result is that the verification is passed, the access operation of the client to the preset business system is performed.

7. A method for obtaining a login ticket, characterized in that: The method comprises: Send a login request to a server, so that the server responds to the login request, determines at least two preset login tickets, and generates a key pair corresponding to each preset login ticket based on the server private key and the client public key, and encrypts each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result; the login request carries the client public key; the client public key is generated based on the preset parameters negotiated between the local client and the server; the preset login ticket is the login credential of the local client in the preset business system or the login credential of the target business site in the preset business system; the server private key is generated based on the preset parameters; each pair of the key pairs includes a downlink key; the downlink key is used to encrypt data sent by the server to the local client; Receive the ticket encryption result and the server public key sent by the server; the server public key is generated based on the preset parameters; At least two key pairs are obtained based on the server public key and the client private key; the client private key is generated based on the preset parameters; The ticket encryption result is decrypted based on the downlink key in each key pair to obtain the preset login ticket.

8. The method according to claim 7, characterized in that Before sending the login request to the server, the method further includes: Sending a key negotiation request to the server, so that the server generates the preset parameters in response to the key negotiation request; Receiving the preset parameters sent by the server; The client public key and the client private key are generated based on the received preset parameters; the client public key is used to be sent to the server so that the server generates at least two pairs of key pairs based on the client public key; the client private key is used to enable the local client to obtain at least two pairs of key pairs based on the server public key and the client private key.

9. The method according to claim 7 or 8, characterized in that: The obtaining of at least two key pairs based on the server public key and the client private key includes: Determine a shared key based on the server public key and the client private key; The shared key is derived based on a preset key derivation algorithm to obtain at least two key pairs; the preset key derivation algorithm is obtained by negotiation between the local client and the server.

10. The method according to claim 9, characterized in that The preset key derivation algorithm includes a first preset key derivation algorithm and a second preset key derivation algorithm; The deriving the shared key based on the preset key derivation algorithm to obtain at least two pairs of the key pairs includes: Performing key extraction and expansion processing on the shared key based on the first preset key derivation algorithm to obtain a master key; The master key is derivatized based on the second preset key derivation algorithm to obtain at least two key pairs.

11. A login ticket acquisition device, characterized in that: The device comprises: A preset login ticket determination module, for determining at least two preset login tickets in response to a login request sent by a client; the login request carries a client public key; the client public key is generated based on preset parameters negotiated between the client and the local server; the preset login ticket is the login credential of the client in a preset business system or the login credential of a target business site in the preset business system; A key pair generation module, used to generate at least two key pairs based on a server private key and the client public key; the server private key is generated based on the preset parameters; each key pair corresponds to one preset login ticket; each key pair includes a downlink key; the downlink key is used to encrypt data sent by the local server to the client; An encryption module, used to encrypt each of the preset login tickets based on the downlink key in the key pair corresponding to each of the preset login tickets to obtain a ticket encryption result; A sending module is used to send the ticket encryption result and the server public key to the client, so that the client can obtain at least two pairs of key pairs based on the server public key and the client private key, and the client can decrypt the ticket encryption result based on the downlink key in each pair of key pairs to obtain the preset login ticket; the server public key and the client private key are generated based on the preset parameters.

12. A login ticket acquisition device, characterized in that: The device comprises: A login request sending module, used for sending a login request to a local server, so that the server responds to the login request, determines at least two preset login tickets, and generates a key pair corresponding to each preset login ticket based on the server private key and the client public key, and enables the server to encrypt each preset login ticket based on the downlink key in the key pair corresponding to each preset login ticket to obtain a ticket encryption result; the login request carries the client public key; the client public key is generated based on the preset parameters negotiated between the local client and the server; the preset login ticket is the login credential of the local client in the preset business system or the login credential of the target business site in the preset business system; the server private key is generated based on the preset parameters; each pair of the key pairs includes a downlink key; the downlink key is used to encrypt data sent by the server to the local client; A receiving module, used to receive the ticket encryption result and the server public key sent by the server; the server public key is generated based on the preset parameters; A key pair determination module, used to obtain at least two pairs of key pairs based on the server public key and the client private key; the client private key is generated based on the preset parameters; The decryption module is used to decrypt the ticket encryption result based on the downlink key in each pair of the key pairs to obtain the preset login ticket.

13. An electronic device for obtaining a login ticket, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executed by the login ticket acquisition method as described in any one of claims 1-6 or the login ticket acquisition method as described in any one of claims 7-10.

14. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the login ticket acquisition method as described in any one of claims 1-6 or the login ticket acquisition method as described in any one of claims 7-10.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the login ticket acquisition method as described in any one of claims 1 to 6 or the login ticket acquisition method as described in any one of claims 7 to 10 is implemented.

Citation Information

Patent Citations

  • System and method for implementation of single login

    CN101207482A

  • Application login method and system, terminal and electronic equipment

    CN110324276A

  • Encryption method and device for third-party account login and storage medium

    CN111193695A

  • Password verification method and device, electronic equipment and storage medium

    CN114500055A

Cited By

  • Risk control method and device of service interface and storage medium

    CN118944986A

  • Client request back-to-source method and device, computer equipment, computer readable storage medium and computer program product

    CN119583659A

  • Client request back-to-source method, device, computer equipment, computer-readable storage medium, and computer program product

    CN119583659B