Authentication method, device, equipment and storage medium
Through asymmetric encryption and double verification of permission information between the terminal and the authentication server, combined with timestamp verification, the problem of high server load and illegal calling of WebAssembly computing tasks in traditional technology is solved, and authentication of security and legitimacy is achieved. process.
Patent Information
- Application Number
- CN202210762848.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-06-29
AI Technical Summary
In traditional technology, placing all computing tasks on the server results in excessive server load. When using WebAssembly technology, there is a risk of illegal calls when computing tasks are executed on the terminal. The existing LICENSE authorization method is easily intercepted and changed, and cannot effectively prevent illegal calls.
By using asymmetric encryption between the terminal and the authentication server, double verification of license information, combined with timestamp verification, ensures the security of the authentication process, and deploys LICENSE information on the client and server respectively to verify legality through encrypted strings .
It effectively reduces the server load, improves the security of the authentication process, prevents illegal calls and replay attacks, and ensures the security and legality of computing tasks.
Smart Images

Figure CN115037552B
Abstract
Description
Technical Field
[0001] The present disclosure relates to, but is not limited to, the field of Internet technology, and in particular to an authentication method, apparatus, device, and storage medium. Background Art
[0002] With the popularization of Internet technology and the increasing complexity of network services, the traditional technology of placing all computing tasks on the server has caused the server load to increase. In order to solve the above problems, the administrator of the network service can execute some or all of the computing tasks on the terminal device to reduce the server load. For example, WebAssembly (wasm) technology can be used to save the computing tasks in a wasm file and deploy them to the terminal device as an algorithm file. When the computing tasks are deployed to the terminal device through the algorithm file, since the source code is completely controlled by the terminal device, there will be the problem of illegal calling of the computing tasks. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure at least provide an authentication method, apparatus, device, storage medium and program product.
[0004] The technical solution of the embodiment of the present disclosure is implemented as follows:
[0005] On the one hand, an embodiment of the present disclosure provides an authentication method, which includes: in response to an access request to target data, encrypting first information to be verified to obtain a first ciphertext; the first information to be verified includes first permission information deployed on the terminal; sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying a second ciphertext sent by the authentication server; decrypting the second ciphertext to obtain first decrypted data, the first decrypted data including a target identifier determined by the authentication server based on the first permission information and second permission information deployed on the authentication server; verifying the first decrypted data based on the first permission information to obtain an authentication result; and determining whether access to the target data is allowed based on the authentication result.
[0006] In some embodiments, the first information to be verified also includes at least one of the following: a first address corresponding to the access request, the first address being used to be decrypted by the authentication server as a judgment condition for whether to send the authentication response; a first timestamp, the first timestamp being the current timestamp of the access page corresponding to the access request.
[0007] In the disclosed embodiment, during the authentication process, not only the first permission information is used as the first message to be verified, but also at least one of the first address and the first timestamp is used as the first message to be verified, so the security of the authentication process can be improved. Among them, by verifying the first address, the call of the target data by unauthorized websites can be effectively avoided. By verifying the first timestamp, replay attacks can be avoided, and the security of the system can be improved.
[0008] In some embodiments, the encrypting of the first information to be verified to obtain the first ciphertext includes: encrypting the first information to be verified based on a first public key to obtain the first ciphertext; the authentication server stores a first private key corresponding to the first public key; the decrypting of the second ciphertext to obtain the first decrypted data includes: decrypting the second ciphertext based on the second private key to obtain the first decrypted data; the second ciphertext is obtained by the authentication server encrypting the second information to be verified based on the second public key corresponding to the second private key.
[0009] In the disclosed embodiment, since an asymmetric encryption method is used to encrypt the data between the terminal and the authentication server, the risk of key leakage in the key transmission process can be effectively reduced and security can be improved.
[0010] In some embodiments, sending an authentication request carrying the first ciphertext to an authentication server and receiving an authentication response carrying the second ciphertext sent by the authentication server includes: establishing a connection channel with the authentication server; sending an authentication request carrying the first ciphertext to the authentication server using the connection channel; the authentication request is used to instruct the authentication server to decrypt the first ciphertext and determine a target identifier based on the first permission information and second permission information deployed on the authentication server; and receiving an authentication response carrying the second ciphertext sent by the authentication server using the connection channel.
[0011] In the embodiment of the present disclosure, since a connection channel is established between the terminal and the authentication server, and data interaction between the authentication server and the terminal is completed based on the connection channel, while ensuring data transmission efficiency, the security of data transmission can also be improved, thereby improving the security of the authentication process.
[0012] In some embodiments, the verification of the first decrypted data based on the first license information to obtain an authentication result includes: obtaining a first identifier in the first license information; and generating the authentication result based on a correspondence between the first identifier and a target identifier included in the first decrypted data.
[0013] In the embodiment of the present disclosure, since the target identifier is generated by the authentication server based on the second license information deployed on the authentication server based on the first license information deployed on the terminal, that is, the first verification of the license information is completed; in the process of the terminal verifying the target identifier based on the first license information, the second verification of the license information can be completed. Therefore, the embodiment of the present disclosure performs double verification of the license information through the terminal and the authentication server respectively, thereby improving the security of the authentication process.
[0014] In some embodiments, the first decrypted data includes a second timestamp; before verifying the first decrypted data based on the first permission information to obtain an authentication result, the method also includes: generating a first timestamp verification result based on the second timestamp and a third timestamp of the access page corresponding to the access request; the second timestamp is the timestamp when the authentication server generates the target identifier; when the first timestamp verification result is a successful verification, the first decrypted data is verified based on the first permission information to obtain an authentication result.
[0015] In the embodiment of the present disclosure, after receiving the authentication response from the authentication server, the first timestamp verification result is generated based on the second timestamp carried in the authentication response and the current third timestamp of the page server. This can prevent illegal users from reusing the authentication response of the authentication server, thereby preventing the target data deployed on the terminal from being illegally called.
[0016] In some embodiments, the target data is an algorithm file in a first underlying library; before encrypting the first information to be verified to obtain a first ciphertext, the method further includes: receiving an initialization request for the algorithm file in the first underlying library; the initialization request is used to request to call an algorithm task in the algorithm file; determining whether to allow access to the target data based on the authentication result includes: if the authentication result is passed, determining that the initialization result of the algorithm file is initialization success, allowing the terminal to call the algorithm task in the algorithm file; if the authentication result is failed, determining that the initialization result of the algorithm file is initialization failure, prohibiting the terminal from calling the algorithm task in the algorithm file.
[0017] In the embodiment of the present disclosure, by obtaining an initialization request for an algorithm file and obtaining an authentication result transmitted by the server through an encrypted channel, an initialization result is obtained based on the authentication result, thereby ensuring the security of the algorithm task in the algorithm file and preventing illegal calls to the algorithm task in the algorithm file by illegal users.
[0018] On the other hand, an embodiment of the present disclosure provides an authentication method, which is applied to an authentication server, and the method includes: receiving an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request for target data; decrypting the first ciphertext to obtain second decrypted data; the second decrypted data includes first permission information; determining a target identifier based on the first permission information and second permission information deployed on the authentication server, and encrypting second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier; sending an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext, and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0019] In some embodiments, the second decrypted data includes a first timestamp; before determining the target identifier based on the first permission information and the second permission information deployed on the authentication server, the method also includes: generating a verification result of the second timestamp based on the first timestamp and a fourth timestamp of the authentication server; the first timestamp is the current timestamp of the access page corresponding to the access request; when the second timestamp verification result indicates that the verification is successful, determining the target identifier based on the first permission information and the second permission information deployed on the authentication server.
[0020] In some embodiments, determining the target identifier based on the first license information and the second license information deployed on the authentication server includes: parsing the first license information to obtain the first identifier in the first license information; parsing the second license information to obtain the second identifier in the second license information; and generating the target identifier based on the first identifier and the second identifier when the first identifier and the second identifier are consistent.
[0021] In some embodiments, generating the target identifier based on the first identifier and the second identifier includes at least one of the following: using the first identifier or the second identifier as the target identifier; transforming the first identifier or the second identifier based on a preset transformation algorithm to obtain the target identifier.
[0022] In some embodiments, the second data to be verified also includes a second timestamp; before encrypting the second data to be verified to obtain the second ciphertext, the method also includes: obtaining a second timestamp corresponding to the authentication server; the second timestamp is the current timestamp when the authentication server generates the target identifier; the second timestamp is used as a judgment condition for whether the terminal verifies the first decrypted data.
[0023] In some embodiments, the encrypting of the second data to be verified to obtain the second ciphertext includes: encrypting the second information to be verified based on the second public key to obtain the second ciphertext; the terminal stores a second private key corresponding to the second public key; the decrypting of the first ciphertext to obtain the second decrypted data includes: decrypting the first ciphertext based on the first private key to obtain the second decrypted data; the first ciphertext is obtained by the terminal encrypting the first information to be verified based on the first public key corresponding to the first private key.
[0024] In some embodiments, the second decrypted data also includes a first address; before sending an authentication response carrying the second ciphertext to the terminal, the method also includes: obtaining a second address of the access request; and when the first address and the second address are consistent, sending an authentication response carrying the second ciphertext to the terminal.
[0025] On the other hand, an embodiment of the present disclosure provides an authentication device, including: a first encryption module, used to encrypt first information to be verified in response to an access request to target data to obtain a first ciphertext; the first information to be verified includes first permission information deployed on the terminal; a first transmission module, used to send an authentication request carrying the first ciphertext to an authentication server, and receive an authentication response carrying a second ciphertext sent by the authentication server; a first decryption module, used to decrypt the second ciphertext to obtain first decrypted data, the first decrypted data including a target identifier determined by the authentication server based on the first permission information and the second permission information deployed on the authentication server; an authentication module, used to verify the first decrypted data based on the first permission information to obtain an authentication result; and based on the authentication result, determine whether access to the target data is allowed.
[0026] On the other hand, an embodiment of the present disclosure provides an authentication device, including: a receiving module, used to receive an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request for target data; a second decryption module, used to decrypt the first ciphertext to obtain second decrypted data; the second decrypted data includes first permission information; a second encryption module, used to determine a target identifier based on the first permission information and second permission information deployed on the authentication server, and encrypt second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier; a sending module, used to send an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext, and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0027] On the other hand, an embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements some or all of the steps in the above method when executing the program.
[0028] On the other hand, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements part or all of the steps in the above method when executed by a processor.
[0029] On the other hand, an embodiment of the present disclosure provides a computer program, including computer-readable codes. When the computer-readable codes are executed in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0030] On the other hand, an embodiment of the present disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, it implements some or all of the steps in the above method.
[0031] In the disclosed embodiment, by transferring part of the authentication process to the authentication server, and completing other authentication processes in combination with the terminal, and generating the final authentication result, the security of the authentication process can be improved compared to the scheme of authentication only through the terminal. On the one hand, the disclosed embodiment double-verifies the license information through the terminal and the authentication server, further improving the security of the authentication process; on the other hand, since the first license information is deployed on the terminal side and the second license information is deployed on the authentication server side in advance, the main authentication process, that is, the process of determining the target identifier based on the first license information and the second license information, is placed on the authentication server side, avoiding the leakage of the authentication method.
[0032] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0034] Figure 1 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0035] Figure 2 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0036] Figure 3A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0037] Figure 4 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0038] Figure 5 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0039] Figure 6 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0040] Figure 7 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0041] Figure 8 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0042] Fig. 9 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0043] Fig.10 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0044] Fig.11 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0045] Fig.12 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0046] Fig.13 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0047] Fig.14 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure;
[0048] Fig.15 A schematic diagram of the structure of an authentication device provided in an embodiment of the present disclosure;
[0049] Fig.16 A schematic diagram of the structure of an authentication device provided in an embodiment of the present disclosure;
[0050] Fig.17 A hardware entity schematic diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions of the present disclosure are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present disclosure. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0052] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing the present disclosure and are not intended to limit the present disclosure.
[0054] The present disclosure provides an authentication method, which can be executed by a processor of a computer device. The computer device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device), or other device with data processing capabilities.
[0055] Figure 1 A schematic diagram of an implementation flow of an authentication method provided in an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method includes the following steps S101 to S103:
[0056] Step S101, in response to an access request to target data, encrypt first information to be verified to obtain a first ciphertext; the first information to be verified includes first permission information deployed on the terminal.
[0057] In some embodiments, the first information to be verified includes first permission information deployed in the terminal. The first permission information may include permission information corresponding to the terminal, and the permission information is used to determine the data identifier of the target data that the terminal can call during the local authentication process. Accordingly, in the process of sending an authentication request to the authentication server and obtaining an authentication result, the sent authentication request can only be used to request to call the target data corresponding to the data identifier, and the authentication result can only instruct the terminal to call the target data.
[0058] In some embodiments, the first permission information may also include a first identifier corresponding to the terminal, which is a unique identifier of the terminal. When the first identifier is sent to the authentication server, the authentication server may determine whether the terminal has the authority to call the algorithm based on the unique identifier, and then generate a corresponding authentication response.
[0059] In some embodiments, the access request is a page provided by the terminal for accessing the Internet, and the page needs to call target data to implement a specific function.
[0060] In some embodiments, the terminal completes the encryption process of the first information to be verified through the first underlying library, that is, the encryption method of the first information to be verified is encapsulated in the first underlying library. In the process of executing the above S101 to encrypt the first information to be verified, it is only necessary to input the first information to be verified into the first underlying library. The first underlying library can complete the encryption process of the first information to be verified based on the encapsulated encryption method and output the first ciphertext. Accordingly, the above S101 can be to encrypt the first information to be verified through the first underlying library in the process of accessing the page to obtain the first ciphertext.
[0061] In some embodiments, the first underlying library can be cached in the terminal in the form of a software development kit (SDK), that is, in response to the terminal accessing the page, the page server can cache the page file (such as an HTML file) and the first underlying library corresponding to the page in the terminal, and parse the page file through the browser of the terminal and present it to the user. Compared with the page code corresponding to the page file, the page code can be stored in the page file in the form of plain text code, and the program code in the first underlying library is encrypted and encapsulated as a software development kit, not stored in the form of plain text code.
[0062] Step S102: sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying a second ciphertext sent by the authentication server.
[0063] In some embodiments, the authentication server can establish a connection with at least one of the terminals, receive an authentication request sent by any terminal, and generate a corresponding authentication response based on the first ciphertext carried by the authentication request, and send the authentication response to the terminal to complete a partial authentication process on the authentication server side.
[0064] In some embodiments, the terminal may send the generated first ciphertext as the authentication request to the authentication server. The authentication request may carry a request identifier, and accordingly, after the terminal receives the authentication response sent by the authentication server, the authentication response also includes a response identifier corresponding to the request identifier, thereby determining the association relationship between the authentication response and the authentication request.
[0065] In some embodiments, when a page needs to call target data to implement a specific function, an authentication request carrying the first ciphertext can be sent to an authentication server through the page, and an authentication response carrying the second ciphertext sent by the authentication server can be received.
[0066] Step S103: decrypt the second ciphertext to obtain first decrypted data, where the first decrypted data includes a target identifier determined by the authentication server based on the first permission information and second permission information deployed on the authentication server.
[0067] In some embodiments, similar to the above-mentioned process of encrypting the first information to be verified to obtain the first ciphertext, the decryption process of the second ciphertext is also performed through the first underlying library, that is, the decryption algorithm for the second ciphertext is encapsulated in the first underlying library. After receiving the second ciphertext, the terminal needs to transmit the second ciphertext to the first underlying library. The first underlying library can call the decryption algorithm to complete the decryption process of the second ciphertext and obtain the first decrypted data.
[0068] Among them, the first decrypted data includes a target identifier, and the target identifier is determined by the authentication server based on the first license information and the second license information deployed on the authentication server. In some embodiments, the target identifier can be the same identification information in the first license information and the second license information; the target identifier can also be the same identification information as the second license information after the first license information is transformed. It should be noted that, when the authentication server determines that there is no identical identification information in the first license information and the second license information, or the first license information does not have the same identification information as the second license information after the transformation, the authentication response may not be sent, or a target identifier that is not associated with the first license information may be sent.
[0069] In some embodiments, after the terminal completes the decryption of the second ciphertext through the first underlying library and obtains the first decrypted data including the target identifier, the terminal still completes the verification process of the first decrypted data through the first underlying library. That is, the verification algorithm for the first decrypted data is also encapsulated in the first underlying library. After the first underlying library completes the verification of the first decrypted data and obtains the authentication result, the authentication result can be output to the terminal page, and then the page can determine whether the algorithm task in the first underlying library can be called based on the authentication result.
[0070] In some embodiments, the verification of the first decrypted data based on the first license information can be achieved by the following method: determining the association relationship between the target identifier and the first license information to determine the authentication result; extracting the first identifier in the first license information, and determining the authentication result based on the association relationship between the first identifier and the target identifier. Wherein, in the case where an association relationship exists, an authentication result of passed authentication is generated, and in the case where an association relationship does not exist, an authentication result of failed authentication is generated. The association relationship can be, but is not limited to, that the target identifier is included in the first license information, the target identifier is the same as the first identifier, and the target identifier can be obtained by transforming the first license information.
[0071] Step S104: verify the first decrypted data based on the first permission information to obtain an authentication result; and determine whether to allow access to the target data based on the authentication result.
[0072] In some embodiments, when the authentication result is that the authentication is passed, the terminal may be allowed to access the target data; when the authentication result is that the authentication is not passed, the terminal is prohibited from accessing the target data.
[0073] In some embodiments, taking the case where a page calls target data and the target data is an algorithm task in the first underlying library, if the authentication result is that the authentication is passed, the page can be allowed to use the algorithm task in the first underlying library; if the authentication result is that the authentication is failed, the page is prohibited from using the algorithm task in the first underlying library.
[0074] Among them, the above-mentioned algorithm task is a program that determines whether the page can be called based on the authentication result. The first underlying library can also include other programs in addition to the program of the algorithm task. The other programs at least include the above-mentioned encryption program for encrypting the first information to be verified, and can also include the above-mentioned decryption program for decrypting the two ciphertexts. Of course, it can also include any other programs that support the implementation of the embodiments of the present disclosure.
[0075] In the disclosed embodiment, by transferring part of the authentication process to the authentication server, and completing other authentication processes in combination with the terminal, and generating the final authentication result, the security of the authentication process can be improved compared to the scheme of authentication only through the terminal. On the one hand, the disclosed embodiment double-verifies the license information through the terminal and the authentication server, further improving the security of the authentication process; on the other hand, since the first license information is deployed on the terminal side and the second license information is deployed on the authentication server side in advance, the main authentication process, that is, the process of determining the target identifier based on the first license information and the second license information, is placed on the authentication server side, avoiding the leakage of the authentication method.
[0076] In some embodiments, the first information to be verified further includes at least one of the following: a first address corresponding to the access request, the first address being used to be decrypted by the authentication server as a judgment condition for whether to send the authentication response; a first timestamp, the first timestamp being the current timestamp of the access page corresponding to the access request. Figure 2 , Figure 2 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 1 ,exist Figure 1 Before S101 in the method, the method may further include S201 to S203, S101 may be updated to S204, and the combination Figure 2 The steps shown are explained.
[0077] In this embodiment, in response to performing the authentication process, the first information to be verified required by the authentication process may be obtained first. The first information to be verified may include: Figure 1 The first permission information deployed in the terminal in the embodiment. Accordingly, the first information to be verified may also include at least one of the first address and the first timestamp. Figure 2 The disclosed embodiment will illustrate this scenario. Step S201 is a process of obtaining first permission information, step S202 is a process of obtaining a first address, and step S203 is a process of obtaining a first timestamp.
[0078] Step S201: Acquire the first permission information.
[0079] Step S202: when the first information to be verified also includes the first address, obtain the first address.
[0080] In some embodiments, the first address is an address corresponding to the access request, and the address may include, but is not limited to, a domain name or an IP address. The terminal may access the page server through the first address, and the page server provides the page to the terminal based on the first address.
[0081] In this embodiment, when the first address is used as one of the first information to be verified, since the present disclosure places part of the authentication process on the authentication server side corresponding to the terminal, after the first address is encrypted as the first information to be verified as the first ciphertext and sent to the authentication server, the authentication server can decrypt it to obtain the first address and determine whether to send an authentication response to the terminal based on the first address.
[0082] Step S203: When the first information to be verified also includes the first timestamp, obtain the first timestamp corresponding to the access request.
[0083] Step S204, encrypting the first information to be verified to obtain a first ciphertext; the first information to be verified includes first permission information deployed on the terminal; the first information to be verified also includes at least one of the following: a first address and a first timestamp.
[0084] In some embodiments, the first information to be verified may include the first permission information and the first address corresponding to the access request; in other embodiments, the first information to be verified may include the first permission information and a first timestamp; in other embodiments, the first information to be verified may include the first permission information, the first address corresponding to the access request, and a first timestamp.
[0085] Step S102: sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying a second ciphertext sent by the authentication server.
[0086] Step S103: decrypt the second ciphertext to obtain first decrypted data, where the first decrypted data includes a target identifier determined by the authentication server based on the first permission information and second permission information deployed on the authentication server.
[0087] Step S104: verify the first decrypted data based on the first permission information to obtain an authentication result; and determine whether to allow access to the target data based on the authentication result.
[0088] In the disclosed embodiment, during the authentication process, not only the first permission information is used as the first message to be verified, but also at least one of the first address and the first timestamp is used as the first message to be verified, so the security of the authentication process can be improved. Among them, by verifying the first address of the access request, the call of the target data by unauthorized websites can be effectively avoided. By verifying the first timestamp, replay attacks can be avoided, and the security of the system can be improved.
[0089] Figure 3is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 1 For example, Figure 1 The S101 in can be updated to S301. Figure 1 S103 in can be updated to S302, which will be combined with Figure 3 The steps shown are explained.
[0090] Step S301, encrypting the first information to be verified based on a first public key to obtain the first ciphertext; the authentication server stores a first private key corresponding to the first public key; the first information to be verified includes first permission information deployed on the terminal.
[0091] In some embodiments, the first information to be verified can be encrypted and transmitted by asymmetric encryption. Exemplarily, the first information to be verified can be encrypted based on the first public key to obtain a first ciphertext; accordingly, when the authentication server decrypts the first ciphertext, the first private key corresponding to the first public key can also be used to decrypt the first information to be verified.
[0092] In this embodiment, the first public key and the first private key may be generated by an authentication server. After generating a first key pair including the first public key and the first private key, the authentication server transmits the first public key to at least one terminal that needs to be authenticated.
[0093] Step S102: sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying a second ciphertext sent by the authentication server.
[0094] Step S302, decrypting the second ciphertext based on the second private key to obtain the first decrypted data; the second ciphertext is obtained by the authentication server encrypting the second information to be verified based on the second public key corresponding to the second private key.
[0095] In some embodiments, the authentication server may also encrypt the authentication response by asymmetric encryption when sending the authentication response corresponding to the authentication request. The authentication server may encrypt the second information to be verified based on the second public key to obtain the corresponding second ciphertext, and then send the second ciphertext to the terminal. After receiving the second ciphertext, the terminal may decrypt the second ciphertext based on the second key corresponding to the second public key to obtain the second information to be verified.
[0096] In this embodiment, the second public key and the second private key may be generated by the terminal. After generating the second key pair including the second public key and the second private key, the terminal transmits the second public key to the authentication server.
[0097] Step S104: verify the first decrypted data based on the first permission information to obtain an authentication result; and determine whether to allow access to the target data based on the authentication result.
[0098] In the disclosed embodiment, since an asymmetric encryption method is used to encrypt the data between the terminal and the authentication server, the risk of key leakage in the key transmission process can be effectively reduced and security can be improved.
[0099] Figure 4 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 1 , Figure 1 S102 in the above example may include S401 to S403, which will be combined with Figure 4 The steps shown are explained.
[0100] Step S401, establishing a connection channel with the authentication server.
[0101] In some embodiments, the connection channel may be a Hyper Text Transfer Protocol (HTTP) channel; in other embodiments, the connection channel may be a security-oriented Hyper Text Transfer Protocol over Secure Socket Layer (HTTPS) channel.
[0102] Step S402: sending an authentication request carrying the first ciphertext to the authentication server using the connection channel; the authentication request is used to instruct the authentication server to decrypt the first ciphertext and determine the target identifier based on the first permission information and the second permission information deployed on the authentication server.
[0103] Step S403: receiving an authentication response carrying the second ciphertext and sent by the authentication server using the connection channel.
[0104] In some embodiments, the terminal may use the established connection channel to send an authentication request carrying the first ciphertext to the authentication server. Correspondingly, the terminal may also receive an authentication response returned by the authentication server through the established connection channel.
[0105] In the embodiment of the present disclosure, since a connection channel is established between the terminal and the authentication server, and data interaction between the authentication server and the terminal is completed based on the connection channel, while ensuring data transmission efficiency, the security of data transmission can also be improved, thereby improving the security of the authentication process.
[0106] Figure 5 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 1 , Figure 1 S103 in can be updated to S501 to S502, which will be combined Figure 5 The steps shown are explained.
[0107] Step S101, in response to an access request to target data, encrypt first information to be verified to obtain a first ciphertext; the first information to be verified includes first permission information deployed on the terminal.
[0108] Step S102: sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying a second ciphertext sent by the authentication server.
[0109] Step S501: decrypt the second ciphertext to obtain first decrypted data, where the first decrypted data includes a target identifier and a second timestamp determined by the authentication server based on the first permission information and second permission information deployed on the authentication server.
[0110] In some embodiments, the first decrypted data includes not only the target identifier, but also a second timestamp, which is the current timestamp of the authentication server in response to the authentication server generating the target identifier. After generating the target identifier based on the first permission information and the second permission information, the authentication server can obtain the current timestamp of the current authentication server system as the second timestamp, and encrypt the second timestamp and the target identifier together as the second information to be verified to obtain the second ciphertext.
[0111] Step S502: verify the first decrypted data based on the first permission information to obtain an authentication result.
[0112] In some embodiments, when the current terminal is authorized to use the target data, the first permission information and the second permission information have a first association relationship. Correspondingly, when the authentication server generates a target identifier based on the first permission information and the second permission information, the target identifier and the first permission information also have a second association relationship. In step S502, it can be determined whether the first permission information and the target identifier in the first decrypted data satisfy the above-mentioned second association relationship, thereby obtaining the authentication result. The first association relationship and the second association relationship can be the same association relationship or different association relationships, which is not limited in the present disclosure.
[0113] The target data may be an algorithm task of a first underlying library deployed on the current terminal.
[0114] In some embodiments, when it is necessary to authorize the current terminal to use the target data deployed on the current terminal, the first association relationship between the first license information deployed on the terminal and the second license information deployed on the authentication server may include but is not limited to at least one of the following: the first license information and the second license information include the same identification information, the fields in at least one field position in the first license information and the second license information are the same, and the identification information in the first license information is the same as the identification information in the second license information after processing based on the first transformation.
[0115] Among them, when the first association relationship is that the first license information and the second license information include the same identification information, the authentication server can, when it is determined that the first license information and the second license information include the same identification information, use the same identification information as the target identifier and send it to the terminal after encryption. The terminal can decrypt the target identifier through the first underlying library, and determine whether the first license information includes the same identification information, and then generate a corresponding authentication result.
[0116] Among them, when the first association relationship is that the fields in at least one field position in the first license information and the second license information are the same, the authentication server can, when it is determined that the first license information and the second license information include the field in at least one same field position, encrypt the field in at least one same field position as the target identifier and send it to the terminal. The terminal can decrypt the target identifier through the first underlying library, and determine whether the first license information includes the field in at least one same field position, thereby generating a corresponding authentication result.
[0117] Wherein, in the case where the first association relationship is that the identification information in the first license information is identical to the identification information in the second license information after the first transformation processing, the authentication server can perform the first transformation processing on the identification information after obtaining the identification information of the first license information, and in the case where it is determined that the identification information after the first transformation processing is identical to the identification information of the second license information, the identification information of the second license information is encrypted as the target identification and sent to the terminal, the terminal can decrypt the target identification through the first underlying library, and perform the second transformation processing on the identification information of the second license information, and determine whether the identification information of the second license information after the second transformation processing is identical to the identification information in the first license information, thereby generating a corresponding authentication result. The second transformation processing is the reverse process of the first transformation processing.
[0118] In some embodiments, the verification of the first decrypted data based on the first permission information can be implemented through S5021 to S5022 to obtain an authentication result.
[0119] Step S5021: Obtain the first identifier in the first license information.
[0120] In some embodiments, the license information may be in the form of a string, and accordingly, the identifier in the license information is a portion of the characters in the string. The identifier position corresponding to the first identifier may be obtained, and the first identifier may be searched in the first license information based on the identifier position; or the identifier field corresponding to the first identifier may be obtained, and the string corresponding to the identifier field may be searched in the first license information based on the identifier field, and determined to be the first identifier.
[0121] Step S5022: Generate the authentication result based on the correspondence between the first identifier and the target identifier included in the first decrypted data.
[0122] In some embodiments, when the correspondence between the first identifier and the target identifier satisfies a preset condition, an authentication result indicating successful authentication is generated; when the correspondence between the first identifier and the target identifier does not satisfy the preset condition, an authentication result indicating failed authentication is generated. The preset condition may include at least one of the following: the first identifier is the same as the target identifier, the first identifier is the same as the target identifier after the first transformation process, and the first identifier is the same as the target identifier after the third transformation process.
[0123] Step S503: Determine whether to allow access to the target data based on the authentication result.
[0124] In some embodiments, the method further includes step S504.
[0125] Step S504: Generate a first timestamp verification result based on the second timestamp and a third timestamp of the access page corresponding to the access request; the second timestamp is the timestamp when the authentication server generates the target identifier.
[0126] In some embodiments, the third timestamp is the current timestamp of the page server when the first decrypted data is obtained.
[0127] In some embodiments, a first time interval between the second timestamp and the third timestamp may be obtained, and the first timestamp verification result may be determined based on the first time interval and a preset time interval threshold. Wherein, if the first time interval is less than or equal to the time interval threshold, a first timestamp verification result indicating successful verification is generated; if the first time interval is greater than the time interval threshold, a first timestamp verification result indicating failed verification is generated.
[0128] If the first timestamp verification result is a successful verification, step S502 is performed. If the first timestamp verification result is a failed verification, an authentication result of failed authentication is generated.
[0129] In the embodiment of the present disclosure, after receiving the authentication response from the authentication server, the first timestamp verification result is generated based on the second timestamp carried in the authentication response and the current third timestamp of the page server. This can prevent illegal users from reusing the authentication response of the authentication server, thereby preventing the target data deployed on the terminal from being illegally called.
[0130] In the embodiment of the present disclosure, since the target identifier is generated by the authentication server based on the second license information deployed on the authentication server based on the first license information deployed on the terminal, that is, the first verification of the license information is completed; in the process of the terminal verifying the target identifier based on the first license information, the second verification of the license information can be completed. Therefore, the embodiment of the present disclosure performs double verification of the license information through the terminal and the authentication server respectively, thereby improving the security of the authentication process.
[0131] Figure 6 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, which can be executed by a processor of a computer device. The target data is an algorithm file in the first underlying library, based on Figure 1 The method further comprises step S601, Figure 1 S104 in can be updated to S602 to S603, which will be combined Figure 6 The steps shown are explained.
[0132] Step S601, receiving an initialization request for an algorithm file in the first underlying library; the initialization request is used to request to call an algorithm task in the algorithm file.
[0133] In some embodiments, the first underlying library includes at least an algorithm file for implementing an algorithm task, and the page can be used to call the algorithm file in the first underlying library to implement the corresponding algorithm task. The terminal can execute the authentication method provided by the embodiment of the present disclosure when receiving a use request for the target service. The target service corresponds to at least one algorithm task, and the terminal needs to use at least one algorithm task corresponding to the target service in the process of using the target service. However, before using the target service, it is necessary to verify the use permission of the target service (or the call permission of the at least one algorithm task), that is, to authenticate the use request and execute the authentication method provided by the embodiment of the present disclosure. The target service includes but is not limited to various query services, image recognition services, computing services, etc. Taking the target service as an image recognition service as an example, when the terminal receives a use request for the image recognition service, it is necessary to call the recognition algorithm task corresponding to the image recognition service. Therefore, in response to the use request, the terminal can authenticate the use request of the image recognition service and execute the authentication method provided by the embodiment of the present disclosure.
[0134] In some embodiments, the terminal can receive a user's access request for the page, and send an access request to the page server where the page is located. Accordingly, the page server can provide the terminal with the page and the first underlying library corresponding to the page. In response to user operations or other preset trigger conditions, the page needs to initialize the algorithm file in the first underlying library corresponding to the page, that is, the page will send an initialization request for the algorithm file to the first underlying library, and the initialization request is used to call the algorithm task in the algorithm file. In other words, in order to call the algorithm task, the algorithm file needs to be initialized according to the initialization request for the algorithm file. If the initialization is successful, the terminal can be allowed to call all the algorithm tasks in the algorithm file or some of the algorithm tasks in the algorithm file; if the initialization fails, the terminal is prohibited from calling the algorithm tasks in the algorithm file.
[0135] Step S101, in response to an access request to target data, encrypt first information to be verified to obtain a first ciphertext; the first information to be verified includes first permission information deployed on the terminal.
[0136] Step S102: sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying a second ciphertext sent by the authentication server.
[0137] Step S103: decrypt the second ciphertext to obtain first decrypted data, where the first decrypted data includes a target identifier determined by the authentication server based on the first permission information and second permission information deployed on the authentication server.
[0138] Step S602: when the authentication result is passed, determine that the initialization result of the algorithm file is successful initialization, and allow the terminal to call the algorithm task in the algorithm file.
[0139] Step S603, when the authentication result is not passed, determining that the initialization result of the algorithm file is initialization failure, prohibiting the terminal from calling the algorithm task in the algorithm file.
[0140] In the disclosed embodiment, by obtaining an initialization request for an algorithm file and obtaining an authentication result transmitted by an authentication server through an encrypted channel, an initialization result is obtained based on the authentication result, thereby ensuring the security of the algorithm tasks in the algorithm file and preventing illegal calls to the algorithm tasks in the algorithm file by illegal users.
[0141] Figure 7 FIG. 1 is an optional flow chart of an authentication method provided by an embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 7 The steps shown are explained.
[0142] Step S701: receiving an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request to target data.
[0143] Step S702: decrypt the first ciphertext to obtain second decrypted data; the second decrypted data includes first permission information.
[0144] Step S703, determining the target identifier based on the first permission information and the second permission information deployed on the authentication server, and encrypting the second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier.
[0145] Step S704, sending an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0146] In some embodiments, the authentication server can decrypt the first ciphertext through the second underlying library in the authentication server. Correspondingly, the second underlying library can also determine the target identifier based on the first license information and the second license information deployed on the authentication server, and encrypt the second data to be verified to obtain the second ciphertext.
[0147] The second underlying library can be stored in the authentication server as a software development kit (SDK), that is, in response to the authentication request carrying the first ciphertext sent by the terminal, the authentication server transmits the first ciphertext to the second underlying library, and executes steps S702 to S703 through the second underlying library to obtain the second ciphertext. The program code in the second underlying library is encrypted and packaged as a software development kit, and is not stored in the form of plain text code.
[0148] In the disclosed embodiment, by transferring part of the authentication process to the authentication server, and completing other authentication processes in combination with the terminal, and generating the final authentication result, the security of the authentication process can be improved compared to the solution of only authenticating through the authentication server. At the same time, the disclosed embodiment performs double verification through the terminal and the authentication server permission information, further improving the security of the authentication process.
[0149] Figure 8 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 7 , Figure 7 S702 can be updated to S801, S703 can be updated to S802 to S803, and the combination Figure 8 The steps shown are explained.
[0150] Step S701: receiving an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request to target data.
[0151] Step S801, decrypt the first ciphertext to obtain second decrypted data; the second decrypted data includes first permission information and a first timestamp.
[0152] Step S802: Generate a verification result of a second timestamp based on the first timestamp and a fourth timestamp of the authentication server; the first timestamp is a current timestamp of the access page corresponding to the access request.
[0153] Step S803, when the second timestamp verification result indicates successful verification, determine the target identifier based on the first permission information and the second permission information deployed on the authentication server, and encrypt the second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier.
[0154] Step S704, sending an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0155] In the disclosed embodiment, during the authentication process, not only the first permission information is used as the first message to be verified, but also the first timestamp is used as the first message to be verified, so the security of the authentication process can be improved. By verifying the first timestamp and the fourth timestamp of the authentication server, replay attacks can be avoided, thereby improving the security of the system.
[0156] Fig. 9 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 7 , Figure 7 S703 in can be updated to S901 to S904, which will be combined with Fig. 9 The steps shown are explained.
[0157] Step S701: receiving an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request to target data.
[0158] Step S702: decrypt the first ciphertext to obtain second decrypted data; the second decrypted data includes first permission information.
[0159] Step S901: parse the first permission information to obtain a first identifier in the first permission information.
[0160] Step S902: parse the second permission information to obtain a second identifier in the second permission information.
[0161] Step S903: When the first identifier and the second identifier are consistent, generate the target identifier based on the first identifier and the second identifier.
[0162] Step S904, encrypt the second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier.
[0163] Step S704, sending an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0164] In the embodiment of the present disclosure, since the target identifier is generated by the authentication server based on the second license information deployed on the authentication server based on the first license information deployed on the terminal, that is, the first verification of the license information is completed; in the process of the terminal verifying the target identifier based on the first license information, the second verification of the license information can be completed. Therefore, the embodiment of the present disclosure performs double verification of the license information through the terminal and the authentication server respectively, thereby improving the security of the authentication process.
[0165] Fig.10 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Fig. 9 The method further includes S1001, S904 can be updated to S1002, combining Fig.10 The steps shown are explained.
[0166] Step S701: receiving an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request to target data.
[0167] Step S702: decrypt the first ciphertext to obtain second decrypted data; the second decrypted data includes first permission information.
[0168] Step S901: parse the first permission information to obtain a first identifier in the first permission information.
[0169] Step S902: parse the second permission information to obtain a second identifier in the second permission information.
[0170] Step S903: When the first identifier and the second identifier are consistent, generate the target identifier based on the first identifier and the second identifier.
[0171] Step S1001, obtaining a second timestamp corresponding to the authentication server; the second timestamp is the current timestamp when the authentication server generates the target identifier; the second timestamp is used as a judgment condition for whether the terminal verifies the first decrypted data.
[0172] Step S1002, encrypt the second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier and a second timestamp.
[0173] Step S704, sending an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0174] In the embodiment of the present disclosure, since the current timestamp of the authentication server in response to generating the target identifier is used as the second information to be verified and is sent to the terminal through the authentication response after encryption, the terminal can generate the first timestamp verification result based on the second timestamp carried in the authentication response and the current third timestamp of the page server, which can prevent illegal users from reusing the authentication response of the authentication server, thereby avoiding the algorithm file deployed in the first underlying library of the terminal from being illegally called.
[0175] Fig.11 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 7 , Figure 7 S702 can be updated to S1101, S703 can be updated to S1102, and the combination Fig.11 The steps shown are explained.
[0176] Step S701: receiving an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request to target data.
[0177] Step S1101, decrypt the first ciphertext based on the first private key to obtain second decrypted data; the first ciphertext is obtained by the terminal encrypting the first information to be verified based on the first public key corresponding to the first private key; the second decrypted data includes first permission information.
[0178] Step S1102, determine the target identifier based on the first license information and the second license information deployed on the authentication server, and encrypt the second information to be verified based on the second public key to obtain the second ciphertext; the terminal stores a second private key corresponding to the second public key, and the second data to be verified includes the target identifier.
[0179] Step S704, sending an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0180] In the disclosed embodiment, since an asymmetric encryption method is used to encrypt the data between the terminal and the authentication server, the risk of key leakage in the key transmission process can be effectively reduced and security can be improved.
[0181] Fig.12 is an optional flow chart of the authentication method provided by the embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Figure 7 , Figure 7S702 in can be updated to S1201, S704 can be updated to S1202 to S1203, and the combination Fig.12 The steps shown are explained.
[0182] Step S701: receiving an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request to target data.
[0183] Step S1201, decrypt the first ciphertext to obtain second decrypted data; the second decrypted data includes first permission information and a first address.
[0184] Step S703, determining the target identifier based on the first permission information and the second permission information deployed on the authentication server, and encrypting the second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier.
[0185] Step S1202: Obtain a second address of the access request.
[0186] In some embodiments, the second address is the address of the page in the authentication request. Before sending the authentication request, the terminal can establish a connection channel with the authentication server through the page, the address of one end of the connection channel is the address of the page, that is, the second address, and the address of the other end of the connection channel is the address of the authentication server. Step S1202 can obtain the second address by obtaining the address of the connection channel on the page side.
[0187] Step S1203, when the first address and the second address are consistent, sending an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0188] In the disclosed embodiment, by comparing the first address of the page carried in the second ciphertext in the authentication request and obtaining the second address of the page through the connection channel, unauthorized websites can be effectively prevented from calling the algorithm file in the first underlying library.
[0189] Fig.13 FIG. 1 is an optional flow chart of an authentication method provided by an embodiment of the present disclosure, and the method can be executed by a processor of a computer device. Fig.13 The steps shown are explained.
[0190] Step S1301, during the process of accessing a page, the terminal encrypts first information to be verified through a first underlying library to obtain a first ciphertext; the first information to be verified includes first permission information deployed in the terminal.
[0191] Step S1302: The terminal sends an authentication request carrying the first ciphertext to an authentication server through the page.
[0192] Step S1303: the authentication server receives an authentication request carrying a first ciphertext sent by the terminal during the process of accessing the page.
[0193] Step S1304: the authentication server decrypts the first ciphertext through a second underlying library to obtain second decrypted data; the second decrypted data includes the first permission information and the first address.
[0194] Step S1305: The authentication server determines the target identifier through the second underlying library based on the first permission information and the second permission information deployed on the authentication server, and encrypts the second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier.
[0195] Step S1306, obtaining a second address of the page corresponding to the authentication request; when the first address and the second address are consistent, sending an authentication response carrying the second ciphertext to the terminal.
[0196] Step S1307: The terminal receives an authentication response carrying a second ciphertext sent by the authentication server.
[0197] In step S1308, the terminal decrypts the second ciphertext through the first underlying library to obtain first decrypted data, and verifies the first decrypted data based on the first license information to obtain an authentication result; the first decrypted data includes the target identifier determined by the authentication server based on the first license information and the second license information deployed on the authentication server.
[0198] Step S1309: The terminal determines whether the page can call the algorithm task in the first underlying library based on the authentication result.
[0199] In the embodiment of the present disclosure, since the target identifier is generated by the authentication server based on the second license information deployed on the authentication server based on the first license information deployed on the terminal, that is, the first verification of the license information is completed; in the process of the terminal verifying the target identifier based on the first license information, the second verification of the license information can be completed. Therefore, the embodiment of the present disclosure performs double verification on the license information through the first underlying library of the terminal and the second underlying library of the authentication server, respectively, thereby improving the security of the authentication process.
[0200] The following describes the application of the authentication method provided by the embodiment of the present disclosure in a practical scenario. The WebAssembly (wasm) library stored in the terminal is used as the first underlying library in the above embodiment as an example for description.
[0201] WEBAR is an application technology based on deep learning models and deployed on the WEB side. Its operating mechanism is that when you access a website through a browser on a computer, the WEB server will download the WebAssembly (wasm) library to the user's computer, and use the browser to indirectly call the wasm low-level library through JavaScript to run C / C++ code. Its performance is closer to native speed and much higher than JavaScript.
[0202] As mentioned above, the wasm library is downloaded to each user's computer, so its confidentiality and security are urgent. Unlike client software downloaded to a personal computer, the WEB-based wasm library cannot obtain the binding information of the user's computer's real hardware through JavaScript (JS), so it cannot generate valid and unique LICENSE information. This makes it easy for commercial libraries purchased by customers to be stolen by others, which is also an economic loss for manufacturers.
[0203] The commonly used LICENSE authorization method on the market is to obtain the URL of the website through JavaScript, and then compare it with the wasm library to determine whether it is valid. If it is invalid, the service can be refused. However, the URL obtained through js is easy to be intercepted and changed by others, disguised as a legitimate website and then passed to the wasm underlying library. Therefore, this article provides a new "CS architecture" authentication and encryption mechanism, which cannot be used normally even if all wasm underlying libraries are stolen by others.
[0204] After research, the following technical problems exist in related technologies: the services provided based on WEB pages use JavaScript as an intermediate bridge to call the wasm underlying library, but JavaScript cannot accurately obtain the ID information of the valid hardware of the user's computer or server. Therefore, it is impossible to achieve unique binding for the encryption algorithm; obtaining the website URL information is a common LICENSE authorization method. However, the method of obtaining the URL is often too simple and easy to be intercepted and changed.
[0205] Based on the above technical problems, the authentication scheme provided by the embodiment of the present disclosure is based on the CS framework, the public key and the private key dual mechanism, and the LICNESE information (corresponding to the first license information and the second license information in the above embodiment) and the website (corresponding to the first address and the second address in the above embodiment) are double-bound. The client generates an encrypted string, which is handed over to the upper HTML (corresponding to the page in the above embodiment) and sent to the authentication server. The authentication server uses the key to decrypt and verify the legitimacy. If it is illegal, it will not be returned, and the client cannot use it. In other words, the embodiment of the present disclosure mainly transfers the local verification mechanism part to the authentication server, encrypts the collected authorization information and sends it to the server, and the server judges the legitimacy of the client.
[0206] Among them, the embodiment of the present disclosure requires two sets of LICENSE files. These two sets of LICENSE files are not two copies of the same file. The client LICENSE (corresponding to the first license information of the terminal in the above embodiment) is deployed on the web page, and the service LICENSE (corresponding to the second license information of the authentication server in the above embodiment) is used to verify whether the client's LICENSE is legal for the authentication server.
[0207] See also Fig.14 The authentication process diagram provided. The authentication process provided by the embodiment of the present disclosure is performed by the terminal 141 and the authentication server 142 respectively, and the terminal 141 and the authentication server 142 will respectively perform the following authentication steps.
[0208] The web client of the terminal performs the following steps: the H5 page (corresponding to the page in the above embodiment) reads out the LICENSE file content (corresponding to the first license information in the above embodiment) and transmits it to the wasm underlying library (corresponding to the first underlying library in the above embodiment) in the form of a plain text string; after the wasm underlying library obtains the plain text LICENSE string, it calls JS to obtain the URL address of the website visited by the user (corresponding to the first address in the above embodiment), and at the same time obtains the current timestamp of the server of the H5 page (corresponding to the page server in the above embodiment) (corresponding to the first timestamp in the above embodiment). The above three pieces of information are encrypted with the first public key to generate transmittable data (corresponding to the first ciphertext in the above embodiment), which is returned to the H5 page, and the H5 page accesses the authentication server through HTTPS request and transmits the encrypted data.
[0209] The authentication server server performs the following steps: the authentication server receives the transmittable data from the client and directly transmits it to the underlying authentication so library (corresponding to the second underlying library in the above embodiment), which performs the first private key decryption to obtain the three items of information sent by the terminal. It is determined whether the first timestamp sent by the client and the fourth timestamp instantly obtained by the server locally are within a legal time period. If not, the client request is directly ignored to prevent the user from intercepting data for repeated transmission. The decrypted LICENSE information (corresponding to the first license information in the above embodiment) is used to verify whether the service LICENSE (corresponding to the second license information in the above embodiment) stored locally on the authentication server is consistent, that is, verification is performed by comparing the unique ID therein. If not, the client request is directly ignored.
[0210] If both of the above steps are verified, the unique ID in the LICENSE is extracted as the target identifier and combined with the server timestamp (corresponding to the second timestamp in the above embodiment). Encrypted by the second public key, the transmittable data is generated and returned to the authentication server together with the website URL obtained by decryption (corresponding to the first address in the above embodiment). The authentication server first verifies whether the HTTPS connection address (corresponding to the second address in the above embodiment) is consistent with the website URL information returned by the underlying library. If not, the client request is directly ignored. After all verifications are passed, the newly generated encrypted string (corresponding to the second ciphertext in the above embodiment) is returned to the client connected to HTTPS.
[0211] The web client of the terminal performs the following steps: After the client H5 page receives the encrypted string from the server, it is passed to the wasm underlying library, which decrypts it. First, it verifies whether the authentication server time (corresponding to the second timestamp in the above embodiment) and the website server time (corresponding to the third timestamp in the above embodiment) are within the legal time period. If it is not legal, the verification fails directly. It is also effective to prevent users from intercepting data for repeated transmission. Finally, the wasm underlying library verifies whether the target identifier is consistent with the LICENSE information. If it is not legal, the verification fails. After passing all the above verification steps, the client LICENSE authorization is successful, and initialization continues, loading the model to provide services, that is, calling the algorithm task in the wasm underlying library.
[0212] Based on the foregoing embodiments, the embodiments of the present disclosure provide an authentication device, which includes the units included and the modules included in the units, which can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0213] Fig.15 A schematic diagram of the structure of an authentication device provided in an embodiment of the present disclosure is shown in FIG. Fig.15 As shown, the authentication device 1500 includes: a first encryption module 1501, a first transmission module 1502, a first decryption module 1503 and an authentication module 1504, wherein:
[0214] The first encryption module 1501 is used to encrypt the first information to be verified in response to the access request to the target data to obtain the first ciphertext; the first information to be verified includes the first permission information deployed in the terminal;
[0215] The first transmission module 1502 is used to send an authentication request carrying the first ciphertext to an authentication server, and receive an authentication response carrying the second ciphertext sent by the authentication server;
[0216] A first decryption module 1503, configured to decrypt the second ciphertext to obtain first decrypted data, where the first decrypted data includes a target identifier determined by the authentication server based on the first permission information and second permission information deployed on the authentication server;
[0217] The authentication module 1504 is used to verify the first decrypted data based on the first permission information to obtain an authentication result; and based on the authentication result, determine whether to allow access to the target data.
[0218] In some embodiments, the first information to be verified also includes at least one of the following: a first address corresponding to the access request, the first address being used to be decrypted by the authentication server as a judgment condition for whether to send the authentication response; a first timestamp, the first timestamp being the current timestamp of the access page corresponding to the access request.
[0219] In some embodiments, the first encryption module 1501 is also used to: encrypt the first information to be verified based on a first public key to obtain the first ciphertext; the authentication server stores a first private key corresponding to the first public key; decrypt the second ciphertext based on a second private key to obtain the first decrypted data; the second ciphertext is obtained by the authentication server encrypting the second information to be verified based on the second public key corresponding to the second private key.
[0220] In some embodiments, the first transmission module 1502 is also used to: establish a connection channel with the authentication server; use the connection channel to send an authentication request carrying the first ciphertext to the authentication server; the authentication request is used to instruct the authentication server to decrypt the first ciphertext and determine the target identifier based on the first permission information and the second permission information deployed on the authentication server; receive the authentication response carrying the second ciphertext sent by the authentication server using the connection channel.
[0221] In some embodiments, the first decryption module 1503 is further used to: obtain the first identifier in the first permission information; and generate the authentication result based on the correspondence between the first identifier and the target identifier included in the first decrypted data.
[0222] In some embodiments, the first decrypted data also includes a second timestamp; before verifying the first decrypted data based on the first permission information to obtain an authentication result, the first decryption module 1503 is also used to: generate a first timestamp verification result based on the second timestamp and a third timestamp of the access page corresponding to the access request; the second timestamp is the timestamp when the authentication server generates the target identifier; when the first timestamp verification result is a successful verification, the first decrypted data is verified based on the first permission information to obtain an authentication result.
[0223] In some embodiments, the first encryption module 1501 is further used to: receive an initialization request for the algorithm file in the first underlying library; the initialization request is used to request to call the algorithm task in the algorithm file; the authentication module 1504 is further used to: when the authentication result is passed, determine that the initialization result of the algorithm file is initialization success, and allow the terminal to call the algorithm task in the algorithm file; when the authentication result is failed, determine that the initialization result of the algorithm file is initialization failure, and prohibit the terminal from calling the algorithm task in the algorithm file.
[0224] Fig.16 A schematic diagram of the structure of an authentication device provided in an embodiment of the present disclosure is shown in FIG. Fig.16As shown, the authentication device 1600 includes: a receiving module 1601, a second decryption module 1602, a second encryption module 1603 and a sending module 1604, wherein:
[0225] The receiving module 1601 is used to receive an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request to target data;
[0226] A second decryption module 1602 is used to decrypt the first ciphertext to obtain second decrypted data; the second decrypted data includes the first permission information;
[0227] The second encryption module 1603 is used to determine the target identifier based on the first permission information and the second permission information deployed on the authentication server, and encrypt the second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier;
[0228] The sending module 1604 is used to send an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and generate an authentication result for the decrypted target identifier based on the first permission information deployed on the terminal.
[0229] In some embodiments, the second decrypted data also includes a first timestamp; before determining the target identifier based on the first permission information and the second permission information deployed on the authentication server, the second encryption module 1603 is also used to: generate a verification result of the second timestamp based on the first timestamp and a fourth timestamp of the authentication server; the first timestamp is the current timestamp of the access page corresponding to the access request; when the second timestamp verification result indicates that the verification is successful, determine the target identifier based on the first permission information and the second permission information deployed on the authentication server.
[0230] In some embodiments, the second encryption module 1603 is also used to: parse the first license information to obtain the first identifier in the first license information; parse the second license information to obtain the second identifier in the second license information; and generate the target identifier based on the first identifier and the second identifier when the first identifier and the second identifier are consistent.
[0231] In some embodiments, the second encryption module 1603 is further used to: use the first identifier or the second identifier as the target identifier; or, based on a preset transformation algorithm, transform the first identifier or the second identifier to obtain the target identifier.
[0232] In some embodiments, the second data to be verified also includes a second timestamp; before encrypting the second data to be verified to obtain the second ciphertext, the second encryption module 1603 is also used to: obtain a second timestamp corresponding to the authentication server; the second timestamp is the current timestamp when the authentication server generates the target identifier; the second timestamp is used as a judgment condition for whether the terminal verifies the first decrypted data.
[0233] In some embodiments, the second encryption module 1603 is further used to: encrypt the second information to be verified based on the second public key to obtain the second ciphertext; the terminal stores a second private key corresponding to the second public key. The second encryption module 1603 is further used to decrypt the first ciphertext based on the first private key to obtain second decrypted data; the first ciphertext is obtained by the terminal encrypting the first information to be verified based on the first public key corresponding to the first private key.
[0234] In some embodiments, the second decrypted data also includes a first address; before sending the authentication response carrying the second ciphertext to the terminal, the sending module 1604 is also used to: obtain the second address of the access request; when the first address and the second address are consistent, send the authentication response carrying the second ciphertext to the terminal.
[0235] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present disclosure, please refer to the description of the method embodiment of the present disclosure for understanding.
[0236] It should be noted that in the embodiments of the present disclosure, if the above-mentioned authentication method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present disclosure is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present disclosure are not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.
[0237] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0238] The embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.
[0239] An embodiment of the present disclosure provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0240] The present disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0241] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product disclosed in the present invention, please refer to the description of the method embodiment disclosed in the present invention for understanding.
[0242] Fig.17 A hardware entity diagram of a computer device provided in an embodiment of the present disclosure, such as Fig.17 As shown, the hardware entity of the computer device 1700 includes: a processor 1701 and a memory 1702, wherein the memory 1702 stores a computer program that can be run on the processor 1701, and the processor 1701 implements the steps in the method of any of the above embodiments when executing the program.
[0243] The memory 1702 stores computer programs that can be run on the processor. The memory 1702 is configured to store instructions and applications executable by the processor 1701. It can also cache data to be processed or processed by the processor 1701 and various modules in the computer device 1700 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0244] When the processor 1701 executes the program, the steps of any of the above authentication methods are implemented. The processor 1701 generally controls the overall operation of the computer device 1700.
[0245] An embodiment of the present disclosure provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the authentication method of any of the above embodiments.
[0246] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present disclosure, please refer to the description of the method embodiments of the present disclosure for understanding.
[0247] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, which is not specifically limited in the embodiments of the present disclosure.
[0248] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0249] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present disclosure. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present disclosure, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution. The execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The serial numbers of the embodiments of the present disclosure are for description only and do not represent the advantages and disadvantages of the embodiments.
[0250] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0251] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0252] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0253] In addition, all functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0254] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0255] Alternatively, if the above-mentioned integrated unit of the present disclosure is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0256] The above description is only an implementation mode of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure.
Claims
1. An authentication method, characterized in that: Applied to terminals, including: Receiving an initialization request for an algorithm file in a first underlying library; the initialization request is used to request to call an algorithm task in the algorithm file; In response to an access request to target data, encrypt the first information to be verified to obtain a first ciphertext; the target data is an algorithm file in the first underlying library; the first information to be verified includes first permission information deployed on the terminal; Sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying the second ciphertext sent by the authentication server; decrypting the second ciphertext to obtain first decrypted data, where the first decrypted data includes a target identifier determined by the authentication server based on the first permission information and second permission information deployed on the authentication server; Verifying the first decrypted data based on the first permission information to obtain an authentication result; and determining whether to allow access to the target data based on the authentication result; The determining whether to allow access to the target data based on the authentication result includes: If the authentication result is passed, the initialization result of the algorithm file is determined to be successful initialization, and the terminal is allowed to call the algorithm task in the algorithm file; if the authentication result is failed, the initialization result of the algorithm file is determined to be failed initialization, and the terminal is prohibited from calling the algorithm task in the algorithm file.
2. The method according to claim 1, characterized in that The first information to be verified also includes at least one of the following: a first address corresponding to the access request, the first address being used to be decrypted by the authentication server and used as a judgment condition for whether to send the authentication response; A first timestamp, where the first timestamp is a current timestamp of the access page corresponding to the access request.
3. The method according to claim 1 or 2, characterized in that: The encrypting the first information to be verified to obtain the first ciphertext includes: encrypting the first information to be verified based on the first public key to obtain the first ciphertext; the authentication server stores a first private key corresponding to the first public key; The decrypting the second ciphertext to obtain the first decrypted data includes: decrypting the second ciphertext based on the second private key to obtain the first decrypted data; the second ciphertext is obtained by the authentication server encrypting the second information to be verified based on the second public key corresponding to the second private key.
4. The method according to claim 1 or 2, characterized in that: The step of sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying the second ciphertext sent by the authentication server, comprises: Establishing a connection channel with the authentication server; Using the connection channel, sending an authentication request carrying the first ciphertext to the authentication server; the authentication request is used to instruct the authentication server to decrypt the first ciphertext and determine a target identifier based on the first permission information and second permission information deployed on the authentication server; An authentication response carrying the second ciphertext and sent by the authentication server using the connection channel is received.
5. The method according to claim 1 or 2, characterized in that: The verifying the first decrypted data based on the first permission information to obtain an authentication result includes: Obtaining a first identifier in the first permission information; The authentication result is generated based on the correspondence between the first identifier and the target identifier included in the first decrypted data.
6. The method according to claim 1 or 2, characterized in that: The first decrypted data includes a second timestamp; before verifying the first decrypted data based on the first permission information to obtain an authentication result, the method further includes: Generate a first timestamp verification result based on the second timestamp and a third timestamp of the access page corresponding to the access request; the second timestamp is the timestamp when the authentication server generates the target identifier; When the first timestamp verification result is successful, the first decrypted data is verified based on the first permission information to obtain an authentication result.
7. An authentication method, characterized in that: Applicable to authentication servers, including: An authentication request carrying a first ciphertext sent by a receiving terminal; the authentication request is sent by the terminal in response to an access request to target data after receiving an initialization request for an algorithm file in a first underlying library; the initialization request is used to request to call an algorithm task in the algorithm file; the target data is the algorithm file in the first underlying library; Decrypting the first ciphertext to obtain second decrypted data; the second decrypted data includes the first permission information; Determine the target identifier based on the first permission information and the second permission information deployed on the authentication server, and encrypt the second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier; Sending an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and verify the decrypted target identifier based on the first permission information deployed in the terminal to generate an authentication result; Among them, when the authentication result is passed, the authentication response is also used to determine that the initialization result of the algorithm file is successful initialization, allowing the terminal to call the algorithm task in the algorithm file; when the authentication result is failed, the authentication response is also used to determine that the initialization result of the algorithm file is failed initialization, prohibiting the terminal from calling the algorithm task in the algorithm file.
8. The method according to claim 7, characterized in that The second decrypted data includes a first timestamp; before determining the target identifier based on the first permission information and the second permission information deployed on the authentication server, the method further includes: Based on the first timestamp and the fourth timestamp of the authentication server, a verification result of the second timestamp is generated; the first timestamp is the current timestamp of the access page corresponding to the access request; the second timestamp is the current timestamp when the authentication server generates the target identifier; When the second timestamp verification result indicates that the verification is successful, a target identifier is determined based on the first permission information and second permission information deployed on the authentication server.
9. The method according to claim 7 or 8, characterized in that: The determining the target identifier based on the first permission information and the second permission information deployed on the authentication server includes: Parsing the first license information to obtain a first identifier in the first license information; Parsing the second license information to obtain a second identifier in the second license information; When the first identifier and the second identifier are consistent, the target identifier is generated based on the first identifier and the second identifier.
10. The method according to claim 8, characterized in that The second data to be verified also includes a second timestamp; before encrypting the second data to be verified to obtain the second ciphertext, the method also includes: Obtain a second timestamp corresponding to the authentication server; the second timestamp is used as a judgment condition for whether the terminal verifies the first decrypted data; the first decrypted data includes a target identifier determined by the authentication server based on the first permission information and the second permission information deployed on the authentication server.
11. The method according to claim 7 or 8, characterized in that: The encrypting the second data to be verified to obtain the second ciphertext includes: encrypting the second data to be verified based on the second public key to obtain the second ciphertext; the terminal stores a second private key corresponding to the second public key; The decrypting of the first ciphertext to obtain the second decrypted data includes: decrypting the first ciphertext based on a first private key to obtain the second decrypted data; the first ciphertext is obtained by the terminal encrypting the first information to be verified based on the first public key corresponding to the first private key; the first information to be verified includes the first permission information deployed on the terminal.
12. The method according to claim 7 or 8, characterized in that: The second decrypted data also includes a first address; before sending an authentication response carrying the second ciphertext to the terminal, the method also includes: Obtaining a second address of the access request; When the first address and the second address are consistent, an authentication response carrying the second ciphertext is sent to the terminal.
13. An authentication device, characterized in that: include: A first encryption module, configured to encrypt the first information to be verified in response to an access request to the target data to obtain a first ciphertext; The target data is an algorithm file in the first underlying library; the first information to be verified includes first permission information deployed in the terminal; A first transmission module, used for sending an authentication request carrying the first ciphertext to an authentication server, and receiving an authentication response carrying the second ciphertext sent by the authentication server; a first decryption module, configured to decrypt the second ciphertext to obtain first decrypted data, wherein the first decrypted data includes a target identifier determined by the authentication server based on the first permission information and second permission information deployed on the authentication server; an authentication module, configured to verify the first decrypted data based on the first permission information to obtain an authentication result; and determine whether to allow access to the target data based on the authentication result; The first encryption module is further used to receive an initialization request for an algorithm file in the first underlying library; the initialization request is used to request to call an algorithm task in the algorithm file; The authentication module is also used to determine, when the authentication result is passed, that the initialization result of the algorithm file is successful initialization, and allow the terminal to call the algorithm task in the algorithm file; and when the authentication result is failed, determine the initialization result of the algorithm file is failed initialization, and prohibit the terminal from calling the algorithm task in the algorithm file.
14. An authentication device, characterized in that: include: A receiving module, configured to receive an authentication request carrying a first ciphertext sent by a terminal; the authentication request is sent by the terminal in response to an access request to target data after the terminal receives an initialization request for an algorithm file in a first underlying library; the initialization request is used to request to call an algorithm task in the algorithm file; the target data is the algorithm file in the first underlying library; A second decryption module, used to decrypt the first ciphertext to obtain second decrypted data; the second decrypted data includes the first permission information; a second encryption module, configured to determine a target identifier based on the first permission information and second permission information deployed on the authentication server, and encrypt second data to be verified to obtain a second ciphertext; the second data to be verified includes the target identifier; a sending module, configured to send an authentication response carrying the second ciphertext to the terminal; the authentication response is used to instruct the terminal to decrypt the second ciphertext and verify the decrypted target identifier based on the first permission information deployed in the terminal to generate an authentication result; Among them, when the authentication result is passed, the authentication response is also used to determine that the initialization result of the algorithm file is successful initialization, allowing the terminal to call the algorithm task in the algorithm file; when the authentication result is failed, the authentication response is also used to determine that the initialization result of the algorithm file is failed initialization, prohibiting the terminal from calling the algorithm task in the algorithm file.
15. An authentication device, characterized in that: include: a memory for storing a computer program executable on the processor; A processor, configured to implement the method described in any one of claims 1 to 6 or any one of claims 7 to 12 when executing the computer program stored in the memory.
16. A computer-readable storage medium having computer program instructions stored thereon, wherein: When the computer program instructions are executed by a processor, the method of any one of claims 1 to 6 or any one of claims 7 to 12 is implemented.
