Method, device, equipment and storage medium for preventing URL parameter tampering
By adding a timestamp when url is generated, the effectiveness of url is verified, and the problem that url data transmission in the prior art is easily tampered, improving the security of data transmission.
Patent Information
- Application Number
- CN202210486660.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-05-06
AI Technical Summary
The existing anti-tampering method based on url data transmission is easily brutally tampered with, resulting in tampering with parameters in url, affecting the security of data transmission.
By adding a timestamp when generating the url, the url is time-sensitive, and the validity of the url is verified by using the timestamp to reduce the risk of brute-force tampering.
It effectively reduces the impact of url modification after being brutally tampered with, and improves the security of data transmission.
Smart Images

Figure CN114866320B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a method, device, equipment and storage medium for preventing URL parameters from being tampered with. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] At present, in order to enable SMEs to obtain loans quickly, banks often need to cooperate with partners in inclusive finance pre-loan marketing and other business scenarios. SMEs fill in business data such as personal information or corporate needs through partners, and partners send business data to banks. Banks can quickly lend to SMEs based on business data, solving the urgent needs of SMEs.
[0004] When the partners and banks (operators) transmit business data, the forms filled out by SMEs are usually split into several URLs for transmission.
[0005] In the existing schemes for preventing tampering of data transmitted by URL, the partners usually extract specific information from the URL, form a string to be signed from the specific information, generate a signature for the string to be signed using a specific algorithm, and send the signature information to the operator, who decrypts the signature to obtain specific information and performs corresponding operations based on the specific information, such as lending to small and medium-sized enterprises. However, some brute force tampering techniques can decrypt the URL multiple times and rewrite the URL, so the above-mentioned method of transmitting data by URL is prone to tampering. Summary of the invention
[0006] The embodiment of the present invention provides a method for preventing URL parameters from being tampered with, so as to reduce the risk of parameters in the URL being tampered with when data is transmitted through the URL. The method comprises:
[0007] Generate a timestamp when receiving a business data string;
[0008] Determine a signature string according to the timestamp and the business data string;
[0009] Generate a URL according to the business data string, the timestamp and the signature string;
[0010] The url is sent to the operator so that the operator executes the business corresponding to the business data string after completing the verification of the signature string and the timestamp in the url.
[0011] As an embodiment of this invention, before generating a timestamp when receiving a service data string, the method includes:
[0012] Acquiring service data, wherein the service data is input by a user according to a URL template associated with the service to be requested;
[0013] The business data is converted into the business data string according to the data filling format of the URL template.
[0014] As an embodiment of this invention, the step of determining the signature string according to the timestamp and the service data string includes:
[0015] Generate a character string to be signed according to the timestamp and the business data string;
[0016] Obtaining a business-related private key according to the business-related fields in the URL template;
[0017] The signature operation is performed on the character string to be signed according to the preset business-related private key to obtain a signature character string.
[0018] As an embodiment of this invention, obtaining a business-related private key according to a business-related field in the URL template includes:
[0019] Determine the business scenario corresponding to the business-related field;
[0020] The private key table is traversed according to the business scenario to obtain the business-related private key, wherein the private key table represents the mapping relationship between the business scenario and the business-related private key.
[0021] As an embodiment of this invention, the step of generating a URL according to the service data string, the timestamp and the signature string includes:
[0022] After the timestamp and the signature string are sequentially filled into the business data string in the URL template in the form of key-value pairs, the URL is generated.
[0023] On the other hand, this article also provides a device for preventing URL parameter tampering, which is applied to partners and includes:
[0024] A timestamp generating unit, used to generate a timestamp when receiving a service data string;
[0025] A character string determination unit, configured to determine a signature character string according to the timestamp and the service data string;
[0026] A url generating unit, used to generate a url according to the business data string, the timestamp and the signature string;
[0027] The sending unit is used to send the URL to the operator, so that the operator executes the business corresponding to the business data string after completing the verification of the signature string and the timestamp in the URL.
[0028] On the other hand, this article also provides a method for preventing URL parameter tampering, which is applied to operators, including:
[0029] Get the URL sent by the partner, where the URL includes a business data string, a timestamp, and a signature string;
[0030] Decrypt the signature string in the URL to obtain a timestamp and a business data string;
[0031] Determine whether the timestamp and service data string obtained by decryption are the same as the service data string and timestamp in the URL, and determine whether the timestamp in the URL meets the time threshold;
[0032] If the judgment results are all yes, the business corresponding to the business data string in the URL is executed.
[0033] On the other hand, this article also provides a device for preventing URL parameter tampering, which is applied to operators, including:
[0034] An acquisition unit, used to acquire the URL sent by the partner, wherein the URL includes a business data string, a timestamp and a signature string;
[0035] A decryption unit, used to decrypt the signature string in the URL to obtain a timestamp and a business data string;
[0036] A judging unit, used to judge whether the timestamp and service data string obtained by decryption are the same as the service data string and timestamp in the URL, and to judge whether the timestamp in the URL meets the time threshold;
[0037] The execution unit is used to execute the business corresponding to the business data string in the URL if the judgment results are all yes.
[0038] On the other hand, the present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the methods described above is implemented.
[0039] On the other hand, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the methods described above is implemented.
[0040] In an embodiment of the present invention, a method for preventing URL parameters from being tampered with is provided. Compared with the technical solution for preventing violent tampering in the prior art, a timestamp is added when generating a URL to make the URL time-effective. Since violent tampering usually takes a long time, after the URL in this article loses its time-effectiveness, when the URL is violently tampered with, whether the URL is valid can also be determined by the time-effectiveness of the URL, thereby reducing the impact on partners caused by the modification of certain parameters in the URL after the URL is violently tampered with. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0042] Figure 1 This is an overall system diagram for preventing URL parameter tampering in an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a method for preventing URL parameters from being tampered with applied to a partner in an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of a device for preventing URL parameters from being tampered with applied to a partner in an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of a method for preventing URL parameters from being tampered with applied to an operator in an embodiment of the present invention;
[0046] Figure 5 Schematic diagram of a device for preventing URL parameters from being tampered with applied to an operator in an embodiment of the present invention;
[0047] Figure 6 This is a data flow chart of URL parameter tamper-proofing in an embodiment of the present invention;
[0048] Figure 7 Schematic diagram of a computer in an embodiment of the present invention.
[0049] Description of the accompanying symbols:
[0050] 101. Partners;
[0051] 102. Operator;
[0052] 301. Timestamp generating unit;
[0053] 302. character string determination unit;
[0054] 303, url generation unit;
[0055] 304, sending unit;
[0056] 501, obtaining unit;
[0057] 502, decryption unit;
[0058] 503, judging unit;
[0059] 504, execution unit;
[0060] 702. Computer equipment;
[0061] 704, processor;
[0062] 706. Memory;
[0063] 708, driving mechanism;
[0064] 710, input / output module;
[0065] 712. Input devices;
[0066] 714. Output devices;
[0067] 716. Presentation equipment;
[0068] 718. Graphical user interface;
[0069] 720, network interface;
[0070] 722. Communication link;
[0071] 724. Communication bus. DETAILED DESCRIPTION
[0072] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0073] At present, in order to enable SMEs to obtain loans quickly, banks often need to cooperate with partners in inclusive finance pre-loan marketing and other business scenarios. SMEs fill in business data such as personal information or corporate needs through partners, and partners send business data to banks. Banks can quickly lend to SMEs based on business data, solving the urgent needs of SMEs.
[0074] like Figure 1 The overall system diagram for preventing URL parameter tampering shown includes a partner 101 and an operator 102.
[0075] Partner 101 is used to run the partner system. The partner system includes an external platform that establishes a cooperative relationship with the bank and signs an agreement. For example, a unit (the unit has signed an agreement with the bank and is a partner of the bank) needs to purchase equipment in large quantities. During the equipment procurement process, when the bill needs to be paid, the unit needs a loan. The unit can find the URL template sent in advance by the bank through the partner terminal, and fill in the business data required for the loan according to the business-related fields on the URL template. The business data includes payment sensitive information such as the loan amount, personal information and the purpose of funds. After filling in, various business data in the URL are encrypted and sent to the bank.
[0076] The operator 102 is used to receive the URLs sent by each partner 101, wherein the operator 102 includes a bank that runs an operating system. The bank decrypts the URL and sends a loan to the unit of the partner 101 according to the business data in the URL.
[0077] The partner 101 and the operator 102 may be connected via a network cable. It should be noted that the business between the partner 101 and the operator 102 includes loans and account opening.
[0078] The above-mentioned URL generation process is relatively simple. When the URL is transmitted to the operator 102 through the partner 101, it may be subject to malicious attacks, causing the business data in the URL to be tampered with. For example, when a unit wants to borrow 100,000 yuan, when tampering occurs, the unit's loan amount is modified to 10,000 yuan. At this time, the unit's bill cannot be paid immediately, resulting in the unit's production capacity being unable to meet demand, causing subsequent serious consequences.
[0079] Therefore, this article provides a method to prevent URL parameter tampering, which can solve the problem of operators receiving tampered URLs by encrypting the URL. Figure 2 A schematic diagram of a method for preventing URL parameter tampering applied to a partner is shown, comprising:
[0080] Step 201: Generate a timestamp when receiving a service data string.
[0081] Step 202: Determine a signature string according to the timestamp and the business data string.
[0082] Step 203: Generate a URL according to the business data string, the timestamp and the signature string.
[0083] Step 204: Send the URL to the operator, so that the operator executes the business corresponding to the business data string after completing the verification of the signature string and the timestamp in the URL.
[0084] Through the above method, by adding a timestamp when generating the URL, the URL is made effective. Because violent tampering usually takes a long time, this article makes the URL invalid. After the URL is violently tampered, the validity of the URL can be judged by the timeliness of the URL, which reduces the impact on partners caused by modifying certain parameters after the URL is violently tampered.
[0085] In this step, when the business data string is obtained, a timestamp can be generated. In this article, the timestamp can be expressed as the total number of seconds from Greenwich Mean Time (00:00:00 GMT) on January 1, 1970 to the current time. It is generated by the partner. Taking Java language as an example, the generation method is: long timestamp = new Date().getTime().
[0086] As an embodiment of this invention, before generating a timestamp when receiving a service data string, the method includes:
[0087] Acquiring service data, wherein the service data is input by a user according to a URL template associated with the service to be requested;
[0088] The business data is converted into the business data string according to the data filling format of the URL template.
[0089] In this step, in order to reduce the communication cost between the partner and the operator and reduce the labor of the operating personnel of both parties, before executing the URL parameter anti-tampering method in this article, the operator can send the URL template to the partner in advance.
[0090] It should be noted that the url template includes fixed fields and fields to be filled. The fixed fields correspond to the user's requested business. For example, if the user needs to request a loan, the url template includes at least a loan field and a loan amount field. The user needs to fill in the actual loan amount after the loan amount field. For the convenience of explanation, the content that the user needs to fill in can be called business data. In this article, each fixed field can be named as a fixed parameter, and the completed business data and fixed fields are collectively referred to as business data strings. For example, the business data string orderId = 0001 & channel = ABC, where 0001 & channel can represent the loan amount, and the equal sign ABC on the right is the amount filled in by the user. In this article, for example, 5w, the business data string is orderId = 0001 & channel = 50000.
[0091] In this article, the loan amount seen by the user is text and the input is number. According to the pre-set code conversion method, the loan amount is converted into an English field (an immutable fixed field), and an assignment "=" relationship is established between the number (business data) entered by the user and the English field.
[0092] It should be noted that this article can not only encrypt each URL, but also encrypt a form composed of several URLs. When encrypting a form, you can first split the form into several URLs, and then encrypt each URL. This article does not limit this.
[0093] As an embodiment of this invention, the step of determining the signature string according to the timestamp and the service data string includes:
[0094] Generate a character string to be signed according to the timestamp and the business data string;
[0095] Obtaining a business-related private key according to the business-related fields in the URL template;
[0096] The signature operation is performed on the character string to be signed according to the preset business-related private key to obtain a signature character string.
[0097] In this step, the timestamp and the business data string can be sequentially spliced to obtain the string to be signed, for example, orderId=0001&channel=ABC×tamp=1646998305. It should be noted that the sequential splicing method can comply with the code decryption method. If the timestamp and the business data string are spliced according to certain rules (poor splicing or interval splicing) to generate a signature string, when the operator needs to decrypt the signature string, it is necessary to obtain the splicing rules of the partner. Although this method can further encrypt the URL, the operator may have established connections with a large number of partners. When each operator has its own splicing rules, the operator needs to save the splicing rules of all partners at the same time, which requires a large amount of data storage space of the operator and is not easy to maintain later. Therefore, this article selects the sequential splicing method to generate the string to be signed.
[0098] In the URL template, a fixed field is provided, and the fixed field contains relevant business information representing the URL template. For the convenience of explanation, the relevant business information can be referred to as a business-related field. For example, there is a field "?001?" in the first position of the URL template, and 001 in "?001?" represents the business of the URL template. In the embodiment of this article, 001 can correspond to a loan business. If there is a field "?002?" in the first position of the URL template, 002 in "?002?" represents the business of the URL template. In the embodiment of this article, 002 can correspond to an account opening business. It should be noted that account opening means an account for withdrawing or remitting money. For example, unit A has added a bank account.
[0099] As an embodiment of this invention, the step of performing a signature operation on the character string to be signed according to a preset business-related private key to obtain a signature character string includes:
[0100] The user can set the encryption algorithm, hash method and secret key length through the partner to perform the signature operation on the signature string. In this article, you can choose the asymmetric encryption algorithm using the international public algorithm RSA, the hash algorithm selects SHA256, and the key length is 2048bit to generate the secret key (including private key and public key). When the first private key is generated, the loan business 001 can be associated with the private key, and then the private key is generated again, and the account opening business 002 can be associated with the private key. All the associations are recorded in the table to generate a private key table. Similarly, the public key corresponding to the private key is generated using the above method to generate a public key table and sent to the operator.
[0101] As an embodiment of this invention, obtaining a business-related private key according to a business-related field in the URL template includes:
[0102] Determine the business scenario corresponding to the business-related field;
[0103] The private key table is traversed according to the business scenario to obtain the business-related private key, wherein the private key table represents the mapping relationship between the business scenario and the business-related private key.
[0104] In this step, the business-related fields in the URL template are determined. The business-related fields are text content visible to the user, such as loan. The business scenario is determined based on the loan, such as 001.
[0105] Query the private key table with 001, obtain the pre-generated private key after traversal, and encrypt the private key to be signed.
[0106] Specifically, the partners use the agreed algorithm and public key, such as the international public algorithm RSA, to perform a signature operation on the above-mentioned string to be signed "orderId = 0001 & channel = ABC × tamp = 1646998305" to generate a signature. Taking Java language as an example, the corresponding method in the java.security.Signature toolkit is used to calculate the signature. The input value of the method is the algorithm type, the public key string, and the string to be signed. The output value is the signed signature string. In this article, the signature string is used as the signature string.
[0107] As an embodiment of this invention, the step of generating a URL according to the service data string, the timestamp and the signature string includes:
[0108] After the timestamp and the signature string are sequentially filled into the business data string in the URL template in the form of a key-value pair "key=value", the URL is generated.
[0109] In this step, in the url, each fixed field has its corresponding key value. According to the key value, the business data string, timestamp and signature string can be filled in the assigned position in the key value in sequence, for example, orderId=0001&channel=ABC×tamp=1646998305, the right side of the last equal sign.
[0110] like Figure 3 A schematic diagram of a device for preventing URL parameters from being tampered with by a partner is shown, comprising:
[0111] The timestamp generating unit 301 is used to generate a timestamp when receiving a service data string.
[0112] The character string determination unit 302 is configured to determine a signature character string according to the timestamp and the service data string.
[0113] The URL generation unit 303 is used to generate a URL according to the business data string, the timestamp and the signature string.
[0114] The sending unit 304 is used to send the URL to the operator, so that the operator executes the business corresponding to the business data string after completing the verification of the signature string and the timestamp in the URL.
[0115] The above-mentioned method of generating URL requires the operator to cooperate accordingly to prevent the parameters in the URL from being tampered with.
[0116] like Figure 4A schematic diagram of a method for preventing URL parameter tampering applied to an operator is shown, comprising:
[0117] Step 401: Obtain the URL sent by the partner, wherein the URL includes a business data string, a timestamp, and a signature string;
[0118] Step 402: decrypt the signature string in the URL to obtain a timestamp and a business data string;
[0119] Step 403: determine whether the timestamp and service data string obtained by decryption are the same as the service data string and timestamp in the URL, and determine whether the timestamp in the URL meets the time threshold;
[0120] Step 404: If the judgment results are all yes, execute the business corresponding to the business data string in the URL.
[0121] In this step, in the generated URL, there are three types of data strings, namely the encrypted signature string, which contains two parts, the first part is the business data string, the second part is the timestamp, the second type is the timestamp, and the third type is the business data string. In order to prevent the parameters in the URL from being tampered with, the operator first decrypts the signature string to obtain the decrypted business data string and the decrypted timestamp. At this time, it is not certain whether the timestamp and business data string outside the signature string in the URL have been changed, so the decrypted business data string and the decrypted timestamp are compared with the timestamp and the business data string. When it is determined that the two parameters are completely consistent, it is determined whether the timestamp meets the time threshold. If it is determined that there are inconsistent parameters in the two parameters, the operator has the right to determine that the partner's URL digital identity is abnormal and refuse to execute the business corresponding to the business data string. For the convenience of explanation, this article provides a method for anti-tampering of URL parameters applied to operators.
[0122] It should be noted that when decrypting an encrypted data string, you can choose the same method as that for encrypting the data string to be encrypted, such as determining the business scenario corresponding to the business data string in the URL (the specific determination method is described in detail above, and due to space limitations, this article will not go into details), and traverse the public key table sent in advance by the partner according to the business scenario to obtain the public key. After obtaining the public key, you can use the public key to decrypt and obtain the timestamp and business data string.
[0123] It should be noted that the time threshold in this article can be selected from 5 minutes, 10 minutes or 20 minutes, etc., and this article does not limit this. For example, if the timestamp is 600000, it is determined whether the time difference between the decryption time and the timestamp 600000 exceeds the set threshold.
[0124] like Figure 5A schematic diagram of a device for preventing URL parameter tampering applied to an operator is shown, comprising:
[0125] The acquisition unit 501 is used to acquire the URL sent by the partner, wherein the URL includes a business data string, a timestamp and a signature string.
[0126] The decryption unit 502 is used to decrypt the signature string in the URL to obtain a timestamp and a business data string.
[0127] The judgment unit 503 is used to judge whether the timestamp and business data string obtained by decryption are the same as the business data string and timestamp in the URL, and to judge whether the timestamp in the URL meets the time threshold.
[0128] The execution unit 504 is used to execute the business corresponding to the business data string in the URL if the judgment results are all yes.
[0129] like Figure 6 The data flow diagram of a URL parameter tamper-proof method shown in the figure includes:
[0130] Step 601: The operator 102 sends several URL templates.
[0131] Step 602 , the partner 101 generates a private key table and a public key table according to the URL template, and sends the public key table to the operator 601 .
[0132] Step 603: Partner 101 fills in business data into the URL template.
[0133] Step 604: Partner 101 generates a timestamp according to the filled-in time, and obtains a private key from the private key table according to the URL template.
[0134] Step 605 : The partner 101 generates a URL according to the timestamp, business data and private key and sends it to the operator 102 .
[0135] Step 606: The operator 102 obtains the public key according to the service of the URL, decrypts the URL, and performs a self-comparison verification on the URL.
[0136] Step 607 : The operator 102 determines whether the self-verification result and the timestamp both meet the set requirements. If so, execute step 608 .
[0137] Step 608: The operator 102 executes corresponding services according to the URL.
[0138] like Figure 7As shown, a computer device provided in an embodiment of the present invention, the computer device 702 may include one or more processors 704, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. The computer device 702 may also include any memory 707, which is used to store any kind of information such as code, settings, data, etc. Non-restrictive, for example, the memory 707 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 702. In one case, when the processor 704 executes an associated instruction stored in any memory or a combination of memories, the computer device 702 may perform any operation of the associated instruction. The computer device 702 also includes one or more drive mechanisms 708 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0139] The computer device 702 may also include an input / output module 710 (I / O) for receiving various inputs (via input device 712) and for providing various outputs (via output device 714). A specific output mechanism may include a presentation device 717 and an associated graphical user interface (GUI) 718. In other embodiments, the input / output module 710 (I / O), the input device 712, and the output device 714 may not be included, and the computer device 702 may be used as a computer device in a network. The computer device 702 may also include one or more network interfaces 720 for exchanging data with other devices via one or more communication links 722. One or more communication buses 724 couple the components described above together.
[0140] The communication link 722 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 722 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
[0141] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for preventing URL parameters from being tampered with is implemented.
[0142] An embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for preventing URL parameters from being tampered with is implemented.
[0143] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0144] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0147] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for preventing URL parameters from being tampered with, characterized in that: include: The partner generates a timestamp when receiving the business data string; The partner determines the signature string according to the timestamp and the business data string, wherein the determining the signature string according to the timestamp and the business data string includes: generating a string to be signed according to the timestamp and the business data string; obtaining a business-related private key according to a business-related field in a URL template; performing a signature operation on the string to be signed according to a preset business-related private key to obtain a signature string; The partner generates a URL according to the business data string, the timestamp and the signature string; The partner sends the URL to the operator; the operator obtains the URL sent by the partner, wherein the URL includes a business data string, a timestamp and a signature string; decrypts the signature string in the URL to obtain a timestamp and a business data string; determines whether the timestamp and business data string obtained by decryption are the same as the business data string and timestamp in the URL, and determines whether the timestamp in the URL meets the time threshold; if the judgment results are all yes, executes the business corresponding to the business data string in the URL.
2. The method for preventing URL parameters from being tampered with as claimed in claim 1, characterized in that: Before generating a timestamp when receiving a service data string, including: Acquiring service data, wherein the service data is input by a user according to a URL template associated with the service to be requested; The business data is converted into the business data string according to the data filling format of the URL template.
3. The method for preventing URL parameters from being tampered with as claimed in claim 2, characterized in that: The obtaining of a business-related private key according to the business-related fields in the URL template includes: Determine the business scenario corresponding to the business-related field; The private key table is traversed according to the business scenario to obtain the business-related private key, wherein the private key table represents the mapping relationship between the business scenario and the business-related private key.
4. The method for preventing URL parameters from being tampered with as claimed in claim 2, characterized in that: The generating a URL according to the business data string, the timestamp and the signature string includes: After the timestamp and the signature string are sequentially filled into the business data string in the URL template in the form of key-value pairs, the URL is generated.
5. A system for preventing URL parameter tampering, characterized in that: The system includes: a device applied to a partner and a device applied to an operator, The device applied to the partner includes: A timestamp generating unit, used to generate a timestamp when receiving a service data string; a character string determination unit, configured to determine a signature character string according to the timestamp and the business data string, wherein the determining the signature character string according to the timestamp and the business data string comprises: generating a character string to be signed according to the timestamp and the business data string; obtaining a business-related private key according to a business-related field in a URL template; performing a signature operation on the character string to be signed according to a preset business-related private key to obtain a signature character string; A url generating unit, used to generate a url according to the business data string, the timestamp and the signature string; A sending unit, used to send the URL to the operator; The device applied to the operator includes: An acquisition unit, used to acquire the URL sent by the partner, wherein the URL includes a business data string, a timestamp and a signature string; A decryption unit, used to decrypt the signature string in the URL to obtain a timestamp and a business data string; A judging unit, used to judge whether the timestamp and service data string obtained by decryption are the same as the service data string and timestamp in the URL, and to judge whether the timestamp in the URL meets the time threshold; The execution unit is used to execute the business corresponding to the business data string in the URL if the judgment results are all yes.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Processing method and system for safe business reuse
CN107465510A
Request processing method, request processing device, request verification method and verification device
CN110032895A
Cited By
Encryption method and device based on front and back ends, electronic equipment and storage medium
CN116015867A