A method, system and computer storage medium for unified signing and verification
By generating personalized signature rules and keys for different terminals and combining them with the server's signature verification mechanism, the problem of insufficient data security in cloud services is solved, and trusted request verification and security assurance for enterprise data are achieved.
Patent Information
- Application Number
- CN202311119156.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-08-31
AI Technical Summary
When enterprises use cloud services, it is difficult to guarantee the security of enterprise data, especially in the absence of protective measures, which makes them vulnerable to malicious attacks and data leaks. Existing security verification methods are insufficient to ensure the trustworthiness of the request source.
Based on the terminal type, corresponding signature rules and keys are generated. After logging in, the terminal receives and uses these rules to sign the data acquisition request. The server verifies the signature. Different rules are used for front-end clients, back-end servers, and temporary terminals to ensure the security of each type of terminal.
By employing a lightweight security verification mechanism, the system ensures that the source of each terminal's request is trustworthy, thereby improving the security and stability of enterprise data and preventing unauthorized access and data leakage.
Smart Images

Figure CN117061209B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of signature and verification, and in particular to a unified method, system, electronic device and computer storage medium for signature and verification. Background Technology
[0002] To facilitate enterprise management, an increasing number of companies are using cloud services for internal data management. However, software providing these cloud services exposes numerous web interfaces to the public internet. Anyone with access to the domain name can attempt to make requests to these interfaces, making it difficult to guarantee enterprise data security in the cloud. Without any protection, data is easily vulnerable to malicious attacks or data scraping, leading to service instability, data leaks, and other information security issues. A unified security verification method is needed, employing lightweight security verification to ensure that the source of each request is trustworthy. Summary of the Invention
[0003] The purpose of this invention is to provide a unified method, system, electronic device, and computer storage medium for signing and verifying signatures, enabling lightweight security verification of requests and ensuring that the sources of requests are trustworthy.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] In a first aspect, the present invention provides a unified method for endorsement and verification, specifically including the following steps:
[0006] S100. Generate corresponding signature rules and keys according to different terminal types and store them in the server;
[0007] S200, The terminal sends a login request to the server; the login request includes one or more of the following: terminal ID, password, MAC address, terminal type, username and password;
[0008] S300: The server receives a login request sent by the terminal, registers the terminal according to the content of the received login request, and stores the terminal's information in the server.
[0009] S400: The server sends the signature rules, key, and key validity period to the terminal based on the terminal type.
[0010] S500: The terminal signs the data acquisition request according to the corresponding signing rules and sends the data acquisition request to the server.
[0011] S600: The server receives a data acquisition request, extracts the terminal type, and verifies the signature of the data based on the terminal type.
[0012] Furthermore, S300 further includes:
[0013] Create a dynamic data table on the server to store one or more of the following: the ID, MAC address, client type, username, and password of the registered terminal.
[0014] Furthermore, S400 further includes:
[0015] If the terminal type is a temporary terminal, such as an automated testing terminal or an operation and maintenance monitoring terminal, then the manual signature rule should be used for signing.
[0016] Furthermore, S500 further includes:
[0017] S501. If the terminal is a front-end client, the front-end client ID and MAC address are signed using the front-end client signing rules and key. The timestamp, terminal type and signed data are put into the header of the data request and the data request is sent to the server.
[0018] S502. If the terminal is a backend server and the interface that initiated the request is an existing interface, then the data acquisition request is signed using bytecode signing rules, and the signed data acquisition request, terminal type and timestamp are sent to the server.
[0019] If the terminal is a backend server and the interface that initiated the request is a new interface, the S503 uses the HTTP signature rules to sign the data retrieval request and sends the signed data retrieval request and terminal type to the server.
[0020] S504. If the terminal is a temporary terminal, the administrator shall use the username, password and key obtained from the server to manually sign the data acquisition request according to the signing rules, and send the signed data acquisition request, terminal type and timestamp to the server.
[0021] Secondly, the present invention also provides a unified system for endorsement and verification, comprising the following apparatus:
[0022] The server includes an encryption rule generation module, a signature verification module, a terminal registration module, a terminal information storage module, and a data storage module;
[0023] The encryption rule generation module generates corresponding signature rules and keys based on different terminal types;
[0024] The terminal registration module is used to receive login requests sent by terminals and register the terminals according to the content of the received login requests.
[0025] The terminal information storage module establishes a dynamic data table to store one or more of the following: the ID, MAC address, client type, username, and password of the registered terminal.
[0026] The signature verification module is used to verify the signature of data acquisition requests sent by the terminal.
[0027] Terminals include front-end clients, back-end servers, and temporary terminals;
[0028] The terminal includes a signature module that signs the data acquisition request according to the signature rules corresponding to the terminal type and the acquired key.
[0029] Furthermore, the terminal information storage module further includes:
[0030] Create a dynamic data table on the server to store one or more of the following: the ID, MAC address, client type, username, and password of the registered terminal.
[0031] Furthermore, the encryption rule generation module further includes:
[0032] If the terminal type is a temporary terminal, such as an automated testing terminal or an operation and maintenance monitoring terminal, then the manual signature rule should be used for signing.
[0033] Furthermore, the signature verification module further includes:
[0034] S501. If the terminal is a front-end client, the front-end client ID and MAC address are signed using the front-end client signing rules and key. The timestamp, terminal type and signed data are put into the header of the data request and the data request is sent to the server.
[0035] S502. If the terminal is a backend server and the interface that initiated the request is an existing interface, then the data acquisition request is signed using bytecode signing rules, and the signed data acquisition request, terminal type and timestamp are sent to the server.
[0036] If the terminal is a backend server and the interface that initiated the request is a new interface, the S503 uses the HTTP signature rules to sign the data retrieval request and sends the signed data retrieval request and terminal type to the server.
[0037] S504. If the terminal is a temporary terminal, the administrator shall use the username, password and key obtained from the server to manually sign the data acquisition request according to the signing rules, and send the signed data acquisition request, terminal type and timestamp to the server.
[0038] Thirdly, the present invention also provides an electronic device, comprising:
[0039] At least one processor, and a memory communicatively connected to at least one of the processors;
[0040] The memory stores instructions that can be executed by at least one of the processors, which are executed by at least one of the processors to enable at least one of the processors to perform the method described above.
[0041] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing the computer to perform the above-described method.
[0042] The beneficial effects of this invention are as follows:
[0043] A unified signature and verification method, system, electronic device, and computer storage medium are disclosed. Different signature rules are generated based on the terminal type and stored in a service. Upon a terminal's login request, terminal information is registered on the service, and the signature rules are sent to the corresponding terminal. When a terminal sends a data retrieval request, it uses the corresponding signature rules to sign the request. The server verifies the signature on the data retrieval request and, if successful, sends the data to the terminal. This invention sets different signature rules for different terminals, providing a unified signature and verification rule for each type of terminal, enabling lightweight security verification of requests and ensuring data security. Attached Figure Description
[0044] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0045] Figure 1 According to an embodiment of the present invention, a unified method for signature affixing and verification is provided. Detailed Implementation
[0046] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0047] To ensure the security of enterprise data, this invention provides a unified method for signature addition and verification, specifically including the following steps:
[0048] S100. Generate corresponding signature rules and keys according to different terminal types and store them on the server.
[0049] S200: The terminal sends a login request to the server. The login request includes one or more of the following: terminal ID, password, MAC address, terminal type, username, and password.
[0050] S300: The server receives a login request from the terminal, registers the terminal based on the content of the received login request, and stores the terminal's information in the server.
[0051] A dynamic data table is created on the server to store one or more of the following: the ID, MAC address, client type, username, and password of the registered terminal. Terminal types include front-end, back-end, and temporary terminals such as automated testing terminals and operation and maintenance monitoring terminals.
[0052] S400: The server sends the signature rules, key, and key validity period to the terminal based on the terminal type.
[0053] S401. If the terminal type is a front-end client, send the front-end client signature rules, key, and key validity period to the front-end client. The front-end client signature rules are as follows:
[0054]
[0055] Where key1 is the key corresponding to the front-end client, D front-end is the client ID, and M is the MAC address of the front-end client.
[0056] S402. If the terminal type is a backend server, then further determine the type of the interface that initiated the request. If the interface that initiated the request is an existing interface, then execute S403; if the interface that initiated the request is a newly added interface, then execute S404.
[0057] S403. Use bytecode enhancement to set bytecode signing rules, and send the bytecode signing rules, key, and key validity period to the backend server.
[0058] S404. Set the HTTP signature rules, and send the HTTP signature rules, key, and key validity period to the server. The HTTP signature rules are as follows:
[0059] S4041. The specific encryption rules for the backend server ID and MAC address are as follows:
[0060] P(key2) = (D2 + M2) mod key2.
[0061] Where key1 is the key corresponding to the backend server, D2 is the backend server ID, and M2 is the backend server MAC address.
[0062] S4042. Concatenate the encrypted P(key2) value, the port number N for sending the request, and the timestamp T in order, and then use the MD5 algorithm to sign the result to obtain the signature sign = MD5(P(key2), N, T).
[0063] S4043. Add the signed signature (sign) to the header of the data request.
[0064] S405. If the terminal type is a temporary terminal, such as an automated testing terminal or an operation and maintenance monitoring terminal, then use the manual signature rule for signing.
[0065] Automated testing terminals and operation and maintenance monitoring terminals are terminals used within the company to monitor and maintain data. Users do not need to physically touch the terminal. By using manual signature, it can be ensured that only internal employees of the company can access the terminal.
[0066] S4501. Obtain the username and password from the login request, and store the username, password, backend server ID, backend server MAC address, and interface port number in the server.
[0067] The manual encryption rules are stored on the server and do not need to be sent to the terminal. On the temporary terminal, the user manually signs the data retrieval request according to the manual signature rules.
[0068] S4502. The server sends the key and key validity period to the temporary terminal.
[0069] S500: The terminal signs the data acquisition request according to the corresponding signing rules and sends the data acquisition request to the server.
[0070] Before sending a data retrieval request, the key validity period is verified. If the current time is within the key validity period, the data retrieval request is sent directly; if the current time is not within the key validity period, the login request is resent to obtain a new key.
[0071] S501. If the terminal is a front-end client, the front-end client ID and MAC address are signed using the front-end client signing rules and key. The timestamp, terminal type, and signed data are placed in the header of the data request, and the data request is sent to the server.
[0072] S502. If the terminal is a backend server and the interface that initiated the request is an existing interface, then the data retrieval request is signed using bytecode signing rules, and the signed data retrieval request, terminal type, and timestamp are sent to the server.
[0073] If the terminal is a backend server and the interface that initiated the request is a new interface, the S503 uses the HTTP signature rules to sign the data retrieval request and sends the signed data retrieval request and terminal type to the server.
[0074] S504. If the terminal is a temporary terminal, the administrator shall use the username, password and key obtained from the server to manually sign the data acquisition request according to the signing rules, and send the signed data acquisition request, terminal type and timestamp to the server.
[0075] S600: The server receives a data acquisition request, extracts the terminal type, and verifies the signature of the data based on the terminal type.
[0076] Specifically, based on the signature rules corresponding to different terminal types, the data acquisition request is verified by comparing whether the key, terminal ID, MAC address, username, password, etc. are the same. If they are the same, the verification is passed and the enterprise data is sent to the terminal.
[0077] Furthermore, the validity of the key is determined based on the timestamp and the corresponding key validity period in the data acquisition request. If it is valid, the verification is passed; if it is invalid, the request is rejected.
[0078] Another embodiment of the present invention provides a unified system for signature affixing and verification, comprising the following apparatus:
[0079] The server includes an encryption rule generation module, a signature verification module, a terminal registration module, a terminal information storage module, and a data storage module;
[0080] The encryption rule generation module generates corresponding signature rules and keys based on different terminal types;
[0081] The terminal registration module is used to receive login requests sent by terminals and register the terminals according to the content of the received login requests.
[0082] The terminal information storage module establishes a dynamic data table to store one or more of the following: the ID, MAC address, client type, username, and password of the registered terminal.
[0083] The signature verification module is used to verify the signature of data acquisition requests sent by the terminal.
[0084] Terminals include front-end clients, back-end servers, and temporary terminals;
[0085] The terminal includes a signature module that signs the data acquisition request according to the signature rules corresponding to the terminal type and the acquired key.
[0086] The unified signature and verification system can use corresponding modules to implement the above methods. The specific implementation method is the same as described above, and will not be repeated here.
[0087] Furthermore, the present invention also provides an electronic device, including a processor and a memory. The storage device can be configured to store program code for executing the unified signature and verification method of the above-described method embodiments. The processor can be configured to execute the program code in the memory, which includes, but is not limited to, program code for executing the unified signature and verification method of the above-described method embodiments. For ease of explanation, only the parts related to the embodiments of the present invention are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of the present invention.
[0088] Furthermore, the present invention also provides a computer-readable storage medium. In one embodiment of the computer-readable storage medium according to the present invention, the computer-readable storage medium may be configured to store a program that performs a unified signature and verification method according to the above-described method embodiments, the program being loaded and run by a processor to implement the above-described unified signature and verification method.
[0089] The medium in this invention can be any combination of one or more computer-readable media. The medium can be a computer-readable signal medium or a computer-readable storage medium. The medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the medium (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, the medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0090] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A unified method for endorsement and verification, characterized in that, Specifically, the steps include the following: S100. Generate corresponding signature rules and keys according to different terminal types and store them in the server; S200: The terminal sends a login request to the server; The login request includes one or more of the following: terminal ID, MAC address, terminal type, username, and password; S300: The server receives a login request sent by the terminal, registers the terminal according to the content of the received login request, and stores the terminal's information in the server. S400: The server sends the signature rules, key, and key validity period to the terminal according to the terminal type. S401. If the terminal type is a front-end client, send the front-end client signature rules, key, and key validity period to the front-end client. The front-end client signature rules are as follows: Where key1 is the key corresponding to the front-end client, D1 is the front-end client ID, and M1 is the front-end client MAC address; S402. If the terminal type is a backend server, then further determine the type of the interface that initiated the request. If the interface that initiated the request is an existing interface, then execute S403; if the interface that initiated the request is a newly added interface, then execute S404. S403. Use bytecode enhancement to set bytecode signing rules, and send the bytecode signing rules, key, and key validity period to the backend server. S404. Set the HTTP signature rules, and send the HTTP signature rules, key, and key validity period to the server. The HTTP signature rules are as follows: S4041. The specific encryption rules for the backend server ID and MAC address are as follows: P(key2) = (D2 + M2) mod key2; Where key1 is the key corresponding to the backend server, D2 is the backend server ID, and M2 is the backend server MAC address; S4042. Concatenate the encrypted P(key2) value, the port number N for sending the request, and the timestamp T in order, and then use the MD5 algorithm to sign the result to obtain the signature sign = MD5(P(key2), N, T). S4043. Add the signed signature (sign) to the header of the data request; S405. If the terminal type is a temporary terminal, and the temporary terminal is an automated testing terminal or an operation and maintenance monitoring terminal, then use the manual signature rule for signing. Automated testing terminals and operation and maintenance monitoring terminals are terminals used by the company to monitor and maintain data. Users do not need to touch the terminal. Using the manual signature method can ensure that only internal employees of the company can access the terminal. S500: The terminal signs the data retrieval request according to the corresponding signing rules and sends the data retrieval request to the server. Before sending the data retrieval request, the terminal verifies the key validity period. If the current time is within the key validity period, the terminal sends the data retrieval request directly. If the current time is not within the key validity period, the terminal resends the login request to obtain a new key. S600: The server receives a data acquisition request, extracts the terminal type, and verifies the signature of the data based on the terminal type. This includes: verifying the signature of the data acquisition request according to the signature rules corresponding to different terminal types, comparing whether the key, terminal ID, MAC address, username, and password are the same; if they are the same, the verification is passed and the enterprise data is sent to the terminal; determining whether the key is valid based on the timestamp and the corresponding key validity period in the data acquisition request; if valid, the verification is passed; if invalid, the request is rejected.
2. The method according to claim 1, characterized in that, The S300 further includes: Create a dynamic data table on the server to store one or more of the following: the ID, MAC address, client type, username, and password of the registered terminal.
3. The method according to claim 1, characterized in that, The S500 further includes: S501. If the terminal is a front-end client, the front-end client ID and MAC address are signed using the front-end client signing rules and key. The timestamp, terminal type and signed data are put into the header of the data request and the data request is sent to the server. S502. If the terminal is a backend server and the interface that initiated the request is an existing interface, then the data acquisition request is signed using bytecode signing rules, and the signed data acquisition request, terminal type and timestamp are sent to the server. If the terminal is a backend server and the interface that initiated the request is a new interface, the S503 uses the HTTP signature rules to sign the data retrieval request and sends the signed data retrieval request and terminal type to the server. S504. If the terminal is a temporary terminal, the administrator shall use the username, password and key obtained from the server to manually sign the data acquisition request according to the signing rules, and send the signed data acquisition request, terminal type and timestamp to the server.
4. An electronic device, comprising: At least one processor, and a memory communicatively connected to at least one of the processors; The memory stores instructions executable by at least one of the processors, which are executed by at least one of the processors to enable the at least one of the processors to perform the method according to any one of claims 1-3.
5. A computer-readable storage medium, characterized in that, The medium stores computer instructions for causing the computer to perform the method described in any one of claims 1-3.
Citation Information
Patent Citations
Signature signing rule loading method and apparatus
CN106789860A
