License authorization authentication method and authentication system based on URL

By establishing a link between the JS part and C part of the toolkit, and generating and encrypting the token token using the URL address, URL-based license authentication is implemented, solving the problems of complexity and difficulty of license authentication in the prior art. Implement control over the use of the toolkit.

CN118246003BActive Publication Date: 2025-02-14CHINA FINANCIAL CERTIFICATION AUTHORITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410280101.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2025-02-14
Estimated Expiration
2044-03-12

AI Technical Summary

Technical Problem

In the prior art, authorization and authentication of software license is difficult to achieve unity between terminal devices and browser scenarios, and additional servers are required for verification, which increases complexity and difficulty.

Method used

By establishing a link between the JS part and the C part of the toolkit, generating and encrypting the token token using the URL address, symmetric encryption and decryption are performed, URL-based License authorization authentication is realized.

Benefits of technology

There is no need to issue an additional license to the end user, nor does it require an additional server to verify it. The license authorization and authentication of the toolkit can be implemented based on the URL of the user page, thereby achieving control over the use of the toolkit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118246003B_ABST
    Figure CN118246003B_ABST
Patent Text Reader

Abstract

The present invention provides a URL-based License authorization and authentication method and authentication system, the authorization and authentication method comprises the following steps: the JS part of the toolkit responds to the Init interface call request of the user page, and establishes a link with the C part in the Init interface; the JS part generates data to be verified according to the acquired URL address, and sends it to the C part for verification; the JS part obtains the Init call result according to the received verification result, and feeds the Init call result back to the user page; wherein the verification result is obtained by the C part after receiving the data to be verified, decrypting and verifying. In the authorization and authentication process, the present invention does not need to issue an additional license to the terminal user, nor does it need an additional server for verification. The License authorization and authentication of the toolkit can be realized based on the URL of the user page, thereby realizing the control of the use of the toolkit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a URL-based License authorization authentication method and authentication system. Background Art

[0002] In order to prevent the software from being used illegally, it is often necessary to add a license function to the software to control the use of the software. In the prior art, adding a license function to the software is mainly achieved in the following ways: one way is to bind the license to a specific terminal device or to bind the user's identity information. However, this binding method limits the terminal devices or users who use the software, and only specific terminal devices or users can use the software; another way is to apply the license to browser-related scenarios. However, this method requires license verification on a dedicated server, which increases the difficulty of verification. Browser plug-in products cannot use this method because they cannot connect to a dedicated server. Summary of the invention

[0003] The present invention provides a URL-based License authorization authentication method and authentication system, so as to realize the control of software use based on URL.

[0004] The present invention provides a URL-based license authorization and authentication method, which includes the following steps:

[0005] The JS part of the toolkit responds to the Init interface call request of the user page and establishes a link with the C part in the Init interface;

[0006] The JS part generates the data to be verified based on the obtained URL address and sends it to the C part for verification;

[0007] The JS part obtains the Init call result according to the received verification result, and feeds back the Init call result to the user page; wherein, the verification result is obtained by the C part after receiving the data to be verified and performing decryption and verification.

[0008] According to a URL-based license authorization and authentication method provided by the present invention, the JS part of the toolkit responds to the Init interface call request of the user page and establishes a link with the C part in the Init interface, which specifically includes:

[0009] The JS part sends a link establishment request to the C part;

[0010] The JS part saves the link established with the C part; wherein, the link established between the JS part and the C part is established after the C part responds to the request to establish the link.

[0011] According to a URL-based license authorization and authentication method provided by the present invention, the data to be verified is a token, and the JS part generates a token according to the acquired URL address and sends it to the C part for verification, which specifically includes:

[0012] The JS part obtains the system time and the URL address of the current user page;

[0013] The JS part derives the SM4-CBC symmetric encryption key based on the preset project name;

[0014] The JS part uses the encryption key to encrypt the time address pair (time, url), generates a token, and sends the token to the C part for verification.

[0015] According to a URL-based license authorization and authentication method provided by the present invention, the specific process of verifying the token in part C is as follows:

[0016] Part C derives an SM4-CBC symmetric decryption key according to a preset project name; wherein the decryption key is the same as the encryption key;

[0017] Part C uses the decryption key to decrypt the received token to obtain the time address pair (time, url).

[0018] Part C verifies the validity of the decrypted time and URL address to obtain the verification result.

[0019] According to a URL-based license authorization and authentication method provided by the present invention, the C part verifies the validity of the decrypted time and URL address to obtain a verification result, which specifically includes:

[0020] Part C verifies the validity of the decrypted time. If the difference between the decrypted time and the current system time is within the preset time range, further URL address verification is performed.

[0021] Part C performs validity verification on the decrypted URL address url to obtain a verification result; wherein, the verification result is one of verification success and verification failure; when the decrypted URL address url is verified to be in the url library bound inside the toolkit, the verification result obtained is verification success.

[0022] According to a URL-based license authorization and authentication method provided by the present invention, the JS part of the toolkit responds to the Init interface call request of the user page, and before establishing a link with the C part in the Init interface, the following steps are also included:

[0023] Perform signature verification on part C;

[0024] Among them, part C is provided with a code signing function, through which the correctness of the signature is verified; when the signature verification passes, it indicates that the program of part C has not been modified and runs normally.

[0025] According to a URL-based license authorization and authentication method provided by the present invention, the data to be verified is a token, and the JS part generates a token according to the acquired URL address and sends it to the C part for verification, which specifically includes:

[0026] The JS part of the toolkit requests a random number from the C part;

[0027] The JS part receives the random number random generated and returned by the C part;

[0028] The JS part obtains the URL address of the current user page;

[0029] The JS part derives the SM4-CBC symmetric encryption key based on the preset project name;

[0030] The JS part uses the encryption key to encrypt the random number address pair (random, url), generates a token, and sends the token to the C part for verification.

[0031] According to a URL-based license authorization and authentication method provided by the present invention, the specific process of verifying the token in part C is as follows:

[0032] Part C derives an SM4-CBC symmetric decryption key according to a preset project name; wherein the decryption key is the same as the encryption key;

[0033] Part C uses the decryption key to decrypt the received token to obtain a random number address pair (random, url);

[0034] Part C verifies the validity of the random number and URL address and saves the verification results.

[0035] According to a URL-based license authorization authentication method provided by the present invention, the C part verifies the validity of the random number and the URL address and saves the verification result, which specifically includes:

[0036] Part C verifies the validity of the random number obtained by decryption. When the time random number obtained by decryption is consistent with the random number stored locally, it further verifies the URL address and destroys the stored random number.

[0037] Part C performs validity verification on the decrypted URL address to obtain a verification result; wherein, the verification result is one of verification success and verification failure; when the decrypted URL address url is in the url library bound inside the toolkit, the verification result obtained is verification success.

[0038] The present invention also provides a URL-based License authorization and authentication system, which includes a user page and a toolkit, wherein the toolkit includes a JS part and a C part;

[0039] The JS part is used to respond to the Init interface call request of the user page and establish a link with the C part in the Init interface; the JS part is also used to generate the data to be verified according to the acquired URL address, and the C part is used to verify the received data to be verified and obtain the verification result; the JS part is used to obtain the Init call result according to the received verification result, and feed back the Init call result to the user page.

[0040] According to a URL-based license authorization and authentication system provided by the present invention, the JS part includes a URL acquisition module, a URL encryption module and a service request generation module, and the C part includes a URL decryption module, a URL verification module and a service request processing module;

[0041] The URL acquisition module is used to obtain the URL address corresponding to the user page. The URL encryption module encrypts the time address pair (time, url) with an encryption key, generates a token token and sends it to the URL decryption module; the encryption key is an SM4-CBC symmetric encryption key, which is derived from a preset project name; the time time in the time address pair (time, url) is the system time obtained by the URL acquisition module;

[0042] The URL decryption module uses the decryption key to decrypt the received token token to obtain a time address pair (time, url); the URL verification module is used to verify the validity of the decrypted time and URL address to obtain a verification result;

[0043] The service request generation module is used to generate a service request after receiving the verification result; the service request processing module is used to process the received service request.

[0044] According to a URL-based license authorization and authentication system provided by the present invention, the JS part includes a URL acquisition module, a URL encryption module and a service request generation module, and the C part includes a URL decryption module, a URL verification module and a service request processing module;

[0045] The URL acquisition module is used to obtain the URL address corresponding to the user page. The URL encryption module encrypts the random number address pair (random, url) with an encryption key, generates a token token and sends it to the URL decryption module; the encryption key is an SM4-CBC symmetric encryption key, which is derived according to a preset project name; the random number random in the random number address pair (random, url) is generated by the C part in response to the request of the JS part;

[0046] The URL decryption module uses the decryption key to decrypt the received token token to obtain a random number address pair (random, url); the URL verification module is used to verify the validity of the decrypted random number and URL address to obtain a verification result;

[0047] The service request generation module is used to generate a service request after receiving the verification result; the service request processing module is used to process the received service request.

[0048] The present invention provides a URL-based license authorization and authentication method and authentication system, which obtains the URL address of the current user page through the JS part of the toolkit, then encrypts the URL address to generate data to be verified, and sends it to the C part of the toolkit for verification. During the authorization and authentication process, the present invention does not need to issue an additional license to the terminal user, nor does it require an additional server for verification. The license authorization and authentication of the toolkit can be implemented based on the URL of the user page, thereby realizing control over the use of the toolkit. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 This is one of the flowcharts of the URL-based License authorization and authentication method provided by the present invention;

[0051] Figure 2 This is the second flowchart of the URL-based license authorization and authentication method provided by the present invention;

[0052] Figure 3 It is a structural diagram of the URL-based License authorization and authentication system provided by the present invention.

[0053] Reference numerals:

[0054] 31. User page;

[0055] 32. Tool kit;

[0056] 321, JS part; 3211, URL acquisition module; 3212, URL encryption module; 3213, business request generation module;

[0057] 322. Part C; 3221. URL decryption module; 3222. URL verification module; 3223. Business request processing module. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] The URL-based license authorization and authentication method provided by the present invention is used in a toolkit having a JavaScript language implementation part (hereinafter referred to as the JS part) and a C language implementation part (hereinafter referred to as the C part) to implement a license authorization and authentication method based on the URL (Uniform Resource Locator; when accessing a web page in a web browser, the URL address is the website address) of the user page. Among them, the JS part is used to obtain the URL address, encrypt the obtained URL address and generate a business request. The C part is used to decrypt the URL, verify the decrypted URL and process the business request. Specifically, the toolkit can be a WebSocket toolkit.

[0060] Combine the following Figure 1 and Figure 2 The present invention describes a URL-based license authorization and authentication method.

[0061] like Figure 1 As shown, when the URL-based License authorization and authentication method provided by the present invention is applied to the JS part of the toolkit, it includes the following steps:

[0062] S1. The JS part of the toolkit responds to the Init interface call request of the user page and establishes a link with the C part in the Init interface.

[0063] Among them, the Init interface is a function implemented by the JS part of the toolkit, and its function is to establish a link and then verify the token.

[0064] S2, JS part generates the data to be verified according to the obtained URL address and sends it to part C for verification.

[0065] Each user page corresponds to a URL address. The JS part encapsulates the obtained URL address into the data to be verified and sends the data to be verified to the C part for verification. The license authorization authentication is completed by verifying the data to be verified. Specifically, the data to be verified is a token, which is ciphertext data. The token is used to represent the object during permission verification.

[0066] S3, JS part obtains the Init call result according to the received verification result, and feeds back the Init call result to the user page.

[0067] The verification result is obtained by decrypting and verifying the data to be verified after receiving it by part C.

[0068] The token verification result is obtained by decrypting and verifying the token after receiving it.

[0069] The Init call result is obtained after the JS part successfully establishes a link with the C part and the JS part receives the verification result returned by the C part. After the Init call result is returned successfully, the user page can access the service functions of the toolkit through the interface of the JS part of the toolkit.

[0070] In the present invention, the authorization object of the toolkit is the customer's application project, not a specific end user or device, so the traditional license authorization solution bound to the end user is no longer applicable.

[0071] Since each application project has a corresponding URL address, the present invention uses the URL address as a characteristic value to establish a corresponding relationship between it and the authorized application project. By marking the authorized object (i.e., the authorized application project) with the URL address, there is no need to issue a license for each application project. It is only necessary to pre-embed the URL address of the application project into the toolkit during the development phase of the toolkit. When in use, the JS part of the toolkit obtains the URL address of the current user page, and the C part of the toolkit determines whether the obtained URL address matches the URL address pre-embedded in the toolkit, and the authorization verification can be completed. The license authorization authentication can be completed through verification.

[0072] In the present invention, when the toolkit is working, the URL address of the current user page is obtained by the JS part of the toolkit, and then the URL address is encrypted to generate data to be verified, and sent to the C part of the toolkit for verification. During the authorization and authentication process, there is no need to issue an additional license to the terminal user, nor is there a need for an additional server for verification.

[0073] In the above step S1, the JS part of the toolkit responds to the Init interface call request of the user page and establishes a link with the C part in the Init interface, which specifically includes:

[0074] S11, JS part sends a link establishment request to C part;

[0075] Specifically, the JS part can send a link establishment request to the C part by calling CreateLink.

[0076] Among them, CreateLink is a function in JS, which is used to generate a link in the interaction between the JS part and the C part of the toolkit.

[0077] S12. The JS part saves the link established with the C part; wherein the link established between the JS part and the C part is established after the C part responds to the request to establish a link.

[0078] Among them, the successful establishment of a link between the JS part of the toolkit and the C part is the basis for authorization and authentication. When the JS part of the toolkit and the C part successfully establish a link, the JS part and the C part will verify the subsequent data to be verified, otherwise, an error will be reported and the system will exit.

[0079] In the above step S2, the JS part generates a token based on the obtained URL address and sends it to the C part for verification, which specifically includes:

[0080] S21, the JS part obtains the system time time and the URL address url of the current user page through the API;

[0081] Specifically, the API can obtain the URL through the instruction window.location.href and store the obtained URL in the variable currentURL, that is:

[0082] var currentURL=window.location.href.

[0083] S22 and JS derive the SM4-CBC symmetric encryption key according to the preset project name. e .

[0084] A project name is preset for each application project. The project name corresponds to the application project one by one and can be represented by a numerical value or a character.

[0085] S23, JS part uses encryption key key e Encrypt the time address pair (time, url), generate a token, and send the token to part C for verification. The token is the encrypted ciphertext data.

[0086] In the above embodiment, the JS part sends the token to the C part for verification. When the C part verifies the received token, it specifically includes:

[0087] S24, part C derives the SM4-CBC symmetric decryption key according to the preset project name d Among them, the decryption key key d The encryption key key derived from the JS part e same.

[0088] S25, C part uses the decryption key key d Decrypt the received token to obtain the time address pair (time, url).

[0089] S26. Part C verifies the validity of the decrypted time and URL address to obtain a verification result.

[0090] Specifically, when part C verifies the validity of the decrypted time, it verifies whether the difference between the decrypted time and the current system time is within the preset time allowable range. If so, it further performs URL address verification, otherwise, it reports an error and exits to prevent replay attacks.

[0091] Part C performs validity verification on the decrypted URL address url to obtain a verification result; wherein, the verification result is one of verification success and verification failure; when the decrypted URL address url is verified to be in the url library bound inside the toolkit, the verification result obtained is verification success.

[0092] S27. After the verification is completed, the C part stores the verification result in the attributes of the current link and returns the verification result to the JS part.

[0093] In the above embodiment, in order to prevent the toolkit from being maliciously modified and bypassing the above verification process, a code signing function is set for part C in the toolkit. Before the URL-based license authorization and authentication method provided by the present invention is started, the correctness of the signature is first verified by the code signing function of part C. If the signature verification passes, it means that the program of part C has not been modified and runs normally; if the signature verification fails, it means that the program of part C has been tampered with and an error is reported and exited.

[0094] In the above embodiment, in order to ensure the security of the JS part, the JS part needs to be obfuscated and compressed so that the user cannot directly know the code logic of the JS part, thereby enhancing the opacity of the JS part to the user.

[0095] In the above step S2, in order to prevent replay attacks, the verification of the verification data can also be implemented by verifying the random number. That is, the system time can be replaced by a random number, and the JS part uses the encryption key to encrypt the random number and the URL address url of the current user page. The process is as follows:

[0096] S211. The JS part of the toolkit applies for a random number from the C part.

[0097] S222. The JS part receives the random number random generated and returned by the C part.

[0098] S233, the JS part obtains the URL address url of the current user page.

[0099] S244, JS part derives SM4-CBC symmetric encryption key according to the preset project name e .

[0100] A project name is preset for each application project. The project name corresponds to the application project one by one and can be represented by a numerical value or a character.

[0101] S255, JS part uses encryption key key e Encrypt the random number address pair (random, url), generate a token, and send the token to part C for verification. The token is the encrypted ciphertext data.

[0102] Corresponding to the above encryption process, the JS part sends the token to the C part for verification. When the C part verifies the received token, it specifically includes:

[0103] S266, part C derives the SM4-CBC symmetric decryption key according to the preset project name dAmong them, the decryption key key d The encryption key key derived from the JS part e same.

[0104] S277, part C uses the decryption key key d Decrypt the received token to get a random number address pair (random, url).

[0105] S288. Part C verifies the validity of the random number and URL address and saves the verification result.

[0106] Specifically, when part C performs validity verification on the random number obtained by decryption, it verifies whether the time random number obtained by decryption is consistent with the random number stored locally. If yes, it further performs URL address verification and destroys the stored random number. Otherwise, it reports an error and exits to prevent replay attacks. Among them, the random number stored locally is the random number generated by part C when the JS part applies for a random number from part C, and the random number is temporarily stored in part C.

[0107] Part C performs validity verification on the decrypted URL address to obtain a verification result; wherein, the verification result is one of verification success and verification failure; when the decrypted URL address url is in the url library bound inside the toolkit, the verification result obtained is verification success.

[0108] After the verification is completed, part C stores the verification result in the attributes of the current link and returns the verification result to the JS part.

[0109] From the above verification process, it can be seen that in order to prevent replay attacks, compared with the time verification method, the random number verification method requires obtaining a random number first, which adds an interaction process between the JS part and the C part, and the process is more complicated. Therefore, in this solution, the time verification method can be used preferentially to prevent replay attacks.

[0110] In the above embodiment, in order to prevent the user from obtaining the verification logic of the current license by analyzing the communication data, the data to be verified needs to be encrypted.

[0111] In order to achieve data encryption, a data encryption scheme based on a public key can also be used. During the software development stage, the encryption public key is pre-embedded in the JS part of the toolkit, and the decryption private key is pre-embedded in the C part of the toolkit. During encryption, the JS part of the toolkit uses the public key to encrypt the data to be verified, and then the C part of the toolkit uses the private key to decrypt the received encrypted data.

[0112] Since the operation speed of asymmetric encryption algorithms is relatively slow, the encryption advantage of using SM4-CBC symmetric encryption in the present invention is more obvious.

[0113] In the above embodiments, the encrypted token is directly passed to the C part of the toolkit for SM4-CBC decryption. If the attacker modifies the token data without knowing the encryption method and process, the decryption of the C part will fail. Therefore, by checking whether the decryption fails, it can be determined whether the current data has been tampered with.

[0114] Optionally, in order to prevent attackers from tampering with the data to be verified, a private key signature method can be used. Specifically, the signature private key is embedded in the JS part of the tool, and the signature verification public key is embedded in the C part of the toolkit. Before the data to be verified is transmitted, the private key is used to sign the data to be verified. After the C part of the toolkit receives the signed data, the public key is used to verify the signature value to determine the integrity of the received data.

[0115] Under normal circumstances, the attacker does not know the encryption process and method of the data to be verified, and the current anti-tampering scheme is effective. In the case where the attacker maliciously cracks the analysis toolkit code, the attacker can also obtain the signature private key data embedded in the toolkit, and the signature scheme is also invalid. In the current application scenario, the effectiveness of these two data tampering prevention methods is basically the same. However, since the anti-tampering method using private key signatures has a more complicated process, the advantages of this anti-tampering method are not obvious.

[0116] In another embodiment, if Figure 2 As shown, the URL-based license authorization and authentication method provided by the present invention can be applied to the interaction process between the JS part and the C part of the toolkit, which includes the following steps:

[0117] S100. The JS part of the toolkit responds to the Init interface call request of the user page and sends a link establishment request to the C part.

[0118] Among them, the Init interface is a function implemented by the JS part of the toolkit, and its function is to establish a link and then verify the token.

[0119] Specifically, the JS part can send a link establishment request to the C part by calling CreateLink, wherein CreateLink is a function in JS, which is used to generate a link in the interaction between the JS part and the C part of the toolkit.

[0120] S200. Part C responds to the link establishment request of the JS part and establishes a link with the JS part.

[0121] Among them, the successful establishment of a link between the JS part of the toolkit and the C part is the basis for authorization and authentication. When the JS part of the toolkit and the C part successfully establish a link, the JS part and the C part will verify the subsequent data to be verified, otherwise, an error will be reported and the system will exit.

[0122] S300, the JS part generates a token according to the obtained URL address and sends it to the C part for verification.

[0123] Each user page has a corresponding URL address. The JS part encapsulates the obtained URL address into a token and sends the token to the C part for verification. The license authorization authentication is completed by verifying the token.

[0124] S400. Part C returns the verification result to part JS.

[0125] S500, the JS part obtains the Init call result according to the received verification result, and feeds back the Init call result to the user page.

[0126] Among them, the token verification result is obtained by part C after receiving the token and decrypting and verifying it.

[0127] The Init call result is obtained after the JS part successfully establishes a link with the C part and the JS part receives the verification result returned by the C part. After the Init call result is returned successfully, the user page can access the service functions of the toolkit through the interface of the JS part of the toolkit.

[0128] In the above step S300, the JS part generates a token according to the obtained URL address and sends it to the C part for verification, which specifically includes:

[0129] S301, the JS part obtains the system time time and the URL address url of the current user page through the API;

[0130] Specifically, the API can obtain the URL through the instruction window.location.href and store the obtained URL in the variable currentURL, that is:

[0131] var currentURL=window.location.href.

[0132] S302, JS part derives SM4-CBC symmetric encryption key key according to the preset project name e .

[0133] A project name is preset for each application project. The project name corresponds to the application project one by one and can be represented by a numerical value or a character.

[0134] S303, JS part uses encryption key key e Encrypt the time address pair (time, url), generate a token, and send the token to part C for verification. The token is the encrypted ciphertext data.

[0135] In the above step S400, part C returns the verification result to part JS, which specifically includes:

[0136] S401, part C derives the SM4-CBC symmetric decryption key according to the preset project name d Among them, the decryption key key d The encryption key key derived from the JS part e same.

[0137] S402, part C uses the decryption key key d Decrypt the received token to obtain the time address pair (time, url).

[0138] S403, part C performs validity verification on the decrypted time and URL address to obtain a verification result.

[0139] Specifically, when part C verifies the validity of the decrypted time, it verifies whether the difference between the decrypted time and the current system time is within the preset time allowable range. If so, it further performs URL address verification, otherwise, it reports an error and exits to prevent replay attacks.

[0140] Part C performs validity verification on the decrypted URL address url to obtain a verification result; wherein, the verification result is one of verification success and verification failure; when the decrypted URL address url is verified to be in the url library bound inside the toolkit, the verification result obtained is verification success.

[0141] S404: After the verification is completed, the C part stores the verification result in the attributes of the current link and returns the verification result to the JS part.

[0142] The URL-based license authorization and authentication method provided by the present invention can be applied to a toolkit having a JS part and a C part. When the toolkit is working, the JS part obtains the URL address of the current user page, and then encrypts the URL address to generate data to be verified, and sends it to the C part of the toolkit for verification. The C part decrypts and verifies the received encrypted data to be verified, and completes the URL-based license authorization and authentication of the toolkit. In the authorization and authentication process, by adopting the URL-based license authorization and authentication method provided by the present invention, there is no need to issue an additional license to the terminal user, and no additional server is required for verification, and the authorization and authentication can be completed independently.

[0143] In the above embodiment, in order to prevent the toolkit from being maliciously modified and bypassing the above verification process, a code signing function is set for part C in the toolkit. Before the URL-based license authorization and authentication method provided by the present invention is started, the correctness of the signature is first verified by the code signing function of part C. If the signature verification passes, it means that the program of part C has not been modified and runs normally; if the signature verification fails, it means that the program of part C has been tampered with and an error is reported and exited.

[0144] In the above embodiment, in order to ensure the security of the JS part, the JS part needs to be obfuscated and compressed so that the user cannot directly know the code logic of the JS part, thereby enhancing the opacity of the JS part to the user.

[0145] In the above step S300, in order to prevent replay attacks, the verification of the data to be verified can also be implemented by verifying random numbers. That is to say, the system time can be replaced by a random number, and the JS part uses the encryption key to encrypt the random number address pair to generate a token. Corresponding to the encryption process, the JS part sends the token to the C part for verification, and the C part verifies the received token. Among them, the process of generating the token is the same as the above steps S211 to S244, and the process of verifying the token is the same as the above steps S255 to S277, which will not be repeated here.

[0146] like Figure 3As shown, based on the URL-based License authorization and authentication method provided by the present invention, the present invention also provides a URL-based License authorization and authentication system, which includes a user page 31 and a toolkit 32, wherein the toolkit 32 includes a JS part 321 and a C part 322, the JS part 321 is used to respond to the Init interface call request of the user page, and establish a link with the C part 322 in the Init interface; the JS part 321 is also used to generate data to be verified according to the acquired URL address, and the C part 322 is used to verify the received data to be verified to obtain a verification result. The JS part 321 is used to obtain an Init call result according to the received verification result, and feed the Init call result back to the user page 31.

[0147] Specifically, the JS part 321 includes a URL acquisition module 3211 , a URL encryption module 3212 and a business request generation module 3213 , and the C part 322 includes a URL decryption module 3221 , a URL verification module 3222 and a business request processing module 3223 .

[0148] The URL acquisition module 3211 is used to obtain the URL address corresponding to the user page, and the URL encryption module 3212 uses the encryption key key e The time address pair (time, url) is encrypted, a token is generated and sent to the URL decryption module 3221. The encryption key key e It is the SM4-CBC symmetric encryption key, which is derived from the preset project name.

[0149] URL decryption module 3221 uses the decryption key key d The received token token is decrypted to obtain a time address pair (time, url). The URL verification module 3222 is used to verify the validity of the decrypted time and URL address to obtain a verification result.

[0150] The service request generation module 3213 is used to generate a service request after receiving the verification result. The service request processing module 3223 is used to process the received service request.

[0151] In the URL-based license authorization and authentication system provided by the present invention, the JS part obtains the URL address of the current user page, then encrypts the URL address to generate data to be verified, and sends it to the C part of the toolkit for verification, and the C part returns the verification result to the JS part. By adopting the URL-based license authorization and authentication system provided by the present invention, there is no need to issue an additional license to the terminal user during the authorization and authentication process, and no additional server is required for verification. The license authorization and authentication of the toolkit can be implemented based on the URL of the user page, thereby realizing the control of the use of the toolkit.

[0152] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A URL-based license authorization and authentication method, characterized in that: The following steps are involved: The JS part of the toolkit responds to the Init interface call request of the user page and establishes a link with the C part in the Init interface; wherein the JS part is the JavaScript language implementation part of the toolkit, and the C part is the C language implementation part of the toolkit; The JS part generates the data to be verified based on the obtained URL address and sends it to the C part for verification; The JS part obtains the Init call result according to the received verification result, and feeds back the Init call result to the user page; wherein, the verification result is obtained by the C part after receiving the data to be verified, decrypting and verifying; The JS part of the toolkit responds to the Init interface call request of the user page and establishes a link with the C part in the Init interface, specifically including: The JS part sends a link establishment request to the C part; The JS part saves the link established with the C part; wherein the link established between the JS part and the C part is established after the C part responds to the link establishment request; The data to be verified is a token. The JS part generates a token based on the obtained URL address and sends it to the C part for verification, which specifically includes: The JS part obtains the system time and the URL address of the current user page; The JS part derives the SM4-CBC symmetric encryption key based on the preset project name; The JS part uses the encryption key to encrypt the time address pair (time, url), generates a token, and sends the token to the C part for verification.

2. According to the URL-based license authorization and authentication method of claim 1, it is characterized in that: The specific process of verifying the token in Part C is as follows: Part C derives an SM4-CBC symmetric decryption key according to a preset project name; wherein the decryption key is the same as the encryption key; Part C uses the decryption key to decrypt the received token to obtain the time address pair (time, url); Part C verifies the validity of the decrypted time and URL address to obtain the verification result.

3. According to the URL-based license authorization and authentication method of claim 2, it is characterized in that: The C part verifies the validity of the decrypted time and URL address to obtain the verification result, which specifically includes: Part C verifies the validity of the decrypted time. If the difference between the decrypted time and the current system time is within the preset time range, further URL address verification is performed. Part C performs validity verification on the decrypted URL address url to obtain a verification result; wherein, the verification result is one of verification success and verification failure; when the decrypted URL address url is verified to be in the url library bound inside the toolkit, the verification result obtained is verification success.

4. The URL-based license authorization and authentication method according to any one of claims 1 to 3, characterized in that: Before the JS part of the toolkit responds to the Init interface call request of the user page and establishes a link with the C part in the Init interface, the following steps are also included: Perform signature verification on part C; Among them, part C is provided with a code signing function, through which the correctness of the signature is verified; when the signature verification passes, it indicates that the program of part C has not been modified and runs normally.

5. The URL-based license authorization and authentication method according to claim 1, characterized in that: The data to be verified is a token. The JS part generates a token based on the obtained URL address and sends it to the C part for verification, which specifically includes: The JS part of the toolkit requests a random number from the C part; The JS part receives the random number random generated and returned by the C part; The JS part obtains the URL address of the current user page; The JS part derives the SM4-CBC symmetric encryption key based on the preset project name; The JS part uses the encryption key to encrypt the random number address pair (random, url), generates a token, and sends the token to the C part for verification.

6. The URL-based license authorization and authentication method according to claim 5, characterized in that: The specific process of verifying the token in Part C is as follows: Part C derives an SM4-CBC symmetric decryption key according to a preset project name; wherein the decryption key is the same as the encryption key; Part C uses the decryption key to decrypt the received token to obtain a random number address pair (random, url); Part C verifies the validity of the random number and URL address and saves the verification results.

7. The URL-based license authorization and authentication method according to claim 6, characterized in that: Part C verifies the validity of the random number and URL address and saves the verification results, including: Part C verifies the validity of the random number obtained by decryption. When the time random number obtained by decryption is consistent with the random number stored locally, it further verifies the URL address and destroys the stored random number. Part C performs validity verification on the decrypted URL address to obtain a verification result; wherein, the verification result is one of verification success and verification failure; when the decrypted URL address url is in the url library bound inside the toolkit, the verification result obtained is verification success.

8. A URL-based license authorization and authentication system, characterized in that: It includes a user page and a toolkit, wherein the toolkit includes a JS part and a C part; the JS part is the JavaScript language implementation part of the toolkit, and the C part is the C language implementation part of the toolkit; The JS part is used to respond to the Init interface call request of the user page and establish a link with the C part in the Init interface; the JS part is also used to generate the data to be verified according to the acquired URL address, and the C part is used to verify the received data to be verified and obtain the verification result; the JS part is used to obtain the Init call result according to the received verification result, and feed back the Init call result to the user page; The JS part includes a URL acquisition module, a URL encryption module and a service request generation module, and the C part includes a URL decryption module, a URL verification module and a service request processing module; The URL acquisition module is used to obtain the URL address corresponding to the user page. The URL encryption module encrypts the time address pair (time, url) with an encryption key, generates a token token and sends it to the URL decryption module; the encryption key is an SM4-CBC symmetric encryption key, which is derived from a preset project name; the time time in the time address pair (time, url) is the system time obtained by the URL acquisition module; The URL decryption module uses the decryption key to decrypt the received token token to obtain a time address pair (time, url); the URL verification module is used to verify the validity of the decrypted time and URL address to obtain a verification result; The service request generation module is used to generate a service request after receiving the verification result; the service request processing module is used to process the received service request.

9. The URL-based license authorization and authentication system according to claim 8, characterized in that: The JS part includes a URL acquisition module, a URL encryption module and a service request generation module, and the C part includes a URL decryption module, a URL verification module and a service request processing module; The URL acquisition module is used to obtain the URL address corresponding to the user page. The URL encryption module encrypts the random number address pair (random, url) with an encryption key, generates a token token and sends it to the URL decryption module; the encryption key is an SM4-CBC symmetric encryption key, which is derived according to a preset project name; the random number random in the random number address pair (random, url) is generated by the C part in response to the request of the JS part; The URL decryption module uses the decryption key to decrypt the received token token to obtain a random number address pair (random, url); the URL verification module is used to verify the validity of the decrypted random number and URL address to obtain a verification result; The service request generation module is used to generate a service request after receiving the verification result; the service request processing module is used to process the received service request.

Citation Information

Patent Citations

  • Method and system for encrypting user login information in interactive network TV system

    CN101170676A

  • Access method supporting multiple IPTV services platform and IPTV terminal unit

    CN101247344A