Cross-platform and cross-framework password protection method and device and storage medium
By initializing the password control in the user interface and using the back-end server to generate a random string for encryption, the problem of poor compatibility between existing security controls between different platforms and systems is solved, and high security password protection across platforms and frameworks is achieved .
Patent Information
- Application Number
- CN202411301390.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-02-21
AI Technical Summary
Compatibility issues with existing security controls across different platforms and systems lead to high development and deployment costs and difficulty in effectively protecting users' private information in native input boxes.
By initializing the password control in the user interface, calling a random string from the backend server to generate an input box, encrypting the input data with the encryption algorithm, storing it to the internal state of the password control, and sending the encrypted data to the rear under the user's operation instructions The terminal server performs decryption and verification.
Cross-platform cross-frame password protection on different platforms and frameworks is realized, reducing development difficulty and cost, improving password input security, and simplifying the maintenance process.
Smart Images

Figure CN119493625A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a cross-platform and cross-framework password protection method, device and storage medium. Background Art
[0002] Password input is a common business scenario. As a traditional method, native input boxes are widely favored by developers for their simplicity and ease of use. Users can directly enter passwords on the interface, but since native input boxes themselves do not have advanced security mechanisms, such as encrypted storage or anti-tampering functions, private information such as user-entered account passwords exists in plain text in the front-end code, making them easy targets for malware such as Trojans and viruses. Therefore, security controls were subsequently developed to improve the security of password input. Security controls integrate multiple security mechanisms to protect private information entered by users.
[0003] However, the deployment and use of security controls face many limitations. The compatibility issues between existing security controls on different platforms and systems make the development and deployment of security controls expensive. Developers need to customize different versions for each platform and system, which not only increases the development workload, but also increases the difficulty of maintenance. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a cross-platform and cross-framework password protection method, device and storage medium for protecting password security during the password input process.
[0005] The technical solution provided in this application is described below:
[0006] The first aspect of the present application provides a cross-platform and cross-frame password protection method, comprising:
[0007] Initialize the password control;
[0008] When the password control is called in the user interface, a random string is called from the backend server;
[0009] Generate an input box according to the random string;
[0010] Obtaining input data in the input box;
[0011] Encrypting the input data and the random string to obtain encrypted data, and displaying the encrypted data in an encrypted form on the user interface;
[0012] storing the encrypted data into the internal state of the password control;
[0013] The encrypted data is sent to the back-end server according to the user's operation instruction, so that the back-end server can decrypt and verify the encrypted data.
[0014] Optionally, generating an input box according to the random string includes:
[0015] Define a div element, and combine the div element with the random string to construct an input box;
[0016] Mount cursor events on the input box.
[0017] Optionally, after generating the input box according to the random string, the method further includes:
[0018] Generate a custom keyboard, the custom keyboard consisting of multiple DOM elements, for providing a function of inputting information in the input box;
[0019] Mount a listener event on the custom keyboard.
[0020] Optionally, the step of mounting a cursor event on the input box includes:
[0021] Add an inline element to the input box, and position the inline element relative to the div element;
[0022] Add focus animation to the input box.
[0023] Optionally, after sending the encrypted data to the back-end server according to the user's operation instruction so that the back-end server decrypts and verifies the encrypted data, the method further includes:
[0024] When the verification result indicates that the random string verification fails, a new random string is called from the backend server again, and a new input box is generated.
[0025] Optionally, after sending the encrypted data to the back-end server according to the user's operation instruction so that the back-end server decrypts and verifies the encrypted data, the method further includes:
[0026] When the verification result indicates that the input data verification fails, the input data in the input box is cleared.
[0027] The second aspect of the present application provides a cross-platform and cross-frame password protection device, including:
[0028] An initialization unit, used to initialize the password control;
[0029] A random string unit, used to call a random string from a backend server when the password control is called in the user interface;
[0030] A generating unit, used for generating an input box according to the random string;
[0031] A monitoring unit, used for obtaining input data in the input box;
[0032] an encryption unit, configured to encrypt the input data and the random string to obtain encrypted data, and display the encrypted data in an encrypted form on the user interface;
[0033] A storage unit, used for storing the encrypted data into the internal state of the password control;
[0034] The verification unit is used to send the encrypted data to the back-end server according to the user's operation instruction, so that the back-end server can decrypt and verify the encrypted data.
[0035] Optionally, the generating unit is specifically used for:
[0036] Define a div element, and combine the div element with the random string to construct an input box;
[0037] Mount cursor events on the input box.
[0038] A third aspect of the present application provides a cross-platform and cross-frame password protection device, the device comprising:
[0039] Processor, memory, input-output unit, and bus;
[0040] The processor is connected to the memory, the input and output unit, and the bus;
[0041] The memory stores a program, and the processor calls the program to execute the first aspect and the optional cross-platform and cross-framework password protection method of any one of the first aspect.
[0042] In a fourth aspect, the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional cross-platform and cross-framework password protection method in the first aspect.
[0043] It can be seen from the above technical solutions that this application has the following advantages:
[0044] The present application provides a cross-platform and cross-frame password protection method, firstly, the password control is initialized; when the password control is called in the user interface, a random string is called from the back-end server; secondly, an input box is generated according to the random string; then the input data in the input box is obtained; the input data and the random string are further encrypted to obtain the encrypted data, and the encrypted data is displayed in an encrypted form in the user interface; then the encrypted data is stored in the internal state of the password control; finally, the encrypted data is sent to the back-end server according to the user's operation instructions, so that the back-end server decrypts and verifies the encrypted data. The present application generates an input box using a random string issued by the server, and then encrypts the input data based on an encryption algorithm, and stores it in the interior of the password control, so that it has higher security than the native input box in the prior art. And the present application can be integrated and reused in different frameworks and different platforms based on the random string and the encryption algorithm, which reduces the difficulty and cost of development and is also easy to maintain. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 A schematic diagram of an embodiment of a cross-platform and cross-frame password protection method provided by this application;
[0047] Figure 2 A flowchart of another embodiment of the cross-platform and cross-frame password protection method provided by the present application;
[0048] Figure 3 A flowchart of another embodiment of the cross-platform and cross-frame password protection method provided by the present application;
[0049] Figure 4 A flowchart of another embodiment of the cross-platform and cross-frame password protection method provided by the present application;
[0050] Figure 5 A flowchart of another embodiment of the cross-platform and cross-frame password protection method provided by the present application;
[0051] Figure 6 A schematic diagram of the structure of an embodiment of a cross-platform and cross-frame password protection device provided by the present application;
[0052] Figure 7 A schematic diagram of the structure of another embodiment of the cross-platform and cross-frame password protection device provided by the present application. DETAILED DESCRIPTION
[0053] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0054] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0055] In the description of the present invention, it should be understood that descriptions involving orientation, such as up, down, left, right, front, back, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0056] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0057] In the description of the present invention, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution. In addition, the identification of specific steps below does not represent a limitation on the order of steps and execution logic, and the execution order and execution logic between each step should be understood and inferred with reference to the contents described in the embodiment.
[0058] It should be noted that the cross-platform and cross-frame password protection method provided by this application can be applied to terminals, systems, and servers. For example, the terminal can be a smart phone or a computer, a tablet computer, a portable computer terminal, or a fixed terminal such as a desktop computer. For the convenience of explanation, this application uses the terminal as an example for the execution subject.
[0059] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a cross-platform and cross-framework password protection method, device and storage medium.
[0060] See also Figure 1 The cross-platform and cross-frame password protection method provided by the present application includes:
[0061] Step S101, initializing the password control;
[0062] Step S102, when the password control is called in the user interface, the random string is called from the backend server;
[0063] Step S103, generating an input box according to the random string;
[0064] Step S104, obtaining input data in the input box;
[0065] Step S105, encrypting the input data and the random string to obtain encrypted data, and displaying the encrypted data in an encrypted form on the user interface;
[0066] Step S106, storing the encrypted data in the internal state of the password control;
[0067] Step S107: sending the encrypted data to the backend server according to the user's operation instruction, so that the backend server decrypts and verifies the encrypted data.
[0068] The cross-platform and cross-frame password protection method of the present invention first initializes the password control; when the password control is called in the user interface, the random string is called from the back-end server; secondly, an input box is generated according to the random string; then the input data in the input box is obtained; the input data and the random string are further encrypted to obtain encrypted data, and the encrypted data is displayed in an encrypted form in the user interface; then the encrypted data is stored in the internal state of the password control; finally, the encrypted data is sent to the back-end server according to the user's operation instructions, so that the back-end server decrypts and verifies the encrypted data. This application generates an input box using a random string issued by the server, and then encrypts the input data based on an encryption algorithm, and stores it in the internal state of the password control, thereby having higher security than the native input box in the prior art. And this application can be integrated and reused in different frameworks and different platforms based on the random string and the encryption algorithm, which reduces the difficulty and cost of development and is also easy to maintain.
[0069] In step S101 of some embodiments, the password control is initialized. The password control of the present application can be a cross-platform and cross-frame password control developed based on WebComponents. Initializing the password control and triggering its life cycle are the prerequisites for the password control to participate in subsequent steps. Initializing the password control may specifically include but is not limited to the following: allocating resources, setting the initial attribute value of the password control, the input format of the password, the length limit, or determining the subsequent encryption method, etc. The life cycle of the password control defines the various stages and behaviors of the password control from creation to destruction. By triggering the life cycle of the password control, it can be ensured that the control performs the necessary operations at each stage, so that it works as expected.
[0070] In step S102 of some embodiments, when the password control is called in the user interface, the random string is called from the backend server. In the process of initializing the password control in step S101, the password control is called, and then the backend server is called through the life cycle callback function (connectedCallback function) to obtain the random string, which is mainly used to generate the input box. The random string is one of the keys in the password protection process. The participation of the random string and subsequent verification can improve the security of password input.
[0071] In step S103 of some embodiments, an input box is generated according to a random string. The input box generated according to the random string is essentially different from the native input box in the prior art, but the two have similar functions in terms of user experience and are displayed in a similar manner on the terminal screen. The essential difference is that the input box generated by the present application can be combined with an encryption algorithm so that the data entered by the user in the input box can be encrypted and protected, so the input box of the present application is safer than the native input box.
[0072] See also Figure 2 According to some embodiments of the present invention, generating an input box according to a random string in step S103 may specifically include, but is not limited to, the following:
[0073] Step S201, define a div element, and combine the div element with a random string to construct an input box;
[0074] Step S202, mounting a cursor event on the input box;
[0075] In steps S201 to S202 of some embodiments, a div element is first defined, and the div element is combined with a random string to construct an input box; then a cursor event is mounted on the input box. An A element is defined for constructing an input box, and the type of the A element is a div element. The div element can be used as a container for the input box, and the style and behavior of the input box can be enhanced or controlled through CSS and JavaScript to make the user experience of the input box similar to that of the native input box. Combining the div element with the random string means writing the random string into the storage unit while defining the A element, so that the random string can be called from the storage unit later and the input data in the input box can be combined with the random string for encryption processing. After the input box is constructed, a cursor event is written into the A element, that is, a cursor event is mounted on the input box to simulate the style of the native input box.
[0076] See also Figure 3 According to some embodiments of the present invention, the event of mounting a cursor on the input box in step S202 may specifically include, but is not limited to, the following:
[0077] Step S301, adding an inline element to the input box, and positioning the inline element relative to the div element;
[0078] Step S302, adding a focus function animation to the input box.
[0079] In steps S301 to S302 of some embodiments, an inline element is first added to the input box, and the inline element is positioned relative to the div element; then an animation of the focus function is added to the input box. The inline element can be a decoration or text label added to the input box. The inline element of the present application is an input indicator cursor, and the inline element is set to be positioned relative to the div element so that the input indicator cursor moves within the range of the input box. Then, an animation with a focus function is added to the input box. In addition, other animations with similar functions can also be added to further simulate the style of the native input box, which is not limited here.
[0080] See also Figure 4After the input box is generated in step S201 to step S202, a custom keyboard adapted to the input box is also required, and the security of the password input process can be improved by setting the custom keyboard, which may include, but is not limited to, the following:
[0081] Step S401, generating a custom keyboard, which is composed of multiple DOM elements and is used to provide a function of inputting information in an input box;
[0082] Step S402, mounting a monitoring event on the custom keyboard.
[0083] In steps S401 to S402 of some embodiments, a custom keyboard is first generated, which is composed of multiple DOM elements and is used to provide the function of inputting information in the input box; then a monitoring event is mounted on the custom keyboard. In order to ensure the integrity and security of the entire password input process, the present application also constructs a custom keyboard for use with the input box to avoid the introduction of third-party keyboards that undermine security. Buttons are constructed by DOM elements according to actual needs and layout requirements to provide the function of inputting information in the input box, and multiple DOM elements are combined to generate a custom keyboard. Then a monitoring event is added to each DOM element, that is, the monitoring event is mounted on the custom keyboard.
[0084] In step S104 of some embodiments, the input data in the input box is obtained. The input data refers to the password entered by the user, and the password is obtained in order to perform subsequent encryption steps on the password, thereby protecting the password from being leaked and intercepted by a third party during the intermediate process from the user entering the password to verifying the password. It should be noted that the custom keyboard in step S402 is mounted with a monitoring event, so the input data added by the user in the input box can be obtained by monitoring the keys triggered by the user on the custom keyboard.
[0085] In step S105 of some embodiments, the input data and the random string are encrypted to obtain encrypted data, and the encrypted data is displayed in an encrypted form on the user interface. The random string obtained in step S102 and the input data obtained in step S104 are combined, and then encrypted according to the encryption algorithm to generate encrypted data. The above-mentioned encryption algorithm can be an asymmetric encryption algorithm (RSA), an elliptic curve public key cryptography algorithm (SM2), a hash algorithm (SM3) or a symmetric algorithm (SM4), etc., which are not specifically limited here. And the encrypted data is displayed in an encrypted form in the input box, that is, the encrypted data is displayed on the user interface of the terminal, and the encryption form can be in the form of black dots or asterisks. Display in encrypted form to prevent third parties from intercepting input data from the user interface.
[0086] In step S106 of some embodiments, the encrypted data is stored in the internal state of the password control. The management of the internal state of the password control is usually protected by the React framework, and React follows the principle of one-way data flow or data binding. In React, data flows from parent components to child components, and child components cannot directly modify the state of parent components. Storing encrypted data in the internal state of the component and maintaining a one-way data flow makes the data flow clearer and predictable, and helps prevent unauthorized data access. When encrypted data is stored in the internal state of the password control, the data will not be directly exposed to the DOM element, thereby reducing the risk of being stolen by malicious attackers through DOM element operations.
[0087] In step S107 of some embodiments, the encrypted data is sent to the back-end server according to the user's operation instruction so that the back-end server decrypts and verifies the encrypted data. After the encrypted data is sent to the back-end server according to the user's operation instruction, the back-end server receives the encrypted data and decrypts the encrypted data according to the encryption algorithm to obtain decrypted data, which includes the decrypted input data and the decrypted random string, and further verifies the decrypted data. When the verification passes, it confirms that the user identity is correct, and the password protection process of this application ends. It should be noted that after obtaining the decrypted data, the back-end server analyzes the consistency of the decrypted random string with the random string before encryption, and analyzes the consistency of the decrypted input data with the input data before encryption, so as to verify the decrypted data.
[0088] See also Figure 5 According to some embodiments of the present invention, step S107 sends the encrypted data to the backend server according to the user's operation instruction, so that the backend server decrypts and verifies the encrypted data, wherein corresponding processing is performed according to different verification results, which may specifically include, but is not limited to, the following:
[0089] Step S501, when the verification result indicates that the random string verification fails, a new random string is called from the backend server again, and a new input box is generated;
[0090] Step S502: when the verification result indicates that the input data verification fails, clear the input data in the input box.
[0091] In some embodiments, in steps S501 to S502, the verification result is that the random string verification fails, that is, the random string decrypted in step S107 is inconsistent with the random string in step S102, resulting in verification failure. The decrypted random string is inconsistent with the random string in step S102, indicating that the random string has expired due to reasons such as verification timeout or third-party attack, and user identity authentication fails. It is necessary to call a new random string from the backend server through the life cycle callback function, and then regenerate the input box according to the new random string, refresh the user interface, and prompt the user to re-enter the data.
[0092] The verification result is that the input data verification failed, that is, the input data decrypted in step S107 is inconsistent with the input data in step S104, resulting in verification failure. The verification of the decrypted input data and the input data in step S104 is to confirm that the input data has not changed in the process from the user inputting data to issuing the operation instruction, that is, to ensure the security of the input data. The decrypted input data is consistent with the input data in step S104, indicating that the password is correct and the password input process is correct. The user identity is confirmed to be correct, and the input password protection process ends. The decrypted input data is inconsistent with the input data in step S104, indicating that the password is incorrect. Clear the input data in the input box and wait for the user to re-enter. A data error prompt can also be sent to the user.
[0093] The above embodiment describes the cross-platform and cross-frame password protection method provided by the present application. The following describes the cross-platform and cross-frame password protection device and storage medium provided by the present application:
[0094] See also Figure 6 The present application provides a cross-platform and cross-frame password protection device, which includes:
[0095] Initialization unit 601, used to initialize the password control;
[0096] A random string unit 602, used to call a random string from a backend server when the password control is called in the user interface;
[0097] A generating unit 603, used to generate an input box according to a random string;
[0098] A monitoring unit 604 is used to obtain input data in the input box;
[0099] The encryption unit 605 is used to encrypt the input data and the random string to obtain encrypted data, and display the encrypted data in an encrypted form on the user interface;
[0100] Storage unit 606, used to store encrypted data to the internal state of the password control;
[0101] The verification unit 607 is used to send the encrypted data to the back-end server according to the user's operation instruction, so that the back-end server can decrypt and verify the encrypted data.
[0102] In this embodiment, the password control is first initialized; when the password control is called in the user interface, the random string is called from the backend server; secondly, an input box is generated according to the random string; then the input data in the input box is obtained; the input data and the random string are further encrypted to obtain encrypted data, and the encrypted data is displayed in an encrypted form in the user interface; then the encrypted data is stored in the internal state of the password control; finally, the encrypted data is sent to the backend server according to the user's operation instructions, so that the backend server decrypts and verifies the encrypted data. This application generates an input box using a random string issued by the server, and then encrypts the input data based on an encryption algorithm, and stores it in the internal state of the password control, thereby having higher security than the native input box in the prior art. And this application can be integrated and reused in different frameworks and different platforms based on the random string and the encryption algorithm, which reduces the difficulty and cost of development and is also easy to maintain.
[0103] Optionally, the generating unit 603 is specifically configured to:
[0104] Define a div element and combine it with a random string to construct an input box;
[0105] Mount cursor events on the input box;
[0106] Optionally, after the generating unit 603, the method further includes:
[0107] A custom keyboard unit 608 is used to generate a custom keyboard, which is composed of multiple DOM elements and is used to provide a function of inputting information in an input box;
[0108] The mounting unit 609 is used to mount the monitoring event on the custom keyboard.
[0109] Optionally, the generating unit 603 is specifically configured to:
[0110] Mounting a cursor event on an input box includes: adding an inline element to the input box, and positioning the inline element relative to the div element;
[0111] Add focus animation to input box.
[0112] Optionally, after the verification unit 607, the method further includes:
[0113] The re-execution unit 610 is used to call a new random string from the backend server and generate a new input box when the verification result indicates that the random string verification fails.
[0114] Optionally, after the verification unit 607, the method further includes:
[0115] The clearing unit 611 is used to clear the input data in the input box when the verification result indicates that the input data verification fails.
[0116] This application also provides a cross-platform and cross-frame password protection device, please refer to Figure 7 , the cross-platform and cross-frame password protection device includes:
[0117] Processor 701, memory 702, input and output unit 703, bus 704;
[0118] The processor 701 is connected to the memory 702, the input and output unit 703 and the bus 704;
[0119] The memory 702 stores a program, and the processor 701 calls the program to execute the following steps: Figures 1 to 5 The cross-platform and cross-frame password protection method shown in any embodiment.
[0120] The present application also relates to a computer-readable storage medium, on which a program is stored, wherein when the program is run on a computer, the computer executes Figures 1 to 5 The cross-platform and cross-frame password protection method shown in any embodiment.
[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0122] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A cross-platform and cross-frame password protection method, characterized in that: The password protection method comprises: Initialize the password control; When the password control is called in the user interface, a random string is called from the backend server; Generate an input box according to the random string; Obtaining input data in the input box; Encrypting the input data and the random string to obtain encrypted data, and displaying the encrypted data in an encrypted form on the user interface; Storing the encrypted data inside the password control; The encrypted data is sent to the back-end server according to the user's operation instruction, so that the back-end server can decrypt and verify the encrypted data.
2. The password protection method according to claim 1, characterized in that: Generating an input box according to the random string includes: Define a div element, and combine the div element with the random string to construct an input box; Mount cursor events on the input box.
3. The password protection method according to claim 1 or 2, characterized in that: After generating the input box according to the random string, the method further includes: Generate a custom keyboard, the custom keyboard consisting of multiple DOM elements, for providing a function of inputting information in the input box; Mount a listener event on the custom keyboard.
4. The password protection method according to claim 2, characterized in that: The mounting of the cursor event on the input box comprises: Add an inline element to the input box, and position the inline element relative to the div element; Add focus animation to the input box.
5. The password protection method according to claim 1, characterized in that: After sending the encrypted data to the back-end server according to the user's operation instruction so that the back-end server decrypts and verifies the encrypted data, the method further includes: When the verification result indicates that the random string verification fails, a new random string is called from the backend server again, and a new input box is generated.
6. The password protection method according to claim 1, characterized in that: After sending the encrypted data to the back-end server according to the user's operation instruction so that the back-end server decrypts and verifies the encrypted data, the method further includes: When the verification result indicates that the input data verification fails, the input data in the input box is cleared.
7. A cross-platform and cross-frame password protection device, characterized in that: include: An initialization unit, used to initialize the password control; A random string unit, used to call a random string from a backend server when the password control is called in the user interface; A generating unit, used for generating an input box according to the random string; A monitoring unit, used for obtaining input data in the input box; an encryption unit, configured to encrypt the input data and the random string to obtain encrypted data, and display the encrypted data in an encrypted form on the user interface; A storage unit, used for storing the encrypted data into the internal state of the password control; The verification unit is used to send the encrypted data to the back-end server according to the user's operation instruction, so that the back-end server can decrypt and verify the encrypted data.
8. The password protection device according to claim 7, characterized in that: The generating unit is specifically used for: Define a div element, and combine the div element with the random string to construct an input box; Mount cursor events on the input box.
9. A cross-platform and cross-frame password protection device, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the cross-platform and cross-framework password protection method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the cross-platform and cross-frame password protection method according to any one of claims 1 to 6.