A browser fingerprint-based identity authentication encryption method
Through the RSA encryption method based on browser fingerprint, the problem of token being easily hijacked is solved, and more secure user information protection is achieved to prevent data leakage and tampering.
Patent Information
- Application Number
- CN202210151401.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-18
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-02-18
AI Technical Summary
In existing identity authentication technologies, tokens are easily hijacked, leading to user data leakage and information tampering.
The browser fingerprint and public key are obtained through the front-end for RSA encryption. The back-end generates and verifies the browser fingerprint, uses the private key to decrypt and verify the user data, generates and saves the user token, and the front-end carries the token for identity authentication every time it requests.
It effectively prevents token hijacking, protects user information from being forged and tampered with, and improves the security of identity authentication.
Smart Images

Figure CN114547579B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of identity authentication, and in particular to an identity authentication encryption method based on browser fingerprint. Background Art
[0002] With the rapid development of the internet and the widespread adoption of mobile internet, including mobile web, mobile apps, and WeChat mini-programs, backend interfaces are facing increasing request pressure and security risks. As the number of users continues to rise, malicious calls and scraping of interfaces are becoming more frequent, putting increasing pressure on servers. Therefore, a mechanism for secure request screening is necessary to ensure the proper functioning of interfaces. One of the key technologies for achieving this functionality is an identity-based request screening mechanism. By pre-setting different identity tokens in the interface, different user identities are securely screened, blocking access by unauthorized users and ensuring interface security.
[0003] The interface uses a token identity feature algorithm to filter and split requests. This algorithm filters and extracts features for each request, such as IP address, User-Agent (UA), frequency, and browser fingerprint. The features are then extracted and encrypted, and the final result is saved and verified. Requests that meet the requirements are released, while requests that do not meet the requirements are rejected with an empty response or feedback.
[0004] Existing technologies generate a token on the backend and send it to the frontend. The frontend then carries the token request, and the backend verifies the token's validity. This solves user authentication, but it doesn't prevent token hijacking, posing the risk of token and user information leakage.
[0005] Existing identity authentication technologies generally involve the backend generating a user authtoken and sending it to the frontend. The frontend then carries the token with each request, and the backend verifies the request's validity by verifying the authtoken. This solves the communication problem between the frontend and backend users. However, if the token is hijacked or forged, user data can be leaked. Hackers can hijack the token to forge user requests, crawl user information, and modify user data, resulting in data anomalies and program errors. Summary of the Invention
[0006] In view of the above problems, the present invention is proposed to provide an identity authentication encryption method based on browser fingerprint that overcomes the above problems or at least partially solves the above problems.
[0007] According to one aspect of the present invention, a browser fingerprint-based identity authentication encryption method is provided, the encryption method comprising:
[0008] The front-end sends browser information to the back-end through the interface, obtains the browser fingerprint and the corresponding public key, and obtains user data;
[0009] The front end encrypts the user data using RSA according to the public key to obtain encrypted user data;
[0010] The front end sends the encrypted user data, the browser information and the browser fingerprint to the back end;
[0011] Get current browser information;
[0012] The backend generates a current browser fingerprint based on the current browser information;
[0013] The backend compares the current browser fingerprint with the browser fingerprint, and if the verification is successful, the backend obtains the private key of the corresponding browser fingerprint;
[0014] The backend uses the private key to perform RSA decryption verification on the encrypted user data sent by the frontend;
[0015] If passed, generate a user token;
[0016] Send the user token to the front end, and the front end saves the user token;
[0017] Each time the front-end requests the back-end, it must carry the user token for identity authentication.
[0018] Optionally, the browser information includes: operating system, resolution, pixels, IP, UA, geographic location and time zone.
[0019] Optionally, the encryption method further includes:
[0020] The front-end request interface encrypts the user data and the user token using RSA according to the public key;
[0021] Sending the browser information and the browser fingerprint to a backend;
[0022] The backend generates a backend browser fingerprint based on the browser information;
[0023] Comparing the back-end browser fingerprint with the browser fingerprint sent by the front-end;
[0024] If the verification is successful, the backend obtains the private key of the corresponding browser fingerprint;
[0025] Use the private key to perform RSA decryption verification on the encrypted user data sent by the front end;
[0026] After decryption is successful, the user token is verified. If successful, the interface returns success, otherwise it returns failure.
[0027] Optionally, the front end sends browser information to the back end through the interface in exchange for the public key, specifically including:
[0028] The backend generates a browser fingerprint based on the browser information and generates a public key corresponding to the browser fingerprint;
[0029] The public key and the browser fingerprint are returned to the front end, and the front end stores the public key information.
[0030] The present invention provides an identity authentication and encryption method based on browser fingerprints, comprising: a front-end sending browser information to a back-end through an interface, obtaining a browser fingerprint and a corresponding public key, and obtaining user data; the front-end encrypting the user data using RSA according to the public key to obtain encrypted user data; the front-end sending the encrypted user data, browser information, and browser fingerprint to the back-end; obtaining current browser information; the back-end generating a current browser fingerprint based on the current browser information; the back-end comparing the current browser fingerprint with the browser fingerprint, and if verification passes, obtaining the private key of the corresponding browser fingerprint; the back-end performing RSA decryption verification on the encrypted user data sent by the front-end using the private key; if verification passes, generating a user token; sending the user token to the front-end, which stores the user token; and each time the front-end requests the back-end for identity authentication, the user token must be carried. This method prevents the forgery of the user token to obtain user data and tampering with user information after the authentication information token is hijacked, thereby more securely protecting user information.
[0031] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 Flowchart of a method for preserving a public key on the front end provided by an embodiment of the present invention;
[0034] Figure 2 Flowchart of the method for returning a user token provided by an embodiment of the present invention;
[0035] Figure 3 A flow chart of a method for front-end decryption request data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0036] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0037] The terms "comprises" and "comprising" and any variations thereof in the description, embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0038] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0039] like Figure 1 As shown in the figure, the front-end sends browser information to the back-end through an interface in exchange for a public key. The information sent includes: operating system, resolution, pixels, IP address, user agent, geographic location, time zone, and so on. The back-end generates a browser fingerprint based on the browser information and generates a corresponding public key. This is then returned to the front-end along with the browser fingerprint, and the front-end stores the public key information.
[0040] like Figure 2 As shown, the frontend encrypts user data using RSA with a public key and sends it, along with browser information and a browser fingerprint, to the backend. The backend then generates a browser fingerprint based on the browser information and compares it with the fingerprint sent by the frontend. If verification is successful, the backend obtains the private key corresponding to the browser fingerprint and uses it to perform RSA decryption on the data sent by the frontend. If verification is successful, a user token is generated and returned to the frontend, which stores it. Subsequently, each request from the frontend to the backend requires the user token for identity authentication.
[0041] like Figure 3 As shown, the frontend requests another interface, encrypts the user data and token using RSA with the public key, and sends this data, along with browser information and a browser fingerprint, to the backend. The backend then generates a browser fingerprint based on the browser information and compares it with the browser fingerprint sent by the frontend. If verification succeeds, the backend obtains the private key corresponding to the browser fingerprint and uses it to perform RSA decryption on the data sent by the frontend. After decryption is successful, the user token is verified. The interface returns a success message if successful, or a failure message if unsuccessful.
[0042] Beneficial effect: Based on browser fingerprint information and RSA asymmetric encryption, user information is encrypted and protected, which prevents the user token from being forged to obtain user data and tamper with user information when the authentication information token is hijacked, thus protecting user information more securely.
[0043] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A browser fingerprint-based identity authentication encryption method, characterized in that: The encryption method includes: The front-end sends browser information to the back-end through the interface, obtains the browser fingerprint and the corresponding public key, and obtains user data; The front end encrypts the user data using RSA according to the public key to obtain encrypted user data; The front end sends the encrypted user data, the browser information and the browser fingerprint to the back end; Get current browser information, current geographic location information, MAC address, IP address; The backend generates a current browser fingerprint based on the current browser information, current geographic location information, MAC address, and IP address; The backend compares the current browser fingerprint with the browser fingerprint, and if the verification is successful, the backend obtains the private key of the corresponding browser fingerprint; The backend uses the private key to perform RSA decryption verification on the encrypted user data sent by the frontend; If passed, a unique token for the user is generated; Send the user token to the front end, and the front end saves the user token; Each time the front-end requests the back-end, it must carry the user token for identity authentication; The front-end request interface encrypts the user data and the user token using RSA according to the public key; Sending the browser information and the browser fingerprint to a backend; The backend generates a backend browser fingerprint based on the browser information; Comparing the back-end browser fingerprint with the browser fingerprint sent by the front-end; If the verification is successful, the backend obtains the private key of the corresponding browser fingerprint; Use the private key to perform RSA decryption verification on the encrypted user data sent by the front end; After decryption is successful, the user token is verified. If successful, the interface returns success, otherwise it returns failure.
2. The identity authentication encryption method based on browser fingerprint according to claim 1, characterized in that: The browser information includes: operating system, resolution, pixels, IP, UA, geographic location and time zone.
3. The identity authentication encryption method based on browser fingerprint according to claim 1, characterized in that: The front-end sends browser information to the back-end through the interface in exchange for the public key, specifically including: The backend generates a browser fingerprint based on the browser information and generates a public key corresponding to the browser fingerprint; The public key and the browser fingerprint are returned to the front end, and the front end stores the public key information.
Citation Information
Patent Citations
Browser built-in crawler system-based fingerprint identification realization method
CN106446020A
Method and apparatus for intercepting malicious Web access request
CN107426181A