API interface dynamic jump method and system based on intrinsic security

Through dynamic token synchronization between API callers and providers, the API port is periodically and randomly changed, which solves the security problems caused by a single API port, improves the security and stability of API calls, avoids attack threats, and reduces system complexity and performance loss.

CN118378253BActive Publication Date: 2024-10-15NAT IND INFORMATION SECURITY DEV RES CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410813351.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-15
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

The openness of a single API port leads to security issues, including brute force cracking and denial of service attacks. Existing solutions such as reverse proxies and firewalls increase system complexity and performance loss, and are difficult to manage.

Method used

Using the API interface dynamic hopping method based on endogenous security, through dynamic token synchronization between the API caller and the provider, the API port is periodically and randomly changed, and the HMAC-SHA-1 algorithm is used to generate a six-digit dynamic token. Make sure to use the latest port number for each API call.

Benefits of technology

It effectively reduces the risk caused by the exposure of a single API port, improves the security and stability of API calls, and prevents attack threats without increasing system complexity and performance loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378253B_ABST
    Figure CN118378253B_ABST
Patent Text Reader

Abstract

The present application discloses a method and system for dynamic API interface jump based on intrinsic security, which relates to the field of intrinsic security technology. The method includes: the API caller initiates a user registration request to the API provider; the API provider authenticates the API caller based on the user registration request; if the authentication is successful, a registration permission instruction is sent to the API provider; the API caller performs user registration based on the registration permission instruction; after the API caller successfully registers, the API caller and the API provider synchronize the dynamic token update according to the set port jump time period; when the API caller needs to call the API, the dynamic token at the current moment is obtained, and the corresponding API is called based on the dynamic token at the current moment. The present application reduces the risk brought by the exposure of a single API port and improves the security and stability of API calls.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intrinsic security technology, and in particular to a method and system for dynamic API interface jump based on intrinsic security. Background Art

[0002] With the popularity of microservice architecture and the continuous development of applications, modern applications often need to provide APIs (Application Programming erface) for third parties to call. As an important bridge for communication and collaboration between different applications, API has become a key component for building powerful, flexible and scalable software systems. The popularity of microservice architecture provides more opportunities and challenges for the widespread application of APIs. Traditional monolithic applications usually implement functions through internal function calls, while applications in microservice architecture are split into a series of small, independent services, each of which communicates with other services through APIs. This distributed architecture model makes applications easier to expand, maintain and deploy, while also improving the reliability and resilience of the system.

[0003] However, the openness of APIs also brings some security issues. Due to the public nature of APIs, applications need to ensure effective authentication and authorization of external requests to prevent unauthorized access and malicious attacks. Malicious attackers can scan common ports on the network, discover fixed API ports, and then attempt brute force attacks. Since the ports are public, attackers can try to gain unauthorized access by trying different username and password combinations. At the same time, attackers can use fixed API ports to launch denial of service attacks, occupying service resources by sending a large number of requests or malicious data packets to the port, causing the API service to be unavailable.

[0004] Existing methods to solve the security issues caused by the fixed single API port include: 1) Reverse proxy: Use reverse proxy to forward external requests to the internal API port to hide the actual API port; 2) Firewall and network security policy: Configure firewall and network security policy to limit access to the API port. However, the above methods still have shortcomings: 1) Reverse proxy requires additional resources to deploy and configure, which increases the complexity of the system. At the same time, it is necessary to parse, forward and process requests, resulting in additional network delays and computing overhead, which degrades performance; 2) Firewall and network security policies may cause false alarms and false interceptions, affecting normal business processes, and the policy needs to be constantly updated as the network changes, thereby increasing the complexity of management. Summary of the invention

[0005] The purpose of this application is to provide a method and system for dynamic API interface jump based on intrinsic security, which reduces the risk brought by the exposure of a single API port and improves the security and stability of API calls.

[0006] To achieve the above objectives, this application provides the following solutions.

[0007] A method for dynamic API interface jump based on intrinsic security, the method is implemented based on an API caller and an API provider, and the method includes:

[0008] The API caller initiates a user registration request to the API provider;

[0009] The API provider authenticates the API caller based on the user registration request;

[0010] If the verification is successful, a registration permission instruction is sent to the API caller;

[0011] The API caller performs user registration based on the registration permission instruction;

[0012] After the API caller successfully registers, the API caller and the API provider perform dynamic token update synchronization according to the set port jump time period;

[0013] When the API caller needs to call the API, it obtains the dynamic token at the current moment, and calls the corresponding API based on the dynamic token at the current moment.

[0014] Optionally, according to a set port jump time period, the API caller and the API provider perform dynamic token update synchronization, including:

[0015] According to the set port jump time period, the API provider randomly generates a random number and a key, adopts the HMAC-SHA-1 algorithm, uses the key to calculate the random number to obtain a hash value, intercepts and calculates the hash value to obtain a dynamic token; the dynamic token is a six-digit token;

[0016] Sending the random number and the key to the API caller;

[0017] After receiving the random number and key sent by the API provider, the API caller uses the HMAC-SHA-1 algorithm to calculate the random number using the key to obtain a hash value, and intercepts and calculates the hash value to obtain a dynamic token.

[0018] Optionally, according to the set port hopping time period, the API provider randomly generates a random number, including:

[0019] At any current port jump time, the API provider generates a random number for the current port jump time according to the random number of the previous port jump time, specifically including:

[0020] Map the random number of the previous port jump time to the interval [0, 1] to obtain the mapping value X;

[0021] The first value Y is calculated using the mapping value conversion formula; the mapping value conversion formula is: ;

[0022] The first value Y is multiplied by 10 raised to the Nth power to obtain the second value Z; N is the number of decimal places of the first value Y;

[0023] The second value Z is modulo 10 raised to the eighth power to obtain a random number for the current port transition time.

[0024] Optionally, the HMAC-SHA-1 algorithm is used to calculate the random number using the key to obtain a hash value, and the hash value is intercepted and calculated to obtain a dynamic token, including:

[0025] Use the HMAC-SHA-1 algorithm and the key to calculate the random number to obtain a 20-byte hash value.

[0026] Intercept the lower 4 bits of the hash value, convert the lower 4 bits of the data from binary to decimal, obtain a decimal integer corresponding to the lower 4 bits of the data, and use the decimal integer corresponding to the lower 4 bits of the data as the subscript offset of the hash value;

[0027] Starting from the subscript offset, 4 bytes of the hash value are obtained in sequence, the 4 bytes are combined in sequence to form a hexadecimal number corresponding to the 4 bytes, and a decimal integer corresponding to the 4 bytes is calculated;

[0028] The last six digits of the decimal integer corresponding to the four bytes are selected as the dynamic token; among them, if the digits are less than six, the front digits are filled with 0 to obtain the dynamic token.

[0029] Optionally, the API provider and the API caller communicate using an encryption protocol.

[0030] Optionally, the corresponding API is called based on the dynamic token at the current moment, including:

[0031] The API caller calculates the port number corresponding to the dynamic token at the current moment based on the dynamic token at the current moment, and initiates an API call request to the API provider with the port number corresponding to the dynamic token at the current moment;

[0032] After receiving the API interface call request, the API provider obtains the dynamic token at the current moment stored locally, and performs identity authentication based on the dynamic token at the current moment in the API call request of the API provider and the dynamic token at the current moment stored locally;

[0033] If the dynamic token at the current moment in the API call request of the API provider is the same as the dynamic token at the current moment stored locally, the API caller is allowed to call the API corresponding to the port number and return the call result.

[0034] Optionally, the process of calculating the port number corresponding to the dynamic token includes:

[0035] Get the preset API port number range;

[0036] Calculate the difference between the maximum port number and the minimum port number based on the preset API port number range;

[0037] Taking the dynamic token modulo the difference to obtain intermediate data;

[0038] The sum of the intermediate data and the minimum port number is calculated to obtain the port number corresponding to the dynamic token.

[0039] An API interface dynamic jump system based on intrinsic security, including:

[0040] A registration request module, used for the API caller to initiate a user registration request to the API provider;

[0041] An identity authentication module, used by the API provider to authenticate the API caller based on the user registration request;

[0042] A registration permission instruction sending module is used to send a registration permission instruction to the API caller if the verification is passed;

[0043] A user registration module, used for the API caller to perform user registration based on the registration permission instruction;

[0044] A dynamic token update module, used for, after the API caller successfully registers, the API caller and the API provider to synchronize dynamic token updates according to a set port jump time period;

[0045] The API calling module is used to obtain the dynamic token at the current moment when the API caller needs to call the API, and call the corresponding API based on the dynamic token at the current moment.

[0046] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0047] The present application discloses a method and system for dynamic API interface jump based on intrinsic security. It adopts the concept of mimicry defense and uses dynamic tokens synchronized between the API caller and the provider to periodically and randomly change the port used by the API service, effectively solving the attacks and threats faced by the API interface single fixed port binding, and improving the security of the API interface calling process, with high reliability, good applicability and stability. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0049] Figure 1 A schematic diagram of the API interface dynamic jump method and system flow based on intrinsic security provided in Example 1 of the present application.

[0050] Figure 2 This is a schematic diagram of the dynamic token synchronization process.

[0051] Figure 3 This is a diagram of the API interface calling process.

[0052] Figure 4 A schematic diagram of the functional modules of the API caller and API provider. DETAILED DESCRIPTION

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

[0054] The purpose of this application is to provide a method and system for dynamic API interface jump based on intrinsic security, aiming to reduce the risks brought by the exposure of a single API port and improve the security and stability of API calls.

[0055] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0056] Embodiment 1 provides a method for dynamic API interface jump based on intrinsic security.

[0057] like Figure 1As shown, the API interface dynamic jump method based on intrinsic security in this embodiment is implemented based on the API caller and the API provider, and the method includes steps 1 to 6.

[0058] Step 1: The API caller initiates a user registration request to the API provider.

[0059] Step 2: The API provider authenticates the API caller based on the user registration request.

[0060] Step 3: If the verification is successful, a registration permission instruction is sent to the API caller.

[0061] Step 4: The API caller performs user registration based on the registration permission instruction.

[0062] Step 5: After the API caller successfully registers, the API caller and the API provider perform dynamic token update synchronization according to the set port jump time period.

[0063] As an optional implementation, in step 5, according to the set port hopping time period, the API caller and the API provider perform dynamic token update synchronization, including steps 51 to 53.

[0064] Step 51: According to the set port jump time period, the API provider randomly generates a random number and a key, adopts the HMAC-SHA-1 algorithm, uses the key to calculate the random number to obtain a hash value, intercepts and calculates the hash value to obtain a dynamic token; the dynamic token is a six-digit token.

[0065] As an optional implementation, in step 51, according to the set port hopping time period, the API provider randomly generates a random number, including steps 511 to 514.

[0066] At any current port hopping time, the API provider generates a random number for the current port hopping time according to the random number for the previous port hopping time, specifically including steps 511 to 514.

[0067] Step 511: Map the random number of the previous port hopping time to the interval [0, 1] to obtain a mapping value X.

[0068] Step 512: Calculate the first value Y using a mapping value conversion formula; the mapping value conversion formula is: .

[0069] Step 513: Multiply the first value Y by 10 raised to the Nth power to obtain a second value Z; N is the number of decimal places of the first value Y.

[0070] Step 514: Taking the modulus of the second value Z to the eighth power of 10 to obtain a random number of the current port jump time.

[0071] Step 52: Send the random number and key to the API caller.

[0072] Step 53: After receiving the random number and key sent by the API provider, the API caller uses the HMAC-SHA-1 algorithm to calculate the random number using the key to obtain a hash value, intercepts and calculates the hash value to obtain a dynamic token.

[0073] As an optional implementation, in step 53, the HMAC-SHA-1 algorithm is adopted, the key is used to calculate the random number to obtain the hash value, the hash value is intercepted and calculated, and the dynamic token is obtained, including steps 531 to 534.

[0074] Step 531: Use the HMAC-SHA-1 algorithm and the key to calculate the random number to obtain a hash value with a length of 20 bytes.

[0075] Step 532: intercept the lower 4 bits of the hash value, convert the lower 4 bits of the data from binary to decimal, obtain a decimal integer corresponding to the lower 4 bits of the data, and use the decimal integer corresponding to the lower 4 bits of the data as the subscript offset of the hash value.

[0076] Step 533: Obtain 4 bytes of the hash value starting from the subscript offset in sequence, combine the 4 bytes in order to form a hexadecimal number corresponding to the 4 bytes, and calculate a decimal integer corresponding to the 4 bytes.

[0077] Step 534: Select the last six digits of the decimal integer corresponding to the four bytes as the dynamic token; if the digits are less than six, fill them with 0 at the front to obtain the dynamic token.

[0078] Step 6: When the API caller needs to call the API, it obtains the dynamic token at the current moment and calls the corresponding API based on the dynamic token at the current moment.

[0079] As an optional implementation, in step 6, the corresponding API is called based on the dynamic token at the current moment, including steps 61 to 63.

[0080] Step 61: The API caller calculates the port number corresponding to the dynamic token at the current moment based on the dynamic token at the current moment, and initiates an API call request to the API provider using the port number corresponding to the dynamic token at the current moment.

[0081] As an optional implementation, in step 61, the process of calculating the port number corresponding to the dynamic token includes steps 611 to 614.

[0082] Step 611: Obtain the preset API port number range.

[0083] Step 612: Calculate the difference between the maximum port number and the minimum port number based on the preset API port number range.

[0084] Step 613: Take the modulus of the difference of the dynamic token to obtain intermediate data.

[0085] Step 614: Calculate the sum of the intermediate data and the minimum port number to obtain the port number corresponding to the dynamic token.

[0086] Step 62: After receiving the API interface call request, the API provider obtains the dynamic token at the current moment stored locally, and performs identity authentication based on the dynamic token at the current moment in the API provider's API call request and the dynamic token at the current moment stored locally.

[0087] Step 63: If the dynamic token at the current moment in the API call request of the API provider is the same as the dynamic token at the current moment stored locally, the API caller is allowed to call the API corresponding to the port number and the call result is returned.

[0088] As an optional implementation, the API provider and the API caller communicate using an encryption protocol.

[0089] Specifically, encryption protocols are used for communication to prevent attackers from capturing communication data packets through network monitoring and other means, and to prevent keys and random numbers from being obtained by attackers.

[0090] Specific implementation example: Assume a certain scenario, in which there are API provider A and API caller B, B wants to call a certain API interface of A, the API port number provided by A will change every set port jump time period, B needs to synchronize the API port of A, and the identity authentication and authorization process has been completed between A and B before. The API interface dynamic jump method based on intrinsic security provided by the present invention is used to realize the above scenario, including the following steps S1-S5.

[0091] S1: B initiates a user registration request to A.

[0092] S2: A authenticates B's identity. If the authentication is successful, the registration is allowed and the result is returned.

[0093] S3: After successfully registering the user, B synchronizes the dynamic token with A. Figure 2 As shown, in S3, A and B perform a dynamic token synchronization process, which specifically includes the following steps.

[0094] S3.1: A randomly generates a random number rand (e.g. 12) and the key key (e.g. 123) required by the HMAC-SHA-1 algorithm, and then uses the HMAC-SHA-1 algorithm to calculate the random number rand (i.e. 12) using the key key (i.e. 123) to obtain the hash value hash (i.e. E8CB733D87703AA25820DE6810E6F4A7B2CDBB02). Finally, the hash value is intercepted to obtain a six-digit dynamic token token (i.e. 494704).

[0095] S3.2: A sends the generated random number rand (i.e. 12) and key key (i.e. 123) to B.

[0096] S3.3: After receiving the information sent by A, B uses the HMAC-SHA-1 algorithm and the key key (i.e. 123) to calculate the random number rand (i.e. 12) to obtain the hash value hash (i.e. E8CB733D87703AA25820DE6810E6F4A7B2CDBB02). Finally, the hash value is intercepted to obtain the six-digit dynamic token token (i.e. 494704).

[0097] S3.4: At every set port hopping time period (e.g., 60 seconds), A and B change the random number rand in the same way to calculate a new and identical dynamic token token, thereby achieving synchronization of the dynamic tokens between the two.

[0098] In S3.1 and S3.3, the specific process of calculating the dynamic token is as follows.

[0099] 1) Using the HMAC-SHA-1 algorithm, the key key (i.e. 123) is used to calculate the random number rand (i.e. 12) to obtain a 20-byte hash value hash (i.e. E8CB733D87703AA25820DE6810E6F4A7B2CDBB02).

[0100] 2) Select the last byte of the hash value hash, extract the lower 4 bits of the byte, which is 2, and convert it into a decimal integer to obtain the subscript offset offSet (which is 2) of the extracted hash value.

[0101] 3) Starting from the subscript offset offSet (i.e. 2), get the 4 bytes of the hash value hash in sequence: 73, 3D, 87, 70, and combine them in order to form a 4-byte hexadecimal number (i.e. 733D8770), and calculate the corresponding decimal integer int (i.e. 1932494704).

[0102] 4) Select the last six digits of the integer int (i.e. 1932494704) as the dynamic token (i.e. 494704), and fill the first digit with 0 if the digits are less than six.

[0103] In S3.2, the communication between A and B uses an encryption protocol to prevent attackers from capturing communication data packets through network monitoring and other means, and to prevent the keys and random numbers from being obtained by attackers.

[0104] In S3.4, the specific process of A and B changing the random number is as follows.

[0105] 1) Map the current random number rand (i.e. 12) to the interval [0, 1], that is, divide the random number rand (i.e. 12) by 100 to get X=0.12.

[0106] 2) Then calculate X=0.12 according to the following mapping value conversion formula to obtain Y=0.4224.

[0107] 3) Finally, map Y=0.4224 to a positive integer, that is, multiply Y by 10 4 , and we get Z=4224.

[0108] 4) Take Z=4224 modulo 10 to the 8th power to get a new random number rand (i.e. 4224).

[0109] S4: Every set port hopping time period, B and A update the dynamic token, and A's API port is changed according to the current dynamic token.

[0110] S5: B uses the current dynamic token to calculate the API port, and then calls the API interface based on the port.

[0111] like Figure 3 As shown, the process in which B of S5 uses a dynamic token to call an API interface specifically includes the following steps.

[0112] S5.1: A and B complete dynamic token synchronization.

[0113] S5.2: A updates the random number rand every set port jump time period (60 seconds), and then calculates a new dynamic token token, and calculates a port number port based on the new dynamic token, and then uses the port number as the new API port to achieve dynamic changes in the API port. For example, the updated random number rand is 4224, the new dynamic token token is calculated to be 464941, and then the updated port number port is calculated to be 20661.

[0114] S5.3: B obtains the current dynamic token token (i.e. 464941) locally, calculates the port number port (i.e. 20661) corresponding to the current dynamic token in the same way, and then initiates an API call request to A with the port number port (i.e. 20661).

[0115] S5.4: A receives the API interface call request and performs identity authentication based on the dynamic token. If it is the same as the current dynamic token, B is allowed to call the API interface and the call result is returned. Otherwise, it is not approved.

[0116] In S5.2 and S5.3, the process of calculating the port number port by using the dynamic token is as follows.

[0117] 1) Set the API port number range to 10000 to 65535, with a difference of 55535.

[0118] 2) Take the dynamic token token (i.e. 464941) modulo 55535, add 10000 to the result, and get the port number port (i.e. 20661).

[0119] In S5, B uses an encrypted communication protocol to call the API interface to prevent attackers from capturing communication data packets through network monitoring and other means, and to prevent the actual port number from being obtained by attackers.

[0120] Further, if Figure 4 As shown, the functional modules in API provider A and API caller B are as follows.

[0121] API provider A includes: dynamic token generation module, random number generation module, key generation module, information management module, port update module and request processing module, and API caller B includes: dynamic token generation module, random number generation module, information management module, token synchronization module and API call module.

[0122] In the dynamic token synchronization process, the token synchronization module of B first sends a synchronization request. After receiving the synchronization request from B, the request processing module of A calls the information management module, sends the random number rand (for example, 12) generated by the random number generation module and the key key (for example, 123) generated by the key generation module to B, and uses the dynamic token generation module to generate a dynamic token token (i.e., 494404). After receiving the information, the information management module of B calls the dynamic token generation module to generate the same dynamic token token (i.e., 494404) as the current A. Then, every set port jump time cycle time (for example, 60 seconds), the information management modules of A and B will call the random number generation module to generate the same random number rand, and then call the dynamic token generation module to generate the same dynamic token token to achieve dynamic token synchronization. For example, after the set port jump time cycle time (i.e., 60 seconds), the new random number rand generated by A and B is 4224, and then the new dynamic token token calculated is 464941.

[0123] During the API interface call process, A's information management module updates the dynamic token every set port jump time cycle time (i.e. 60 seconds), and then calls the port update module to calculate the new port number based on the updated dynamic token and use it as the current API port number. For example, after the set port jump time cycle time (i.e. 60 seconds), A updates the dynamic token token to 464941, and then updates the API port port to 20661 based on the token (i.e. 464941). B's API call module calls the information management module to obtain the current dynamic token token as 464941, calculates the current API port number port as 20661 based on the token (i.e. 464941), and then makes an API interface call with the port port (i.e. 20661). When receiving the API interface call request, A's request processing module verifies whether the dynamic token is 464941. If the verification is successful, the API interface is allowed to be called and the call result is returned.

[0124] Embodiment 2 provides an API interface dynamic jump system based on intrinsic security, including the following modules.

[0125] The registration request module is used by the API caller to initiate a user registration request to the API provider.

[0126] The authentication module is used by the API provider to authenticate the API caller based on the user registration request.

[0127] The registration permission instruction sending module is used to send a registration permission instruction to the API caller if the verification is passed.

[0128] The user registration module is used by the API caller to register a user based on the registration permission instruction.

[0129] The dynamic token update module is used to synchronize the dynamic token update between the API caller and the API provider according to the set port jump time period after the API caller successfully registers.

[0130] The API calling module is used to obtain the dynamic token at the current moment when the API caller needs to call the API, and call the corresponding API based on the dynamic token at the current moment.

[0131] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0132] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for dynamic API interface jump based on intrinsic security, the method is implemented based on the API caller and the API provider. It is characterized in that The method comprises: The API caller initiates a user registration request to the API provider; The API provider authenticates the API caller based on the user registration request; If the verification is successful, a registration permission instruction is sent to the API caller; The API caller performs user registration based on the registration permission instruction; After the API caller successfully registers, the API caller and the API provider perform dynamic token update synchronization according to the set port jump time period; When the API caller needs to call the API, it obtains the dynamic token at the current moment, and calls the corresponding API based on the dynamic token at the current moment; According to the set port jump time period, the API caller and the API provider perform dynamic token update synchronization, including: According to the set port jump time period, the API provider randomly generates a random number and a key, uses the HMAC-SHA-1 algorithm, uses the key to calculate the random number to obtain a hash value, intercepts and calculates the hash value to obtain a dynamic token; the dynamic token is a six-digit token; Send the random number and key to the API caller; After receiving the random number and key sent by the API provider, the API caller uses the HMAC-SHA-1 algorithm to calculate the random number using the key to obtain a hash value, and then intercepts and calculates the hash value to obtain a dynamic token; According to the set port hopping time period, the API provider randomly generates a random number, including: At any current port jump time, the API provider generates a random number for the current port jump time based on the random number of the previous port jump time, specifically including: Map the random number of the previous port jump time to the interval [0, 1] to obtain the mapping value X; The first value Y is calculated using the mapping value conversion formula; the mapping value conversion formula is: ; Multiply the first value Y by 10 raised to the Nth power to obtain the second value Z; N is the number of decimal places of the first value Y; Taking the modulus of the second value Z to the eighth power of 10, a random number for the current port transition time is obtained; The HMAC-SHA-1 algorithm is used to calculate the random number using the key to obtain the hash value, and the hash value is intercepted and calculated to obtain the dynamic token, including: Use the HMAC-SHA-1 algorithm and the key to calculate the random number to obtain a 20-byte hash value. The lower 4 bits of the hash value are intercepted, and the lower 4 bits of the data are converted from binary to decimal to obtain the decimal integer corresponding to the lower 4 bits of the data, and the decimal integer corresponding to the lower 4 bits of the data is used as the subscript offset of the hash value; Get the 4 bytes of the hash value starting from the subscript offset, combine the 4 bytes in order to form a hexadecimal number corresponding to the 4 bytes, and calculate the decimal integer corresponding to the 4 bytes; The last six digits of the decimal integer corresponding to the four bytes are selected as the dynamic token; among them, if the digits are less than six, the front of the digits are filled with 0 to obtain the dynamic token.

2. According to claim 1, the API interface dynamic jump method based on intrinsic security, It is characterized in that The API provider and the API caller communicate with each other using an encryption protocol.

3. According to claim 1, the API interface dynamic jump method based on intrinsic security, It is characterized in that Call the corresponding API based on the dynamic token at the current moment, including: The API caller calculates the port number corresponding to the dynamic token at the current moment based on the dynamic token at the current moment, and initiates an API call request to the API provider with the port number corresponding to the dynamic token at the current moment; After receiving the API interface call request, the API provider obtains the dynamic token at the current moment stored locally, and performs identity authentication based on the dynamic token at the current moment in the API call request of the API provider and the dynamic token at the current moment stored locally; If the dynamic token at the current moment in the API call request of the API provider is the same as the dynamic token at the current moment stored locally, the API caller is allowed to call the API corresponding to the port number and return the call result.

4. According to claim 3, the API interface dynamic jump method based on intrinsic security, It is characterized in that The process of calculating the port number corresponding to the dynamic token includes: Get the preset API port number range; Calculate the difference between the maximum port number and the minimum port number based on the preset API port number range; Taking the dynamic token modulo the difference to obtain intermediate data; The sum of the intermediate data and the minimum port number is calculated to obtain the port number corresponding to the dynamic token.

5. A dynamic API interface jump system based on intrinsic security, It is characterized in that The system comprises: The registration request module is used by the API caller to initiate a user registration request to the API provider; An identity authentication module, used by the API provider to authenticate the API caller based on the user registration request; A registration permission instruction sending module is used to send a registration permission instruction to the API caller if the verification is passed; A user registration module, used for the API caller to perform user registration based on the registration permission instruction; A dynamic token update module, used for, after the API caller successfully registers, the API caller and the API provider to synchronize dynamic token updates according to a set port jump time period; An API calling module, used for obtaining a dynamic token at the current moment when the API caller needs to call an API, and calling a corresponding API based on the dynamic token at the current moment; According to the set port jump time period, the API caller and the API provider perform dynamic token update synchronization, including: According to the set port jump time period, the API provider randomly generates a random number and a key, uses the HMAC-SHA-1 algorithm, uses the key to calculate the random number to obtain a hash value, intercepts and calculates the hash value to obtain a dynamic token; the dynamic token is a six-digit token; Send the random number and key to the API caller; After receiving the random number and key sent by the API provider, the API caller uses the HMAC-SHA-1 algorithm to calculate the random number using the key to obtain a hash value, and then intercepts and calculates the hash value to obtain a dynamic token; According to the set port hopping time period, the API provider randomly generates a random number, including: At any current port jump time, the API provider generates a random number for the current port jump time based on the random number of the previous port jump time, specifically including: Map the random number of the previous port jump time to the interval [0, 1] to obtain the mapping value X; The first value Y is calculated using the mapping value conversion formula; the mapping value conversion formula is: ; The first value Y is multiplied by 10 raised to the Nth power to obtain the second value Z; N is the number of decimal places of the first value Y; Taking the modulus of the second value Z to the eighth power of 10, a random number for the current port transition time is obtained; The HMAC-SHA-1 algorithm is used to calculate the random number using the key to obtain the hash value, and the hash value is intercepted and calculated to obtain the dynamic token, including: Use the HMAC-SHA-1 algorithm and the key to calculate the random number to obtain a 20-byte hash value. The lower 4 bits of the hash value are intercepted, and the lower 4 bits of the data are converted from binary to decimal to obtain the decimal integer corresponding to the lower 4 bits of the data, and the decimal integer corresponding to the lower 4 bits of the data is used as the subscript offset of the hash value; Get the 4 bytes of the hash value starting from the subscript offset, combine the 4 bytes in order to form a hexadecimal number corresponding to the 4 bytes, and calculate the decimal integer corresponding to the 4 bytes; The last six digits of the decimal integer corresponding to the four bytes are selected as the dynamic token; among them, if the digits are less than six, the front of the digits are filled with 0 to obtain the dynamic token.