A data processing method, client, server, and system
By using the WebAssembly module and a dynamic key encryption algorithm on the web server, the problem of data leakage and tampering in web server interface requests is solved, thus protecting critical encryption and decryption programs and improving data security.
Patent Information
- Application Number
- CN202410826993.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-06-25
AI Technical Summary
Web server interface requests are easily intercepted by packet sniffing software, leading to the leakage and tampering of sensitive data. Furthermore, the plaintext source code of JavaScript scripts is easily analyzed and cracked by malicious users, causing security risks.
The encryption algorithm and dynamic key in the WebAssembly module are used to encrypt and decrypt login and non-login requests respectively. The combination of asymmetric and symmetric encryption algorithms with static and dynamic keys enhances the protection level of the encryption program and the randomness of the keys.
It effectively prevents source code leakage, improves encryption performance, reduces the risk of sensitive data being stolen and tampered with, and enhances the security of data information.
Smart Images

Figure CN118555125B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information security technology, specifically to a data processing method, client, server, and system. Background Technology
[0002] Web server interfaces typically make requests via HTTP. Packet capture software can capture the request URL and parameters, which poses a risk of sensitive data theft. Furthermore, once the request URL and parameters are obtained, users can simulate user requests and tamper with the request parameters, which also poses a risk of sensitive data corruption. Malicious users can use the captured URLs and request parameters to launch malicious attacks on the server, causing it to crash.
[0003] Currently, when clients interact with servers, they can use JavaScript to encrypt data. However, JavaScript programs are plaintext source code, which can easily lead to the leakage of critical source code. Malicious users can obtain the source code and analyze it to obtain key information for encrypting and decrypting transmitted data, causing security risks and even cracking the encryption program. Summary of the Invention
[0004] The purpose of this application is to provide a data processing method, client, server, system, storage medium, and computer program product, which can solve or at least partially solve the above-mentioned defects of the prior art.
[0005] To achieve the above objectives, the first aspect of this application provides a data processing method applied to a client, the method comprising: for a login request, encrypting the data transmitted by the login request using a first encryption algorithm and a static key in the WebAssembly module, and sending the login request to the server;
[0006] The system receives the first business data and dynamic key in response to the login request from the server, and decrypts the first business data and the dynamic key using the first decryption algorithm and static key in the WebAssembly module.
[0007] For non-login requests, the data transmitted in the non-login request is encrypted using the second encryption algorithm in the WebAssembly module and the dynamic key; and the non-login request is sent to the server; and
[0008] The server receives the second business data in response to the non-login request, and decrypts the second business data using the second decryption algorithm in the WebAssembly module and the dynamic key.
[0009] In one embodiment, the first encryption algorithm and the first decryption algorithm are asymmetric encryption algorithms, and the static key used to encrypt the data transmitted in the login request is the public key corresponding to the asymmetric encryption algorithm; and
[0010] The static key used to decrypt the first business data and the dynamic key is the private key corresponding to the asymmetric encryption algorithm.
[0011] In one embodiment, the second encryption algorithm and the second decryption algorithm are symmetric encryption algorithms, and the dynamic key used to encrypt the data transmitted in the non-login request is the symmetric key corresponding to the symmetric encryption algorithm; and
[0012] The dynamic key used to decrypt the second business data is the symmetric key corresponding to the symmetric encryption algorithm.
[0013] In one embodiment, for a non-login request, encrypting the data transmitted by the non-login request using the second encryption algorithm in the WebAssembly module and the dynamic key; and sending the non-login request to the server includes:
[0014] The dynamic key is added to the request header data of the non-login request and sent to the server, wherein the dynamic key is the encrypted dynamic key sent by the server in response to the login request and received by the client.
[0015] A second aspect of this application provides a data processing method applied to a server, the method comprising:
[0016] The system receives a login request from a client, uses a first decryption algorithm and a static key to decrypt the data transmitted in the login request, and processes the data to generate first business data and a dynamic key.
[0017] The first business data and the dynamic key are encrypted using the first encryption algorithm and the static key, and then the first business data and the dynamic key are sent to the client.
[0018] The system receives a non-login request sent by the client, uses the second decryption algorithm and the dynamic key to decrypt the data transmitted by the non-login request, processes the data transmitted by the non-login request, and generates second business data.
[0019] The second business data is encrypted using the second encryption algorithm and the dynamic key, and then sent to the client.
[0020] In one embodiment, the first decryption algorithm and the first encryption algorithm are asymmetric encryption algorithms, and the static key used to decrypt the data transmitted in the login request is the private key corresponding to the asymmetric encryption algorithm; and
[0021] The static key used to encrypt the first business data and the dynamic key is the public key corresponding to the asymmetric encryption algorithm.
[0022] In one embodiment, the second decryption algorithm and the second encryption algorithm are symmetric encryption algorithms, and the dynamic key used to decrypt the data transmitted in the non-login request is the symmetric key corresponding to the symmetric encryption algorithm; and
[0023] The dynamic key used to encrypt the second business data is the symmetric key corresponding to the symmetric encryption algorithm.
[0024] In one embodiment, the dynamic key is generated based on user information after the data transmitted in the login request is decrypted and the user authentication is successful; and the dynamic key has an expiration period and is stored on the server.
[0025] In one embodiment, the method further includes: when a user request is abnormal, setting the user's dynamic key stored on the server to invalid;
[0026] The user request exceptions include: user login failure, login status expiration, user login failure, and user changing login device.
[0027] In one embodiment, when a non-login request is received from a client during the validity period of the dynamic key, the validity period of the dynamic key is extended.
[0028] In one embodiment, the dynamic key is associated with a user ID, and the method further includes:
[0029] The server receives a non-login request sent by the client and obtains the encrypted dynamic key from the request header data of the non-login request.
[0030] The encrypted dynamic key in the request header data is decrypted using the first decryption algorithm and the static key to obtain the user ID associated with the encrypted dynamic key in the request header data and the decrypted dynamic key.
[0031] Based on the user ID associated with the encrypted dynamic key in the request header data, obtain the dynamic key corresponding to the user ID stored on the server. If the decrypted dynamic key is inconsistent with the dynamic key stored on the server, intercept the non-login request.
[0032] A third aspect of this application provides a client comprising a memory and a processor configured to perform the aforementioned data processing method applied to the client.
[0033] A fourth aspect of this application provides a server comprising a memory and a processor configured to perform the aforementioned data processing method applied to the server.
[0034] The fifth aspect of this application provides a system comprising the aforementioned client and server.
[0035] A sixth aspect of this application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the data processing method.
[0036] The seventh aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method.
[0037] The data processing method provided in this application embeds the encryption algorithm into the WebAssembly module and uses random and dynamic keys during encryption and decryption. This not only effectively avoids source code leakage and improves the protection of critical encryption and decryption programs, but also enhances encryption performance. At the same time, the use of dynamic keys increases the randomness of the keys, solving the problem of low security caused by easy key leakage, reducing the risk of sensitive data being stolen or tampered with, and increasing the security of data information. It is simple, secure, fast, and efficient.
[0038] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0039] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings:
[0040] Figure 1 This illustration shows a schematic diagram of the data processing method provided in the embodiments of this application applied to a client-side processing flow.
[0041] Figure 2 This illustration schematically shows the interaction timing diagram of the client and server provided in an embodiment of this application;
[0042] Figure 3 This illustration shows a schematic diagram of the data processing method provided in the embodiments of this application applied to the processing flow on the server side;
[0043] Figure 4 The diagram illustrates the internal structure of a computer device according to an embodiment of this application. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0045] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0046] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0047] The acquisition, transmission, storage, use, and processing of data in this application comply with relevant national laws and regulations. Furthermore, it should be noted that existing industry solutions such as software, components, and models may be mentioned in the embodiments of this application. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0048] Example 1
[0049] Figure 1 This illustration shows a schematic diagram of the data processing method provided in the embodiments of this application applied to a client-side processing flow. Figure 2 This illustration schematically shows the interaction timing diagram of the client and server provided in an embodiment of this application. (Refer to...) Figure 1 , Figure 2This application provides a data processing method applied to a client, the method comprising:
[0050] Step S101: Identify login requests and non-login requests.
[0051] Step S102: For the login request, use the first encryption algorithm and static key in the WebAssembly module to encrypt the data transmitted in the login request, and send the login request to the server.
[0052] Among them, a static key refers to a key that remains unchanged throughout the entire encrypted communication process. The key is used throughout the entire encryption cycle and does not change with time or session.
[0053] In one embodiment, a static key (also known as a default key) agreed upon by the client and the server is stored in the WebAssembly module in advance. When the client sends a login request to the server, the data transmitted in the login request is encrypted using a first encryption algorithm and the static key. The data to be transmitted at this time is generally the login username and login password.
[0054] In one embodiment, an encryption / decryption algorithm is written using the AssemblyScript language. The AssemblyScript encryption / decryption method is then compiled to generate a WebAssembly module, resulting in the encrypt.wasm file. Further, a partial code snippet from the encrypt.wasm file is as follows: "00 61 73 6D 0D 00 00 00 01 86 80 80 8000 01 60". Here, the wasm file is a bytecode-level product pre-compiled. It is a binary instruction format that runs in a browser, achieving near-native performance in web browsers, and is a bytecode standard used in browsers.
[0055] Existing technologies typically use JavaScript for data encryption, making it easy for attackers to reverse engineer and reconstruct the target code. WebAssembly, however, is a binary instruction format that runs in a browser. It's a universal browser application bytecode standard. Converting target code into custom bytecode can break the text's syntax and hide critical logic. This reduces the readability of the target code, making it difficult for attackers to understand the program logic through manual or automated analysis. Therefore, this method significantly increases the difficulty for users to crack encryption and decryption programs, thus strengthening the protection of critical encryption and decryption procedures.
[0056] Step S103: Receive the first business data and dynamic key from the server in response to the login request, and decrypt the first business data and the dynamic key using the first decryption algorithm and static key in the WebAssembly module.
[0057] In one embodiment, after a user successfully logs in, the client receives the dynamic key returned by the server and stores the dynamic key in the client's cache. The dynamic key is associated with the user ID.
[0058] In one embodiment, the first encryption algorithm and the first decryption algorithm are asymmetric encryption algorithms, and the static key used to encrypt the data transmitted in the login request is the public key corresponding to the asymmetric encryption algorithm; and
[0059] The static key used to decrypt the first business data and the dynamic key is the private key corresponding to the asymmetric encryption algorithm.
[0060] Furthermore, the first encryption algorithm and the first decryption algorithm can be implemented using asymmetric encryption algorithms such as RSA, ECC, ElGamal, DSA, LUC, McEliece, or X25519.
[0061] It should be noted that the first encryption algorithm and the first decryption algorithm can also be implemented using user-defined encryption and decryption algorithms.
[0062] Step S104: For non-login requests, use the second encryption algorithm in the WebAssembly module and the dynamic key to encrypt the data transmitted by the non-login request; and send the non-login request to the server.
[0063] Specifically, dynamic keys are a technology used in secure communication, referring to the use of different keys in each communication session to enhance security. This application uses dynamic keys to encrypt data transmitted via non-login requests, increasing the randomness of the key and solving the problem of low security caused by easy key leakage. Furthermore, the dynamic key is dynamically returned by the server, making it difficult for malicious users to obtain the complete encryption program, thus strengthening the protection of critical encryption and decryption procedures.
[0064] In one embodiment, after a user successfully logs in, the client receives the dynamic key returned by the server and saves the dynamic key in the client cache. When the client subsequently sends a non-login request, it uses the second encryption algorithm in the WebAssembly module and the dynamic key in the client cache to encrypt the transmitted data.
[0065] It should be noted that the encryption program in this application separates the encryption / decryption algorithm and the dynamic key. The encryption / decryption algorithm is generated based on the WebAssembly module. When data needs to be transmitted, the encryption algorithm program (.wasm file) is loaded locally using a JavaScript program. In terms of implementation, the client of this application does not need to remotely call the encryption program, thus improving encryption performance. Furthermore, when changing the encryption strategy, only the dynamic key needs to be changed; there is no need to rewrite the encryption algorithm or regenerate the encryption program based on the WebAssembly module. Therefore, the development cost of this invention is low when changing encryption strategies.
[0066] In one embodiment, for non-login requests, the dynamic key is added to the request header data of the non-login request and sent to the server. The dynamic key is the encrypted dynamic key sent by the server in response to the login request, received by the client. Since the dynamic key is also transmitted data, an encrypted version of the dynamic key needs to be transmitted from the client to the server. Therefore, the encrypted dynamic key sent by the server in response to the login request can be used directly.
[0067] Step S105: Receive the second business data in response to the non-login request from the server, and decrypt the second business data using the second decryption algorithm in the WebAssembly module and the dynamic key.
[0068] In one embodiment, a first encryption algorithm, a first decryption algorithm, a second encryption algorithm, and a second decryption algorithm are pre-written using AssemblyScript, and the first encryption algorithm, the first decryption algorithm, the second encryption algorithm, the second decryption algorithm, and the static key are compiled to generate a WebAssembly module.
[0069] In one embodiment, the client first generates an encryption / decryption program based on the WebAssembly module, and then loads the encryption / decryption program using a JavaScript program. Specifically, the client first uses the WebAssembly module to generate a first encryption algorithm, a first decryption algorithm, a second encryption algorithm, and a second decryption algorithm, and then loads these algorithms using a JavaScript program.
[0070] In one embodiment, the second encryption algorithm and the second decryption algorithm are symmetric encryption algorithms, and the dynamic key used to encrypt the data transmitted in the non-login request is the symmetric key corresponding to the symmetric encryption algorithm; and
[0071] The dynamic key used to decrypt the second business data is the symmetric key corresponding to the symmetric encryption algorithm.
[0072] In one embodiment, the second encryption algorithm and the second decryption algorithm can be implemented using symmetric encryption algorithms such as AES, DES, GOST, Twofish, or Blowfish.
[0073] Example 2
[0074] Figure 2 This illustration schematically shows the interaction timing diagram of the client and server provided in an embodiment of this application. Figure 3 This illustration shows a schematic diagram of the data processing method provided in this application applied to a server-side processing flow. (Refer to...) Figure 2 , Figure 3 This application provides a data processing method applied to a server, the method comprising:
[0075] Step S301: Identify login requests and non-login requests sent by the client.
[0076] Specifically, the server distinguishes between non-login requests and login requests sent by the client based on the received request URL.
[0077] Step S302: Receive the login request sent by the client, use the first decryption algorithm and static key to decrypt the data transmitted by the login request, and process the data transmitted by the login request to generate the first business data and dynamic key.
[0078] In one embodiment, the server first decrypts the data transmitted in the login request to obtain the user's login name and password. Then, it verifies the login name and password. Once both verification is successful, the server generates a dynamic password based on the user information and stores it in the server's database or cache. The dynamic key generated by the server is associated with the logged-in user ID, and the dynamic key has an expiration period, for example, 30 minutes. This implementation increases the randomness of the dynamic key, solves the problem of low security caused by easy key leakage, reduces the risk of sensitive data being stolen or tampered with during interaction, increases data security, and is simple, secure, fast, and efficient.
[0079] Step S303: Encrypt the first business data and the dynamic key using the first encryption algorithm and the static key, and send the first business data and the dynamic key to the client.
[0080] Specifically, since the dynamic key returned by the server is also part of the transmitted data, the transmitted dynamic key needs to be encrypted. In this case, the encryption key uses a static key (i.e., the default key).
[0081] In one embodiment, the first decryption algorithm and the first encryption algorithm are asymmetric encryption algorithms, and the static key used to decrypt the data transmitted in the login request is the private key corresponding to the asymmetric encryption algorithm; and
[0082] The static key used to encrypt the first business data and the dynamic key is the public key corresponding to the asymmetric encryption algorithm.
[0083] Step S304: Receive a non-login request sent by the client, use the second decryption algorithm and the dynamic key to decrypt the data transmitted by the non-login request, process the data transmitted by the non-login request, and generate second business data.
[0084] In one embodiment, since the dynamic key is associated with the logged-in user ID on the server side, when a user fails to log in, the login status expires, the same user logs in repeatedly, or the user changes the login device, the server will set the current dynamic key to invalid. When the client transmits data, it cannot use the invalid dynamic key for encryption, which will lead to encryption failure. The client cannot decrypt the data returned by the server using the invalid dynamic key. This reduces the risk caused by key leakage. Malicious users cannot decrypt the transmitted data (ciphertext) to obtain sensitive information using the invalid key, while normal users can log in again to obtain a new dynamic key.
[0085] Step S305: Encrypt the second service data using the second encryption algorithm and the dynamic key, and send the second service data to the client.
[0086] In one embodiment, the second decryption algorithm and the second encryption algorithm are symmetric encryption algorithms, and the dynamic key used to decrypt the data transmitted in the non-login request is the symmetric key corresponding to the symmetric encryption algorithm; and
[0087] The dynamic key used to encrypt the second business data is the symmetric key corresponding to the symmetric encryption algorithm.
[0088] In one embodiment, when a non-login request is received from a client during the validity period of the dynamic key, the validity period of the dynamic key is extended.
[0089] Specifically, regarding the expiration time of dynamic keys, if a user does not perform any operations in the application for an extended period, the server will return an error message after the dynamic key expires. The user will then be unable to continue operating in the application and will need to log in again to obtain a new dynamic key. If the user makes a new operation request within the dynamic key's validity period (e.g., within 30 minutes), the server will extend the dynamic key's validity period to ensure a good user experience. For example, if a user makes a new operation request within 30 minutes, the dynamic key will remain valid for the first 30 minutes after the new request. The dynamic key will only expire if the user makes no operation requests within 30 minutes.
[0090] In one embodiment, to enable the server to intercept expired keys more quickly, when a client sends a non-login request to the server, it adds the dynamic key used for encryption to the request header data of the non-login request. It should be noted that the dynamic key added to the request header data of the non-login request is an encrypted dynamic key, which can be directly used from the encrypted dynamic key returned by the server in response to the login interface. Thus, each time the server receives a client request, it can first obtain the encrypted dynamic key from the request header data, and then decrypt the encrypted dynamic key using the first decryption algorithm and the static key to obtain the user ID associated with the encrypted dynamic key in the request header data and the decrypted dynamic key. The server first determines whether the dynamic key in the client's request has expired. If it has expired, the request is directly intercepted. If it has not expired, the server obtains the dynamic key stored on the server based on the user ID. If the dynamic key stored on the server (unencrypted) is inconsistent with the decrypted dynamic key transmitted in the client's request header data (after decryption), the client request is directly intercepted.
[0091] This application provides a client that includes a memory and a processor, the processor being configured to execute a data processing method applied to the client.
[0092] This application provides a server that includes a memory and a processor, the processor being configured to execute a data processing method applied to the server.
[0093] This application provides a system that includes the aforementioned client and server.
[0094] This application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the data processing method.
[0095] This application provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method described above.
[0096] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows. Figure 4 As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05, and a memory (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A06. The network interface A02 is used for communication with external terminals via a network connection. When the computer program is executed by the processor A01, it implements the data processing method described above. The display screen A04 can be a liquid crystal display (LCD) or an e-ink display. The input device A05 can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0097] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0098] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.
[0099] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0100] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0101] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0102] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0103] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0104] Computer-readable media include both permanent and non-permanent, removable and non-removable media, which can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0105] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0106] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method of data processing, applied to a client, characterized in that, The method comprises: For a login request, encrypting data transmitted by the login request by using a first encryption algorithm and a static key in a WebAssembly module, and sending the login request to a server; Receiving first service data and a dynamic key in response to the login request from the server, and decrypting the first service data and the dynamic key by using a first decryption algorithm and a static key in the WebAssembly module; For a non-login request, encrypting data transmitted by the non-login request by using a second encryption algorithm and the dynamic key in the WebAssembly module, and sending the non-login request to the server; and Receiving second service data in response to the non-login request from the server, and decrypting the second service data by using a second decryption algorithm and the dynamic key in the WebAssembly module.
2. The method of claim 1, wherein The first encryption algorithm and the first decryption algorithm are asymmetric encryption algorithms, the static key used for encrypting the data transmitted by the login request is a public key corresponding to the asymmetric encryption algorithm, and The static key used for decrypting the first service data and the dynamic key is a private key corresponding to the asymmetric encryption algorithm.
3. The method of claim 1, wherein The second encryption algorithm and the second decryption algorithm are symmetric encryption algorithms, the dynamic key used for encrypting the data transmitted by the non-login request is a symmetric key corresponding to the symmetric encryption algorithm, and The dynamic key used for decrypting the second service data is the symmetric key corresponding to the symmetric encryption algorithm. The method comprises: For a non-login request, encrypting data transmitted by the non-login request by using a second encryption algorithm and the dynamic key in the WebAssembly module, and sending the non-login request to the server; and 4. The method of claim 1, wherein, The dynamic key is added to the request header data of the non-login request and sent to the server, wherein the dynamic key is an encrypted dynamic key sent by the server in response to the login request and received by the client. The method comprises: Receiving a login request sent by a client, decrypting data transmitted by the login request by using a first decryption algorithm and a static key, and processing the data transmitted by the login request to generate first service data and a dynamic key; 5. A method of data processing, applied to a server, characterized in that, Encrypting the first service data and the dynamic key by using a first encryption algorithm and a static key, and sending the first service data and the dynamic key to the client; Receiving a non-login request sent by a client, decrypting data transmitted by the non-login request by using a second decryption algorithm and the dynamic key, and processing the data transmitted by the non-login request to generate second service data; Encrypting the second service data by using a second encryption algorithm and the dynamic key, and sending the second service data to the client.
6. The method of claim 5, wherein The first decryption algorithm and the first encryption algorithm are asymmetric encryption algorithms, a static key used for decrypting data transmitted by the login request is a private key corresponding to the asymmetric encryption algorithm; and A static key used for encrypting the first service data and the dynamic key is a public key corresponding to the asymmetric encryption algorithm.
7. The method of claim 5, wherein, The second decryption algorithm and the second encryption algorithm are symmetric encryption algorithms, a dynamic key used for decrypting data transmitted by the non-login request is a symmetric key corresponding to the symmetric encryption algorithm; and A dynamic key used for encrypting the second service data is a symmetric key corresponding to the symmetric encryption algorithm.
8. The method of claim 5, wherein, The dynamic key is generated according to user information after the data transmitted by the login request is decrypted and the user identity verification is passed, and the dynamic key is set with a validity period and stored in the service end.
9. The method of claim 8, wherein, The method further comprises: when a user request is abnormal, setting the dynamic key of the user stored in the service end as invalid; The user request abnormality includes: user login failure, login state expiration, user repeated login, and user replacement of login equipment.
10. The method of claim 8, wherein, When a non-login request sent by the client is received within the validity period of the dynamic key, the validity period of the dynamic key is extended.
11. The method of claim 8, wherein, The dynamic key is associated with a user ID, and the method further comprises: The service end receives a non-login request sent by the client, and obtains an encrypted dynamic key in request header data in the non-login request; The encrypted dynamic key in the request header data is decrypted by using the first decryption algorithm and the static key to obtain a user ID associated with the encrypted dynamic key in the request header data and a decrypted dynamic key, and According to the user ID associated with the encrypted dynamic key in the request header data, the dynamic key corresponding to the user ID stored in the service end is obtained, and when the decrypted dynamic key is inconsistent with the dynamic key stored in the service end, the non-login request is intercepted.
12. A client comprising a memory and a processor configured to perform the method of claims 1-4.
13. A service end comprising a memory and a processor configured to perform the method of claims 5-11.
14. A system comprising a client according to claims 1-4 and a service end according to claims 5-11.
15. A machine-readable storage medium having stored thereon instructions, the instructions comprising: The instructions, when executed by a processor, cause the processor to be configured to perform the method according to any one of claims 1 to 11.
16. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method according to any one of claims 1 to 11. The computer program, when executed by a processor, implements the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Data processing method and system, computing device and readable storage medium
CN116186733A
Game data interaction method and device and computer readable storage medium
CN116688519A