A method and system for HTTP interaction based on double-end automatic encryption and decryption

By deploying adaptive dynamic encryption and decryption algorithms on both the client and server sides, and generating encryption keys using time and user identification, the system achieves fully automatic encryption and decryption of HTTP request and response information, solving data security issues during HTTP interaction and improving the security and efficiency of data transmission.

CN121509108BActive Publication Date: 2026-04-28LU ZE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LU ZE TECH CO LTD
Filing Date
2026-01-13
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

During HTTP interactions, data between the client and server is easily stolen and tampered with, and the existing HTTPS protocol still has security vulnerabilities in practical applications.

Method used

An adaptive dynamic encryption/decryption algorithm is adopted to achieve fully automatic encryption and decryption processing on both the client and server sides. An encryption key is generated using the client time, server time, and user identity, and data encryption and decryption are performed using a symmetric encryption/decryption algorithm.

Benefits of technology

It effectively solves the security risks of data transmission, enhances the anti-cracking ability of keys, simplifies the interaction process, and improves the security and efficiency of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509108B_ABST
    Figure CN121509108B_ABST
Patent Text Reader

Abstract

The application discloses a kind of HTTP interaction methods and systems based on double-end automatic encryption and decryption, it is related to communication field, this method includes: client initiates HTTP request according to business requirement, and uses adaptive dynamic encryption and decryption algorithm to encrypt HTTP request, sends request ciphertext to server end;Server end uses adaptive dynamic encryption and decryption algorithm to decrypt request ciphertext, and generates response information, uses adaptive dynamic encryption and decryption algorithm to encrypt response information, and sends response ciphertext to client;Client uses adaptive dynamic encryption and decryption algorithm to decrypt response ciphertext;Wherein, adaptive dynamic encryption and decryption algorithm is based on client time, server end time and user identity mark generates encryption key, and according to encryption key, using symmetric encryption and decryption algorithm carries out encryption and decryption.The application realizes the automatic encryption and decryption processing of HTTP request and response information all the way, improves the security of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and in particular to an HTTP interaction method and system based on automatic encryption and decryption from both ends. Background Technology

[0002] In most internet applications, clients and servers communicate using the Hypertext Transfer Protocol (HTTP). Client data is transmitted to the server using this method. Core user data is transmitted in the request body using the HTTP POST method, and server data is also returned to the client in the response body.

[0003] The client uses components such as jQuery and Axios to initiate HTTP requests, and receives the response data after the server processes it. The server-side service uses Spring MVC components to accept HTTP requests, retrieve client data, process it, and return the result. For data security, Hypertext Transfer Protocol Secure (HTTPS) is typically used on top of HTTP to ensure the security of user data assets. However, in real-world scenarios, unauthorized means such as packet sniffing can still obtain data from both ends, leading to the loss of customer data assets. Summary of the Invention

[0004] The purpose of this application is to provide an HTTP interaction method and system based on dual-end automatic encryption and decryption, which can realize the automatic encryption and decryption of HTTP request and response information throughout the entire process, thereby improving data security.

[0005] To achieve the above objectives, this application provides the following solution:

[0006] Firstly, this application provides an HTTP interaction method based on automatic encryption and decryption from both ends, including:

[0007] The client initiates an HTTP request based on business needs, and uses an adaptive dynamic encryption and decryption algorithm to encrypt the HTTP request to obtain the ciphertext request, which is then sent to the server.

[0008] After receiving the ciphertext request, the server decrypts the ciphertext request using an adaptive dynamic encryption and decryption algorithm to obtain the HTTP request, generates response information based on the HTTP request, encrypts the response information using an adaptive dynamic encryption and decryption algorithm to obtain the response ciphertext, and sends the response ciphertext to the client.

[0009] After receiving the ciphertext of the response, the client uses an adaptive dynamic encryption and decryption algorithm to decrypt the ciphertext of the response in order to obtain the response information corresponding to the HTTP request;

[0010] The adaptive dynamic encryption / decryption algorithm generates an encryption key based on the client time, server time, and user identity, and then uses a symmetric encryption / decryption algorithm to encrypt and decrypt the data based on the encryption key.

[0011] Secondly, this application provides an HTTP interaction system based on dual-end automatic encryption and decryption, including a client and a server; both the client and the server integrate an adaptive dynamic encryption and decryption algorithm;

[0012] The client is used to initiate an HTTP request according to business needs, and encrypt the HTTP request using an adaptive dynamic encryption and decryption algorithm to obtain the request ciphertext, and send the request ciphertext to the server; after receiving the response ciphertext, it uses an adaptive dynamic encryption and decryption algorithm to decrypt the response ciphertext to obtain the response information corresponding to the HTTP request;

[0013] The server is configured to, upon receiving the ciphertext request, decrypt the ciphertext request using an adaptive dynamic encryption / decryption algorithm to obtain the HTTP request, and generate response information based on the HTTP request; encrypt the response information using an adaptive dynamic encryption / decryption algorithm to obtain the response ciphertext, and send the response ciphertext to the client.

[0014] The adaptive dynamic encryption / decryption algorithm generates an encryption key based on the client time, server time, and user identity, and then uses a symmetric encryption / decryption algorithm to encrypt and decrypt the data based on the encryption key.

[0015] According to the specific embodiments provided in this application, this application has the following technical effects: By deploying an adaptive dynamic encryption and decryption algorithm on both the client and server sides, the entire process of automatic encryption and decryption of HTTP request and response information is realized, effectively solving the security risks of data transmission being easily stolen and tampered with during traditional HTTP interaction; its encryption key is jointly generated by the client time, server time, and user identity identifier, possessing dynamism and uniqueness, which significantly improves the key's anti-cracking capability compared to fixed key encryption and decryption methods, avoiding the failure of the overall security system due to key leakage; at the same time, both ends use the same adaptive dynamic encryption and decryption algorithm to complete the encryption and decryption operation, eliminating the need for additional adaptation to multiple algorithms, simplifying the complexity of the interaction process between the two ends, and improving the efficiency of HTTP interaction while ensuring the security and reliability of data transmission. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating an HTTP interaction method based on automatic encryption and decryption between two ends, provided as an embodiment of this application.

[0018] Figure 2 This is a schematic diagram of the interaction process between the client and the server in one embodiment of this application.

[0019] Figure 3 This is a schematic diagram of the process of generating a key using an adaptive dynamic encryption / decryption algorithm in one embodiment of this application.

[0020] Figure 4 This is a schematic diagram of the client processing flow in one embodiment of this application.

[0021] Figure 5 This is a server-side processing flow in one embodiment of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] First, some technical terms involved in the embodiments of this application will be introduced.

[0025] HTTP: HTTP is a simple request-response protocol that typically runs on top of the Transmission Control Protocol (TCP). It specifies what messages a client might send to a server and what responses it might receive.

[0026] jQuery framework: jQuery is a fast and concise open-source JavaScript framework. It encapsulates the ability to initiate HTTP requests.

[0027] Axios is an open-source network request library based on promise[5], which works in node.js and browsers and can initiate HTTP requests in browsers and servers.

[0028] Timestamp: A timestamp is the total number of seconds or milliseconds from Greenwich Mean Time 00:00:00 on January 1, 1970 (08:00:00 on January 1, 1970 in Beijing) to the present.

[0029] Unicode encoding: Unicode, also known as Universal Character Set or International Character Set, is an international standard for character encoding developed by the Unicode Consortium. It covers character sets and encoding schemes such as UTF-8, UTF-16, and UTF-32. In other words, each character has a corresponding numerical mapping.

[0030] In one exemplary embodiment, such as Figure 1 and Figure 2 As shown, an HTTP interaction method based on automatic encryption and decryption on both ends is provided, including the following steps 101 to 103.

[0031] Step 101: The client initiates an HTTP request according to business requirements, and encrypts the HTTP request using an adaptive dynamic encryption / decryption algorithm to obtain the ciphertext request, and sends the ciphertext request to the server.

[0032] Step 102: After receiving the ciphertext request, the server decrypts it using an adaptive dynamic encryption / decryption algorithm to obtain the HTTP request. Based on the HTTP request, it generates response information, encrypts the response information using the same algorithm, and sends the ciphertext response to the client. The server generates the response information by executing business processing flows and accessing data from the database. Both the client and server integrate automatic encryption / decryption components, which execute the adaptive dynamic encryption / decryption algorithm to perform the encryption and decryption process.

[0033] Step 103: After receiving the ciphertext of the response, the client uses an adaptive dynamic encryption and decryption algorithm to decrypt the ciphertext of the response in order to obtain the response information corresponding to the HTTP request.

[0034] The adaptive dynamic encryption / decryption algorithm generates an encryption key based on the client's time, the server's time, and the user's identity identifier. It then uses this encryption key to perform encryption and decryption using a symmetric encryption / decryption algorithm. The encryption key generated by the adaptive dynamic encryption / decryption algorithm generally remains unchanged for about one and a half minutes, and a single communication process between the client and server must occur within one and a half minutes, thus ensuring successful encryption and decryption.

[0035] In a specific application example, such as Figure 3 As shown, the adaptive dynamic encryption and decryption algorithm generates an encryption key based on the client time, server time, and user identity identifier, including the following steps 201 to 205.

[0036] Step 201: Calculate the base time based on the client time and the server time.

[0037] Specifically, the difference between the client time and the server time is calculated, and the difference is summed with the client time to obtain the base time.

[0038] The client first sends its time to the server. The server compares the client's time with the client's time and stores the difference in the client's time (cookie). The client can then use this data to calibrate the time difference between the client and the server.

[0039] For example: the client time is 2025-11-11 12:45:00, the server time is 2025-11-11 12:48:00 (3 minutes difference from the client time), the client stores the difference (cookie): 180000 milliseconds (1000 milliseconds = 1 second), the base time = server time = client time + client stored difference.

[0040] Step 202: The user identity identifier and the reference time are fused to generate a composite key.

[0041] Specifically, the user identity token (pToken) is concatenated with the base time to generate a composite key.

[0042] For example: The user's identity token (pToken) is "CG1Ab5pLnTcST4tQO+s3wYYDjHOTkB2W8Mi52gUMlbaZEQVadOPRogFXfOGrbyW". The base time (converted to a timestamp) is "1764053257132". Then the composite key is: "CG1Ab5pLnTcST4tQO+s3wYYDjHOTkB2W8Mi52gUMlbaZEQVadOPRogFXfOGrbyW1764053257132".

[0043] Step 203: Perform time-granularity dimensionality reduction processing on the composite key to obtain the dimensionality-reduced key.

[0044] Specifically, the last N characters of the composite key are removed to obtain a dimensionality-reduced key, where N > 0. This application removes the last 5 digits of the timestamp in the composite key, reducing time sensitivity from milliseconds to hundreds of seconds, decreasing the frequency of key changes, and balancing security and availability.

[0045] For example, the composite key is: "CG1Ab5pLnTcST4tQO+s3wYYDjHOTkB2W8Mi52gUMlbaZEQVadOPRogFXfOGrbyW1764053257132". The dimensionality-reduced key obtained after removing the last 5 digits is: "CG1Ab5pLnTcST4tQO+s3wYYDjHOTkB2W8Mi52gUMlbaZEQVadOPRogFXfOGrbyW17640532".

[0046] Step 204: Perform coordinate calculations on each character in the dimensionality reduction key, and replace the characters in the dimensionality reduction key with the characters at the corresponding coordinates in the predefined cryptographic matrix to obtain the cryptographic transformation key.

[0047] Specifically, for any character in the dimensionality reduction key, the Unicode encoding value of the character is calculated, and the modulo operation is performed on the number of rows in the cryptographic matrix using the Unicode encoding value of the character to obtain the target row. The modulo operation is then performed on the number of columns in the cryptographic matrix using the position of the character in the dimensionality reduction key to obtain the target column. The character at the target row and target column in the cryptographic matrix is ​​then used to replace the character to obtain the cryptographic transformation key.

[0048] In this application, the server synchronizes a password book (including multiple sets of random characters) to the client. The granularity of this password book can be controlled down to the global and user levels. For each character in the cyclic dimensionality reduction key, a modulo operation is performed based on the character encoding value, and a replacement character is dynamically selected from the password book.

[0049] Assuming the codebook contains 10 groups of characters, each group containing 10 characters, a 10×10 cipher matrix is ​​formed. Coordinate operations are performed on the dimensionality reduction key, and the corresponding characters are concatenated from the cipher matrix to form the cipher transformation key. For example, the dimensionality reduction key is: “CG1Ab5pLnTcST4tQO+s3wYYDjHOTkB2W8Mi52gUMlbaZEQVadOPRogFXfOGrbyW17640532”. Then, starting from the first character, the following logic is applied sequentially. For example, the first character C: The Unicode encoding value (decimal) of C is 67. Taking the modulo (remainder) of the row number, which is 10 rows in this cipher matrix, results in 7. C is the first character processed in the dimensionality reduction cipher. Taking the modulo (remainder) of the column number in the cipher matrix, which is 1 modulo 10, results in 1. Therefore, C is transformed into the character at position (7,1) in the cipher matrix. The key for the cipher transformation is: "0U3AMc3yd3dJ4auzghSFp3fEHn2BdbjWLyhpdZjqcnAlK1PZGq3Bdf6BEldQZHod4EG".

[0050] Step 205: Perform byte compression on the cryptographic transformation key to obtain the encryption key.

[0051] Specifically, the cryptographic transformation key is divided into multiple character segments. For any given character segment, the sum of the Unicode encoding values ​​of the characters within that segment is calculated. The sum of the Unicode encoding values ​​of the character segment is divided by the length of the character segment and rounded down to obtain a new character for that segment. The new characters from each segment are then concatenated to obtain the encryption key.

[0052] This application divides the cryptographic transformation key into 24 segments. The length of each segment is the original total character length divided by 24 and rounded down. The last segment retains all remaining characters. For each segment, a new Unicode encoding value is calculated by summing the Unicode encoding values ​​corresponding to each character, dividing by the length of each segment, and rounding down. The new character is then determined using the new Unicode encoding value. Finally, the new characters from all segments are concatenated.

[0053] The Unicode encoding can be obtained using Java's `Character.codePointAt("a", 0)`. For example, if the first character segment is `0U`, the Unicode encoding value of `0` is 48, and the Unicode encoding value of `U` is 85; then the new Unicode encoding value is: (48+85) / 2=66.5, which rounds down to 66; the character corresponding to the Unicode encoding value 66 is B. Therefore, the final result of converting the first segment `0U` is B.

[0054] For example, the key for password transformation is: "0U3AMc3yd3dJ4auzghSFp3fEHn2BdbjWLyhpdZjqcnAlK1PZGq3Bdf6BEldQZHod4EG", and its transformation process is shown in Table 1.

[0055] Table 1

[0056]

[0057] The final encryption key obtained is: "B:XVWKJwglLQU[:c`bl_hmhVS".

[0058] To better understand the technical solution of this application, the HTTP interaction process is described below from the perspectives of both the client and server sides.

[0059] like Figure 4 As shown, the client's processing flow includes the following steps (11) to (19).

[0060] (11) The business side initiates an HTTP request. Business applications (such as web clients, client programs, etc.) generate and initiate regular HTTP requests due to business needs (such as data query, submission, etc.), with the target pointing to the server interface or resources.

[0061] For example: the request method is POST, the request address is "https: / / lzkj-isv.isvjcloud.com / test / cc / interact / api / active / basicInfo", and the request data is "{"activityId":"1977572618794680321"}".

[0062] (12) The client's automatic encryption / decryption component intercepts requests. The automatic encryption / decryption component, integrated into the client environment, captures HTTP requests sent by the business in real time and triggers the encryption / decryption process.

[0063] (13) Encryption requirement judgment. The automatic encryption and decryption component has a built-in strategy engine (which supports configurable rules, such as URL matching, data type marking, business identifier, etc. If the request URL contains the character api, it needs to be encrypted) to determine whether the current request needs to be encrypted: if no encryption is required, it will directly proceed to step (15) to initiate an HTTP request; if encryption is required, it will execute the encryption sub-process of step (14).

[0064] (14) Encryption Sub-process: Call the adaptive dynamic encryption / decryption algorithm to generate an encryption key (e.g., "ASKnCcomYaZfQjDw"). Use the encryption key to encrypt sensitive data (such as request body, custom parameters, etc.) in the HTTP request using the AES encryption algorithm (such as AES-256 standard), converting plaintext into ciphertext. Convert the plaintext data in the original HTTP request into ciphertext, keeping the HTTP protocol structure (such as URL, request header) unchanged, and generate the request ciphertext. For example, "{"ecyText":" / hzInbfVyn2ZU / m8HkPV / V06jrUSU1nR / ysdYlb2RnbYL8 / QGO3BFvvfuukAhlaS4b2FG8Vqc4565kWg8jD5LgEnsoSq2suzIm8SYzxK7WHwRKWfn5m0Nb0ddh / Padmq"}.

[0065] (15) The client sends the encrypted request or the original HTTP request to the server via the network, and enters the server-side business processing flow.

[0066] (16) After receiving the request, the server executes the regular business logic (such as data verification, database interaction, etc.), generates an HTTP response (including business results and data), and sends it back to the client.

[0067] (17) Decryption requirement judgment. After the client captures the server's response, it again uses the policy engine (linked with encryption rules, such as marking response features that need to be decrypted) to determine whether decryption is required: if no decryption is required, it directly proceeds to step (19) to obtain data on the business side; if decryption is required, it executes the decryption sub-process of step (18).

[0068] (18) Decryption subprocess: Call the adaptive dynamic encryption / decryption algorithm to generate a decryption key. Use the decryption key to decrypt the ciphertext data in the response (such as the response body and encrypted return value) and restore it to plaintext. Response repackaging: Replace the ciphertext in the response with plaintext, keep the HTTP protocol structure (such as status codes and response headers) unchanged, and generate a response that can be recognized by the business.

[0069] (19) The business side obtains the final data. The client decrypts the response information or passes the original unencrypted response information to the business application. The business side reads and uses the plaintext data returned by the server to complete a complete HTTP interaction.

[0070] like Figure 5 As shown, the server-side processing flow includes the following steps (21) to (29).

[0071] (21) The application server receives client requests. The application server (such as the Tomcat container) acts as the network entry point, listening for and receiving business requests initiated by the client (supporting protocols such as HTTP / HTTPS). The request data may contain plaintext or ciphertext (in coordination with the client's encryption logic).

[0072] (22) Server-side automatic encryption / decryption component intercepts requests. The automatic encryption / decryption component, integrated into the server-side environment, captures requests received by the application server in real time and triggers a security processing flow. The automatic encryption / decryption component is decoupled from the business system, requiring no modification to the Tomcat core or business code.

[0073] (23) Decryption requirement judgment. The automatic encryption and decryption component uses the strategy engine (pre-configured rules: such as request header tags, URL path, data encryption identifier) ​​to determine whether the request contains ciphertext that needs to be decrypted: if no decryption is required, it directly enters step (25) for server-side business processing; if decryption is required, it executes the decryption sub-process of step (24).

[0074] (24) Decryption Subprocess: Invoke the adaptive dynamic encryption / decryption algorithm to generate a temporary key that matches the client's encryption logic. Use this temporary key to decrypt the ciphertext data (such as the request body and encryption parameters) in the request using the AES standard algorithm (such as AES-256), restoring it to plaintext. Replace the ciphertext with plaintext, maintain the HTTP protocol structure, and generate a new request that the business can recognize.

[0075] (25) Server-side business logic processing. The automatic encryption / decryption component transmits the decrypted plaintext request or the original plaintext request to the business system. The business side processes the request according to the usual process (parameter verification, database interaction, etc.) and generates plaintext response data.

[0076] For example, the client data is “{"ecyText":" / hzInbfVyn2ZU / m8HkPV / V06jrUSU1nR / ysdYlb2RnbYL8 / QGO3BFvvfuukAhlaS4b2FG8Vqc4565kWg8jD5LgEnsoSq2suzIm8SYzxK7WHwRKWfn5m0Nb0ddh / Padmq"}”. After decryption, the transmitted business data is “{"activityId":"1977572618794680321"}”.

[0077] (26) The server returns the processing result. After the business logic processing is completed, an HTTP response (including status code and business data) is generated and sent back to the automatic encryption / decryption component to enter the response processing flow.

[0078] (27) Encryption requirement judgment. The automatic encryption and decryption component uses the strategy engine (linked with request rules, such as response header marking and data sensitivity identification) to determine whether the response needs to be encrypted: if no encryption is required, it directly proceeds to step (29) to return the response through Tomcat; if encryption is required, it executes the encryption sub-process of step (28).

[0079] (28) Encryption Sub-process: Based on client-side collaborative logic or key negotiation mechanism, generate a temporary key compatible with client decryption (due to AES symmetry, the key can be reused or dynamically derived). Use this temporary key to encrypt plaintext data (such as response body, sensitive results) in the response, converting it into ciphertext. Replace the plaintext with ciphertext, maintaining the HTTP protocol structure, and generate a client-decryptable response.

[0080] (29) The application server returns the final response. The automatic encryption / decryption component passes the ciphertext or original plaintext response to Tomcat, which then sends it back to the client from the server side, completing a request-response interaction.

[0081] For example, the decrypted response data is “{"ecyText":" / hzInbfVyn2ZU / m8HkPV / V06jrUSU1nR / ysdYlb2RnbYL8 / QGO3BFvvfuukAhlaS4b2FG8Vqc4565kWg8jD5LgEnsoSq2suzIm8SYzxK7WHwRKWfn5m0Nb0ddh / Padmq"}”. The original plaintext response data is “{"activityId":"1977572618794680321"}”.

[0082] This application designs non-intrusive client-side and server-side automatic encryption / decryption components, and integrates an adaptive dynamic encryption / decryption algorithm within the automatic encryption / decryption components. Through transparent integration at the application layer, end-to-end encrypted data transmission capabilities can be achieved without affecting existing business logic. This design ensures the integrity and confidentiality of users' core data assets during transmission, effectively avoiding the risk of asset loss due to data leakage, while significantly reducing the deployment and maintenance costs of enterprise-level data security protection through standardized security components.

[0083] Based on the same inventive concept, this application also provides an HTTP interactive system based on dual-end automatic encryption and decryption, including a client and a server, both of which are computer devices.

[0084] Both the client and the server integrate an adaptive dynamic encryption / decryption algorithm. Specifically, the code implementing the adaptive dynamic encryption / decryption algorithm is written using an integrated framework (jQuery or Ajax), encapsulated, and then run on the front-end page of the client or server, thus integrating the adaptive dynamic encryption / decryption algorithm on both the client and server sides.

[0085] The client initiates an HTTP request based on business needs and encrypts the HTTP request using an adaptive dynamic encryption / decryption algorithm to obtain a ciphertext request, which is then sent to the server. Upon receiving the ciphertext response, the client decrypts the ciphertext response using an adaptive dynamic encryption / decryption algorithm to obtain the response information corresponding to the HTTP request.

[0086] The server is configured to, upon receiving the ciphertext request, decrypt the ciphertext request using an adaptive dynamic encryption / decryption algorithm to obtain the HTTP request, and generate response information based on the HTTP request; encrypt the response information using an adaptive dynamic encryption / decryption algorithm to obtain the response ciphertext, and send the response ciphertext to the client.

[0087] The adaptive dynamic encryption / decryption algorithm generates an encryption key based on the client time, server time, and user identity, and then uses a symmetric encryption / decryption algorithm to encrypt and decrypt the data based on the encryption key.

[0088] This application employs a non-intrusive architecture design, encapsulating adaptive dynamic encryption and decryption algorithms within independent client and server components. This enables application-layer transparent end-to-end encrypted transmission without requiring modifications to existing business systems. It protects core user data from theft or tampering, mitigates data leakage risks, and enhances security. Standardized components reduce system modification and maintenance costs, improving the cost-effectiveness of security protection. It seamlessly adapts to both new and legacy systems, meeting data security regulatory requirements.

[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0090] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.

[0091] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for HTTP interaction based on automatic encryption and decryption from both ends, characterized in that, The method includes: The client initiates an HTTP request based on business needs, and uses an adaptive dynamic encryption and decryption algorithm to encrypt the HTTP request to obtain the ciphertext request, which is then sent to the server. After receiving the ciphertext request, the server uses an adaptive dynamic encryption and decryption algorithm to decrypt the ciphertext request to obtain the HTTP request. Based on the HTTP request, the server generates response information, uses an adaptive dynamic encryption and decryption algorithm to encrypt the response information to obtain the response ciphertext, and sends the response ciphertext to the client. After receiving the ciphertext of the response, the client uses an adaptive dynamic encryption and decryption algorithm to decrypt the ciphertext of the response in order to obtain the response information corresponding to the HTTP request; The adaptive dynamic encryption and decryption algorithm generates an encryption key based on the client time, server time, and user identity, and performs encryption and decryption using a symmetric encryption and decryption algorithm based on the encryption key. The adaptive dynamic encryption / decryption algorithm generates an encryption key based on client time, server time, and user identity identifier, including the following process: Calculate the base time based on the client time and the server time; The user's identity identifier is fused with the reference time to generate a composite key; The composite key is subjected to time-granularity dimensionality reduction processing to obtain a dimensionality-reduced key; Perform coordinate operations on each character in the dimensionality reduction key, and replace the characters in the dimensionality reduction key with the characters at the corresponding coordinates in a predefined cryptographic matrix to obtain the cryptographic transformation key; The cryptographic transformation key is byte-compressed to obtain the encryption key.

2. The HTTP interaction method based on automatic encryption and decryption from both ends according to claim 1, characterized in that, The base time is calculated based on the client time and the server time, including: Calculate the difference between the client time and the server time, and sum the difference with the client time to obtain the base time.

3. The HTTP interaction method based on automatic encryption and decryption from both ends according to claim 1, characterized in that, The user's identity identifier is fused with the reference time to generate a composite key, including: The user's identity identifier is concatenated with the reference time to generate a composite key.

4. The HTTP interaction method based on automatic encryption and decryption from both ends according to claim 1, characterized in that, The composite key is subjected to time-granular dimensionality reduction processing to obtain a dimensionality-reduced key, including: The last N characters of the composite key are removed to obtain the dimensionality-reduced key; where N>0.

5. The HTTP interaction method based on dual-end automatic encryption and decryption according to claim 1, characterized in that, Perform coordinate operations on each character in the dimensionality reduction key, and replace the characters in the dimensionality reduction key with the characters at the corresponding coordinates in a predefined cryptographic matrix to obtain the cryptographic transformation key, including: For any character in the dimensionality reduction key, calculate the Unicode encoding value of the character, and use the Unicode encoding value of the character to perform a modulo operation on the number of rows in the password matrix to obtain the target row; The target column is obtained by taking the modulo of the number of columns in the cryptographic matrix using the position of the character in the dimensionality reduction key; The characters in the target row and target column of the cryptographic matrix are replaced to obtain the cryptographic transformation key.

6. The HTTP interaction method based on automatic encryption and decryption from both ends according to claim 1, characterized in that, The cryptographic transformation key is byte-compressed to obtain the encryption key, which includes: The cryptographic transformation key is divided into multiple character segments; For any given character segment, calculate the sum of the Unicode encoding values ​​of the characters in that segment; The sum of the Unicode encoding values ​​of the character segment is divided by the length of the character segment and then rounded down to obtain the new character of the character segment; The new characters from each character segment are concatenated to obtain the encryption key.

7. An HTTP interactive system based on dual-end automatic encryption and decryption, characterized in that, The system executes the HTTP interaction method based on dual-end automatic encryption and decryption as described in any one of claims 1-6, the system comprising a client and a server; both the client and the server integrate an adaptive dynamic encryption and decryption algorithm; The client is used to initiate an HTTP request according to business needs, and to encrypt the HTTP request using an adaptive dynamic encryption and decryption algorithm to obtain the request ciphertext, and then send the request ciphertext to the server. Upon receiving the ciphertext of the response, an adaptive dynamic encryption / decryption algorithm is used to decrypt the ciphertext of the response in order to obtain the response information corresponding to the HTTP request. The server is used to decrypt the ciphertext of the request using an adaptive dynamic encryption and decryption algorithm after receiving the ciphertext of the request, to obtain the HTTP request, and to generate response information based on the HTTP request. The response information is encrypted using an adaptive dynamic encryption / decryption algorithm to obtain ciphertext, and the ciphertext is then sent to the client. The adaptive dynamic encryption / decryption algorithm generates an encryption key based on the client time, server time, and user identity, and then uses a symmetric encryption / decryption algorithm to encrypt and decrypt the data based on the encryption key.

8. The HTTP interactive system based on dual-end automatic encryption and decryption according to claim 7, characterized in that, Both the client and the server are computer devices.

Citation Information

Patent Citations

  • HTTP communication method and device

    CN111193704A