CN114003134A - Method and device for constructing hidden replacement display input box, electronic equipment and medium - Google Patents

Method and device for constructing hidden replacement display input box, electronic equipment and medium Download PDF

Info

Publication number
CN114003134A
CN114003134A CN202111276371.9A CN202111276371A CN114003134A CN 114003134 A CN114003134 A CN 114003134A CN 202111276371 A CN202111276371 A CN 202111276371A CN 114003134 A CN114003134 A CN 114003134A
Authority
CN
China
Prior art keywords
characters
character string
layer
hidden
character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111276371.9A
Other languages
Chinese (zh)
Inventor
王子微
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202111276371.9A priority Critical patent/CN114003134A/en
Publication of CN114003134A publication Critical patent/CN114003134A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0489Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using dedicated keyboard keys or combinations thereof
    • G06F3/04895Guidance during keyboard input operation, e.g. prompting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application provides a construction method, a construction device, electronic equipment and a medium for a hidden replacement display input frame, wherein the method comprises the following steps: constructing a first layer and a second layer; receiving a character string input by a user based on the second image layer; the character string comprises M characters, wherein the types of the M characters at least comprise two types of common characters, capital letter characters and special characters; displaying the character string after processing the input character string on the first layer; the processed character string comprises N characters which are hidden and displayed instead and M-N characters which are normally displayed; the number and type of characters normally displayed are confirmed according to the hidden alternative display rule.

Description

Method and device for constructing hidden replacement display input box, electronic equipment and medium
Technical Field
The present disclosure relates to the field of string encryption, and in particular, to a method and an apparatus for constructing a hidden replacement display input box, an electronic device, and a medium.
Background
With the development of electronic technology and communication technology, the wireless mobile communication industry has developed rapidly, and mobile terminals have become necessary for people to work and live in daily life. People usually install various application clients in mobile terminals, some of the application clients related to personal privacy and security need to verify identity for use, and verifying a password input by a user is a common verification method. In the prior art, the most common password input mode is simple key input through a plurality of preset number and letter keys, and password verification is performed by comparing input information with preset password data.
The intelligent mobile terminal, the input of information is carried out to the virtual button that most used touch-sensitive screen to show, and the user probably is peeped by the people next door when inputing the password, causes the password to reveal, perhaps malicious screen capture software is through the display screen of screen when intercepting user input password again to acquire user's input button and button order, and then acquire user's password, cause user's input password security to obtain not to obtain the assurance, cause individual privacy to reveal. Therefore, when a user enters a character such as a password or a user name in an input box, the system often masks the character entered by the user with a special symbol (e.g., a "+" character). Through the mode, the characters input by the user can be prevented from being peeped by others to a certain extent, and the safety is ensured.
However, the password mask is a full mask, and there are many inconveniences if the password mask is used for inputting an account number, such as a user wants to display the account number of the first 3 digits or the last 4 digits to confirm whether the input is correct. Therefore, how to solve the problem that technicians focus on how to determine whether an account input by a user is wrong based on displayed characters under the condition that the account is guaranteed not to be divulged is a problem that technicians pay more attention to.
Disclosure of Invention
The embodiment of the application provides a construction method, a construction device, electronic equipment and a construction medium for hiding a replacement display input box, and solves the problem that in the process of inputting a character string, a user cannot know whether the character is input by mistake or not because characters in the character string are prevented from being leaked and the character string is completely hidden, so that the user can input the character string for many times and further consumes the time of the user.
In a first aspect, an embodiment of the present application provides a method for constructing a hidden replacement display input box, including: constructing a first layer and a second layer; receiving a character string input by a user based on the second image layer; the character string comprises M characters, and the types of the M characters at least comprise two types of common characters, capital letter characters and special characters; displaying the character string after the input character string is processed on the first layer; wherein the processed character string comprises N characters which are hidden and displayed instead and M-N characters which are normally displayed; the number and type of characters normally displayed are confirmed according to the hidden alternative display rule.
According to the embodiment, after the user inputs the character string, the character string displayed in the character string display frame (the first layer) is the character string which is partially encrypted and hidden through the hidden replacement display rule, namely, the user can see partial characters in the character string.
In a possible implementation manner, after receiving the character string input by the user based on the second layer, the method includes: synchronously displaying hidden and replaced characters on the first layer according to the character string input by the user; judging whether the time for not receiving the newly added characters in the second image layer is greater than or equal to a first time threshold value or not; if yes, the character string is processed.
In the above embodiment, whether the user completes inputting the character string is determined by determining the time length of the second layer for not receiving the newly added character, so that the character string input by the user can be partially replaced and encrypted according to the preset hidden replacement display rule.
In a possible implementation manner, constructing the first layer and the second layer includes: creating a main image layer in a webpage by using a first Div label, wherein the main image layer is a partition used for executing a login/registration function in the webpage; creating a first layer in the main graph layer by using a second Div label, wherein the first layer is a partition for displaying an encrypted character string; and constructing and loading an input function on the main image layer to obtain a second image layer. Therefore, the character strings of the receiving user on the second layer can be covered by the processed character strings displayed on the first layer, and therefore the replacement and hiding of partial characters in the character strings on a webpage interface are achieved.
In a possible implementation manner, before receiving the character string input by the user based on the second layer, the method further includes: moving the position of the first layer through the cascading style sheet to enable the first layer to cover the second layer; and setting a PointerEvents attribute on the second image layer, so that the mouse click event can be transmitted to the second image layer. Therefore, the character strings of the receiving user on the second layer can be covered by the processed character strings displayed on the first layer, and therefore the replacement and hiding of partial characters in the character strings on a webpage interface are achieved.
In one possible implementation, processing a string of characters includes: determining the number N of hidden replaced characters in the character string according to a formula N [ (L1/M) × L1+ (L2/M) × L2+ (L3/M) × L3 ]; carrying out hidden replacement on N characters in the character string according to a hidden replacement display rule; wherein M is the number of characters in the character string, L1 is the number of common characters in the character string, L2 is the number of capital letter characters in the character string, and L3 is the number of special characters in the character string.
In the embodiment, the number of the encrypted replacement characters in the characters is determined based on the length of the character string and the character composition in the character string, and the number of the encrypted replacement characters calculated in the manner ensures that the character string after encrypted replacement cannot be cracked due to peeping by others, so that the character string is leaked, and simultaneously ensures that a user can judge whether the user wrongly transmits the character string with the characters (normally displayed characters) which are not encrypted and replaced in the character string after encrypted replacement.
In a possible implementation manner, performing hidden replacement on N characters in the character string according to the hidden replacement display rule includes: judging whether the character string has common characters or not; in the case of the presence of a normal character, detecting whether L1 is greater than or equal to N; if the detection result is yes, carrying out hidden replacement on any N common characters in the character string; if not, determining whether the character string has capital letter characters; if an uppercase alphabetic character is present, analyzing (L1+ L2) whether it is greater than or equal to N; if the analysis shows that the characters are hidden and replaced, carrying out hidden replacement on L1 common characters and any N-L1 capital letter characters; if the analysis is no, carrying out hidden replacement on all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string; if the capital letter characters do not exist, all the common characters and any N-L1 special characters in the character string are hidden and replaced; under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string; if an uppercase letter character is present, determining whether the L2 is greater than or equal to N; determining that any N capital letter characters in the character string are hidden and replaced; if not, carrying out hidden replacement on all capital letters in the character string and any N-L2 special characters in the character string; if no capital letters exist, hiding and replacing any N characters in the character string.
In the above embodiment, after the number of the characters to be replaced by encryption is determined, encryption replacement is performed on part of the characters in the character string according to the sequence of the characters which are not easy to be mistaken (common characters), the characters which are easy to be mistaken (capital letters), and the characters which are especially easy to be mistaken (special characters), so that the character string after being replaced by encryption is ensured not to be cracked due to peeping by others, and the character string is leaked, and meanwhile, the user is also ensured to be capable of judging whether the user wrongly inputs the character string with the characters which are not replaced by encryption (normally displayed characters) in the character string after being replaced by encryption, thereby reducing the times of repeatedly inputting the character string by the user, and improving the user experience.
In one possible implementation manner, the processing the character string further includes: judging whether common characters exist in the character string or not; detecting whether M1 is greater than or equal to 3M/4 in the case of the existence of the common characters, wherein M is the character string character number, and M1 is the number of the common characters in the character string; if yes, calculating the number N of characters hidden and replaced according to a formula N ═ M1/2, and carrying out hidden replacement on any N common characters in the character string; if not, determining whether capital letters exist in the character string; if the capital letter characters exist, analyzing whether (M1+ M2) is larger than or equal to 3M/4, wherein M2 is the number of the capital letter characters; if the analysis shows that the characters are hidden and replaced, calculating the number N of the characters hidden and replaced according to the formula N which is M1+ [ M2/2], and carrying out hidden and replacement on M1 common characters and any [ M2/2] capital letter characters; if the analysis is no, calculating the number N of characters hidden and replaced according to the formula N, wherein the formula is M1+ M2+ [ (M-M1-M2)/2], and carrying out hidden and replacement on all common characters, all capital letters and any [ (M-M1-M2)/2] special characters in the character string; if no capital letter character exists, calculating the number N of hidden and replaced characters according to a formula N-M1 + [ (M-M1)/2], and carrying out hidden and replacement on all common characters and any [ (M-M1)/2] special characters in the character string; under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string; if an uppercase alphabetic character is present, determining whether the M2 is greater than or equal to 3M/4; determining that the number N of characters of hidden replacement is calculated according to the formula N ═ M2/2, and carrying out hidden replacement on any N upper-case alphabetic characters in the character string; if the result is negative, all capital letters in the character string and any N-M2 special characters in the character string are encrypted according to the formula N-M2 + [ (M-M2)/2 ]; and if the capital letters do not exist, calculating the character number N of hidden replacement according to a formula N ═ M/2, and carrying out hidden replacement on any N special characters in the character string.
In the embodiment, the number of the characters to be encrypted and replaced is determined according to the number of various types of characters in the character string and the replacement rule of the number of the characters to be encrypted and replaced, then, partial characters in the character string are encrypted and replaced according to the sequence of the characters (common characters) which are not easy to be wrongly input, the characters (capital letters) which are easy to be wrongly input and the characters (special characters) which are particularly easy to be wrongly input, and the user is ensured to judge whether the character string is wrongly input or not by the user and the characters (normally displayed characters) which are not encrypted and replaced in the character string which is encrypted and replaced (normally displayed) while the character string which is encrypted and replaced is not cracked by others is ensured not to be peeped and is leaked, so that the times of repeatedly inputting the character string by the user is reduced, and the user experience is improved.
In a second aspect, an embodiment of the present application provides a building apparatus for hiding a replacement display input box, where the apparatus includes:
the layer construction module is used for constructing a first layer and a second layer;
the character string receiving module is used for receiving a character string input by a user based on the second image layer;
and the first display module is used for displaying the character string after the character string input by the user is processed on the first layer.
In one possible implementation manner, the constructing means for hiding the alternative display input box further includes: second display module, first judgement module, character string processing module, wherein:
the second display module is used for synchronously displaying the hidden and replaced characters on the first layer;
the first judging module is used for judging whether the time for not receiving the newly added characters in the second image layer is greater than or equal to a first time threshold value or not;
and the character string processing module is used for processing the character string under the condition that the first judging module judges that the character string is positive.
In a possible implementation manner, when the layer module is used to construct a first layer and a second layer, the layer module is configured to:
the method comprises the steps that a first Div label is used for creating a main layer in a webpage, wherein the main layer is a partition used for executing a login/registration function in the webpage;
creating a first layer in the main graph layer by using a second Div label, wherein the first layer is a partition for displaying an encrypted character string;
and constructing and loading an input function on the main layer to obtain the second layer.
In one possible implementation manner, the constructing means for hiding the alternative display input box further includes: layer position adjustment module, click the event setting module, wherein:
the layer position adjusting module is used for moving the position of the first layer through a cascading style sheet so that the first layer covers the second layer;
and the click event setting module is used for setting PointerEvents attribute on the second image layer so that the mouse click event can be transmitted to the second image layer.
In one possible implementation manner, the processing of the character string by the character string processing module includes:
determining the number N of hidden replaced characters in the character string according to a formula N [ (L1/M) × L1+ (L2/M) × L2+ (L3/M) × L3 ];
and carrying out hidden replacement on the N characters in the character string according to the hidden replacement display rule.
In a possible implementation manner, the hidden replacement of N characters in the character string by the character string processing module according to the hidden replacement display rule specifically includes:
judging whether common characters exist in the character string or not;
in the case of the presence of a normal character, detecting whether the L1 is greater than or equal to the N;
if the detection result is yes, carrying out hidden replacement on any N common characters in the character string;
if not, determining whether capital letters exist in the character string;
if an uppercase alphabetic character is present, analyzing (L1+ L2) whether it is greater than or equal to N;
if the analysis shows that the characters are hidden and replaced, carrying out hidden replacement on L1 common characters and any N-L1 capital letter characters;
if the analysis is negative, all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string are hidden and replaced;
if the capital letter characters do not exist, hiding and replacing all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string;
under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string;
if an uppercase alphabetic character is present, determining whether the L2 is greater than or equal to N;
determining that any N capital letter characters in the character string are hidden and replaced;
if not, carrying out hidden replacement on all capital letters in the character string and any N-L2 special characters in the character string;
and if the capital letters do not exist, hiding and replacing any N characters in the character string.
In one possible implementation manner, the processing of the character string by the character string processing module includes:
judging whether common characters exist in the character string or not;
detecting whether M1 is greater than or equal to 3M/4 in the case of the existence of the common characters, wherein M is the character string character number, and M1 is the number of the common characters in the character string;
if yes, calculating the number N of characters hidden and replaced according to a formula N ═ M1/2, and carrying out hidden replacement on any N common characters in the character string;
if not, determining whether capital letters exist in the character string;
if the capital letter characters exist, analyzing whether (M1+ M2) is larger than or equal to 3M/4, wherein M2 is the number of the capital letter characters;
if the analysis shows that the characters are hidden and replaced, calculating the number N of the characters hidden and replaced according to the formula N which is M1+ [ M2/2], and carrying out hidden and replacement on M1 common characters and any [ M2/2] capital letter characters;
if the analysis is no, calculating the number N of characters hidden and replaced according to the formula N, wherein the formula is M1+ M2+ [ (M-M1-M2)/2], and carrying out hidden and replacement on all common characters, all capital letters and any [ (M-M1-M2)/2] special characters in the character string;
if no capital letter character exists, calculating the number N of hidden and replaced characters according to a formula N-M1 + [ (M-M1)/2], and carrying out hidden and replacement on all common characters and any [ (M-M1)/2] special characters in the character string;
under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string;
if an uppercase alphabetic character is present, determining whether the M2 is greater than or equal to 3M/4;
determining that the number N of characters of hidden replacement is calculated according to the formula N ═ M2/2, and carrying out hidden replacement on any N upper-case alphabetic characters in the character string;
if the result is negative, all capital letters in the character string and any N-M2 special characters in the character string are encrypted according to the formula N-M2 + [ (M-M2)/2 ];
and if the capital letters do not exist, calculating the character number N of hidden replacement according to a formula N ═ M/2, and carrying out hidden replacement on any N special characters in the character string.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors and memory; the memory coupled with the one or more processors, the memory for storing computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the steps of: constructing a first layer and a second layer; receiving a character string input by a user based on the second image layer; the character string comprises M characters, and the types of the M characters at least comprise two types of common characters, capital letter characters and special characters; displaying the character string after the input character string is processed on the first layer; wherein the processed character string comprises N characters hidden and displayed instead and M-N characters normally displayed; the number and type of the normally displayed characters are confirmed according to the hidden alternative display rule.
In one possible implementation manner, after receiving the character string input by the user based on the second image layer, the processor is configured to: synchronously displaying hidden and replaced characters on the first layer according to the character string input by the user; judging whether the time for not receiving the newly added characters in the second image layer is greater than or equal to a first time threshold value or not; if the judgment result is yes, the character string is processed.
In a possible implementation manner, the processor constructs a first layer and a second layer, and is configured to: the method comprises the steps that a first Div label is used for creating a main layer in a webpage, wherein the main layer is a partition used for executing a login/registration function in the webpage; creating a first layer in the main graph layer by using a second Div label, wherein the first layer is a partition for displaying an encrypted character string; and constructing and loading an input function on the main layer to obtain the second layer.
In one possible implementation manner, before the processor receives the character string input by the user, the processor is further configured to: moving the position of the first layer through a cascading style sheet to enable the first layer to cover the second layer; and setting a PointerEvents attribute on the second image layer, so that a mouse click event can be transmitted to the second image layer.
In one possible implementation, the processor processes the string to: determining the number N of hidden replaced characters in the character string according to a formula N [ (L1/M) × L1+ (L2/M) × L2+ (L3/M) × L3 ]; according to the hidden replacement display rule, carrying out hidden replacement on N characters in the character string; wherein, M is the number of characters in the character string, L1 is the number of common characters in the character string, L2 is the number of capital letter characters in the character string, and L3 is the number of special characters in the character string.
In one possible implementation manner, the processor performs hidden replacement on N characters in the character string according to the hidden replacement display rule, and is configured to: judging whether common characters exist in the character string or not; in the case of the presence of a normal character, detecting whether the L1 is greater than or equal to the N; if the detection result is yes, carrying out hidden replacement on any N common characters in the character string; if not, determining whether capital letters exist in the character string; if an uppercase alphabetic character is present, analyzing (L1+ L2) whether it is greater than or equal to N; if the analysis shows that the characters are hidden and replaced, carrying out hidden replacement on L1 common characters and any N-L1 capital letter characters; if the analysis is negative, all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string are hidden and replaced; if the capital letter characters do not exist, hiding and replacing all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string; under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string; if an uppercase alphabetic character is present, determining whether the L2 is greater than or equal to N; determining that any N capital letter characters in the character string are hidden and replaced; if not, carrying out hidden replacement on all capital letters in the character string and any N-L2 special characters in the character string; and if the capital letters do not exist, hiding and replacing any N characters in the character string.
In one possible implementation, the processor processes the string to: judging whether common characters exist in the character string or not; detecting whether M1 is greater than or equal to 3M/4 in the case of the existence of the common characters, wherein M is the character string character number, and M1 is the number of the common characters in the character string; if yes, calculating the number N of characters hidden and replaced according to a formula N ═ M1/2, and carrying out hidden replacement on any N common characters in the character string; if not, determining whether capital letters exist in the character string; if the capital letter characters exist, analyzing whether (M1+ M2) is larger than or equal to 3M/4, wherein M2 is the number of the capital letter characters; if the analysis shows that the characters are hidden and replaced, calculating the number N of the characters hidden and replaced according to the formula N which is M1+ [ M2/2], and carrying out hidden and replacement on M1 common characters and any [ M2/2] capital letter characters; if the analysis is no, calculating the number N of characters hidden and replaced according to the formula N, wherein the formula is M1+ M2+ [ (M-M1-M2)/2], and carrying out hidden and replacement on all common characters, all capital letters and any [ (M-M1-M2)/2] special characters in the character string; if no capital letter character exists, calculating the number N of hidden and replaced characters according to a formula N-M1 + [ (M-M1)/2], and carrying out hidden and replacement on all common characters and any [ (M-M1)/2] special characters in the character string; under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string; if an uppercase alphabetic character is present, determining whether the M2 is greater than or equal to 3M/4; determining that the number N of characters of hidden replacement is calculated according to the formula N ═ M2/2, and carrying out hidden replacement on any N upper-case alphabetic characters in the character string; if the result is negative, all capital letters in the character string and any N-M2 special characters in the character string are encrypted according to the formula N-M2 + [ (M-M2)/2 ]; and if the capital letters do not exist, calculating the character number N of hidden replacement according to a formula N ═ M/2, and carrying out hidden replacement on any N special characters in the character string.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, which includes instructions that, when executed on an electronic device, cause the electronic device to perform a method according to the first aspect or any one of the possible implementation manners of the first aspect.
Drawings
FIG. 1A is a set of exemplary user interface diagrams for password entry when a user logs in to a system according to an embodiment of the present disclosure;
FIG. 1B is a set of exemplary user interface diagrams for password entry during system login provided by an embodiment of the present application;
FIG. 2 is a diagram illustrating an effect of a user on displaying an encryption password string during logging in a system according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of an encrypted input box construction provided by an embodiment of the present application;
FIG. 4 is a schematic diagram of an example of a main pattern layer according to an embodiment of the present disclosure;
fig. 5 is an exemplary diagram of a relationship between a main pattern layer and a first pattern layer and a second pattern layer according to an embodiment of the present application;
fig. 6 is an exemplary effect diagram of a user interface after setting a PointerEvents attribute according to an embodiment of the present application;
fig. 7 is an exemplary effect diagram of displaying a character string in an overlapping area of a first layer and a second layer according to an embodiment of the present application;
fig. 8 is a flowchart of a string processing according to an embodiment of the present application;
FIG. 9 is a flow chart of another string processing provided by embodiments of the present application;
FIG. 10 is a schematic structural diagram of a construction apparatus for hiding an alternative display input box according to the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not necessarily for describing a particular order. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process may comprise a sequence of steps or elements, or may alternatively comprise steps or elements not listed, or may alternatively comprise other steps or elements inherent to such process, method, article, or apparatus.
Only some, but not all, of the material relevant to the present application is shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
As used in this specification, the terms "component," "module," "system," "unit," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a unit may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or a distribution between two or more computers. In addition, these units may execute from various computer readable media having various data structures stored thereon. The units may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., from a second unit of data interacting with another unit in a local system, distributed system, and/or across a network.
The account login is the first ring of the management system and is the necessary way to use the management system. The existing account system usually uses private information such as a mobile phone number, and when the private information is input, people nearby have a risk of reading the private information. One type of < input > element is called "password," which allows the user to more securely enter a password. This element is presented as a line of plain text editor controls, where the text is obscured from reading, typically by replacing the character entered by the user with a special character such as an "a" or a dot "·", which will be specifically displayed depending on the user's browser and operating system.
However, the password is covered completely, and if the user carelessly inputs wrong characters in the process of inputting the password, the user cannot correct the wrong characters in time due to the fact that the password is covered by special characters, and the user needs to input the password again. Fig. 1A is an exemplary interface of a user login personnel system according to an embodiment of the present application, and as shown in fig. 1A, the login interface includes a user name input box and a password input box, and the user name input box displays characters input by the user without performing character replacement on the input characters. The password input box replaces the input characters, displays 'x', and if the correct password is 1234@67, the user inputs wrong characters due to factors such as undersize of a keyboard and the like in the process of inputting the password, the password input by the user is 1234%, the characters displayed on the electronic equipment are 'x' and the user cannot judge whether the input characters are accurate. When the electronic device 100 detects a click operation of the user on the "ok" control, in response to the operation, the electronic device compares password characters input by the user with correct password characters stored in the system, and if the comparison is inconsistent, the electronic device 100 displays a prompt message "password error, please re-input" as shown in fig. 1B.
Therefore, the user can log in the system only by inputting the user name or the password for many times, the time for logging in the user is greatly consumed, and poor user experience is brought to the user.
In order to solve the above problem, an embodiment of the present application provides a method for constructing a hidden replacement display input box, where according to a length of a character string input by a user in the input box and a complexity of an input character, a character string input by the user in the input box is selectively hidden and replaced, that is: only a part of the characters in the character string is replaced with a preset character (for example, all the characters to be replaced are displayed with "+"). Therefore, the readability of the character string is improved while the character string input by the user is prevented from being leaked, the character which is easy to be wrongly input can be corrected in time in the process of inputting the character string by the user, and the times of inputting the password by the user can be reduced in scenes such as logging in a system by the user.
Illustratively, as shown in fig. 2, when the password string input by the user in the password input box is 12 &% 90@, and the string displayed in the password input box is "× &% × @", the password input box hides the numeric characters with "×", and displays only the special characters (&,%, @). The system classifies input characters, and analysis is carried out based on big data, so that when a user inputs characters, the input error rate of special characters is higher than that of digital characters. Therefore, the characters with lower input error rate in the character string are covered, the characters with higher error rate are displayed, the password input by the user is prevented from being read by others, the safety is guaranteed, and meanwhile, the user is also guaranteed to check whether the input password is correct or not in time, so that the input times of the password are reduced, and the user experience is improved.
Next, a specific flow of the encrypted input box construction will be described with reference to fig. 3. Fig. 3 is a flowchart of an encryption input box construction provided in an embodiment of the present application, and the specific flow is as follows:
step S301: and constructing a first layer and a second layer.
Specifically, in a possible implementation manner, before a first layer and a second layer are constructed, an Htlm file is created, and a main layer is constructed in the Htlm file. The html is used as a hypertext markup language, and can be used for creating a web page, when a user creates the web page using the html, the web page needs to be partitioned, and the partitions are used for setting various functions of the web page, including but not limited to: login/registration function, information display function. The information display function is used for displaying the text information of the webpage, and the login/registration function is used for receiving the character string input by the user and carrying out personalized hidden replacement on the input character string according to the length of the input character string and the complexity of the input character. The webpage can be blocked through the first Div tag, so that a main layer is created, and the visual representation form of the main layer on the webpage is a partition which is similar to the function of login/registration and the like, and the partition is used for receiving a character string input by a user and individually covering characters in the character string according to the length of the character string and the complexity of the character composition. Fig. 4 is an exemplary diagram of a main pattern layer according to an embodiment of the present disclosure. Illustratively, the main graphics layer may be the main graphics layer of the login interface, as shown in fig. 4, in which the area where the user logs in/registers.
After the main pattern layer is constructed, a first pattern layer and a second pattern layer need to be established in the pattern layers. The first layer is a character string display frame and is used for displaying a character string after hidden replacement of a character string input by a user; the second layer is a character string input box and is used for receiving character strings input by a user. The specific implementation mode is as follows: the method comprises the steps that a first layer is built in a main graph layer by using a second Div label, the first layer is located in a partition corresponding to the main graph layer and used for displaying a character string after hidden replacement of the character string Input by a user, an Input function is built in the main graph layer, and after the Input function is built, a second layer can be automatically built in the main graph layer. The Input function is used for receiving a character string Input by a user and displaying the character string Input by the user in a character string Input box (a second layer).
Next, referring to fig. 5, an exemplary description is given of a relationship between the main layer, the first layer, and the second layer. As shown in fig. 5, the display frame 101 is a partition corresponding to the main layer created by using the first Div tag, and the partition includes a first display area 102, a second display area 103, a third display area 104, and a fourth display area 105. The layers corresponding to the first display area 101 and the second display area 102 are layers constructed in a main layer by using Div tags, the third display area is a partition corresponding to the first layer constructed by using the second Div tags, the layers are used for displaying encrypted character strings, the fourth display area 105 is a character string input box created by an input function, and the input box is used for displaying character strings of user accounts input by users. When the user inputs the character string, the character string is displayed in the character string input box, and as shown in fig. 5, when the user inputs the character string "1234 ming", the character string input box (second layer) displays "1234 ming".
In a possible implementation manner, after the first layer and the second layer are built, the position of the first layer is changed through a cascading style sheet, so that the first layer can be covered above the second layer. Specifically, a Cascading Style Sheets (CSS) is a computer language used for representing file styles such as HTML, and can change the positions of layers, perform pixel-level precise control on the layout of element positions in a web page, and have the capability of editing web page objects and model styles. Since the positions of the first layer and the character string input box corresponding to the input function are not consistent, for example, the positions of the third display area 104 and the fourth display area 105 are different as shown in fig. 5, it is necessary to change the position of the first layer using the cascading style sheet so that the first layer can be overlaid on the character string input box. In this way, the characters displayed on the first layer can be enabled to cover the characters displayed on the character string input box, so that the characters after replacement can be displayed on the webpage through the first layer.
In a possible implementation mode, after a first layer and a second layer are built, a PoInterEvents attribute is set for a character string input box through a cascading style sheet, so that a mouse click event can be transmitted to the second layer. Specifically, by setting the PointerEvents attribute to the character string Input box by using the cascading style sheet, when the user clicks the character string Input box (second layer) by using a mouse or other methods, the Input function is started, the character string Input by the user can be received, and the character string can be displayed on the character string Input box (second layer).
Illustratively, as shown in fig. 6, after the PointerEvents attribute is set to the character string Input box 601, after the character string Input box 601 is mouse-clicked, a cursor 602 is displayed in the character string Input box 601, at which time, the Input function is started and the character string Input by the user can be received.
In one possible implementation manner, after the first layer and the second layer are constructed, the text color and the cursor color of the second layer are adjusted through the cascading style sheet. Specifically, after the Input function detects that the user inputs the character string in the character string Input box, the color of the character in the character string Input box needs to be set to be fully transparent through the cascading style sheet, so that the character string in the first layer does not visually generate a ghost image after covering the color of the character string in the character string Input box. For example, as shown in fig. 7, the character string input in the character string input box is "1234 ming", the character string in the partition corresponding to the first layer is "1234 ming", and after the partition corresponding to the first layer is overlaid on the character string input box using the cascading style sheet, a ghost phenomenon occurs in the overlaid area. Therefore, after the character color in the character string input box is set to be fully transparent, the problem that the ghost of the content displayed by the character string in the character string input box and the corresponding subarea of the first layer can be effectively reduced.
Since the PointerEvents attribute is set for the character string input box, when the user clicks the overlapping area of the character string input box and the first layer using a mouse, a cursor is generated in the overlapping area. Because the color of the character string in the character string input box is set to be fully transparent, and the cursor in the character string input box also belongs to the character, the generated cursor is also fully transparent, so that after the user clicks the overlapping area through a mouse, the user cannot see the cursor to flash, and cannot judge whether the current overlapping area is in a state capable of inputting the character string through the cursor. In order to solve the problems, after the character color of the character string input box is set to be fully transparent through the cascading style sheet, the color of the cursor is adjusted through the cascading style sheet, so that the color of the cursor is visible visually. The character string double image problem in the overlapping area is solved by using the cascading style sheet to input the text color and the cursor color of the character string input box under the condition of not influencing the normal display of the cursor.
Step S302: and receiving a character string input by a user based on the second image layer.
Specifically, a variable InputValue is newly created, the variable InputValue is used for storing characters Input by a user, and an Input function receives a character string Input by the user and stores the character string into the InputValue.
Step S303: and displaying the character string after the input character string is processed on the first layer.
Specifically, in a possible implementation manner, after receiving a character string input by a user based on a second layer, determining the number N of characters of a hidden replacement based on a character type composition of the character string and a length M of the character string, and processing the character string according to a hidden replacement display rule. The main method for processing the character string comprises the following steps:
and newly creating a variable ShowValue, wherein the variable ShowValue is used for storing the character subjected to hidden replacement. The functions Onchange _1(InputValue) and Onchange _2(ShowValue), Timer _ char (InputValue) are set. Wherein, Onchange _1(InputValue) is used for monitoring the newly added input characters in the InputValue, Onchange _2(ShowValue) is used for monitoring the newly added characters in the ShowValue, and Timer _ char (InputValue) is used for monitoring the time interval for receiving two characters. When a user inputs a character, the Input function stores the character into the Input value, at this time, Onchange _1(Input value) calls a function exchange (Input value) after detecting that a new character is added to the Input value, the new character is replaced by another character (for example, ""), and then exchange (Input value) stores the replaced character into the ShowValue. When Onchange _2(ShowValue) detects that there is a new added character in ShowValue, a function div2. htmtext ═ ShowValue is called to display the new added replacement character on the character string display box (first layer). For example, during the process of inputting characters by the user, the exchange (inputvalue) replaces all characters input by the user with "×" and displays the replaced character strings in the character string display box, so that the user sees that the character strings input by the user are in the form of "× … …" during the process of inputting characters by the user. Therefore, in the process of inputting characters by a user, the characters actually input by the user cannot be displayed on the webpage interface, and the problem that information leakage is caused because the user is peeped by others in the process of inputting character strings is solved. In the process of inputting a character string by a user, Timer _ char (InputValue) monitors the time interval of two newly added characters in the InputValue in the whole process, if the time interval is within a set first time threshold, the Timer _ char (InputValue) does not detect that the newly added characters exist in the InputValue, the Timer _ char (InputValue) judges that the character input by the user is finished, and the Timer _ char (InputValue) is called to process the character string stored in the InputValue.
Replace _ char (InputValue) processes the string stored in the InputValue as follows: determining the number M of the characters to be hidden and replaced based on the character type composition of the character string and the length N of the character string, and hiding and replacing M characters in the character string according to a hidden and replaced display rule. Next, with reference to fig. 8, a specific process for processing a character string in the InputValue by Replace _ char (InputValue) is described, where the specific process is as follows:
step S801: and determining the number N of the hidden replaced characters in the character string according to the formula (N) [ (L1/M) × L1+ (L2/M) × L2+ (L3/M) × L3 ].
Where M is the number of characters in the character string, L1 is the number of common characters in the character string, L2 is the number of capital letters in the character string, and L3 is the number of special characters in the character string. The normal characters are numeric characters and lower case alphabetic characters, and the special characters are characters other than the normal characters and upper case alphabetic characters, [ ] indicating an upward rounding function.
Step S802: and judging whether the common characters exist in the character string. If it is determined that the information exists, step S803 is executed, and if it is determined that the information does not exist, step S810 is executed.
Step S803: detecting whether the L1 is greater than or equal to the N. If the detection is yes, step S809 is executed, and if the detection is no, step S804 is executed.
Step S804: it is determined whether an uppercase alphabetic character exists in the character string. If yes, go to step S805, otherwise go to step S808.
Step S805: it is analyzed whether (L1+ L2) is greater than or equal to N. If the analysis is yes, step S806 is executed, and if the analysis is no, step S807 is executed.
Step S806: hidden replacement is carried out on L1 common characters and any N-L1 capital letter characters.
Step S807: and carrying out hidden replacement on all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string.
Step S808: and carrying out hidden replacement on all common characters in the character string and any N-L1 special characters.
Step S809: and carrying out hidden replacement on any N common characters in the character string.
Step S810: detecting whether the character string has capital letter characters. If yes, go to step S811, and if not, go to step S814.
Step S811: determining whether the L2 is greater than or equal to N. If yes, step S812 is executed, and if no, step S813 is executed.
Step S812: and carrying out hidden replacement on any N upper-case letter characters in the character string.
Step S813: and carrying out hidden replacement on all capital letter characters in the character string and any N-L2 special characters in the character string.
Step S814: and carrying out hidden replacement on any N characters in the character string.
In one possible implementation, Replace _ char (InputValue) may employ another method to process the string stored in the InputValue. Next, with reference to fig. 9, a specific process for processing a character string in the InputValue by Replace _ char (InputValue) is described, where the specific process is as follows:
step S901: and judging whether the common characters exist in the character string. If yes, step S902 is executed, and if not, step S909 is executed.
Step S902: it is determined whether M1 is greater than or equal to 3M/4. If yes, step S908 is executed, and if no, step S903 is executed. Wherein, M1 is the number of common characters in the character string, and M is the number of characters in the character string.
Step S903: it is determined whether an upper case letter character exists in the character string. If yes, go to step S904, otherwise go to step S907.
Step S904: it is analyzed whether (M1+ M2) is greater than or equal to 3M/4. If the analysis is yes, step S905 is executed, and if the analysis is no, step S906 is executed. Where M2 is the number of capital letters in the string.
Step S905: the number of characters of hidden replacement is calculated according to the formula of N, M1+ [ (M2)/2], and M1 common characters and arbitrary [ M2/2] capital letter characters are hidden replaced. Where [ ] is an upward rounding function.
Step S906: and calculating the number of characters of hidden replacement according to the formula N-M1 + M2+ [ (M-M1-M2)/2], and carrying out hidden replacement on all common characters, all capital letters and any [ (M-M1-M2)/2] special characters in the character string. Where [ ] is an upward rounding function.
Step S907: and calculating the number of characters of hidden replacement according to the formula of N-M1 + [ (M-M1)/2], and carrying out hidden replacement on all common characters and any [ (M-M1)/2] special characters in the character string. Where [ ] is an upward rounding function.
Step S908: and calculating the number of characters of hidden replacement according to the formula N ═ M1/2, and carrying out hidden replacement on any N common characters in the character string.
Step S909: detecting whether the character string has capital letter characters. If yes, go to step S910, otherwise go to step S912.
Step S910: it is determined whether M2 is greater than or equal to 3M/4. If yes, step S911 is executed, and if no, step S913 is executed.
Step S911: and calculating the number N of characters of hidden replacement according to the formula N ═ M2/2, and carrying out hidden replacement on any N upper-case alphabetical characters in the character string. Where [ ] is an upward rounding function.
Step S912: and calculating the number N of characters of hidden replacement according to a formula N ═ M/2, and carrying out hidden replacement on any N special characters in the character string. Where [ ] is an upward rounding function.
Step S913: all capital letters in the string shown, as well as any N-M2 special characters in the string, are encrypted according to the formula N-M2 + [ (M-M2)/2 ]. Where [ ] is an upward rounding function.
Displaying the processed character string on a first layer, wherein the method comprises the following steps: after the user finishes inputting the character string, Replace _ char (inputvalue) will clear the character string stored in the ShowValue and store the processed character string in the ShowValue. The processed character string comprises characters which are replaced according to the hidden replacement display rule and also comprises characters which are not replaced. For example, the character string input by the user is "123 Al @% pk", in which the characters to be hidden-replaced based on the hidden-replacement display rule are "1", "2", "3", "l", "p", "k", and all six characters are replaced by "@", and in which the characters not to be replaced are "a", "@", "%"; therefore, the processed character string stored in ShowValue is in the form "@%". Then, the processed character string is displayed on the first layer by calling the function div2.htmltext ═ ShowValue.
In some embodiments, a third layer may be newly created in the first layer using a third Div tag, where the third layer is a string transformation icon. When the electronic device detects an input operation (e.g., a single click) for the string conversion icon and the string displayed on the second layer is a processed string, the function div2. htmtext ═ InputValue is called to display the original string in the InputValue variable on the first layer. When the electronic device detects an input operation (e.g., a single click) for the string conversion icon and the string displayed on the second layer is an unprocessed string, a call function div2.htmltext ═ ShowValue is called to display the processed string in the ShowValue variable on the first layer.
According to the embodiment of the application, the number of the characters to be hidden and replaced in the character string is determined based on the length of the character string and the character type in the character string, then, partial characters in the character string are hidden and replaced according to the preset character hiding and replacing rule, the problem that a password is leaked due to the fact that the characters are normally displayed when a user inputs the password and the like and are peeped by other people is solved, and meanwhile, the problems that the characters in the character string are prevented from being leaked, the character string is completely hidden, the user cannot know whether the characters are mistakenly input or not, the character string is input for many times by the user, and further the time of the user is consumed are solved.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a construction apparatus for hiding an alternative display input box according to the present application. It should be noted that, the constructing apparatus for hiding the alternative display input box shown in fig. 10 is used for executing the method of the embodiment shown in fig. 3, fig. 8 and fig. 9 of the present application, for convenience of description, only the portion related to the embodiment of the present application is shown, and details of the specific technology are not disclosed, and reference is made to the embodiment shown in fig. 3, fig. 8 and fig. 9 of the present application. The constructing apparatus 1000 for hiding the alternative display input box may include: the display device comprises a layer construction module 1001, a character string receiving module 1002 and a first display module 1003. Wherein:
the layer construction module 1001 is configured to construct a first layer and a second layer;
a character string receiving module 1002, configured to receive a character string input by a user based on the second layer;
a first display module 1003, configured to display, on the first layer, a character string obtained after processing the character string input by the user.
In one possible implementation manner, the constructing apparatus 1000 for hiding the alternative display input box further includes: second display module, first judgement module, character string processing module, wherein:
the second display module is used for synchronously displaying the hidden and replaced characters on the first layer;
the first judging module is used for judging whether the time for not receiving the newly added characters in the second image layer is greater than or equal to a first time threshold value or not;
and the character string processing module is used for processing the character string under the condition that the first judging module judges that the character string is positive.
In a possible implementation manner, when the layer module 1001 is used to construct a first layer and a second layer, it is specifically configured to:
the method comprises the steps that a first Div label is used for creating a main layer in a webpage, wherein the main layer is a partition used for executing a login/registration function in the webpage;
creating a first layer in the main graph layer by using a second Div label, wherein the first layer is a partition for displaying an encrypted character string;
and constructing and loading an input function on the main layer to obtain the second layer.
In one possible implementation manner, the constructing apparatus 1000 for hiding the alternative display input box further includes: layer position adjustment module, click the event setting module, wherein:
the layer position adjusting module is used for moving the position of the first layer through a cascading style sheet so that the first layer covers the second layer;
and the click event setting module is used for setting PointerEvents attribute on the second image layer so that the mouse click event can be transmitted to the second image layer.
In one possible implementation manner, the processing of the character string by the character string processing module includes:
determining the number N of hidden replaced characters in the character string according to a formula N [ (L1/M) × L1+ (L2/M) × L2+ (L3/M) × L3 ];
and carrying out hidden replacement on the N characters in the character string according to the hidden replacement display rule.
In a possible implementation manner, the hidden replacement of N characters in the character string by the character string processing module according to the hidden replacement display rule includes:
judging whether common characters exist in the character string or not;
in the case of the presence of a normal character, detecting whether the L1 is greater than or equal to the N;
if the detection result is yes, carrying out hidden replacement on any N common characters in the character string;
if not, determining whether capital letters exist in the character string;
if an uppercase alphabetic character is present, analyzing (L1+ L2) whether it is greater than or equal to N;
if the analysis shows that the characters are hidden and replaced, carrying out hidden replacement on L1 common characters and any N-L1 capital letter characters;
if the analysis is negative;
if the capital letter characters do not exist, hiding and replacing all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string;
under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string;
if an uppercase alphabetic character is present, determining whether the L2 is greater than or equal to N;
determining that any N capital letter characters in the character string are hidden and replaced;
if not, carrying out hidden replacement on all capital letters in the character string and any N-L2 special characters in the character string;
and if the capital letters do not exist, hiding and replacing any N characters in the character string.
In a possible implementation manner, the processing of the character string by the character string processing module specifically includes:
judging whether common characters exist in the character string or not;
detecting whether M1 is greater than or equal to 3M/4 in the case of the existence of the common characters, wherein M is the character string character number, and M1 is the number of the common characters in the character string;
if yes, calculating the number N of characters hidden and replaced according to a formula N ═ M1/2, and carrying out hidden replacement on any N common characters in the character string;
if not, determining whether capital letters exist in the character string;
if the capital letter characters exist, analyzing whether (M1+ M2) is larger than or equal to 3M/4, wherein M2 is the number of the capital letter characters;
if the analysis shows that the characters are hidden and replaced, calculating the number N of the characters hidden and replaced according to the formula N which is M1+ [ M2/2], and carrying out hidden and replacement on M1 common characters and any [ M2/2] capital letter characters;
if the analysis is no, calculating the number N of characters hidden and replaced according to the formula N, wherein the formula is M1+ M2+ [ (M-M1-M2)/2], and carrying out hidden and replacement on all common characters, all capital letters and any [ (M-M1-M2)/2] special characters in the character string;
if no capital letter character exists, calculating the number N of hidden and replaced characters according to a formula N-M1 + [ (M-M1)/2], and carrying out hidden and replacement on all common characters and any [ (M-M1)/2] special characters in the character string;
under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string;
if an uppercase alphabetic character is present, determining whether the M2 is greater than or equal to 3M/4;
determining that the number N of characters of hidden replacement is calculated according to the formula N ═ M2/2, and carrying out hidden replacement on any N upper-case alphabetic characters in the character string;
if the result is negative, all capital letters in the character string and any N-M2 special characters in the character string are encrypted according to the formula N-M2 + [ (M-M2)/2 ];
and if the capital letters do not exist, calculating the character number N of hidden replacement according to a formula N ═ M/2, and carrying out hidden replacement on any N special characters in the character string.
The functional modules in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of software functional module, which is not limited in this application.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 11, the electronic device 1100 includes: at least one processor 1101, a memory 1102. Optionally, the electronic device may further include a network interface 1103, and the processor 1101, the network interface 1103, and the memory 1102 are connected to each other through an internal bus 1104. Data can be interacted among the processor 1101, the memory 1102 and the network interface 1103, the network interface 1103 is controlled by the processor 1101 to transmit and receive messages, the memory 1102 is used for storing a computer program, the computer program comprises program instructions, and the processor 1101 is used for executing the program instructions stored in the memory 1102. Wherein the processor 1101 is configured to call the program instruction to execute the construction method of the hidden alternative display input box.
The memory 1102 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 1102 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a solid-state drive (SSD), etc.; the memory 1102 may also comprise a combination of memories of the kind described above.
The processor 1101 may be a Central Processing Unit (CPU). In one embodiment, the processor 1101 may also be a Graphics Processing Unit (GPU). The processor 1101 may also be a combination of a CPU and a GPU.
In one possible embodiment, the memory 1102 is used to store program instructions. The processor 1101 may call the program instructions to perform the following steps:
constructing a first layer and a second layer;
receiving a character string input by a user based on the second image layer; the character string comprises M characters, and the types of the M characters at least comprise two types of common characters, capital letter characters and special characters;
displaying the character string after the input character string is processed on the first layer; wherein the processed character string comprises N characters hidden and displayed instead and M-N characters normally displayed; the number and type of the normally displayed characters are confirmed according to the hidden alternative display rule.
In one possible implementation manner, after receiving the character string input by the user based on the second layer, the processor 1101 is configured to:
synchronously displaying hidden and replaced characters on the first layer according to the character string input by the user;
judging whether the time for not receiving the newly added characters in the second image layer is greater than or equal to a first time threshold value or not;
if the judgment result is yes, the character string is processed.
In a possible implementation manner, the processor 1101 constructs a first layer and a second layer, which are specifically configured to:
the method comprises the steps that a first Div label is used for creating a main layer in a webpage, wherein the main layer is a partition used for executing a login/registration function in the webpage;
creating a first layer in the main graph layer by using a second Div label, wherein the first layer is a partition for displaying an encrypted character string;
and constructing and loading an input function on the main layer to obtain the second layer.
In one possible implementation, before the processor 1101 receives the character string input by the user, it is further configured to:
moving the position of the first layer through a cascading style sheet to enable the first layer to cover the second layer;
and setting a PointerEvents attribute on the second image layer, so that a mouse click event can be transmitted to the second image layer.
In a possible implementation manner, the processor 1101 processes the character string, specifically to:
determining the number N of hidden replaced characters in the character string according to a formula N [ (L1/M) × L1+ (L2/M) × L2+ (L3/M) × L3 ];
according to the hidden replacement display rule, carrying out hidden replacement on N characters in the character string;
wherein, M is the number of characters in the character string, L1 is the number of common characters in the character string, L2 is the number of capital letter characters in the character string, and L3 is the number of special characters in the character string.
In a possible implementation manner, the processor 1101 performs hidden replacement on N characters in the character string according to the hidden replacement display rule, specifically to:
judging whether common characters exist in the character string or not;
in the case of the presence of a normal character, detecting whether the L1 is greater than or equal to the N;
if the detection result is yes, carrying out hidden replacement on any N common characters in the character string;
if not, determining whether capital letters exist in the character string;
if an uppercase alphabetic character is present, analyzing (L1+ L2) whether it is greater than or equal to N;
if the analysis shows that the characters are hidden and replaced, carrying out hidden replacement on L1 common characters and any N-L1 capital letter characters;
if the analysis is negative, all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string are hidden and replaced;
if the capital letter characters do not exist, hiding and replacing all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string;
under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string;
if an uppercase alphabetic character is present, determining whether the L2 is greater than or equal to N;
determining that any N capital letter characters in the character string are hidden and replaced;
if not, carrying out hidden replacement on all capital letters in the character string and any N-L2 special characters in the character string;
and if the capital letters do not exist, hiding and replacing any N characters in the character string.
In a possible implementation manner, the processor 1101 processes the character string, specifically to:
judging whether common characters exist in the character string or not;
detecting whether M1 is greater than or equal to 3M/4 in the case of the existence of the common characters, wherein M is the character string character number, and M1 is the number of the common characters in the character string;
if yes, calculating the number N of characters hidden and replaced according to a formula N ═ M1/2, and carrying out hidden replacement on any N common characters in the character string;
if not, determining whether capital letters exist in the character string;
if the capital letter characters exist, analyzing whether (M1+ M2) is larger than or equal to 3M/4, wherein M2 is the number of the capital letter characters;
if the analysis shows that the characters are hidden and replaced, calculating the number N of the characters hidden and replaced according to the formula N which is M1+ [ M2/2], and carrying out hidden and replacement on M1 common characters and any [ M2/2] capital letter characters;
if the analysis is no, calculating the number N of characters hidden and replaced according to the formula N, wherein the formula is M1+ M2+ [ (M-M1-M2)/2], and carrying out hidden and replacement on all common characters, all capital letters and any [ (M-M1-M2)/2] special characters in the character string;
if no capital letter character exists, calculating the number N of hidden and replaced characters according to a formula N-M1 + [ (M-M1)/2], and carrying out hidden and replacement on all common characters and any [ (M-M1)/2] special characters in the character string;
under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string;
if an uppercase alphabetic character is present, determining whether the M2 is greater than or equal to 3M/4;
determining that the number N of characters of hidden replacement is calculated according to the formula N ═ M2/2, and carrying out hidden replacement on any N upper-case alphabetic characters in the character string;
if the result is negative, all capital letters in the character string and any N-M2 special characters in the character string are encrypted according to the formula N-M2 + [ (M-M2)/2 ];
and if the capital letters do not exist, calculating the character number N of hidden replacement according to a formula N ═ M/2, and carrying out hidden replacement on any N special characters in the character string.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions described in accordance with the present application are generated, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk), among others.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.
In short, the above description is only an example of the technical solution of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalents, improvements and the like made in accordance with the disclosure of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A construction method of a hidden alternative display input box is characterized by comprising the following steps:
constructing a first layer and a second layer;
receiving a character string input by a user based on the second image layer; the character string comprises M characters, and the types of the M characters at least comprise two types of common characters, capital letter characters and special characters;
displaying the character string after the input character string is processed on the first layer; wherein the processed character string comprises N characters hidden and displayed instead and M-N characters normally displayed; the number and type of the normally displayed characters are confirmed according to the hidden alternative display rule.
2. The method of claim 1, wherein after receiving the character string input by the user based on the second layer, the method comprises:
synchronously displaying hidden and replaced characters on the first layer according to the character string input by the user;
judging whether the time for not receiving the newly added characters in the second image layer is greater than or equal to a first time threshold value or not;
if the judgment result is yes, the character string is processed.
3. The method of claim 1, wherein constructing the first layer and the second layer comprises:
the method comprises the steps that a first Div label is used for creating a main layer in a webpage, wherein the main layer is a partition used for executing a login/registration function in the webpage;
creating a first layer in the main graph layer by using a second Div label, wherein the first layer is a partition for displaying an encrypted character string;
and constructing and loading an input function on the main layer to obtain the second layer.
4. The method of claim 3, wherein prior to receiving the user-entered character string based on the second layer, further comprising:
moving the position of the first layer through a cascading style sheet to enable the first layer to cover the second layer;
and setting a PointerEvents attribute on the second image layer, so that a mouse click event can be transmitted to the second image layer.
5. The method of claim 2, wherein the processing the string of characters comprises:
determining the number N of hidden replaced characters in the character string according to a formula N [ (L1/M) × L1+ (L2/M) × L2+ (L3/M) × L3 ];
according to the hidden replacement display rule, carrying out hidden replacement on N characters in the character string;
wherein, M is the number of characters in the character string, L1 is the number of common characters in the character string, L2 is the number of capital letter characters in the character string, and L3 is the number of special characters in the character string.
6. The method of claim 5, wherein the hidden replacement of N characters in the character string according to the hidden replacement display rule comprises:
judging whether common characters exist in the character string or not;
in the case of the presence of a normal character, detecting whether the L1 is greater than or equal to the N;
if the detection result is yes, carrying out hidden replacement on any N common characters in the character string;
if not, determining whether capital letters exist in the character string;
if an uppercase alphabetic character is present, analyzing (L1+ L2) whether it is greater than or equal to N;
if the analysis shows that the characters are hidden and replaced, carrying out hidden replacement on L1 common characters and any N-L1 capital letter characters;
if the analysis is negative, all common characters, all capital letter characters and any (N-L1-L2) special characters in the character string are hidden and replaced;
if no capital letter character exists, all common characters and any N-L1 special characters in the character string are hidden and replaced;
under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string;
if an uppercase alphabetic character is present, determining whether the L2 is greater than or equal to N;
determining that any N capital letter characters in the character string are hidden and replaced;
if not, carrying out hidden replacement on all capital letters in the character string and any N-L2 special characters in the character string;
and if the capital letters do not exist, hiding and replacing any N characters in the character string.
7. The method of claim 2, wherein the processing the string of characters further comprises:
judging whether common characters exist in the character string or not;
detecting whether M1 is greater than or equal to 3M/4 in the case of the existence of the common characters, wherein M is the character string character number, and M1 is the number of the common characters in the character string;
if yes, calculating the number N of characters hidden and replaced according to a formula N ═ M1/2, and carrying out hidden replacement on any N common characters in the character string;
if not, determining whether capital letters exist in the character string;
if the capital letter characters exist, analyzing whether (M1+ M2) is larger than or equal to 3M/4, wherein M2 is the number of the capital letter characters;
if the analysis shows that the characters are hidden and replaced, calculating the number N of the characters hidden and replaced according to the formula N which is M1+ [ M2/2], and carrying out hidden and replacement on M1 common characters and any [ M2/2] capital letter characters;
if the analysis is no, calculating the number N of characters hidden and replaced according to the formula N, wherein the formula is M1+ M2+ [ (M-M1-M2)/2], and carrying out hidden and replacement on all common characters, all capital letters and any [ (M-M1-M2)/2] special characters in the character string;
if no capital letter character exists, calculating the number N of hidden and replaced characters according to a formula N-M1 + [ (M-M1)/2], and carrying out hidden and replacement on all common characters and any [ (M-M1)/2] special characters in the character string;
under the condition that no common character exists, detecting whether an upper-case alphabetic character exists in the character string;
if an uppercase alphabetic character is present, determining whether the M2 is greater than or equal to 3M/4;
determining that the number N of characters of hidden replacement is calculated according to the formula N ═ M2/2, and carrying out hidden replacement on any N upper-case alphabetic characters in the character string;
if the result is negative, all capital letters in the character string and any N-M2 special characters in the character string are encrypted according to the formula N-M2 + [ (M-M2)/2 ];
and if the capital letters do not exist, calculating the character number N of hidden replacement according to a formula N ═ M/2, and carrying out hidden replacement on any N special characters in the character string.
8. A construction apparatus for hiding a substitute display input box, comprising:
the layer construction module is used for constructing a first layer and a second layer;
the character string receiving module is used for receiving a character string input by a user based on the second image layer;
and the first display module is used for displaying the character string after the character string input by the user is processed on the first layer.
9. An electronic device comprising a processor and a memory, wherein the memory is configured to store a computer program comprising program instructions, and wherein the processor is configured to invoke the program instructions to perform the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202111276371.9A 2021-10-29 2021-10-29 Method and device for constructing hidden replacement display input box, electronic equipment and medium Pending CN114003134A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111276371.9A CN114003134A (en) 2021-10-29 2021-10-29 Method and device for constructing hidden replacement display input box, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111276371.9A CN114003134A (en) 2021-10-29 2021-10-29 Method and device for constructing hidden replacement display input box, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN114003134A true CN114003134A (en) 2022-02-01

Family

ID=79925589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111276371.9A Pending CN114003134A (en) 2021-10-29 2021-10-29 Method and device for constructing hidden replacement display input box, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114003134A (en)

Similar Documents

Publication Publication Date Title
US9716706B2 (en) Systems and methods for providing a covert password manager
US10552644B2 (en) Method and apparatus for displaying information content
US9038166B2 (en) Method and apparatus for authenticating password of user terminal
US9064104B2 (en) Graphical authentication
JP5723981B2 (en) Method, apparatus and computer program for providing challenge response tests related to computer resources
US20120167204A1 (en) Isolation tool for user assistance in solving a captcha test
KR20140109130A (en) Method and apparatus for configuring password and for releasing lock
US8661532B2 (en) Method and apparatus for authenticating password
US20140380463A1 (en) Password setting and verification
CN104866752B (en) A kind of application guard method and user terminal
US20200089910A1 (en) Message privacy
CN105335633A (en) Mobile terminal anti-peeping method and mobile terminal
EP2492835A1 (en) Data security management systems and methods
CN107092452A (en) A kind of information processing method and device of displaying business completion status
US20200412762A1 (en) Protecting users from phishing attempts
KR102055044B1 (en) Muti-language keyboard system
CN106953845A (en) A kind of guard method and device that sensitive information is inputted to webpage
CN113949560A (en) Network security identification method, device, server and storage medium
JP2012094031A (en) Information input method, information input system, information input device and computer program
EP2966552A1 (en) Apparatus and method for providing feedback on input data
CN114003134A (en) Method and device for constructing hidden replacement display input box, electronic equipment and medium
WO2023103901A1 (en) Application management method and apparatus, and electronic device
US10346606B2 (en) Generation of a captcha on a handheld touch screen device
Revyakina et al. Possibilities of conducting XSS-attacks and the development of countermeasures
CN106933666B (en) Method for calling information input program and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination