Summary of the invention
For compatible prior art, and solve input inconvenience and the not high problem of fail safe that exists in the prior art under certain condition, the invention provides a kind of OTP equipment and utilize this equipment to carry out the method for authentication.
OTP equipment provided by the invention comprises control module, OTP generation module, display module, memory module, trigger module, judge module and communication module;
Described judge module links to each other with described control module, is used to judge the operating state of OTP equipment;
Described trigger module links to each other with described control module, is used to receive the trigger message that the user sends, and triggers described OTP generation module generation OTP according to described trigger message;
Described OTP generation module links to each other with described control module, is used for after the triggering that receives described trigger module, obtains the OTP that stores in the described memory module by described control module and generates key element, and generate key element generation OTP according to described OTP;
Described communication module links to each other with described control module, when being used for judged result when described judge module and being described OTP equipment and being in the on-line working state, but send the message bag that contains described OTP and described OTP generation key element to connection device, but described message bag is used for the described OTP generation key element generation new disposal password of described connection device according to described message bag, and described new disposal password and the OTP that obtains from described message bag compared, if it is identical, then described OTP equipment is legal, and the OTP generation key element that renewal self is stored according to described OTP generation key element, otherwise described OTP equipment is illegal;
Described display module links to each other with described control module, when being used for judged result when described judge module and being described OTP equipment and being in the off-line working state, show described OTP, but, the OTP of described demonstration receives userspersonal information and the described OTP of user by the keyboard input of described connection device but being used for described connection device, generate new disposal password according to described userspersonal information, and described new disposal password and described OTP compared, if it is identical, then described OTP equipment is legal, otherwise described OTP equipment is illegal.
Described trigger module is specially button or numeric keypad.
Described communication module is specially at least one in USB interface, infrared interface, blue tooth interface, parallel port, serial ports, radio frequency interface and the eSATA interface.
The present invention also provides a kind of OTP of utilization equipment to carry out the method for authentication, and described method comprises:
OTP equipment is judged self working state;
If described OTP equipment is in the on-line working state, the user sends trigger message to described OTP equipment, after described OTP equipment is received described trigger message, generate key element according to the OTP of self storage and generate disposal password, but and send to connection device and to contain the message bag that described disposal password and described OTP generate key element; But described connection device generates key element according to the described OTP in the described message bag and generates new disposal password, and described new disposal password and the disposal password that obtains from described message bag compared, if it is identical, then described OTP equipment is legal, and the disposal password generation key element that renewal self is stored according to described OTP generation key element, otherwise described OTP equipment is illegal;
If described OTP equipment is in the off-line working state, the user sends trigger message to described OTP equipment, after described OTP equipment is received described trigger message, generate the key element generation and show disposal password according to the OTP that self stores, but the user is by the keyboard input userspersonal information and the described disposal password of connection device, but described connection device generates new disposal password according to the userspersonal information who receives, and described new disposal password and the disposal password that receives compared, if it is identical, then described OTP equipment is legal, otherwise described OTP equipment is illegal.
Described step according to the disposal password generation key element generation disposal password of self storing also comprises: but described connection device is verified described OTP equipment holder's identity.
Described user is specially to the step that described OTP equipment sends trigger message: the user presses the triggering button on the described OTP equipment.
Described user is specially to the step that described OTP equipment sends trigger message: the user is by the input of the numeric keypad on described OTP equipment long number.
Described according to the disposal password generation key element generation disposal password of self storing, but and be specially to the step that connection device sends the message bag contain described disposal password: described OTP equipment generates key element according to the disposal password of self storage and generates disposal password, and with described disposal password generation key element and disposal password composition message bag, but send described message bag to connection device.
But described connection device is specially according to the step that described message bag generates new disposal password: generate key element and disposal password but described connection device parses described disposal password from described message bag, generate key element according to described disposal password and generate new disposal password.
The described step that generates new disposal password according to described disposal password generation key element is specially: but the disposal password that described connection device obtains parsing generates key element and current disposal password generation key element of self storing compares, if resolving the disposal password that obtains generates the inferior numerical value of the generation disposal password in the key element or generates the time of the time of disposal password greater than the inferior numerical value or the generation disposal password of the generation disposal password of self storing, but the disposal password that then described connection device obtains according to parsing generates key element and generates new disposal password, otherwise, but described connection device prompting authentification failure.
The step that the disposal password that described renewal self is stored generates key element is specially: but described connection device generates key element with resolving the current disposal password of self storing of disposal password generation key element replacement that obtains.
Described according to the disposal password generation key element generation disposal password of self storing, but and be specially to the step that connection device sends the message bag contain described disposal password: described OTP equipment generates key element according to the disposal password of self storage and generates disposal password, and described disposal password is generated key element carry out cryptographic calculation, cryptographic calculation result and described disposal password are formed the message bag, but send described message bag to connection device.
But described connection device is specially according to the step that described message bag generates new disposal password: but described connection device parses described disposal password and cryptographic calculation result from described message bag, and to described cryptographic calculation result deciphering obtains described disposal password and generates key element, generate key element according to described disposal password and generate new disposal password.
The described step that generates new disposal password according to described disposal password generation key element is specially: but the disposal password that described connection device obtains deciphering generates key element and current disposal password generation key element of self storing compares, if the disposal password that deciphering obtains generates the inferior numerical value of the generation disposal password in the key element or generates the time of the time of disposal password greater than the inferior numerical value or the generation disposal password of the generation disposal password of self storing, but the disposal password that then described connection device obtains according to deciphering generates key element and generates new disposal password, otherwise, but described connection device prompting authentification failure.
The step that the disposal password that described renewal self is stored generates key element is specially: generate key element but the disposal password that described connection device obtains with deciphering generates the current disposal password of self storing of key element replacement.
The algorithm of described cryptographic calculation is two-way algorithm, and described two-way algorithm comprises DES, 3DES or RC4.
But described connection device is specially according to the step that the userspersonal information who receives generates new disposal password: generate key element but described connection device retrieves disposal password according to the userspersonal information who receives, and generate the new disposal password of key element generation according to described disposal password.
Described disposal password generates key element and comprises the inferior numerical value that generates disposal password, time or the random number that generates disposal password.
But described OTP equipment is connected with described connection device by USB interface, infrared interface, blue tooth interface, parallel port, serial ports, radio frequency interface or eSATA interface.
Beneficial effect: the disposal password that OTP equipment provided by the invention produces does not need the user to import by hand, but directly sends connection device to, is user-friendly to; But the OTP that OTP equipment provided by the invention generates key element and generation with the OTP that encrypts is combined into the message bag and together sends to connection device as final password, has increased the password cracking difficulty like this, has improved fail safe; But the inferior numerical value of OTP equipment provided by the invention and connection device generation OTP or the time of generation OTP are synchronous automatically, have avoided main frame to calculate disposal password blindly again and again, can also stop Replay Attack simultaneously.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
As shown in Figure 1, a kind of OTP equipment 108 that the embodiment of the invention provides, this OTP equipment 108 comprises communication module 102, memory module 101, control module 103, OTP generation module 104, judge module 105, display module 106 and trigger module 107;
Communication module 102 links to each other with control module 103, is used to carry out the parsing of communications protocol, but sets up and realize being connected and information interaction between OTP equipment 108 and the outside connection device; Communication module 102 can be in USB interface, infrared interface, blue tooth interface, parallel port, serial ports, radio frequency interface and the eSATA interface at least one;
Memory module 101 links to each other with control module 103, is used to store the inferior numerical value of OTP equipment 108 generation OTP, time or the random number of generation OTP;
OTP generation module 104 links to each other with control module 103, is used to generate OTP;
Judge module 105 links to each other with control module 103, is used for by detecting the receiving and transmitting signal of OTP equipment 108, judging that OTP equipment 108 is in the on-line working state or is in the off-line working state before 108 work of OTP equipment;
Display module 106 links to each other with control module 103, is used for the OTP that shows that on the built-in display of OTP equipment 108 OTP generation module 104 generates;
Trigger module 107 links to each other with control module 103, is used for triggering OTP generation module 104 by control module 103 and generates OTP; Trigger module 107 can adopt button to realize, the user triggers OTP equipment 108 generation OTP by pressing button; Trigger module 107 can also adopt numeric keypad to realize, the user imports a plurality of numerals by numeric keypad and triggers OTP equipment 108 generation OTP;
Control module 103 is used to control the information interaction between communication module 102, memory module 101, OTP generation module 104, judge module 105, display module 106 and the trigger module 107, but the information interaction between control OTP equipment 108 and the connection device.
In actual applications, but OTP equipment can carry out information interaction by wireless mode or wired mode and connection device.OTP equipment can by but be not limited to infrared signal, Bluetooth signal, Wireless USB signal, contactless smart card communication signal, lightwave signal or radiofrequency signal and but connection device carries out wireless information interaction; But OTP equipment can also by but be not limited to USB interface, parallel port, serial ports, radio frequency interface or eSATA interface and connection device and carry out information interaction.But connection device can but to be not limited to be card reader, communication apparatus, digital camera, main frame, main frame peripheral hardware, the server or other special equipment that connect by network.
But carrying out information interaction by wireless mode and wired mode with connection device with OTP equipment respectively below is example, but connection device can but to be not limited to be card reader, communication apparatus, digital camera, main frame, main frame peripheral hardware, by server or other special equipment that network connects, the OTP equipment that utilizes that setting forth the embodiment of the invention provides carries out the method for authentication.
Embodiment one
But OTP equipment carries out information interaction by wireless mode and connection device, wherein, but connection device is a main frame, OTP equipment is connected with the wireless messages fetch equipment, the wireless messages fetch equipment is connected with distance host by network, the method of utilizing OTP equipment to carry out authentication that the embodiment of the invention provides specifically may further comprise the steps, as shown in Figures 2 and 3:
Step 201:OTP equipment sends the wireless signal of searching main frame;
Step 202:OTP equipment judges whether to receive the feedback signal from main frame, if then execution in step 203, otherwise, execution in step 213;
If OTP equipment receives the feedback signal from main frame, illustrate that so OTP equipment is in the on-line working state; If OTP equipment does not receive the feedback signal from main frame, illustrate that so OTP equipment is in the off-line working state;
Step 203: the user sends trigger message to OTP equipment, and after OTP equipment was received trigger message, the OTP generation module obtained the OTP that stores in the memory module by control module and generates key element;
The user can send trigger message to OTP equipment by the triggering button of pressing on the OTP equipment, can also send trigger message to OTP equipment by the input of the numeric keypad on OTP equipment long number;
OTP generates key element and comprises the inferior numerical value that generates OTP, time or the random number that generates OTP; It is that example illustrates with the inferior numerical value that generates OTP that present embodiment OTP generates key element;
Step 204:OTP generation module adds up to the inferior numerical value that the OTP that gets access to generates the generation OTP in the key element, obtains the inferior numerical value of new generation OTP, and calculates generation OTP according to the inferior numerical value of this new generation OTP;
Step 205:OTP generation module sends to control module with the inferior numerical value of new generation OTP and the OTP of generation;
Step 206: control module sends to memory module with the inferior numerical value of new generation OTP, and the inferior numerical value of new generation OTP is carried out cryptographic calculation;
The algorithm of cryptographic calculation is two-way algorithm, two-way algorithm can for but be not limited to DES, 3DES or RC4 etc.;
Step 207: control module is formed the message bag with the OTP of cryptographic calculation result and generation, and by communication module this message bag is sent to the wireless messages fetch equipment;
Communication module carries out communication by wireless mode and wireless messages fetch equipment, communication module can for but be not limited to infrared interface, blue tooth interface etc.;
Step 208: after the wireless messages fetch equipment receives the message bag, this message bag is sent to main frame;
Step 209: main frame parses cryptographic calculation result and OTP from the message bag of receiving, the cryptographic calculation result is deciphered, obtain the inferior numerical value of new generation OTP, and the inferior numerical value of the generation OTP of inferior numerical value that will this new generation OTP and self storage compares, if the inferior numerical value of new generation OTP is greater than the inferior numerical value of the generation OTP that self stores, then execution in step 210, otherwise carry out 212;
Step 210: main frame generates new OTP according to the inferior numerical value of the new generation OTP that deciphering obtains, resolves the OTP that obtains with new OTP with from the message bag and compares, if two OTP are identical, then execution in step 211, otherwise execution in step 212;
Step 211: OTP is correct in the main frame prompting, allows OTP equipment holder login, and upgrades the OTP generation key element of self storing;
Main frame upgrades the OTP generation key element of self storing and is specially: main frame is replaced current OTP generation key element of self storing with deciphering the OTP generation key element that obtains, at the inferior numerical value of present embodiment main frame with the generation OTP of inferior numerical value replacement self storage of deciphering the new generation OTP that obtains;
Step 212: main frame prompting OTP makes mistakes, refusal OTP equipment holder login;
Step 213:OTP generation module generates OTP;
OTP and userspersonal information that step 214:OTP equipment holder demonstrates by the built-in display on the host keyboard input OTP equipment;
Step 215: main frame generates new OTP according to the userspersonal information who receives, and this new OTP is compared with the OTP that receives, if two OTP are identical, then execution in step 216, otherwise execution in step 212;
Step 216: OTP is correct in the main frame prompting, allows OTP equipment holder login.
In addition, control module can also be directly will new generation OTP inferior numerical value and the OTP composition packets of information of generation, send to main frame, and after not needing inferior numerical value to new generation OTP to carry out cryptographic calculation, again with the OTP composition packets of information of generation.It is basic identical to adopt this scheme to realize that the present invention utilizes OTP equipment to carry out method and the present embodiment of authentication, is step 206,207,209,210 and 211 different, 206,207,209,210 and 211 corresponding becoming:
Step 206 ': control module sends to memory module with the inferior numerical value of new generation OTP;
Step 207 ': control module is formed the message bag with the inferior numerical value of new generation OTP and the OTP of generation, and by communication module this message bag is sent to the wireless messages fetch equipment;
Communication module carries out communication by wireless mode and wireless messages fetch equipment, communication module can for but be not limited to infrared interface, blue tooth interface etc.;
Step 209 ': main frame is resolved inferior numerical value and the OTP of the generation OTP that makes new advances from the message bag of receiving, and the inferior numerical value of the generation OTP of inferior numerical value that will this new generation OTP and self storage compares, if the inferior numerical value of new generation OTP is greater than the inferior numerical value of the generation OTP that self stores, then execution in step 210 ', otherwise carry out 212;
Step 210 ': the inferior numerical value of the new generation OTP that main frame obtains according to parsing generates new OTP, resolve the OTP that obtains with new OTP with from the message bag and compare, if two OTP are identical, then execution in step 211 ', otherwise execution in step 212;
Step 211 ': OTP is correct in the main frame prompting, allows OTP equipment holder login, and upgrades the OTP generation key element of self storing;
Main frame upgrades the OTP generation key element of self storing and is specially: main frame is replaced current OTP generation key element of self storing with resolving the OTP generation key element that obtains, at the inferior numerical value of present embodiment main frame with the generation OTP of inferior numerical value replacement self storage of resolving the new generation OTP that obtains;
It is to be that example describes with the inferior numerical value that generates OTP that OTP in the present embodiment generates key element, in actual applications, can also be used as OTP with the time that generates OTP and generate key element, generate that will to realize usually that the present invention utilizes OTP equipment to carry out the method and the present embodiment of authentication just the same the time that adopt to generate OTP as OTP, repeat no more here.
Embodiment two
But OTP equipment carries out information interaction by wired mode and connection device, wherein but connection device is a main frame, OTP equipment carries out information interaction by USB interface and main frame, the method of utilizing OTP equipment to carry out authentication that the embodiment of the invention provides specifically may further comprise the steps, as shown in Figure 4 and Figure 5:
Step 301:OTP equipment sends the signal of searching main frame;
Step 302:OTP equipment judges whether to receive the feedback signal from main frame, if then execution in step 303, otherwise execution in step 312;
If OTP equipment receives the feedback signal from main frame, illustrate that so OTP equipment is in the on-line working state; If OTP equipment does not receive the feedback signal from main frame, illustrate that so OTP equipment is in the off-line working state;
Step 303: the user sends trigger message to OTP equipment, and after OTP equipment was received trigger message, the OTP generation module obtained the OTP that stores in the memory module by control module and generates key element;
The user can send trigger message to OTP equipment by the triggering button of pressing on the OTP equipment, can also send trigger message to OTP equipment by the input of the numeric keypad on OTP equipment long number;
OTP generates key element and comprises the inferior numerical value that generates OTP, time or the random number that generates OTP; It is that example illustrates with the inferior numerical value that generates OTP that present embodiment OTP generates key element;
Step 304:OTP generation module adds up to the inferior numerical value that the OTP that gets access to generates the generation OTP in the key element, obtains the inferior numerical value of new generation OTP, and calculates generation OTP according to the inferior numerical value of this new generation OTP;
Step 305:OTP generation module sends to control module with the inferior numerical value of new generation OTP and the OTP of generation;
Step 306: control module sends to memory module with the inferior numerical value of new generation OTP, and the inferior numerical value of new generation OTP is carried out cryptographic calculation;
The algorithm of cryptographic calculation is two-way algorithm, two-way algorithm can for but be not limited to DES, 3DES or RC4 etc.;
Step 307: control module is formed the message bag with the OTP of cryptographic calculation result and generation, and by communication module this message bag is sent to main frame;
Communication module carries out communication by wired mode and main frame, communication module can for but be not limited to USB interface, parallel port, serial ports or eSATA interface etc.;
Step 308: main frame parses cryptographic calculation result and OTP from the message bag of receiving, the cryptographic calculation result is deciphered, obtain the inferior numerical value of new generation OTP, and the inferior numerical value of the generation OTP of the inferior numerical value of new generation OTP and self storage compared, if the inferior numerical value of new generation OTP is greater than the inferior numerical value of the generation OTP that self stores, then execution in step 309, otherwise execution in step 311;
Step 309: main frame generates new OTP according to the inferior numerical value of the new generation OTP that deciphering obtains, resolves the OTP that obtains with new OTP with from the message bag and compares, if two OTP are identical, then execution in step 310, otherwise execution in step 311;
Step 310: OTP is correct in the main frame prompting, allows OTP equipment holder login, and upgrades the OTP generation key element of self storing;
Main frame upgrades the OTP generation key element of self storing and is specially: main frame is replaced current OTP generation key element of self storing with deciphering the OTP generation key element that obtains, at the inferior numerical value of present embodiment main frame with the generation OTP of inferior numerical value replacement self storage of deciphering the new generation OTP that obtains;
Step 311: main frame prompting OTP mistake, refusal OTP equipment holder login;
Step 312:OTP generation module generates OTP;
OTP and userspersonal information that step 313:OTP equipment holder demonstrates by the built-in display on the host keyboard input OTP equipment;
Step 314: main frame generates new OTP according to the userspersonal information who receives, and this new OTP is compared with the OTP that receives, if two OTP are identical, then execution in step 315, otherwise execution in step 311;
Step 315: OTP is correct in the main frame prompting, allows OTP equipment holder login.
In addition, control module can also be directly will new generation OTP inferior numerical value and the OTP composition packets of information of generation, send to main frame, and after not needing inferior numerical value to new generation OTP to carry out cryptographic calculation, again with the OTP composition packets of information of generation.It is basic identical to adopt this scheme to realize that the present invention utilizes OTP equipment to carry out method and the present embodiment of authentication, is step 306,307,308,309 and 310 different, 306,307,308,309 and 310 corresponding becoming:
Step 306 ': control module sends to memory module with the inferior numerical value of new generation OTP;
Step 307 ': control module is formed the message bag with the inferior numerical value of new generation OTP and the OTP of generation, and by communication module this message bag is sent to the wireless messages fetch equipment;
Communication module carries out communication by wireless mode and wireless messages fetch equipment, communication module can for but be not limited to infrared interface, blue tooth interface etc.;
Step 308 ': main frame is resolved inferior numerical value and the OTP of the generation OTP that makes new advances from the message bag of receiving, and the inferior numerical value of the generation OTP of inferior numerical value that will this new generation OTP and self storage compares, if the inferior numerical value of new generation OTP is greater than the inferior numerical value of the generation OTP that self stores, then execution in step 309 ', otherwise carry out 311;
Step 309 ': the inferior numerical value of the new generation OTP that main frame obtains according to parsing generates new OTP, resolve the OTP that obtains with new OTP with from the message bag and compare, if two OTP are identical, then execution in step 310 ', otherwise execution in step 311;
Step 310 ': OTP is correct in the main frame prompting, allows OTP equipment holder login, and upgrades the OTP generation key element of self storing;
Main frame upgrades the OTP generation key element of self storing and is specially: main frame is replaced current OTP generation key element of self storing with resolving the OTP generation key element that obtains, at the inferior numerical value of present embodiment main frame with the generation OTP of inferior numerical value replacement self storage of resolving the new generation OTP that obtains;
It is to be that example describes with the inferior numerical value that generates OTP that OTP in the present embodiment generates key element, in actual applications, can also be used as OTP with the time that generates OTP and generate key element, generate that will to realize usually that the present invention utilizes OTP equipment to carry out the method and the present embodiment of authentication just the same the time that adopt to generate OTP as OTP, repeat no more here.
In order further to increase the fail safe of authentication, before OTP equipment generated OTP, main frame can also be verified OTP equipment holder's identity, and verification mode can be PIN code checking, fingerprint or iris checking etc.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.