Information input method and device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to an information input method and apparatus.
Background
With the development of mobile communication technology, users may often need to enter information on mobile devices. Especially, when information is input on a mobile phone, the size of the mobile phone is limited, the physical keyboard or the virtual keyboard is small, and a user can easily input wrong information, for example, a letter a is input originally but a letter such as s near the letter a is input actually.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, an object of the present invention is to provide an information input method, which can reduce input errors caused by a small keyboard and improve input effects.
Another object of the present application is to provide an information input device.
In order to achieve the above object, an information input method provided in an embodiment of a first aspect of the present application includes: obtaining pre-saved information, wherein the pre-saved information comprises: plaintext first information, or encrypted first information, the first information comprising: the method comprises the steps of setting information and generating associated information according to the set information; receiving information to be verified; verifying the information to be verified according to the pre-stored information; and if the information to be verified belongs to the associated information, receiving the information to be verified which is input again.
The information input method provided by the embodiment of the first aspect of the application can generate not only the set information, but also the associated information obtained according to the set information, and receive the re-input information to be verified when the information to be verified belongs to the associated information, so that the user has a chance of re-verification after an input error caused by a small keyboard and the like, the input error caused by the small keyboard is reduced, and the input effect is improved.
In order to achieve the above object, an embodiment of a second aspect of the present application provides an information input device, including: an obtaining module, configured to obtain pre-stored information, where the pre-stored information includes: plaintext first information, or encrypted first information, the first information comprising: the method comprises the steps of setting information and generating associated information according to the set information; the first receiving module is used for receiving information to be verified; the verification module is used for verifying the information to be verified according to the pre-stored information; and the second receiving module is used for receiving the re-input information to be verified if the information to be verified belongs to the associated information.
The information input device provided by the embodiment of the second aspect of the present application may generate not only the set information, but also the associated information obtained according to the set information, and receive the re-input information to be verified when the information to be verified belongs to the associated information, so that there is a chance of re-verification after an input error caused by a user due to a small keyboard or the like, thereby reducing an input error caused by the small keyboard, and improving an input effect.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of an information input method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of an information input method according to another embodiment of the present application;
FIG. 3 is a schematic flow chart of an information input method according to another embodiment of the present application;
FIG. 4 is a schematic flow chart of an information input method according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of an information input device according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of an information input device according to another embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar modules or modules having the same or similar functionality throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application. On the contrary, the embodiments of the application include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Fig. 1 is a schematic flowchart of an information input method according to an embodiment of the present application, where the method includes:
s11: obtaining pre-saved information, wherein the pre-saved information comprises: plaintext first information, or encrypted first information, the first information comprising: the information of the setting, and the associated information generated according to the information of the setting.
The method of the embodiment can be used for information verification in various scenes, for example, for password verification, identity card number verification, bank card number verification, mobile phone number verification and the like.
Before password authentication, the user may set a password in advance, for example, the set password is x. It is understood that the password x set by the user may include one or more information items, each of which may be a number or a letter, etc.
Further, taking the case that the password is stored at the mobile phone end as an example, the password can be stored in the clear text when being stored at the mobile phone end, for example, directly stored as x. Or, to improve security, the plaintext password is encrypted and stored, for example, the mobile phone stores the encrypted x. It will be appreciated that there are a variety of encryption algorithms, for example, hash algorithms in particular. In this embodiment, the mobile phone side stores the hashed and encrypted password as an example. Let x be denoted as H (x) after being hashed.
In the prior art, the prestored information is at most H (x), and when the user inputs x, the verification fails.
In this embodiment, not only h (x) but also the associated information can be obtained according to x, and the information obtained by performing hash encryption on the associated information is also stored at the mobile phone.
Specifically, referring to fig. 2, the method of this embodiment may further include:
s10: and generating associated information according to the set information.
Optionally, the generating the associated information according to the set information includes:
randomly selecting one information item in the set information, and acquiring a new information item corresponding to the selected information item, wherein the position distance between the new information item and the selected information item on the keyboard is within a preset range;
and replacing the selected information item in the set information with the new information item to obtain the associated information.
For example, if one of the passwords x set by the user is a, corresponding to a, a character which is closer to a on the virtual keyboard or the physical keyboard may be selected as a new character, assuming that the new character is represented by a ', a ' is substituted for a to form a new password x ', which is the associated information of x, and after hash encryption is performed, the encrypted associated information may be represented as: h (x '), H (x "), …, the sequence being denoted as H'. Specifically, if x is abcd, and the character closer to a includes a ', the associated information of x includes a' bcd, and if the character closer to a also includes a ″, the associated information of x further includes: a "bcd," and assuming that the character closer to b includes b', the association information of x further includes: ab' cd, and so on, all the associated information can be obtained.
It is understood that the specific meaning of the close distance may be set according to actual needs, for example, characters corresponding to adjacent keys around may be determined as characters with the close distance, or characters within two keys apart may be determined as characters with the close distance, and the like.
S12: information to be verified is received.
Wherein, the user can input the information to be verified through the keyboard of the keyboard.
For example, the user inputs a password or the like using a virtual keyboard of a cellular phone.
S13: and verifying the information to be verified according to the pre-stored information.
When the mobile phone end directly stores the password of the plaintext, the input information and the pre-stored information can be directly compared, when the input information and the pre-stored information are the same, the verification is passed, otherwise, the verification is not passed.
The embodiment takes the case of storing the encrypted first information as an example.
When the pre-stored information is encrypted first information, the verifying the information to be verified according to the pre-stored information includes:
encrypting the information to be verified by adopting an encryption algorithm the same as that of the first information to obtain the encrypted information to be verified;
and comparing the encrypted information to be verified with the information stored in advance.
Assuming that the information to be verified input by the user is y, and assuming that a hash encryption algorithm is adopted, H (y) may be calculated first, and then H (y) may be compared with H (x) and H'.
S14: and if the information to be verified belongs to the associated information, receiving the information to be verified which is input again.
For example, if H (y) belongs to H', the re-entered information to be verified may be received. After which a further verification can be performed.
Referring to fig. 3, in this embodiment, when the information to be verified belongs to the associated information, the following steps may be specifically performed:
s141: and receiving the information to be verified input again, and guiding or giving an obvious prompt.
Specifically, the guiding or giving an obvious prompt may include:
before receiving information to be verified input again, displaying prompt information to a user, wherein the prompt information is used for prompting the user to pay attention to the keyboard keys; or,
after receiving the re-input information to be verified, prolonging the plaintext display time of the re-input information to be verified; or,
and after receiving the re-input information to be verified, directly displaying the re-input information to be verified in a plaintext form.
For example, when y input by the user belongs to the associated information, which is probably because the key pressing is small, the user can be reminded to pay attention to the keyboard to avoid inputting errors due to the small keyboard. Or,
usually, all information that is finally displayed in the password authentication is non-plaintext, for example, a symbol is displayed, and information input by a user in plaintext is displayed shortly before the symbol is displayed.
In this embodiment, when the plaintext display time is prolonged, the plaintext display time of each item of information in the information to be verified may be prolonged, or only the plaintext display time of the information item input with the error last time may be prolonged. For example, if the information to be verified is abcd, if a is detected to have an error for the first time, only the plaintext display time of a may be extended, or the plaintext display times of a, b, c, and d may be extended. In addition, similar execution can be performed in the plaintext display, such as displaying only the information item input with the error last time in the plaintext, or displaying all the information items in the plaintext.
And then further performing:
s142: a re-authentication is performed.
For example, the user may check the re-input information to be verified according to the prompt information or the information displayed in the plaintext, and after receiving the re-input information to be verified, the mobile phone terminal may compare the re-input information to be verified with the pre-stored information to obtain a verification result.
In this embodiment, the time for displaying the plaintext input information may be extended, so that the user may better see the information input by himself to verify whether the input is correct, and the specific extended time may be set. Or, the display is directly in a clear text form, so that the user can conveniently check the display.
On the other hand, referring to fig. 4, after the user verifies the input information to be verified, the method may further include:
s15: and if the information to be verified is the same as the set information, determining that the verification is passed.
For example, when the stored value is a hashed value, if the information to be verified input by the user is y, the hash operation is performed on y to obtain h (y), and if h (y) is the same as h (x), the verification is passed.
S16: and if the information to be verified is different from the set information and does not belong to the associated information, determining that the information does not pass verification.
For example, if H (y) is different from H (x) and H (y) does not belong to H', it is determined that the password is not verified, and at this time, the user is presented with a message that the password input is incorrect.
In the embodiment, not only the set information but also the associated information obtained according to the set information can be generated, and when the information to be verified belongs to the associated information, the information is verified again, so that the user has the chance of verifying again after an input error caused by a small keyboard and the like, the input error caused by the small keyboard is reduced, and the input effect is improved. The method is different from the direct verification failure of the malicious input error, so that the unintentional error and the malicious error can be effectively distinguished, and the information verification failure caused by the unintentional input error is reduced.
Fig. 5 is a schematic structural diagram of an information input device according to another embodiment of the present application, where the device 50 includes: an acquisition module 51, a first receiving module 52, a verification module 53 and a second receiving module 54.
An obtaining module 51, configured to obtain pre-stored information, where the pre-stored information includes: plaintext first information, or encrypted first information, the first information comprising: the method comprises the steps of setting information and generating associated information according to the set information;
the method of the embodiment can be used for information verification in various scenes, for example, for password verification, identity card number verification, bank card number verification, mobile phone number verification and the like.
Before password authentication, the user may set a password in advance, for example, the set password is x. It is understood that the password x set by the user may include one or more information items, each of which may be a number or a letter, etc.
Further, taking the case that the password is stored at the mobile phone end as an example, the password can be stored in the clear text when being stored at the mobile phone end, for example, directly stored as x. Or, to improve security, the plaintext password is encrypted and stored, for example, the mobile phone stores the encrypted x. It will be appreciated that there are a variety of encryption algorithms, for example, hash algorithms in particular. In this embodiment, the mobile phone side stores the hashed and encrypted password as an example. Let x be denoted as H (x) after being hashed.
In the prior art, the prestored information is at most H (x), and when the user inputs x, the verification fails.
In this embodiment, not only h (x) but also the associated information can be obtained according to x, and the information obtained by performing hash encryption on the associated information is also stored at the mobile phone.
Referring to fig. 6, the apparatus 50 further comprises:
a setting module 55, configured to arbitrarily select an information item from the set information, and acquire a new information item corresponding to the selected information item, where a distance between positions of the new information item and the selected information item on the keyboard is within a preset range; and replacing the selected information item in the set information with the new information item to obtain the associated information.
For example, if one of the passwords x set by the user is a, corresponding to a, a character which is closer to a on the virtual keyboard or the physical keyboard may be selected as a new character, assuming that the new character is represented by a ', a ' is substituted for a to form a new password x ', which is the associated information of x, and after hash encryption is performed, the encrypted associated information may be represented as: h (x '), H (x "), …, the sequence being denoted as H'. Specifically, if x is abcd, and the character closer to a includes a ', the associated information of x includes a' bcd, and if the character closer to a also includes a ″, the associated information of x further includes: a "bcd," and assuming that the character closer to b includes b', the association information of x further includes: ab' cd, and so on, all the associated information can be obtained.
It is understood that the specific meaning of the close distance may be set according to actual needs, for example, characters corresponding to adjacent keys around may be determined as characters with the close distance, or characters within two keys apart may be determined as characters with the close distance, and the like.
A first receiving module 52, configured to receive information to be verified;
wherein, the user can input the information to be verified through the keyboard of the keyboard.
For example, the user inputs a password or the like using a virtual keyboard of a cellular phone.
The verification module 53 is configured to verify the information to be verified according to the pre-stored information;
when the mobile phone end directly stores the password of the plaintext, the input information and the pre-stored information can be directly compared, when the input information and the pre-stored information are the same, the verification is passed, otherwise, the verification is not passed.
The embodiment takes the case of storing the encrypted first information as an example.
When the pre-stored information is encrypted first information, the verification module 53 is specifically configured to:
encrypting the information to be verified by adopting an encryption algorithm the same as that of the first information to obtain the encrypted information to be verified;
and comparing the encrypted information to be verified with the information stored in advance.
Assuming that the information to be verified input by the user is y, and assuming that a hash encryption algorithm is adopted, H (y) may be calculated first, and then H (y) may be compared with H (x) and H'.
A second receiving module 54, configured to receive the re-input information to be verified if the information to be verified belongs to the associated information.
For example, if H (y) belongs to H', the re-entered information to be verified may be received. After which a further verification can be performed.
Optionally, the second receiving module is further configured to:
before receiving information to be verified input again, displaying prompt information to a user, wherein the prompt information is used for prompting the user to pay attention to the keyboard keys; or,
after receiving the re-input information to be verified, prolonging the plaintext display time of the re-input information to be verified; or,
and after receiving the re-input information to be verified, directly displaying the re-input information to be verified in a plaintext form.
For example, when y input by the user belongs to the associated information, which is probably because the key pressing is small, the user can be reminded to pay attention to the keyboard to avoid inputting errors due to the small keyboard. Or,
usually, all information that is finally displayed in the password authentication is non-plaintext, for example, a symbol is displayed, and information input by a user in plaintext is displayed shortly before the symbol is displayed.
In this embodiment, when the plaintext display time is prolonged, the plaintext display time of each item of information in the information to be verified may be prolonged, or only the plaintext display time of the information item input with the error last time may be prolonged. For example, if the information to be verified is abcd, if a is detected to have an error for the first time, only the plaintext display time of a may be extended, or the plaintext display times of a, b, c, and d may be extended. In addition, similar execution can be performed in the plaintext display, such as displaying only the information item input with the error last time in the plaintext, or displaying all the information items in the plaintext.
In this embodiment, the time for displaying the plaintext input information may be extended, so that the user may better see the information input by himself to verify whether the input is correct, and the specific extended time may be set. Or, the display is directly in a clear text form, so that the user can conveniently check the display.
Referring to fig. 6, the apparatus 50 further comprises:
a determining module 56, configured to determine that the verification is passed if the information to be verified is the same as the set information; or if the information to be verified is different from the set information and does not belong to the associated information, determining that the verification is not passed.
For example, when the stored value is a hashed value, if the information to be verified input by the user is y, the hash operation is performed on y to obtain h (y), and if h (y) is the same as h (x), the verification is passed.
For example, if H (y) is different from H (x) and H (y) does not belong to H', it is determined that the password is not verified, and at this time, the user is presented with a message that the password input is incorrect.
In the embodiment, not only the set information but also the associated information obtained according to the set information can be generated, and when the information to be verified belongs to the associated information, the information is verified again, so that the user has the chance of verifying again after an input error caused by a small keyboard and the like, the input error caused by the small keyboard is reduced, and the input effect is improved. The method is different from the direct verification failure of the malicious input error, so that the unintentional error and the malicious error can be effectively distinguished, and the information verification failure caused by the unintentional input error is reduced.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.