WO2016082317A1 - 一种具有日志功能的动态令牌及其工作方法 - Google Patents

一种具有日志功能的动态令牌及其工作方法 Download PDF

Info

Publication number
WO2016082317A1
WO2016082317A1 PCT/CN2015/070680 CN2015070680W WO2016082317A1 WO 2016082317 A1 WO2016082317 A1 WO 2016082317A1 CN 2015070680 W CN2015070680 W CN 2015070680W WO 2016082317 A1 WO2016082317 A1 WO 2016082317A1
Authority
WO
WIPO (PCT)
Prior art keywords
button
log
interrupt
dynamic token
determining module
Prior art date
Application number
PCT/CN2015/070680
Other languages
English (en)
French (fr)
Inventor
陆舟
于华章
Original Assignee
飞天诚信科技股份有限公司
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 飞天诚信科技股份有限公司 filed Critical 飞天诚信科技股份有限公司
Priority to US15/502,832 priority Critical patent/US10162949B2/en
Publication of WO2016082317A1 publication Critical patent/WO2016082317A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/34User authentication involving the use of external additional devices, e.g. dongles or smart cards
    • 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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • H04L63/0846Network architectures or network communication protocols for network security for authentication of entities using passwords using time-dependent-passwords, e.g. periodically changing passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the invention relates to a dynamic token with a log function and a working method thereof, and belongs to the field of information security.
  • Dynamic Token is a device for generating dynamic passwords. It is widely used in online banking, telecom operators and e-government applications.
  • the dynamic password generated by the dynamic token can be used for identity authentication, which can effectively improve the security of identity authentication.
  • the dynamic token automatically shuts down after displaying the dynamic password for a period of time (usually several tens of seconds), and the user cannot view any information related to the completed identity authentication through the dynamic token, and cannot be confirmed. Whether the completed identity authentication is an identity authentication completed by itself, therefore, the existing identity authentication mechanism using the dynamic password has a security defect.
  • the object of the present invention is to provide a dynamic token with a log function and a working method thereof to solve the security defect of using the dynamic password for identity authentication in the prior art.
  • a method of working with a dynamic token having a log function comprising the steps of:
  • step S2 the dynamic token determines whether there is a set interrupt flag, and if so, step S3 is performed; otherwise, step S2 is continued;
  • step S3 the dynamic token is set to determine the interrupt flag, if it is a timer interrupt flag, step S4 is performed; if it is a button interrupt flag, step S5 is performed;
  • step S6 the dynamic token determines the currently pressed button according to the first key value, and if the currently pressed button is the first button, step S7 is performed; if the currently pressed button is The second button, or a combination of the third button and the fourth button, then step S8;
  • the dynamic token generates a dynamic password and a log corresponding to the dynamic password, stores the dynamic password in a display data buffer, stores the log in a log storage area, turns on a key interrupt, and returns to step S2. ;as well as
  • the dynamic token reads the log from the log storage area, stores the read log into the display data buffer, turns on the key interrupt, and returns to step S2.
  • a dynamic token having a log function including:
  • the initialization module is configured to perform an initialization operation after power-on, and turn on the total interrupt and the button wake-up function;
  • a first determining module configured to determine whether there is an interrupt flag that is set
  • a second determining module configured to: after the first determining module determines that the set interrupt flag exists, determine the interrupt flag that is set;
  • a reset module configured to: when the second determining module determines that the set interrupt flag is a timer interrupt flag, reset a timer interrupt flag, and trigger the first determining module to determine whether there is a set interrupt Sign
  • a first obtaining module configured to: when the second determining module determines that the set interrupt flag is a button interrupt flag, close the button interrupt, scan the keyboard, and obtain the first key value;
  • a third determining module configured to determine, according to the first key value acquired by the first acquiring module, a currently pressed button
  • a first processing module configured to: when the third determining module determines that the currently pressed button is the first button, generate a dynamic password and a log corresponding to the dynamic password, and store the dynamic password to the display data a buffer, storing the log in a log storage area, opening a key interrupt, and triggering the first determining module to determine whether there is an interrupt flag that is set;
  • a second processing module configured to: when the third determining module determines that the currently pressed button is a second button, or a combination of the third button and the fourth button, reading the log from the log storage area And storing the read log into the display data buffer, turning on the key interrupt, and triggering the first determining module to determine whether there is an interrupt flag that is set.
  • the dynamic token after generating the dynamic password, the dynamic token generates and records a log corresponding to the dynamic password for the user to view, thereby recording information related to the completed identity authentication, so that the user can review whether the completed identity authentication is
  • the identity authentication completed by itself improves the identity authentication mechanism using dynamic passwords and the security of dynamic tokens.
  • 1 to 14 are flowcharts showing a working method of a dynamic token having a log function according to an embodiment of the present invention
  • 15 is a flowchart of a method for adding a new log to a dynamic token storage according to an embodiment of the present invention
  • 16 is a flowchart of a method for reading a log by a dynamic token according to an embodiment of the present invention
  • FIG. 17 is a schematic structural diagram of a dynamic token with a log function according to an embodiment of the present invention.
  • the invention provides a working method of a dynamic token with a log function. After the dynamic token determines that the key interrupt flag is set, the key is interrupted, the keyboard is scanned, the first key value is obtained, and according to the first key value, Judging the currently pressed button, if the currently pressed button is the first button, generating a dynamic password and a log corresponding to the dynamic password, storing the dynamic password in the display data buffer, and storing the log in the log In the storage area, the button is interrupted; if the currently pressed button is a combination of the third button and the fourth button, the log is read from the log storage area, the read log is stored in the display data buffer, and the button is turned on.
  • the first button can be a confirmation button on the dynamic token, or other buttons on the dynamic token
  • the third button can be a numeric key on the dynamic token, or can be other on the dynamic token
  • the button can be the delete button on the dynamic token, or it can be other buttons on the dynamic token.
  • the working method of the dynamic token with log function comprises the following steps:
  • step 101 the dynamic token is powered on, and an initialization operation is performed.
  • step 102 the dynamic token turns on the total interrupt and the button wake-up function.
  • step 103 the dynamic token determines whether there is a set interrupt flag, and if so, step 104 is performed; otherwise, step 252 is performed.
  • Step 104 The dynamic token judges the set interrupt flag. If it is a timer interrupt flag, step 105 is performed; if it is a key interrupt flag, step 106 is performed; if it is another interrupt flag, the set interrupt is executed. The flag is reset, the corresponding operation is performed, and the process returns to step 103.
  • the dynamic token receives the timer interrupt, and the timer interrupt flag is set by hardware; when the button on the dynamic token is triggered, the dynamic token is received.
  • the key interrupt flag is set by hardware; when the dynamic token receives other interrupts, the corresponding interrupt flag is set by hardware.
  • step 105 the dynamic token resets the timer interrupt flag and returns to step 103.
  • step 106 the dynamic token closes the button interrupt, resets the long button flag, and delays the first preset duration.
  • the first preset duration may be 20 ms.
  • Step 107 The dynamic token scans the keyboard to obtain the first key value.
  • Step 108 The dynamic token determines whether the first key value is empty or an incorrect key value. If yes, the key interrupt is turned on, and the process returns to step 103; otherwise, step 109 is performed.
  • Step 109 The dynamic token delays the second preset duration, saves the first key value, scans the keyboard, and acquires the second key value.
  • the second preset duration may be 20 ms.
  • Step 110 The dynamic token determines whether the second key value is the same as the first key value. If yes, step 111 is performed; otherwise, the key interrupt is turned on, and the process returns to step 103.
  • Step 111 the dynamic token determines whether the currently pressed button is a power button according to the first key value, and if so, step 113 is performed; otherwise, step 112 is performed;
  • Step 112 The dynamic token determines, according to the first key value, whether the currently pressed button is a combination of the third button and the fourth button. If yes, step 113 is performed; otherwise, step 125 is performed.
  • the third button may be a numeric button, for example, "1"
  • the fourth button may be a delete button.
  • Step 113 The dynamic token sets the overflow time of the timer to a third preset duration, and sets the overflow number to the first preset value.
  • the third preset duration may be 100 ms.
  • step 114 the dynamic token turns on the timer function of the total interrupt and the timer, switches the clock source to the low speed clock, and enters the sleep mode.
  • step 115 after the dynamic token is woken up, the timer function of the timer is turned off, and the clock source is switched to the high speed clock.
  • step 116 the dynamic token determines whether the timer interrupt flag is set. If yes, step 117 is performed; otherwise, the process returns to step 114.
  • step 117 the dynamic token determines to close the total interrupt and reset the timer interrupt flag.
  • Step 118 The dynamic token scans the keyboard to obtain a third key value.
  • step 119 the dynamic token determines whether the third key value is an empty key. If yes, step 125 is performed; otherwise, step 120 is performed.
  • Step 120 The dynamic token determines whether the third key value is an error key. If yes, the key interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 121 is performed.
  • Step 121 The dynamic token determines whether the third key value is the same as the first key value. If yes, step 122 is performed; otherwise, the key interrupt and the total interrupt are turned on, and the process returns to step 103.
  • step 122 the dynamic token updates the number of overflows.
  • step 123 the dynamic token determines whether the number of overflows is the second preset value. If yes, step 124 is performed; otherwise, the process returns to step 114.
  • step 124 the dynamic token sets the long button flag.
  • Step 125 The dynamic token determines, according to the first key value, whether the currently pressed button is a power button. If yes, step 126 is performed; otherwise, step 134 is performed.
  • Step 126 The dynamic token determines whether the system status is the shutdown state. If yes, step 128 is performed; otherwise, step 127 is performed.
  • Step 127 the dynamic token clears the button data buffer and the display data buffer, sets the system state to the shutdown state, and resets the log boot flag. Turn on the key interrupt and the total interrupt, and return to step 103.
  • step 128 the dynamic token determines whether the long button flag is set. If yes, step 129 is performed; otherwise, the button interrupt and the total interrupt are turned on, and the process returns to step 103.
  • step 124 when the dynamic token determines that the number of overflows is the second preset value, the long button flag is set.
  • Step 129 The dynamic token determines whether the token lock flag is set. If yes, step 130 is performed; otherwise, step 131 is performed.
  • step 168 when the dynamic token determines that the number of token verification errors is the first preset number of times, the token lock flag is set.
  • step 130 the dynamic token sets the system state to display the unlock challenge code state, displays the token lock information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 131 the dynamic token determines whether the password setting flag is set. If yes, step 132 is performed; otherwise, step 133 is performed.
  • step 155 when the dynamic token setting password is successful, the password setting flag is set.
  • step 132 the dynamic token sets the system state to the verification token PIN state, displays the token verification information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 133 the dynamic token sets the system state to the first setting PIN state, displays the first setting PIN information, turns on the key interruption and the total interruption, and returns to step 103.
  • Step 134 the dynamic token determines the system status, if it is the shutdown state, step 135 is performed; if it is the first setting PIN state, step 141 is performed; if it is the second setting PIN state, step 148 is performed; If the PIN is set to the error state, step 159 is performed; if it is the verification token PIN state, step 160 is performed; if it is the PIN error state, step 172 is performed; if the unlock challenge code state is displayed, step 175 is performed; Enter the unlock code status, go to step 176; if it is the token interface status, go to step 186; if it is to display the dynamic password status, go to step 213; if it is to verify the log PIN status, go to step 215; if it is log display If the status is OK, step 228 is performed.
  • Step 135 The dynamic token determines, according to the first key value, whether the currently pressed button is a combination of the third button and the fourth button, and if yes, executing step 136; otherwise, turning on the button interrupt and the total interrupt, and returning Step 103.
  • step 136 the dynamic token determines whether the long button flag is set. If yes, step 137 is performed; otherwise, the button interrupt and the total interrupt are turned on, and the process returns to step 103.
  • step 137 the dynamic token sets the log boot flag.
  • step 138 the dynamic token determines whether the log lock flag is set. If yes, step 139 is performed; otherwise, step 140 is performed.
  • step 223 when the dynamic token determines that the number of log verification errors is the second preset number, the log lock flag is set.
  • step 139 the dynamic token sets the system state to display the unlock challenge code state, displays the log lock information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 140 the dynamic token sets the system state to the verification log PIN state, displays the log verification information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 141 The dynamic token determines the currently pressed button according to the first key value. If it is a numeric key, step 142 is performed; if it is a delete key, step 146 is performed.
  • step 142 the dynamic token saves the first key value to the key data buffer and updates the key data length.
  • the dynamic token adds 1 to the length of the key data as the updated key data length.
  • Step 143 The dynamic token determines whether the button data length is less than the first preset length. If yes, step 144 is performed; otherwise, step 145 is performed.
  • the first preset length is the length of the PIN.
  • step 144 the dynamic token updates the first setting PIN information, turns on the key interruption and the total interruption, and returns to step 103.
  • Step 145 The dynamic token stores the data in the button data buffer into the password data buffer, clears the button data buffer, sets the system state to the second setting PIN state, displays the second setting PIN information, and enables the button interrupt and Total interruption and return to step 103.
  • Step 146 The dynamic token determines whether the button data length is zero. If yes, the button interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 147 is performed.
  • Step 147 the dynamic token deletes the last data stored in the button data buffer, updates the button data length, updates and displays the first setting PIN information, turns on the button interrupt and the total interrupt, and returns to step 103.
  • the dynamic token decrements the key data length by one as the updated key data length.
  • Step 148 The dynamic token determines the currently pressed button according to the first key value. If it is a numeric key, step 149 is performed; if it is a delete key, step 157 is performed.
  • step 149 the dynamic token saves the first key value to the key data buffer and updates the key data length.
  • the dynamic token adds 1 to the length of the key data as the updated key data length.
  • Step 150 The dynamic token determines whether the button data length is less than the first preset length. If yes, step 151 is performed; otherwise, step 152 is performed.
  • step 151 the dynamic token updates the second setting PIN information, turns on the key interruption and the total interruption, and returns to step 103.
  • Step 152 The dynamic token determines whether the data in the button data buffer is the same as the data in the password data buffer. If yes, step 154 is performed; otherwise, step 153 is performed.
  • step 153 the dynamic token clears the button data buffer and the password data buffer, sets the system state to the PIN setting error state, displays the PIN setting error message, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 154 the dynamic token determines whether the log boot flag is set. If yes, step 155 is performed; otherwise, step 156 is performed.
  • step 137 the dynamic token determines that the currently pressed button is a combination of the third button and the fourth button, and when the long button flag is set, the log boot flag is set.
  • step 155 the dynamic token sets the password setting flag, clears the button data buffer, sets the system state to the log display state, displays the log interface information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 156 the dynamic token sets the password setting flag, clears the button data buffer, sets the system state to the token interface state, displays the token interface information, turns on the button interrupt and the total interrupt, and returns to step 103.
  • step 157 the dynamic token determines whether the button data length is zero. If yes, the button interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 158 is performed.
  • Step 158 The dynamic token deletes the last data stored in the button data buffer, updates the button data length, updates and displays the second setting PIN information, turns on the button interrupt and the total interrupt, and returns to step 103.
  • the dynamic token decrements the key data length by one as the updated key data length.
  • step 159 the dynamic token sets the system state to the first setting PIN state, displays the first setting PIN information, turns on the key interruption and the total interruption, and returns to step 103.
  • Step 160 The dynamic token determines the currently pressed button according to the first key value. If it is a numeric key, step 161 is performed; if it is a delete key, step 170 is performed.
  • step 161 the dynamic token saves the first key value to the key data buffer and updates the key data length.
  • the dynamic token adds 1 to the length of the key data as the updated key data length.
  • Step 162 The dynamic token determines whether the button data length is less than the first preset length. If yes, step 163 is performed; otherwise, step 164 is performed.
  • step 163 the dynamic token updates the token verification information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 164 The dynamic token determines whether the data in the button data buffer is the same as the data in the password data buffer. If yes, step 165 is performed; otherwise, step 166 is performed.
  • Step 165 The dynamic token clears the key data buffer, clears the number of token verification errors, sets the system state to the token interface state, displays the token interface information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 166 the dynamic token clears the key data buffer, and updates the number of token verification errors.
  • the dynamic token adds 1 to the number of token verification errors as the number of times the updated token is verified.
  • Step 167 The dynamic token determines whether the number of token verification errors is the first preset number of times. If yes, step 168 is performed; otherwise, step 169 is performed.
  • step 168 the dynamic token sets the token lock flag, sets the system state to display the unlock challenge code state, displays the token lock information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 169 the dynamic token sets the system state to the PIN error state, displays the PIN error message, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 170 The dynamic token determines whether the button data length is zero. If yes, the button interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 171 is performed.
  • step 171 the dynamic token deletes the last data stored in the button data buffer, updates the button data length, updates and displays the token verification information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • the dynamic token decrements the key data length by one as the updated key data length.
  • step 172 the dynamic token determines whether the log boot flag is set. If yes, step 174 is performed; otherwise, step 173 is performed.
  • step 173 the dynamic token sets the system state to the verification token PIN state, displays the token verification information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 174 the dynamic token sets the system state to the verification log PIN state, displays the log verification information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 175 The dynamic token generates an unlock challenge code, sets the system state to wait for the input unlock code state, displays the unlock challenge code, turns on the button interrupt and the total interrupt, and returns to step 103.
  • Step 176 The dynamic token judges the currently pressed button according to the first key value. If it is a numeric key, step 177 is performed; if it is a delete key, step 184 is performed.
  • step 177 the dynamic token saves the first key value to the key data buffer and updates the key data length.
  • the dynamic token adds 1 to the length of the key data as the updated key data length.
  • Step 178 The dynamic token determines whether the button data length is less than the second preset length. If yes, step 179 is performed; otherwise, step 180 is performed.
  • the second preset length is the length of the unlock code.
  • step 179 the dynamic token displays the unlock code input information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 180 The dynamic token verifies the data in the button data buffer according to the unlock challenge code. If the verification passes, step 181 is performed; otherwise, step 182 is performed.
  • Step 181 The dynamic token clears the button data buffer, resets the token lock flag, the log lock flag, and the password setting flag, sets the system state to the first setting PIN state, displays the first setting PIN information, and enables the button interrupt and total Interrupt and return to step 103.
  • step 182 the dynamic token clears the key data buffer, sets the system state to the unlock code error state, and displays the unlock code error information.
  • Step 183 the dynamic token delays the fourth preset duration, sets the system state to the shutdown state, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 184 the dynamic token determines whether the button data length is zero. If yes, the button interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 185 is performed.
  • Step 185 The dynamic token deletes the last data stored in the button data buffer, updates the button data length, updates and displays the unlock code input information, turns on the button interrupt and the total interrupt, and returns to step 103.
  • the dynamic token decrements the key data length by one as the updated key data length.
  • Step 186 The dynamic token judges the currently pressed button according to the first key value. If it is a numeric key, step 187 is performed; if it is a delete key, step 192 is performed; if it is a left key, step is performed 197; if it is a right button, step 201 is performed; if it is a confirmation button, step 205 is performed.
  • Step 187 The dynamic token determines whether the button data length is less than the third preset length. If yes, step 188 is performed; otherwise, the button interrupt and the total interrupt are turned on, and the process returns to step 103.
  • the third preset length is the length of the challenge code.
  • step 188 the dynamic token saves the first key value to the key data buffer and updates the key data length.
  • the dynamic token adds 1 to the length of the key data as the updated key data length.
  • Step 189 The dynamic token determines whether the display data length is less than the fourth preset length. If yes, step 190 is performed; otherwise, step 191 is performed.
  • the fourth preset length is the total length of the display data buffer.
  • step 190 the dynamic token saves the first key value into the display data buffer, updates the display data length, turns on the key interrupt and the total interrupt, and returns to step 103.
  • the dynamic token adds 1 to the display data length as the updated display data length.
  • Step 191 the dynamic token will display the data stored in the data buffer for the earliest time, delete the data remaining in the data buffer, save the first key value to the key data buffer, and enable the key interrupt and total Interrupt and return to step 103.
  • the data remaining in the data buffer is forwarded to a continuous storage space starting from the first address of the display data buffer. Save the first key value to the end of the contiguous storage space.
  • step 192 the dynamic token determines whether the button data length is zero. If yes, the button interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 193 is performed.
  • step 193 the dynamic token deletes the last data stored in the button data buffer, and updates the button data length.
  • Step 194 The dynamic token determines whether the button data length is less than the fourth preset length. If yes, step 195 is performed; otherwise, step 196 is performed.
  • step 195 the dynamic token stores the data in the key data buffer into the display data buffer, sets the display data length to the key data length, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 196 The dynamic token selects the data of the fourth preset length stored in the latest from the button data buffer, stores the selected data in the display data buffer, and sets the display data length to the fourth preset length. , the button interrupt and the total interrupt are turned on, and the process returns to step 103.
  • Step 197 The dynamic token determines whether there is undisplayed data stored in the data buffer earlier than the data in the button data buffer. If yes, step 198 is performed; otherwise, the button interrupt and the total interrupt are turned on, and the process returns. Step 103.
  • Step 198 The dynamic token determines whether the length of the undisplayed data is less than the fourth preset length. If yes, step 199 is performed; otherwise, step 200 is performed.
  • step 199 the dynamic token stores the undisplayed data in the display data buffer, sets the display data length to the length of the undisplayed data, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 200 The dynamic token selects the data of the fourth preset length that is stored last in the undisplayed data, stores the selected data in the display data buffer, and sets the display data length to the fourth preset length. Turn on the key interrupt and the total interrupt, and return to step 103.
  • Step 201 The dynamic token determines whether there is undisplayed data stored in the data buffer later than the data in the button data buffer. If yes, step 202 is performed; otherwise, the button interrupt and the total interrupt are turned on, and the process returns. Step 103.
  • Step 202 The dynamic token determines whether the length of the undisplayed data is less than the fourth preset length. If yes, step 203 is performed; otherwise, step 204 is performed.
  • Step 203 The dynamic token stores the undisplayed data into the display data buffer, sets the display data length to the length of the undisplayed data, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 204 The dynamic token selects the earliest stored data of the fourth preset length from the undisplayed data, stores the selected data in the display data buffer, and sets the display data length to the fourth preset length, and starts The key is interrupted and the total interrupt is returned, and the process returns to step 103.
  • Step 205 The dynamic token determines whether the button data length is zero. If yes, step 206 is performed; otherwise, step 211 is performed.
  • Step 206 The dynamic token generates a dynamic password and a new log corresponding to the dynamic password according to the time factor, and stores the dynamic password in the display data buffer.
  • the dynamic token generates a time-type dynamic password according to the time factor, allocates an index for the newly added log, and uses the length of the time information corresponding to the time factor as the length of the newly added log, the length of the index, the newly added log, and the time.
  • the time information corresponding to the factor is combined to obtain a new log.
  • Step 207 The dynamic token determines whether the number of log records is zero. If yes, step 208 is performed; otherwise, step 209 is performed.
  • Step 208 The dynamic token stores the newly added log in the log storage area, sets the first log index and the last log index to the index in the newly added log, updates the number of logs, and sets the system state to display the dynamic password state. Turn on the key interrupt and the total interrupt, and return to step 103.
  • the dynamic token adds 1 to the number of logs as the number of updated logs.
  • Step 209 The dynamic token determines whether the space occupied by the newly added log is larger than the remaining space in the log storage area. If yes, step 210 is performed; otherwise, the newly added log is stored in the log storage area, and the number of logs is updated and finally The log index sets the system state to display the dynamic password state, turns on the key interrupt and the total interrupt, and returns to step 103.
  • the dynamic token can update the last log index to an index in the newly added log.
  • Step 210 The dynamic token deletes the log that is stored in the log storage area for the first time, moves the remaining logs in the log storage area forward, updates the number of logs and the first log index, and returns to step 209.
  • the dynamic token will display the log of the earliest storage in the data buffer, and then move the remaining logs in the log storage area to the continuous storage space starting from the first address of the log storage area, and log the log.
  • the number of bars is reduced by 1, as the number of updated logs, and the first log index is incremented by 1.
  • step 211 the dynamic token clears the display data buffer, and the data in the key data buffer is used as a challenge code to generate a dynamic password and a new log corresponding to the dynamic password.
  • the dynamic token generates a challenge dynamic password according to the time factor and the challenge code, allocates an index for the newly added log, compresses the transaction information corresponding to the challenge code, obtains the compressed transaction data, and acquires time information corresponding to the time factor.
  • the sum of the length and the length of the compressed transaction data is used as the length of the newly added log, and the index, the length of the newly added log, the time information corresponding to the time factor, and the compressed transaction data are combined to obtain a new log.
  • step 212 the dynamic token stores the dynamic password in the display data buffer, clears the key data buffer, and returns to step 207.
  • Step 213 The dynamic token determines, according to the first key value, whether the currently pressed button is a numeric key or a delete key. If yes, the display data buffer is cleared, and step 214 is performed; otherwise, the key interrupt and the total interrupt are turned on. And return to step 103.
  • step 214 the dynamic token sets the system state to the token interface state, displays the token interface information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 215 The dynamic token judges the currently pressed button according to the first key value. If it is a numeric key, step 216 is performed; if it is a delete key, step 226 is performed.
  • step 216 the dynamic token saves the first key value to the key data buffer and updates the key data length.
  • the dynamic token adds 1 to the length of the key data as the updated key data length.
  • Step 217 The dynamic token determines whether the button data length is less than the first preset length. If yes, step 218 is performed; otherwise, step 219 is performed.
  • step 218 the dynamic token updates the log verification information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 219 The dynamic token determines whether the data in the button data buffer is the same as the data in the password data buffer. If yes, step 220 is performed; otherwise, step 221 is performed.
  • Step 220 The dynamic token clears the key data buffer, clears the number of log verification errors, sets the system state to the log display state, sets the time information display flag, and sets the current log index to the last log index, according to the current log.
  • the index reads the corresponding log from the log storage area, stores the read log into the log buffer, stores the time information in the read log into the display data buffer, and starts the key interrupt and the total interrupt. And return to step 103.
  • the dynamic token reads the corresponding log from the log storage area according to the current log index, and specifically includes: the dynamic token sets the read pointer to the first address of the log storage area, and stores the log according to the read pointer.
  • the corresponding log is read in the area, and it is determined whether the index in the read log is the same as the current log index. If yes, it is determined that the read log is a log corresponding to the current log index; otherwise, according to the read
  • the size of the space occupied by the log updates the read pointer, and continues to read the corresponding log from the log storage area according to the read pointer until the index in the read log is the same as the current log index.
  • step 221 the dynamic token clears the key data buffer, and updates the number of log verification errors.
  • the dynamic token adds 1 to the number of log verification errors as the number of log verification errors after the update.
  • Step 222 The dynamic token determines whether the number of log verification errors is the second preset number of times. If yes, step 223 is performed; otherwise, step 224 is performed.
  • step 223 the dynamic token sets the log lock flag, sets the system state to display the unlock challenge code state, displays the log lock information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 224 the dynamic token sets the system state to a PIN error state and displays a PIN error message.
  • step 225 the dynamic token turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 226 the dynamic token determines whether the button data length is zero. If yes, the button interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 227 is performed.
  • Step 227 the dynamic token deletes the last data stored in the button data buffer, updates the button data length, updates the log verification information, turns on the key interrupt and the total interrupt, and returns to step 103.
  • the dynamic token decrements the key data length by one as the updated key data length.
  • step 220 when the dynamic token determines that the data in the key data buffer is the same as the data in the password data buffer, the time information display flag is set.
  • Step 229 The dynamic token judges the currently pressed button according to the first key value. If it is the confirmation key, step 230 is performed; if it is the left button, step 236 is performed; if it is the right button, step 238 is performed. .
  • Step 230 The dynamic token determines whether the length of the log in the log buffer is the fifth preset length. If yes, step 231 is performed; otherwise, step 232 is performed.
  • the fifth preset length is the length of the time information in the log.
  • step 231 the dynamic token displays the blank transaction information, resets the time information display flag, turns on the key interrupt and the total interrupt, and returns to step 103.
  • Step 232 The dynamic token resets the time information display flag, obtains compressed transaction data from the log in the log buffer, and decompresses the compressed transaction data to obtain current transaction information.
  • Step 233 The dynamic token determines whether the length of the current transaction information is greater than the fourth preset length. If yes, step 234 is performed; otherwise, step 235 is performed.
  • Step 234 The dynamic token selects, from the current transaction information, the data of the fourth preset length of the storage location as the current display information, stores the current display information in the display data buffer, and illuminates the right on the display screen.
  • the arrow, the button interrupt and the total interrupt are turned on, and returns to step 103.
  • step 235 the dynamic token stores the current transaction information into the display data buffer, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 236 the dynamic token determines whether the current log index is equal to the first log index. If yes, the key interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 237 is performed.
  • Step 237 The dynamic token updates the current log index, reads the corresponding log from the log storage area according to the current log index, stores the time information in the read log into the display data buffer, and starts the key interrupt and the total interrupt. And return to step 103.
  • the dynamic token can decrement the current log index by one.
  • step 2308 the dynamic token determines whether the current log index is equal to the last log index. If yes, the key interrupt and the total interrupt are turned on, and the process returns to step 103; otherwise, step 239 is performed.
  • Step 239 The dynamic token updates the current log index, reads the corresponding log from the log storage area according to the current log index, stores the time information in the read log into the display data buffer, and starts the key interrupt and the total interrupt. And return to step 103.
  • the dynamic token can increment the current log index by one.
  • Step 240 the dynamic token according to the first key value, the currently pressed button is judged, if it is the confirmation button, step 241 is performed;
  • step 242 is performed;
  • step 247 If it is a right button, go to step 247.
  • Step 241 the dynamic token sets the time information display flag, reads the time information from the log in the log buffer, stores the read time information into the display data buffer, and starts the key interrupt and the total interrupt, and Go back to step 103.
  • step 242 the dynamic token determines whether the left arrow on the display screen is illuminated. If yes, step 243 is performed; otherwise, the button interrupt and the total interrupt are turned on, and the process returns to step 103.
  • Step 243 The dynamic token reads data adjacent to the current display information from the current transaction information, and stores the data at a higher position as undisplayed data.
  • Step 244 The dynamic token determines whether the length of the undisplayed data is greater than the fourth preset length. If yes, step 245 is performed; otherwise, step 246 is performed.
  • Step 245 The dynamic token selects the data of the fourth preset length that is the last of the storage location from the undisplayed data as the current display information, stores the current display information in the display data buffer, and illuminates the right on the display screen.
  • the arrow, the button interrupt and the total interrupt are turned on, and returns to step 103.
  • step 246 the dynamic token stores the undisplayed data in the display data buffer, illuminates the right arrow on the display, turns off the left arrow on the display, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 247 the dynamic token determines whether the right arrow on the display is illuminated. If yes, step 248 is performed; otherwise, the button interrupt and the total interrupt are turned on, and the process returns to step 103.
  • Step 248 The dynamic token reads the data adjacent to the current display information from the current transaction information, and the data stored later is used as the undisplayed data.
  • Step 249 The dynamic token determines whether the length of the undisplayed data is greater than the fourth preset length. If yes, step 250 is performed; otherwise, step 251 is performed.
  • Step 250 The dynamic token selects the data of the fourth preset length of the storage location from the undisplayed data as the current display information, stores the current display information in the display data buffer, and illuminates the left on the display screen.
  • the arrow, the button interrupt and the total interrupt are turned on, and returns to step 103.
  • step 251 the dynamic token stores the undisplayed data in the display data buffer, illuminates the left arrow on the display, turns off the right arrow on the display, turns on the key interrupt and the total interrupt, and returns to step 103.
  • step 252 the dynamic token turns on the total interrupt, switches the clock source to the low speed clock, and enters the sleep mode.
  • Step 253 after the dynamic token is woken up, the clock source is switched to the high speed clock, and the process returns to step 103.
  • the dynamic token in the embodiment of the present invention After generating the dynamic password, the dynamic token in the embodiment of the present invention generates and records a log corresponding to the dynamic password for the user to view, thereby recording information related to the completed identity authentication, so that the user can review the completed identity authentication. Whether it is the identity authentication completed by itself, the authentication mechanism using dynamic password and the security of dynamic token are improved.
  • the dynamic token determines the currently pressed button according to the first key value, and generates a dynamic password if the currently pressed button is the first button.
  • the log corresponding to the dynamic password stores the dynamic password in the display data buffer, stores the log in the log storage area, and turns on the button interrupt; if the currently pressed button is the second button, the log is read from the log storage area.
  • the log, the stored log is stored in the display data buffer, and the key interrupt is turned on, and the object of the present invention can also be achieved.
  • the dynamic token determines, according to the first key value, that the currently pressed button is the second button, or after the combination of the third button and the fourth button, the button can also be turned on.
  • Interrupt and after judging that the set interrupt flag is the key interrupt flag, the key is turned off, the keyboard is scanned, and the key value obtained by the scan is used to determine that the currently pressed button is the fifth button, and is read from the log storage area. The log is taken, the read log is stored in the display data buffer, and the key interrupt is turned on, and the object of the present invention can also be achieved.
  • the dynamic token may also use a circular queue to store the newly added log to the log storage area, as shown in the figure.
  • Figure 15 including the following steps:
  • step 301 the dynamic token determines whether the space occupied by the newly added log is greater than the remaining space in the log storage area. If yes, step 302 is performed; otherwise, step 304 is performed.
  • Step 302 The dynamic token reads the corresponding log from the log storage area according to the first record pointer, and updates the space in the foremost record pointer and the log storage area according to the space occupied by the read log.
  • the dynamic token may add the remaining space in the foremost record pointer and the log storage area respectively to the size of the space occupied by the read log, and the obtained result is respectively used as the updated first record pointer and the log storage area.
  • the remaining space may be added to the foremost record pointer and the log storage area respectively to the size of the space occupied by the read log, and the obtained result is respectively used as the updated first record pointer and the log storage area. The remaining space.
  • Step 303 The dynamic token reads the corresponding log from the log storage area according to the first record pointer, uses the index of the read log as the first log index, updates the number of logs, and returns to step 301.
  • the dynamic token can decrement the number of logs by one.
  • Step 304 The dynamic token determines whether the number of log records is zero. If yes, step 306 is performed; otherwise, step 305 is performed.
  • Step 305 The dynamic token reads the corresponding log from the log storage area according to the last record pointer, updates the last record pointer according to the space occupied by the read log, and performs step 306.
  • the dynamic token may add the last record pointer to the size of the space occupied by the read log, and use the obtained result as the updated last record pointer.
  • Step 306 The dynamic token sets the count value of the temporary counter to zero, sets the value of the temporary pointer to the value of the last record pointer, and sets the current log byte to the first byte of the newly added log.
  • Step 307 The dynamic token determines whether the value of the temporary pointer is smaller than the size of the log storage area. If yes, step 308 is performed; otherwise, the value of the temporary pointer is set to zero, and step 308 is performed.
  • Step 308 The dynamic token stores the current log byte to a position corresponding to the temporary pointer, updates the count value of the temporary pointer and the temporary counter, and uses the next byte of the current log byte as the updated current log byte.
  • the dynamic token can increment the temporary pointer by one and increment the count value of the temporary counter by one.
  • Step 309 The dynamic token determines whether the count value of the temporary counter is smaller than the space occupied by the newly added log. If yes, the process returns to step 307; otherwise, step 310 is performed.
  • Step 310 The dynamic token sets the last log index to the index of the newly added log, updates the number of logs, and updates the remaining space in the log storage area according to the space occupied by the newly added log.
  • the dynamic token can increase the number of logs by one, and the remaining space in the log storage area is subtracted from the space occupied by the newly added log as the remaining space in the updated log storage area.
  • the dynamic token reads the corresponding log process from the log storage area according to the current log index, as shown in FIG. 16, and includes the following steps:
  • step 401 the dynamic token sets the value of the temporary pointer to the value of the foremost record pointer.
  • Step 402 The dynamic token reads the corresponding index from the log storage area according to the temporary pointer, and obtains a space occupied by the log corresponding to the index.
  • Step 403 The dynamic token determines whether the read index is the same as the current log index. If yes, step 406 is performed; otherwise, step 404 is performed.
  • step 404 the dynamic token updates the temporary pointer according to the size of the space occupied by the log.
  • the dynamic token may add the temporary pointer to the size of the space occupied by the log, and use the obtained result as the updated temporary pointer.
  • Step 405 The dynamic token determines whether the value of the temporary pointer is smaller than the space size of the log storage area. If yes, return to step 402; otherwise, update the temporary pointer according to the space size of the log storage area, and return to step 402.
  • the dynamic token may subtract the space size of the log storage area from the temporary pointer, and use the obtained result as the updated temporary pointer.
  • step 406 the dynamic token sets the count value of the temporary counter to the size of the space occupied by the log.
  • Step 407 The dynamic token reads one byte of data from the log storage area according to the temporary pointer, and updates the count value of the temporary pointer and the temporary counter.
  • the dynamic token can increment the temporary pointer by one and decrement the count value of the temporary counter by one.
  • Step 408 The dynamic token determines whether the value of the temporary pointer is smaller than the space size of the log storage area. If yes, step 409 is performed; otherwise, the temporary pointer is updated according to the space size of the log storage area, and step 409 is performed.
  • the dynamic token may subtract the space size of the log storage area from the temporary pointer, and use the obtained result as the updated temporary pointer.
  • step 409 the dynamic token determines whether the count value of the temporary counter is greater than zero. If yes, the process returns to step 407; otherwise, it is determined that the log corresponding to the current log index is read from the log storage area.
  • the embodiment of the present invention further provides a dynamic token with a log function, as shown in FIG. 17, including:
  • the initialization module 501 is configured to perform an initialization operation after power-on, and enable a total interrupt and a button wake-up function;
  • the first determining module 502 is configured to determine whether there is an interrupt flag that is set
  • the second determining module 503 is configured to: after the first determining module 502 determines that the set interrupt flag exists, determine the set interrupt flag;
  • the reset module 504 is configured to: when the second determining module 503 determines that the set interrupt flag is a timer interrupt flag, reset the timer interrupt flag, and trigger the first determining module 502 to determine whether the set interrupt flag exists;
  • the first obtaining module 505 is configured to: when the second determining module 503 determines that the set interrupt flag is a button interrupt flag, close the button interrupt, and scan the button Disk, obtaining the first key value;
  • the third determining module 506 is configured to determine, according to the first key value acquired by the first obtaining module 505, the currently pressed button;
  • the first processing module 507 is configured to: when the third determining module 506 determines that the currently pressed button is the first button, generate a dynamic password and a log corresponding to the dynamic password, and store the dynamic password in the display data buffer, The log is stored in the log storage area, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is an interrupt flag that is set;
  • the second processing module 508 is configured to: when the third determining module 506 determines that the currently pressed button is the second button, or the combination of the third button and the fourth button, the log is read from the log storage area, and The read log is stored in the display data buffer, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag.
  • the second processing module 508 is specifically configured to: after the third determining module 506 determines that the currently pressed button is the second button, or the combination of the third button and the fourth button, perform the following operations:
  • step T1 open the key interrupt, determine whether there is a set interrupt flag, if yes, proceed to step T2; otherwise, continue to step T1;
  • T2 it is determined that the set interrupt flag is a key interrupt flag, the button is turned off, and the keyboard is scanned;
  • the first determining module 502 determines whether there is a set interrupt flag.
  • the first button may be a confirmation button, and correspondingly, the dynamic token further includes:
  • the third processing module is configured to: when the third determining module 506 determines that the currently pressed button is a numeric key, determine whether the button data length is less than a third preset length, and if yes, save the first key value to the button In the data buffer and the display data buffer, the button data length is updated, the button interrupt is turned on, and the first judging module 502 is triggered to determine whether there is an interrupt flag that is set; otherwise, the button interrupt is turned on, and the first judging module 502 is triggered to determine whether There is a set interrupt flag; when the third determining module 506 determines that the currently pressed button is a delete button, it determines whether the button data length is zero, and if so, turns on the button interrupt, and triggers the first determining module 502 to determine Whether there is a set interrupt flag; otherwise, the last data stored in the button data buffer is deleted, the button data length is updated, the last data stored in the data buffer is deleted, the button interrupt is turned on, and the trigger is triggered.
  • the first processing module 507 includes:
  • the first determining sub-module is configured to determine, when the third determining module 506 determines that the currently pressed button is a confirming button, determine whether the button data length is zero;
  • a first generating submodule configured to generate, according to a time factor, a dynamic password and a new log corresponding to the dynamic password when the first determining submodule determines that the button data length is zero;
  • the first generating sub-module is specifically configured to: when the first determining sub-module determines that the button data length is zero, generate a time-type dynamic password according to the time factor, and allocate an index for the newly added log, which corresponds to the time factor.
  • the length of the time information is used as the length of the newly added log.
  • the index, the length of the newly added log, and the time information corresponding to the time factor are combined to obtain a new log.
  • a second generating submodule configured to: when the first determining submodule determines that the key data length is not zero, use the data in the key data buffer as a challenge code to generate a dynamic password and a new log corresponding to the dynamic password;
  • the foregoing second generating sub-module is specifically configured to: when the first determining sub-module determines that the button data length is not zero, generate a challenge-type dynamic password according to the time factor and the challenge code, and allocate an index for the newly added log,
  • the transaction information corresponding to the challenge code is compressed to obtain compressed transaction data, and the sum of the length of the time information corresponding to the time factor and the length of the compressed transaction data is obtained as the length of the newly added log, the length of the index, the newly added log, and
  • the time information corresponding to the time factor and the compressed transaction data are combined to obtain a new log.
  • a first storage submodule configured to store the dynamic password generated by the first generation submodule and the second generation submodule into the display data buffer
  • a second storage submodule configured to store the newly added logs generated by the first generation submodule and the second generation submodule into a log storage area
  • the sub-module is configured to enable the key interrupt after the first generation sub-module or the second generation sub-module generates the dynamic password and the newly added log, and trigger the first judging module 502 to determine whether there is an interrupt flag that is set.
  • the foregoing second storage sub-module is specifically configured to determine whether the number of logs is zero. If yes, the newly added logs are stored in the log storage area, and the first log index and the last log index are both set to newly added logs. In the index, update the number of logs; otherwise, store the newly added log in the log storage area, set the last log index to the index in the newly added log, and update the number of logs.
  • the foregoing second processing module 508 is specifically configured to set the current log index to the last log index, read the corresponding log from the log storage area according to the current log index, and store the read log into the log buffer.
  • the time information in the read log is stored in the display data buffer, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag.
  • the above dynamic token further includes:
  • the fourth processing module is configured to: when the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines that the currently pressed button is the left button, determining the current log. Whether the index is equal to the first log index, if yes, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is an interrupt flag that is set; otherwise, the current log index is updated, and the corresponding log index is read from the log storage area according to the current log index.
  • the log stores the time information in the read log into the display data buffer, turns on the key interrupt, and triggers the first determining module 502 to determine whether there is an interrupt flag that is set;
  • the fifth processing module is configured to: when the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines that the currently pressed button is the right button, determining the current log index. Whether it is equal to the last log index, if yes, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; otherwise, the current log index is updated, and the corresponding log index is read from the log storage area according to the current log index.
  • the log stores the time information in the read log into the display data buffer, turns on the key interrupt, and triggers the first determining module 502. Determine if there is an interrupt flag that is set.
  • the dynamic token further includes:
  • a fourth determining module configured to determine whether the time information display flag is set
  • the fourth processing module is configured to: when the fourth determining module determines that the time information display flag is set, the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining
  • the module 506 determines that the currently pressed button is the left button, it determines whether the current log index is equal to the first log index, and if so, turns on the button interrupt, and triggers the first determining module 502 to determine whether there is a set interrupt flag; otherwise
  • the current log index is updated, the corresponding log is read from the log storage area according to the current log index, the time information in the read log is stored in the display data buffer, the key interrupt is turned on, and the first determining module 502 is triggered. Determine whether there is an interrupt flag that is set;
  • the fifth processing module is specifically configured to: when the fourth determining module determines that the time information display flag is set, the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines When the currently pressed button is the right button, it is determined whether the current log index is equal to the last log index. If yes, the button interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; otherwise, the current log index is updated. The corresponding log is read from the log storage area according to the current log index, and the time information in the read log is stored in the display data buffer, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether the set is set. Interrupt flag
  • the above dynamic tokens also include:
  • the sixth processing module is specifically configured to: when the fourth determining module determines that the time information display flag is set, the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines When the currently pressed button is the confirmation button, do the following:
  • step R1 determining whether the length of the log in the log buffer is the fifth preset length, if yes, executing step R2; otherwise, performing step R3;
  • Step R3 resetting the time information display flag, obtaining compressed transaction data from the log in the log buffer, decompressing the compressed transaction data, and determining whether the length of the current transaction information obtained by decompression is greater than a fourth preset length, and if so, Step R4 is performed; otherwise, step R5 is performed;
  • the second processing module 508 is specifically configured to determine, at the third determining module 506, that the currently pressed button is the second button or the third button.
  • the current log index is set to the last log index
  • the corresponding log is read from the log storage area according to the current log index
  • the compressed transaction data in the read log is decompressed, and the decompression is obtained.
  • the current transaction information is stored in the log buffer to determine whether the current transaction information is greater than the fourth preset length. If yes, the data of the fourth preset length of the storage location is selected as the current display from the current transaction information.
  • the information is stored in the display data buffer, the right arrow on the display screen is illuminated, the button interrupt is turned on, and the first determining module 502 is triggered to determine whether there is an interrupt flag that is set; otherwise, the current transaction information is stored.
  • the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag.
  • the above dynamic token further includes:
  • the seventh processing module is configured to: when the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines that the currently pressed button is the left button, determining the display screen Whether the upper left arrow is illuminated, if not, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; if it is lit, the current transaction information is read and The current display information is adjacent, and the data with the higher storage position is used as the undisplayed data, and it is determined whether the length of the undisplayed data is greater than the fourth preset length, and if so, the storage location is selected from the undisplayed data, The fourth preset length data is used as the current display information, the current display information is stored in the display data buffer, the right arrow on the display screen is illuminated, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether the set is present.
  • Interrupt flag otherwise, store the undisplayed data in the display data buffer, illuminate the right arrow on the display, turn off the left arrow on the display, and turn it on Key interrupt and trigger the determining module 502 determines whether the first set, the interrupt flag is present;
  • the eighth processing module is configured to: when the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines that the currently pressed button is the right button, determining the display screen Whether the right arrow is illuminated, if not illuminated, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; if it is lit, the current transaction information is read and current.
  • the data indicating that the information is adjacent to each other and the storage location is further lower is used as the undisplayed data, and it is determined whether the length of the undisplayed data is greater than the fourth preset length. If yes, the storage location is selected from the undisplayed data.
  • the four preset length data is used as the current display information, the current display information is stored in the display data buffer, the left arrow on the display screen is illuminated, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt. Flag; otherwise, store the undisplayed data in the display data buffer, illuminate the left arrow on the display, turn off the right arrow on the display, and turn it on Key interrupt and trigger the determining module 502 first determines whether the present interrupt flag is set.
  • a fifth determining module configured to determine whether the time information display flag is set
  • the seventh processing module is specifically configured to: when the fifth determining module determines that the time information display flag is reset, the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines the current
  • the pressed button is the left button, it is judged whether the left arrow on the display screen is lit, if not, the button interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag;
  • the data adjacent to the current display information is read from the current transaction information, and the data with the storage position higher is used as the undisplayed data, and the data is not displayed.
  • the data of the fourth preset length that is the last of the storage location is selected from the undisplayed data as the current display information, and the current display information is stored in the display data buffer. Illuminating the right arrow on the display screen, turning on the key interrupt, and triggering the first determining module 502 to determine whether there is a set interrupt flag; otherwise, storing the undisplayed data in the display data buffer, illuminating the right side of the display An arrow, extinguishing the left arrow on the display screen, turning on the key interrupt, and triggering the first determining module 502 to determine whether there is an interrupt flag that is set;
  • the eighth processing module is specifically configured to: when the fifth determining module determines that the time information display flag is reset, the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines that the currently pressed button is a right button, determines whether the right arrow on the display screen is illuminated, if not, turns on the button interrupt, and triggers the first determining module 502 to determine whether there is a set interrupt.
  • the data adjacent to the current display information is read from the current transaction information, and the data stored later is used as the undisplayed data, and it is determined whether the length of the undisplayed data is greater than the fourth preset length, if If yes, the data of the fourth preset length of the storage location is selected from the undisplayed data as the current display information, and the current display information is stored in the display data buffer, and the left arrow on the display is illuminated to be turned on.
  • the key is interrupted, and the first determining module 502 is triggered to determine whether there is an interrupt flag that is set; otherwise, the undisplayed data is stored to the display data. Region, the left arrow on the display screen lights up, off the right arrow on the display screen, open key interrupt and trigger the determining module 502 determines whether the first set, the interrupt flag is present;
  • the above dynamic tokens also include:
  • the ninth processing module is configured to: when the fourth determining module determines that the time information display flag is reset, the second processing module 508 triggers the first determining module 502 to determine that the set interrupt flag exists, and the third determining module 506 determines When the currently pressed button is the confirmation button, the time information display flag is set, the time information is read from the log in the log buffer, the read time information is stored in the display data buffer, and the key interrupt is turned on. And triggering the first determining module 502 to determine whether there is a set interrupt flag.
  • P1 Determine whether the number of logs is zero. If yes, store the newly added logs in the log storage area, set the first log index and the last log index to the index in the newly added log, and update the number of logs; otherwise, Perform step P2;
  • step P2 determining whether the space occupied by the newly added log is larger than the remaining space in the log storage area, and if yes, executing step P3; otherwise, storing the newly added log in the log storage area, updating the number of logs and the last log index;
  • the second processing module 508 is specifically configured to perform the following operations:
  • step H2 According to the read pointer, read the corresponding log from the log storage area, determine whether the index in the read log is the same as the current log index, and if so, store the read log to the display data buffer. , the button interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; otherwise, step H3 is performed;
  • the foregoing second storage submodule is specifically configured to perform the following operations:
  • step G3 according to the first record pointer, read the corresponding log from the log storage area, the index of the read log as the first log index, update the number of logs, and return to step G1;
  • step G5 the last record pointer, read the corresponding log from the log storage area, according to the space occupied by the read log, update the last record pointer, and perform step G6;
  • G6 Set the count value of the temporary counter to zero, set the value of the temporary pointer to the value of the last record pointer, and set the current log byte to the first byte of the newly added log;
  • step G7 determining whether the value of the temporary pointer is smaller than the size of the log storage area, and if so, executing step G8; otherwise, setting the value of the temporary pointer to zero, and executing step G8;
  • G8 storing the current log byte to the position corresponding to the temporary pointer, updating the count value of the temporary pointer and the temporary counter, and using the next byte of the current log byte as the updated current log byte;
  • step G9 determining whether the count value of the temporary counter is smaller than the size of the space occupied by the newly added log, if yes, returning to step G7; otherwise, executing step G10;
  • G10 Set the last log index to the index of the newly added log, update the number of logs, and update the remaining space in the log storage area according to the amount of space occupied by the newly added log.
  • the second processing module 508 reads the corresponding log from the log storage area according to the current log index. Specifically, the second processing module 508 performs the following operations:
  • K1 Set the current log index to the last log index, and set the value of the temporary pointer to the value of the first record pointer
  • step K2 According to the temporary pointer, read the corresponding index from the log storage area, obtain the space occupied by the log corresponding to the index, and determine whether the index is the same as the current log index. If yes, execute step K4; otherwise, perform steps K3;
  • step K3 updating the temporary pointer according to the size of the space occupied by the log, determining whether the value of the temporary pointer is smaller than the size of the log storage area, and if yes, returning to step K2; otherwise, updating the temporary pointer according to the space size of the log storage area, and Return to step K2;
  • step K6 determining whether the value of the temporary pointer is smaller than the size of the log storage area, if yes, executing step K7; otherwise, updating the temporary pointer according to the size of the log storage area, and performing step K7;
  • step K7 determining whether the count value of the temporary counter is greater than zero, and if yes, returning to step K5; otherwise, storing the read data in a log buffer, and storing the time information in the read log to the display data buffer
  • the button interrupt is turned on, and the first judging module 502 is triggered to determine whether there is an interrupt flag that is set.
  • the dynamic token further includes:
  • a second obtaining module configured to acquire a button duration after the first acquiring module 505 obtains the first key value
  • the sixth determining module is configured to determine, after the third determining module 506, that the currently pressed button is the second button, or the combination of the third button and the fourth button, determining whether the button duration acquired by the second acquiring module is Less than the first preset duration;
  • the tenth processing module is configured to: when the sixth determining module determines that the button duration is less than the first preset duration, perform a corresponding operation according to the currently pressed button, open the button interrupt, and trigger the first determining module 502 to determine whether the button exists.
  • Set interrupt flag
  • the second processing module 508 is configured to: when the sixth determining module determines that the button duration is not less than the first preset duration, read the log from the log storage area, store the read log in the display data buffer, and enable The key is interrupted, and the first determining module 502 is triggered to determine whether there is a set interrupt flag.
  • the first preset duration is a product of a difference between the first preset value and the second preset value and a third preset duration
  • the reset module 504 is further configured to: when the second determining module 503 determines that the set interrupt flag is a key interrupt flag, reset the long button flag;
  • the second obtaining module is specifically configured to: after the first obtaining module 505 obtains the first key value, perform the following operations:
  • step S10 determining whether the second key value is the same as the first key value, if yes, executing step S11; otherwise, turning on the key interrupt, and triggering the first determining module 502 to determine whether there is a set interrupt flag;
  • step S14 determining whether the timer interrupt flag is set, if yes, proceeding to step S15; otherwise, returning to step S12;
  • step S16 scanning the keyboard, obtaining the third key value, determining whether the third key value is the same as the first key value, and if yes, executing step S17; otherwise, turning on the key interrupt and the total interrupt, and triggering the first determining module 502 to determine whether There is a set interrupt flag;
  • step S17 update the number of overflows, determine whether the number of overflows is the second preset value, and if so, set the long button flag; otherwise, return to step S12;
  • the sixth determining module is specifically configured to determine, after the third determining module 506, that the currently pressed button is a second button, or a combination of the third button and the fourth button, determining whether the long button flag is set, if , determining that the duration of the button is not less than the first preset duration; otherwise, determining that the duration of the button is less than the first preset duration.
  • the dynamic token further includes:
  • a seventh determining module configured to determine a system status
  • the eleventh processing module is configured to: when the third determining module 506 determines that the currently pressed button is a power button, and the seventh determining module determines that the system state is not the shutdown state, the system state is set to a shutdown state, and the button is turned on. Interrupting, and triggering the first determining module 502 to determine whether there is a set interrupt flag; when the third determining module 506 determines that the currently pressed button is a power button, and the seventh determining module determines that the system state is the shutdown state, Update system status;
  • the second processing module 508 includes:
  • the seventh determining module determines that the system state is the shutdown state, and the third determining module 506 determines that the currently pressed button is the second button, or is the combination of the third button and the fourth button , update the system status;
  • the processing submodule is configured to determine, in the seventh determining module, that the system state is the shutdown state, and the third determining module 506 determines that the currently pressed button is the second button, or is the combination of the third button and the fourth button
  • the log is read from the log storage area, the read log is stored in the display data buffer, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether the set interrupt flag exists.
  • the eleventh processing module updates the system status, specifically:
  • the eleventh processing module sets the system state to the verification token PIN state
  • the above dynamic tokens also include:
  • the twelfth processing module is configured to: when the seventh determining module determines that the system state is the verification token PIN state, and the third determining module 506 determines that the currently pressed button is a numeric key, perform the following operations:
  • step B3 determining whether the button data length is less than the first preset length, and if so, turning on the button interrupt, and triggering the first determining module 502 to determine whether to save The interrupt flag is set; otherwise, step B4 is performed;
  • step B4 determining whether the data in the button data buffer is the same as the data in the password data buffer, and if so, executing step B5; otherwise, executing step B6;
  • step B7 determining whether the number of token verification errors is the first predetermined number of times, and if so, executing step B8; otherwise, performing step B9;
  • the thirteenth processing module is configured to determine, when the seventh determining module determines that the system state is the verification token PIN state, and the third determining module 506 determines that the currently pressed button is a delete button, determining whether the button data length is zero If yes, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is an interrupt flag that is set;
  • the last data stored in the button data buffer is deleted, the button data length is updated, the button interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag.
  • the update submodule is specifically configured to determine, in the seventh determining module, that the system state is the shutdown state, and the third determining module 506 determines that the currently pressed button is the second button, or the third button and the third button When the combination of four buttons, the system state is set to verify the log PIN state;
  • the above dynamic token further includes:
  • the fourteenth processing module is configured to: when the seventh determining module determines that the system state is the verification log PIN state, and the third determining module 506 determines that the currently pressed button is a numeric key, performing the following operations:
  • step C3 determining whether the button data length is less than the first preset length, if yes, then opening the button interrupt, and triggering the first determining module 502 to determine whether there is a set interrupt flag; otherwise, performing step C4;
  • step C4 determining whether the data in the key data buffer is the same as the data in the password data buffer, and if so, executing step C5; otherwise, executing step C6;
  • step C7 determining whether the number of log verification errors is the second predetermined number of times, and if so, executing step C8; otherwise, performing step C9;
  • the fifteenth processing module is configured to determine, when the seventh determining module determines that the system state is the verification log PIN state, and the third determining module 506 determines that the currently pressed button is a delete key, determining whether the button data length is zero. If yes, the button interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; otherwise, the last data stored in the button data buffer is deleted, the button data length is updated, and the button interrupt is turned on, and The trigger first determination module 502 determines whether there is an interrupt flag that is set.
  • the dynamic token further includes:
  • the flag bit management module is configured to: when the third determining module 506 determines that the currently pressed button is a power button, and the seventh determining module determines that the system state is not the shutdown state, resetting the log boot flag; and the seventh determining module Determining that the system state is the shutdown state, and the third determining module 506 determines that the currently pressed button is the second button, or the combination of the third button and the fourth button, setting the log boot flag;
  • the sixteenth processing module is configured to: when the third determining module 506 determines that the currently pressed button is not a power button, and the seventh determining module determines that the system state is a PIN error state, determining whether the log boot flag is set, if Yes, the system state is set to verify the log PIN state, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; otherwise, the system state is set to the verification token PIN state, and the button interrupt is turned on. The first determining module 502 is triggered to determine whether there is an interrupt flag that is set.
  • the eleventh processing module is configured to: when the third determining module 506 determines that the currently pressed button is a power button, and the seventh determining module determines that the system state is not the shutdown state, setting the system state to In the shutdown state, the button interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; the third determining module 506 determines that the currently pressed button is a power button, and the seventh determining module determines the system state.
  • the state is off, it is determined whether the token lock flag is set. If yes, the system state is set to display the unlock challenge code state, the button interrupt is turned on, and the first judgment module 502 is triggered to determine whether there is a set interrupt flag; otherwise , set the system state to verify token PIN status;
  • the update sub-module is specifically configured to determine, in the seventh determining module, that the system state is the shutdown state, and the third determining module 506 determines that the currently pressed button is the second button, or the third button and the fourth button.
  • it is determined whether the log lock flag is set, and if so, the system state is set to display the unlock challenge code state, the key interrupt is turned on, and the first judgment module 502 is triggered to determine whether there is a set interrupt flag; otherwise, the system is The status is set to verify the log PIN status;
  • the twelfth processing module is further configured to: after determining that the number of token verification errors is the first preset number of times, setting the token lock flag;
  • the fourteenth processing module is further configured to: after determining that the number of log verification errors is the second preset number, setting the token lock flag;
  • the above dynamic tokens also include:
  • the seventeenth processing module is configured to: when the seventh determining module determines that the system state is the display unlocking challenge code state, and the third determining module 506 determines that the currently pressed button is not the power button, generates an unlocking challenge code, and the system The status is set to wait for the input unlock code status, display the unlock challenge code, turn on the key interrupt, and trigger the first determining module 502 to determine whether there is an interrupt flag that is set;
  • the eighteenth processing module is configured to: when the seventh determining module determines that the system state is waiting for the input unlocking code state, and the third determining module 506 determines that the currently pressed button is a numeric key, performing the following operations:
  • step D2 saving the first key value into the button data buffer, updating the button data length, determining whether the button data length is less than the second preset length, and if so, turning on the button interrupt, and triggering the first determining module 502 to determine whether the existence exists.
  • step D3 the data in the button data buffer is verified, if the verification is passed, step D4 is performed; otherwise, step D5 is performed;
  • the nineteenth processing module is configured to determine, when the seventh determining module determines that the system state is waiting for the input of the unlocking code state, and the third determining module 506 determines that the currently pressed button is the delete key, determining whether the button data length is zero. If yes, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is an interrupt flag set; otherwise, the last data stored in the button data buffer is deleted, the button data length is updated, and the button interrupt is turned on. The first determining module 502 is triggered to determine whether there is an interrupt flag that is set.
  • the eleventh processing module is configured to: when the third determining module 506 determines that the currently pressed button is a power button, and the seventh determining module determines that the system state is not the shutdown state, setting the system state to In the shutdown state, the button interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; the third determining module 506 determines that the currently pressed button is a power button, and the seventh determining module determines the system state.
  • the password setting flag is set. If yes, the system state is set to the verification token PIN state; otherwise, the system state is set to the first setting PIN state, the button interrupt is turned on, and the first judgment is triggered.
  • Module 502 determines if there is a set interrupt flag;
  • the above dynamic token further includes:
  • the twentieth processing module is configured to: when the seventh determining module determines that the system state is the first setting PIN state, and the third determining module 506 determines that the currently pressed button is a numeric key, save the first key value to In the button data buffer, update the button data length to determine whether the button data length is less than the first preset length, and if so, turn on the button interrupt, and trigger the first determining module 502 to determine whether there is a set interrupt flag; otherwise,
  • the data in the key data buffer is stored in the password data buffer, the key data buffer is cleared, the system state is set to the second setting PIN state, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt. Sign
  • the twenty-first processing module is configured to determine, when the seventh determining module determines that the system state is the first setting PIN state, and the third determining module 506 determines that the currently pressed button is the delete key, determining whether the button data length is Zero, if yes, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; otherwise, the last data stored in the button data buffer is deleted, the key data length is updated, and the key interrupt is turned on. And triggering the first determining module 502 to determine whether there is an interrupt flag that is set;
  • the twenty-second processing module is configured to: when the seventh determining module determines that the system state is the second setting PIN state, and the third determining module 506 determines that the currently pressed button is a numeric key, performing the following operations:
  • step F2 saving the first key value into the button data buffer, updating the button data length, determining whether the button data length is less than the first preset length, and if so, turning on the button interrupt, and triggering the first determining module 502 to determine whether the existence exists.
  • step F3 determining whether the data in the key data buffer is the same as the data in the password data buffer, and if so, executing step F5; otherwise, executing step F4;
  • step F5 determining whether the log boot flag is set, if yes, proceeding to step F6; otherwise, performing step F7;
  • the twenty-third processing module is configured to determine, when the seventh determining module determines that the system state is the second setting PIN state, and the third determining module 506 determines that the currently pressed button is the delete key, determining whether the button data length is Zero, if yes, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is a set interrupt flag; otherwise, the last data stored in the button data buffer is deleted, the key data length is updated, and the key interrupt is turned on. And triggering the first determining module 502 to determine whether there is an interrupt flag that is set;
  • the twenty-fourth processing module is configured to: when the third determining module 506 determines that the currently pressed button is not a power button, and the seventh determining module determines that the system state is a PIN setting error state, setting the system state to the first state Setting the PIN state, turning on the key interrupt, and triggering the first determining module 502 to determine whether there is an interrupt flag that is set;
  • the first processing module 507 is specifically configured to: when the third determining module 506 determines that the currently pressed button is the first button, and the seventh determining module determines that the system state is the token interface state, generating a dynamic password and the dynamic The log corresponding to the password, the dynamic password is stored in the display data buffer, The log is stored in the log storage area, the key interrupt is turned on, and the first determining module 502 is triggered to determine whether there is an interrupt flag that is set;
  • the second processing module 508 is specifically configured to determine, by the third determining module 506, that the currently pressed button is a second button, or a combination of the third button and the fourth button, and the seventh determining module determines that the system state is
  • the log shows the status
  • the log is read from the log storage area
  • the read log is stored in the display data buffer
  • the key interrupt is turned on
  • the first determining module 502 is triggered to determine whether the set interrupt flag exists.
  • the dynamic token in the embodiment of the present invention After generating the dynamic password, the dynamic token in the embodiment of the present invention generates and records a log corresponding to the dynamic password for the user to view, thereby recording information related to the completed identity authentication, so that the user can review the completed identity authentication. Whether it is the identity authentication completed by itself, the authentication mechanism using dynamic password and the security of dynamic token are improved.
  • the steps in the methods described in connection with the embodiments disclosed herein may be implemented directly in hardware, a software module executed by a processor, or a combination of both.
  • the software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Input From Keyboards Or The Like (AREA)
  • Storage Device Security (AREA)

Abstract

一种具有日志功能的动态令牌及其工作方法,动态令牌判断出按键中断标志被置位后,扫描键盘,获取第一键值,并根据第一键值,对当前被按下的按键进行判断,如果当前被按下的按键是第一按键,则生成动态口令以及与该动态口令对应的日志,将动态口令存储到显示数据缓冲区,将日志存储到日志存储区,开启按键中断;如果当前被按下的按键是第二按键,或者是第三按键和第四按键的组合,则从日志存储区中读取日志,并将读取到的日志存储到显示数据缓冲区。根据本发明,通过动态令牌记录与已完成的身份认证相关的信息,用户能够复核已完成的身份认证是否为由自身完成的身份认证,从而提高了使用动态口令的身份认证机制以及动态令牌的安全性。

Description

一种具有日志功能的动态令牌及其工作方法 技术领域
本发明涉及一种具有日志功能的动态令牌及其工作方法,属于信息安全领域。
背景技术
动态令牌是一种用于生成动态口令的设备,广泛应用于网银、电信运营商和电子政务等应用领域。动态令牌所生成的动态口令可用于身份认证,能够有效提高身份认证的安全性。
现有技术中,动态口令是与时间相关的、不可预测的随机数字组合,每个动态口令只能使用一次,且动态口令被使用后,无法被再次查看和确认。
发明人在实现本发明的过程中,发现现有技术至少存在以下缺陷:
由于动态口令只能使用一次,动态令牌在显示动态口令一段时间(通常是几十秒钟)后,自动关机,用户无法通过动态令牌查看与已完成的身份认证相关的任何信息,无法确认已完成的身份认证是否为由自身完成的身份认证,因此,现有的使用动态口令的身份认证机制存在安全性缺陷。
发明内容
本发明的目的是提供一种具有日志功能的动态令牌及其工作方法,以解决现有技术中使用动态口令进行身份认证的安全性缺陷。
为此,根据本发明的一个方面,提供了一种具有日志功能的动态令牌的工作方法,包括以下步骤:
S1)动态令牌上电,执行初始化操作,开启总中断和按键唤醒功能;
S2)所述动态令牌判断是否存在置位的中断标志,如果是,则执行步骤S3;否则,继续执行步骤S2;
S3)所述动态令牌对置位的中断标志进行判断,如果是定时器中断标志,则执行步骤S4;如果是按键中断标志,则执行步骤S5;
S4)所述动态令牌将定时器中断标志复位,并返回步骤S2;
S5)所述动态令牌关闭按键中断,扫描键盘,获取第一键值;
S6)所述动态令牌根据所述第一键值,对当前被按下的按键进行判断,如果当前被按下的按键是第一按键,则执行步骤S7;如果当前被按下的按键是第二按键,或者是第三按键和第四按键的组合,则执行步骤S8;
S7)所述动态令牌生成动态口令以及与所述动态口令对应的日志,将所述动态口令存储到显示数据缓冲区,将所述日志存储到日志存储区,开启按键中断,并返回步骤S2;以及
S8)所述动态令牌从所述日志存储区中读取日志,将读取到的日志存储到所述显示数据缓冲区,开启按键中断,并返回步骤S2。
根据本发明的另外一个方面,提供了一种具有日志功能的动态令牌,包括:
初始化模块,用于在上电之后,执行初始化操作,开启总中断和按键唤醒功能;
第一判断模块,用于判断是否存在置位的中断标志;
第二判断模块,用于在所述第一判断模块判断出存在置位的中断标志之后,对置位的中断标志进行判断;
复位模块,用于在所述第二判断模块判断出所述置位的中断标志是定时器中断标志时,将定时器中断标志复位,并触发所述第一判断模块判断是否存在置位的中断标志;
第一获取模块,用于在所述第二判断模块判断出所述置位的中断标志是按键中断标志时,关闭按键中断,扫描键盘,获取第一键值;
第三判断模块,用于根据所述第一获取模块获取到的所述第一键值,对当前被按下的按键进行判断;
第一处理模块,用于在所述第三判断模块判断出当前被按下的按键是第一按键时,生成动态口令以及与所述动态口令对应的日志,将所述动态口令存储到显示数据缓冲区,将所述日志存储到日志存储区,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;
第二处理模块,用于在所述第三判断模块判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,从所述日志存储区中读取日志,将读取到的日志存储到所述显示数据缓冲区,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志。
根据本发明,动态令牌在生成动态口令后,生成并记录与该动态口令对应的日志供用户查看,从而记录与已完成的身份认证相关的信息,使得用户能够复核已完成的身份认证是否为由自身完成的身份认证,从而提高了使用动态口令的身份认证机制以及动态令牌的安全性。
附图说明
图1至14为本发明实施例中的一种具有日志功能的动态令牌的工作方法流程图;
图15为本发明实施例中的动态令牌存储新增日志的方法流程图;
图16为本发明实施例中的动态令牌读取日志的方法流程图;
图17为本发明实施例中的一种具有日志功能的动态令牌的结构示意图。
具体实施方式
下面将结合附图,对本发明实施例的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域的技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明提供了一种具有日志功能的动态令牌的工作方法,动态令牌判断出按键中断标志被置位后,关闭按键中断,扫描键盘,获取第一键值,并根据第一键值,对当前被按下的按键进行判断,如果当前被按下的按键是第一按键,则生成动态口令以及与该动态口令对应的日志,将动态口令存储到显示数据缓冲区,将日志存储到日志存储区,开启按键中断;如果当前被按下的按键是第三按键和第四按键的组合,则从日志存储区中读取日志,将读取到的日志存储到显示数据缓冲区,开启按键中断,其中,第一按键可以是动态令牌上的确认键,也可以是动态令牌上的其他按键;第三按键可以动态令牌上的是数字键,也可以是动态令牌上的其他按键;第四按键可以是动态令牌上的删除键,也可以是动态令牌上的其他按键。
如图1至14所示,根据本发明的具有日志功能的动态令牌的工作方法,包括以下步骤:
步骤101,动态令牌上电,执行初始化操作。
步骤102,动态令牌开启总中断和按键唤醒功能。
步骤103,动态令牌判断是否存在置位的中断标志,如果是,则执行步骤104;否则,执行步骤252。
步骤104,动态令牌对置位的中断标志进行判断,如果是定时器中断标志,则执行步骤105;如果是按键中断标志,则执行步骤106;如果是其他中断标志,则将置位的中断标志复位,执行相应的操作,并返回步骤103。
需要说明的是,当动态令牌中的定时器溢出时,动态令牌接收到定时器中断,通过硬件将定时器中断标志置位;当动态令牌上的按键被触发时,动态令牌接收到按键中断,通过硬件将按键中断标志置位;动态令牌接收到其他中断时,通过硬件将对应的中断标志置位。
步骤105,动态令牌将定时器中断标志复位,并返回步骤103。
步骤106,动态令牌关闭按键中断,将长按键标志复位,并延时第一预设时长。
其中,第一预设时长可以为20ms。
步骤107,动态令牌扫描键盘,获取第一键值。
步骤108,动态令牌判断第一键值是否为空或错误键值,如果是,则开启按键中断,并返回步骤103;否则,执行步骤109。
步骤109,动态令牌延时第二预设时长,保存第一键值,扫描键盘,获取第二键值。
其中,第二预设时长可以为20ms。
步骤110,动态令牌判断第二键值是否与第一键值相同,如果是,则执行步骤111;否则,开启按键中断,并返回步骤103。
步骤111,动态令牌根据第一键值,判断当前被按下的按键是否为电源键,如果是,则执行步骤113;否则,执行步骤112;
步骤112,动态令牌根据第一键值,判断当前被按下的按键是否为第三按键和第四按键的组合,如果是,则执行步骤113;否则,执行步骤125。
其中,第三按键可以为数字键,例如,“1”,第四按键可以为删除键。
步骤113,动态令牌将定时器的溢出时间设置为第三预设时长,将溢出次数设置为第一预设值。
其中,第三预设时长可以为100ms。
步骤114,动态令牌开启总中断和定时器的计时功能,将时钟源切换至低速时钟,进入休眠模式。
步骤115,动态令牌被唤醒后,关闭定时器的计时功能,将时钟源切换至高速时钟。
步骤116,动态令牌判断定时器中断标志是否置位,如果是,则执行步骤117;否则,返回步骤114。
步骤117,动态令牌判断关闭总中断,将定时器中断标志复位。
步骤118,动态令牌扫描键盘,获取第三键值。
步骤119,动态令牌判断第三键值是否为空按键,如果是,则执行步骤125;否则,执行步骤120。
步骤120,动态令牌判断第三键值是否为错误按键,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤121。
步骤121,动态令牌判断第三键值是否与第一键值相同,如果是,则执行步骤122;否则,开启按键中断和总中断,并返回步骤103。
步骤122,动态令牌对溢出次数进行更新。
步骤123,动态令牌判断溢出次数是否为第二预设值,如果是,则执行步骤124;否则,返回步骤114。
步骤124,动态令牌将长按键标志置位。
步骤125,动态令牌根据第一键值,判断当前被按下的按键是否为电源键,如果是,则执行步骤126;否则,执行步骤134。
步骤126,动态令牌判断系统状态是否为关机状态,如果是,则执行步骤128;否则,执行步骤127。
步骤127,动态令牌清空按键数据缓冲区和显示数据缓冲区,将系统状态设置为关机状态,将日志开机标志复位, 开启按键中断和总中断,并返回步骤103。
步骤128,动态令牌判断长按键标志是否置位,如果是,则执行步骤129;否则,开启按键中断和总中断,并返回步骤103。
需要说明的是,在步骤124中,动态令牌判断出溢出次数为第二预设值时,将长按键标志置位。
步骤129,动态令牌判断令牌锁定标志是否置位,如果是,则执行步骤130;否则,执行步骤131。
需要说明的是,在步骤168中,动态令牌判断出令牌验证错误次数为第一预设次数时,将令牌锁定标志置位。
步骤130,动态令牌将系统状态设置为显示解锁挑战码状态,显示令牌锁定信息,开启按键中断和总中断,并返回步骤103。
步骤131,动态令牌判断密码设置标志是否置位,如果是,则执行步骤132;否则,执行步骤133。
需要说明的是,在步骤155中,动态令牌设置密码成功时,将密码设置标志置位。
步骤132,动态令牌将系统状态设置为验证令牌PIN状态,显示令牌验证信息,开启按键中断和总中断,并返回步骤103。
步骤133,动态令牌将系统状态设置为第一设置PIN状态,显示第一设置PIN信息,开启按键中断和总中断,并返回步骤103。
步骤134,动态令牌对系统状态进行判断,如果是关机状态,则执行步骤135;如果是第一设置PIN状态,则执行步骤141;如果是第二设置PIN状态,则执行步骤148;如果是PIN设置错误状态,则执行步骤159;如果是验证令牌PIN状态,则执行步骤160;如果是PIN错误状态,则执行步骤172;如果是显示解锁挑战码状态,则执行步骤175;如果是等待输入解锁码状态,则执行步骤176;如果是令牌界面状态,则执行步骤186;如果是显示动态口令状态,则执行步骤213;如果是验证日志PIN状态,则执行步骤215;如果是日志显示状态,则执行步骤228。
步骤135,动态令牌根据第一键值,判断当前被按下的按键是否为第三按键和第四按键的组合,如果是,则执行步骤136;否则,开启按键中断和总中断,并返回步骤103。
步骤136,动态令牌判断长按键标志是否置位,如果是,则执行步骤137;否则,开启按键中断和总中断,并返回步骤103。
步骤137,动态令牌将日志开机标志置位。
步骤138,动态令牌判断日志锁定标志是否置位,如果是,则执行步骤139;否则,执行步骤140。
需要说明的是,在步骤223中,动态令牌判断出日志验证错误次数为第二预设次数时,将日志锁定标志置位。
步骤139,动态令牌将系统状态设置为显示解锁挑战码状态,显示日志锁定信息,开启按键中断和总中断,并返回步骤103。
步骤140,动态令牌将系统状态设置为验证日志PIN状态,显示日志验证信息,开启按键中断和总中断,并返回步骤103。
步骤141,动态令牌根据第一键值,对当前被按下的按键进行判断,如果是数字键,则执行步骤142;如果是删除键,则执行步骤146。
步骤142,动态令牌将第一键值保存到按键数据缓冲区中,更新按键数据长度。
具体地,动态令牌将按键数据长度加1,作为更新后的按键数据长度。
步骤143,动态令牌判断按键数据长度是否小于第一预设长度,如果是,则执行步骤144;否则,执行步骤145。
其中,第一预设长度为PIN的长度。
步骤144,动态令牌对第一设置PIN信息进行更新显示,开启按键中断和总中断,并返回步骤103。
步骤145,动态令牌将按键数据缓冲区中的数据存储到密码数据缓冲区中,清空按键数据缓冲区,将系统状态设置为第二设置PIN状态,显示第二设置PIN信息,开启按键中断和总中断,并返回步骤103。
步骤146,动态令牌判断按键数据长度是否为零,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤147。
步骤147,动态令牌将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,对第一设置PIN信息进行更新显示,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌将按键数据长度减1,作为更新后的按键数据长度。
步骤148,动态令牌根据第一键值,对当前被按下的按键进行判断,如果是数字键,则执行步骤149;如果是删除键,则执行步骤157。
步骤149,动态令牌将第一键值保存到按键数据缓冲区中,更新按键数据长度。
具体地,动态令牌将按键数据长度加1,作为更新后的按键数据长度。
步骤150,动态令牌判断按键数据长度是否小于第一预设长度,如果是,则执行步骤151;否则,执行步骤152。
步骤151,动态令牌对第二设置PIN信息进行更新显示,开启按键中断和总中断,并返回步骤103。
步骤152,动态令牌判断按键数据缓冲区中的数据是否与密码数据缓冲区中的数据相同,如果是,则执行步骤154;否则,执行步骤153。
步骤153,动态令牌清空按键数据缓冲区和密码数据缓冲区,将系统状态设置为PIN设置错误状态,显示PIN设置错误信息,开启按键中断和总中断,并返回步骤103。
步骤154,动态令牌判断日志开机标志是否置位,如果是,则执行步骤155;否则,执行步骤156。
需要说明的是,在步骤137中,动态令牌判断出当前被按下的按键为第三按键和第四按键的组合,且长按键标志置位时,将日志开机标志置位。
步骤155,动态令牌将密码设置标志置位,清空按键数据缓冲区,将系统状态设置为日志显示状态,显示日志界面信息,开启按键中断和总中断,并返回步骤103。
步骤156,动态令牌将密码设置标志置位,清空按键数据缓冲区,将系统状态设置为令牌界面状态,显示令牌界面信息,开启按键中断和总中断,并返回步骤103。
步骤157,动态令牌判断按键数据长度是否为零,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤158。
步骤158,动态令牌将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,对第二设置PIN信息进行更新显示,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌将按键数据长度减1,作为更新后的按键数据长度。
步骤159,动态令牌将系统状态设置为第一设置PIN状态,显示第一设置PIN信息,开启按键中断和总中断,并返回步骤103。
步骤160,动态令牌根据第一键值,对当前被按下的按键进行判断,如果是数字键,则执行步骤161;如果是删除键,则执行步骤170。
步骤161,动态令牌将第一键值保存到按键数据缓冲区中,更新按键数据长度。
具体地,动态令牌将按键数据长度加1,作为更新后的按键数据长度。
步骤162,动态令牌判断按键数据长度是否小于第一预设长度,如果是,则执行步骤163;否则,执行步骤164。
步骤163,动态令牌对令牌验证信息进行更新显示,开启按键中断和总中断,并返回步骤103。
步骤164,动态令牌判断按键数据缓冲区中的数据是否与密码数据缓冲区中的数据相同,如果是,则执行步骤165;否则,执行步骤166。
步骤165,动态令牌清空按键数据缓冲区,将令牌验证错误次数清零,将系统状态设置为令牌界面状态,显示令牌界面信息,开启按键中断和总中断,并返回步骤103。
步骤166,动态令牌清空按键数据缓冲区,对令牌验证错误次数进行更新。
具体地,动态令牌将令牌验证错误次数加1,作为更新后的令牌验证错误次数。
步骤167,动态令牌判断令牌验证错误次数是否为第一预设次数,如果是,则执行步骤168;否则,执行步骤169。
步骤168,动态令牌将令牌锁定标志置位,将系统状态设置为显示解锁挑战码状态,显示令牌锁定信息,开启按键中断和总中断,并返回步骤103。
步骤169,动态令牌将系统状态设置为PIN错误状态,显示PIN错误信息,开启按键中断和总中断,并返回步骤103。
步骤170,动态令牌判断按键数据长度是否为零,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤171。
步骤171,动态令牌将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,对令牌验证信息进行更新显示,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌将按键数据长度减1,作为更新后的按键数据长度。
步骤172,动态令牌判断日志开机标志是否置位,如果是,则执行步骤174;否则,执行步骤173。
步骤173,动态令牌将系统状态设置为验证令牌PIN状态,显示令牌验证信息,开启按键中断和总中断,并返回步骤103。
步骤174,动态令牌将系统状态设置为验证日志PIN状态,显示日志验证信息,开启按键中断和总中断,并返回步骤103。
步骤175,动态令牌生成解锁挑战码,将系统状态设置为等待输入解锁码状态,显示解锁挑战码,开启按键中断和总中断,并返回步骤103。
步骤176,动态令牌根据第一键值,对当前被按下的按键进行判断,如果是数字键,则执行步骤177;如果是删除键,则执行步骤184。
步骤177,动态令牌将第一键值保存到按键数据缓冲区中,更新按键数据长度。
具体地,动态令牌将按键数据长度加1,作为更新后的按键数据长度。
步骤178,动态令牌判断按键数据长度是否小于第二预设长度,如果是,则执行步骤179;否则,执行步骤180。
其中,第二预设长度为解锁码的长度。
步骤179,动态令牌显示解锁码输入信息,开启按键中断和总中断,并返回步骤103。
步骤180,动态令牌根据解锁挑战码,对按键数据缓冲区中的数据进行验证,如果验证通过,则执行步骤181;否则,执行步骤182。
步骤181,动态令牌清空按键数据缓冲区,将令牌锁定标志、日志锁定标志和密码设置标志复位,将系统状态设置为第一设置PIN状态,显示第一设置PIN信息,开启按键中断和总中断,并返回步骤103。
步骤182,动态令牌清空按键数据缓冲区,将系统状态设置为解锁码错误状态,显示解锁码错误信息。
步骤183,动态令牌延时第四预设时长,将系统状态设置为关机状态,开启按键中断和总中断,并返回步骤103。
步骤184,动态令牌判断按键数据长度是否为零,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤185。
步骤185,动态令牌将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,对解锁码输入信息进行更新显示,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌将按键数据长度减1,作为更新后的按键数据长度。
步骤186,动态令牌根据第一键值,对当前被按下的按键进行判断,如果是数字键,则执行步骤187;如果是删除键,则执行步骤192;如果是左键,则执行步骤197;如果是右键,则执行步骤201;如果是确认键,则执行步骤205。
步骤187,动态令牌判断按键数据长度是否小于第三预设长度,如果是,则执行步骤188;否则,开启按键中断和总中断,并返回步骤103。
其中,第三预设长度为挑战码的长度。
步骤188,动态令牌将第一键值保存到按键数据缓冲区中,更新按键数据长度。
具体地,动态令牌将按键数据长度加1,作为更新后的按键数据长度。
步骤189,动态令牌判断显示数据长度是否小于第四预设长度,如果是,则执行步骤190;否则,执行步骤191。
其中,第四预设长度为显示数据缓冲区的总长度。
步骤190,动态令牌将第一键值保存到显示数据缓冲区中,更新显示数据长度,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌将显示数据长度加1,作为更新后的显示数据长度。
步骤191,动态令牌将显示数据缓冲区中最早一次存入的数据删除,将显示数据缓冲区中剩余的数据前移,将第一键值保存到按键数据缓冲区中,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌将显示数据缓冲区中最早一次存入的数据删除后,将显示数据缓冲区中剩余的数据前移至以显示数据缓冲区的首地址为起始位置的连续存储空间,将第一键值保存到该连续存储空间的末尾。
步骤192,动态令牌判断按键数据长度是否为零,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤193。
步骤193,动态令牌将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度。
步骤194,动态令牌判断按键数据长度是否小于第四预设长度,如果是,则执行步骤195;否则,执行步骤196。
步骤195,动态令牌将按键数据缓冲区中的数据存储到显示数据缓冲区中,将显示数据长度设置为按键数据长度,开启按键中断和总中断,并返回步骤103。
步骤196,动态令牌从按键数据缓冲区中选取最晚存入的、第四预设长度的数据,将选取的数据存储到显示数据缓冲区中,将显示数据长度设置为第四预设长度,开启按键中断和总中断,并返回步骤103。
步骤197,动态令牌判断显示数据缓冲区中是否存在比按键数据缓冲区中的数据更早存入的未显示数据,如果是,则执行步骤198;否则,开启按键中断和总中断,并返回步骤103。
步骤198,动态令牌判断未显示数据的长度是否小于第四预设长度,如果是,则执行步骤199;否则,执行步骤200。
步骤199,动态令牌将未显示数据存储到显示数据缓冲区中,将显示数据长度设置为未显示数据的长度,开启按键中断和总中断,并返回步骤103。
步骤200,动态令牌从未显示数据中选取最晚存入的、第四预设长度的数据,将选取的数据存储到显示数据缓冲区中,将显示数据长度设置为第四预设长度,开启按键中断和总中断,并返回步骤103。
步骤201,动态令牌判断显示数据缓冲区中是否存在比按键数据缓冲区中的数据更晚存入的未显示数据,如果是,则执行步骤202;否则,开启按键中断和总中断,并返回步骤103。
步骤202,动态令牌判断未显示数据的长度是否小于第四预设长度,如果是,则执行步骤203;否则,执行步骤204。
步骤203,动态令牌将未显示数据存储到显示数据缓冲区中,将显示数据长度设置为未显示数据的长度,开启按键中断和总中断,并返回步骤103。
步骤204,动态令牌从未显示数据中选取最早存入的、第四预设长度的数据,将选取的数据存储到显示数据缓冲区中,将显示数据长度设置为第四预设长度,开启按键中断和总中断,并返回步骤103。
步骤205,动态令牌判断按键数据长度是否为零,如果是,则执行步骤206;否则,执行步骤211。
步骤206,动态令牌根据时间因子,生成动态口令以及与该动态口令对应的新增日志,将动态口令存储到显示数据缓冲区中。
具体地,动态令牌根据时间因子生成时间型动态口令,为新增日志分配索引,将与时间因子对应的时间信息的长度作为新增日志的长度,对索引、新增日志的长度以及与时间因子对应的时间信息进行组合,得到新增日志。
步骤207,动态令牌判断日志条数是否为零,如果是,则执行步骤208;否则,执行步骤209。
步骤208,动态令牌将新增日志存储到日志存储区中,将最前日志索引和最后日志索引均设置为新增日志中的索引,更新日志条数,将系统状态设置为显示动态口令状态,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌将日志条数加1,作为更新后的日志条数。
步骤209,动态令牌判断新增日志占用的空间是否大于日志存储区中的剩余空间,如果是,则执行步骤210;否则,将新增日志存储到日志存储区中,更新日志条数和最后日志索引,将系统状态设置为显示动态口令状态,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌可以将最后日志索引更新为新增日志中的索引。
步骤210,动态令牌将日志存储区中最早一次存入的日志删除,将日志存储区中剩余的日志前移,更新日志条数和最前日志索引,并返回步骤209。
具体地,动态令牌将显示数据缓冲区中最早一次存入的日志删除后,将日志存储区中剩余的日志前移至以日志存储区的首地址为起始位置的连续存储空间,将日志条数减1,作为更新后的日志条数,并将最前日志索引加1。
步骤211,动态令牌清空显示数据缓冲区,将按键数据缓冲区中的数据作为挑战码,生成动态口令以及与该动态口令对应的新增日志。
具体地,动态令牌根据时间因子和挑战码生成挑战型动态口令,为新增日志分配索引,对与挑战码对应的交易信息进行压缩,得到压缩交易数据,获取与时间因子对应的时间信息的长度和压缩交易数据的长度之和作为新增日志的长度,对索引、新增日志的长度、与时间因子对应的时间信息,以及压缩交易数据进行组合,得到新增日志。
步骤212,动态令牌将动态口令存储到显示数据缓冲区中,清空按键数据缓冲区,并返回步骤207。
步骤213,动态令牌根据第一键值,判断当前被按下的按键是否为数字键或删除键,如果是,则清空显示数据缓冲区,并执行步骤214;否则,开启按键中断和总中断,并返回步骤103。
步骤214,动态令牌将系统状态设置为令牌界面状态,显示令牌界面信息,开启按键中断和总中断,并返回步骤103。
步骤215,动态令牌根据第一键值,对当前被按下的按键进行判断,如果是数字键,则执行步骤216;如果是删除键,则执行步骤226。
步骤216,动态令牌将第一键值保存到按键数据缓冲区中,更新按键数据长度。
具体地,动态令牌将按键数据长度加1,作为更新后的按键数据长度。
步骤217,动态令牌判断按键数据长度是否小于第一预设长度,如果是,则执行步骤218;否则,执行步骤219。
步骤218,动态令牌对日志验证信息进行更新显示,开启按键中断和总中断,并返回步骤103。
步骤219,动态令牌判断按键数据缓冲区中的数据是否与密码数据缓冲区中的数据相同,如果是,则执行步骤220;否则,执行步骤221。
步骤220,动态令牌清空按键数据缓冲区,将日志验证错误次数清零,将系统状态设置为日志显示状态,将时间信息显示标志置位,将当前日志索引设置为最后日志索引,根据当前日志索引从日志存储区中读取对应的日志,将读取到的日志存储到日志缓冲区中,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断和总中断,并返回步骤103。
本实施例中,动态令牌根据当前日志索引从日志存储区中读取对应的日志,具体包括:动态令牌将读取指针设置为日志存储区的首地址,根据读取指针,从日志存储区中读取对应的日志,判断读取到的日志中的索引是否与当前日志索引相同,如果是,则确定读取到的日志为与所述当前日志索引对应的日志;否则,根据读取到的日志占用的空间大小更新读取指针,并继续根据读取指针,从日志存储区中读取对应的日志,直到读取到的日志中的索引与当前日志索引相同。
步骤221,动态令牌清空按键数据缓冲区,对日志验证错误次数进行更新。
具体地,动态令牌将日志验证错误次数加1,作为更新后的日志验证错误次数。
步骤222,动态令牌判断日志验证错误次数是否为第二预设次数,如果是,则执行步骤223;否则,执行步骤224。
步骤223,动态令牌将日志锁定标志置位,将系统状态设置为显示解锁挑战码状态,显示日志锁定信息,开启按键中断和总中断,并返回步骤103。
步骤224,动态令牌将系统状态设置为PIN错误状态,显示PIN错误信息。
步骤225,动态令牌开启按键中断和总中断,并返回步骤103。
步骤226,动态令牌判断按键数据长度是否为零,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤227。
步骤227,动态令牌将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,对日志验证信息进行更新显示,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌将按键数据长度减1,作为更新后的按键数据长度。
步骤228,动态令牌判断时间信息显示标志是否置位,如果是,则执行步骤229;否则,执行步骤240。
需要说明的是,在步骤220中,动态令牌判断出按键数据缓冲区中的数据与密码数据缓冲区中的数据相同时,将时间信息显示标志置位。
步骤229,动态令牌根据第一键值,对当前被按下的按键进行判断,如果是确认键,则执行步骤230;如果是左键,则执行步骤236;如果是右键,则执行步骤238。
步骤230,动态令牌判断日志缓冲区中的日志的长度是否为第五预设长度,如果是,则执行步骤231;否则,执行步骤232。
其中,第五预设长度为日志中的时间信息的长度。
步骤231,动态令牌显示空白交易信息,将时间信息显示标志复位,开启按键中断和总中断,并返回步骤103。
步骤232,动态令牌将时间信息显示标志复位,从日志缓冲区中的日志中获取压缩交易数据,对所述压缩交易数据进行解压,得到当前交易信息。
步骤233,动态令牌判断当前交易信息的长度是否大于第四预设长度,如果是,则执行步骤234;否则,执行步骤235。
步骤234,动态令牌从当前交易信息中选取存储位置最靠前的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的右箭头,开启按键中断和总中断,并返回步骤103。
步骤235,动态令牌将当前交易信息存储到显示数据缓冲区中,开启按键中断和总中断,并返回步骤103。
步骤236,动态令牌判断当前日志索引是否等于最前日志索引,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤237。
步骤237,动态令牌更新当前日志索引,根据当前日志索引从日志存储区中读取对应的日志,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌可以将当前日志索引减1。
步骤238,动态令牌判断当前日志索引是否等于最后日志索引,如果是,则开启按键中断和总中断,并返回步骤103;否则,执行步骤239。
步骤239,动态令牌更新当前日志索引,根据当前日志索引从日志存储区中读取对应的日志,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断和总中断,并返回步骤103。
具体地,动态令牌可以将当前日志索引加1。
步骤240,动态令牌根据第一键值,对当前被按下的按键进行判断,如果是确认键,则执行步骤241;
如果是左键,则执行步骤242;
如果是右键,则执行步骤247。
步骤241,动态令牌将时间信息显示标志置位,从日志缓冲区中的日志中读取时间信息,将读取到的时间信息存储到显示数据缓冲区中,开启按键中断和总中断,并返回步骤103。
步骤242,动态令牌判断显示屏上的左箭头是否被点亮,如果是,执行步骤243;否则,开启按键中断和总中断,并返回步骤103。
步骤243,动态令牌从当前交易信息中读取与当前显示信息相邻,且存储位置更靠前的数据作为未显示数据。
步骤244,动态令牌判断未显示数据的长度是否大于第四预设长度,如果是,则执行步骤245;否则,执行步骤246。
步骤245,动态令牌从未显示数据中选取存储位置最靠后的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的右箭头,开启按键中断和总中断,并返回步骤103。
步骤246,动态令牌将未显示数据存储到显示数据缓冲区中,点亮显示屏上的右箭头,熄灭显示屏上的左箭头,开启按键中断和总中断,并返回步骤103。
步骤247,动态令牌判断显示屏上的右箭头是否被点亮,如果是,执行步骤248;否则,开启按键中断和总中断,并返回步骤103。
步骤248,动态令牌从当前交易信息中读取与当前显示信息相邻,且存储位置更靠后的数据作为未显示数据。
步骤249,动态令牌判断未显示数据的长度是否大于第四预设长度,如果是,则执行步骤250;否则,执行步骤251。
步骤250,动态令牌从未显示数据中选取存储位置最靠前的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的左箭头,开启按键中断和总中断,并返回步骤103。
步骤251,动态令牌将未显示数据存储到显示数据缓冲区中,点亮显示屏上的左箭头,熄灭显示屏上的右箭头,开启按键中断和总中断,并返回步骤103。
步骤252,动态令牌开启总中断,将时钟源切换至低速时钟,进入休眠模式。
步骤253,动态令牌被唤醒后,将时钟源切换至高速时钟,并返回步骤103。
本发明实施例中的动态令牌在生成动态口令后,生成并记录与该动态口令对应的日志供用户查看,从而记录与已完成的身份认证相关的信息,使得用户能够复核已完成的身份认证是否为由自身完成的身份认证,提高了使用动态口令的身份认证机制以及动态令牌的安全性。
需要说明的是,在本发明的其他实施方式中,动态令牌根据第一键值,对当前被按下的按键进行判断,如果当前被按下的按键是第一按键,则生成动态口令以及与该动态口令对应的日志,将动态口令存储到显示数据缓冲区,将日志存储到日志存储区,开启按键中断;如果当前被按下的按键是第二按键,则从日志存储区中读取日志,将读取到的日志存储到显示数据缓冲区,开启按键中断,同样可以达到本发明的发明目的。
另外,在本发明的其他实施方式中,动态令牌根据第一键值,判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合之后,还可以开启按键中断,并在判断出置位的中断标志是按键中断标志后,关闭按键中断,扫描键盘,根据扫描得到的键值判断出当前被按下的按键为第五按键后,从日志存储区中读取日志,将读取到的日志存储到所述显示数据缓冲区,开启按键中断,同样可以达到本发明的发明目的。
此外,在本发明的其他实施方式中,动态令牌还可以采用循环队列的方式将新增日志存储到日志存储区,如图 15所示,包括以下步骤:
步骤301,动态令牌判断新增日志占用的空间是否大于日志存储区中的剩余空间,如果是,则执行步骤302;否则,执行步骤304。
步骤302,动态令牌根据最前记录指针,从日志存储区中读取对应的日志,根据读取到的日志占用的空间,更新最前记录指针和日志存储区中的剩余空间。
具体地,动态令牌可以将最前记录指针和日志存储区中的剩余空间分别与读取到的日志占用的空间大小相加,将得到的结果分别作为更新后的最前记录指针和日志存储区中的剩余空间。
步骤303,动态令牌根据最前记录指针,从日志存储区中读取对应的日志,将读取到的日志的索引作为最前日志索引,更新日志条数,并返回步骤301。
具体地,动态令牌可以将日志条数减1。
步骤304,动态令牌判断日志条数是否为零,如果是,则执行步骤306;否则,执行步骤305。
步骤305,动态令牌根据最后记录指针,从日志存储区中读取对应的日志,根据读取到的日志占用的空间,更新最后记录指针,并执行步骤306。
具体地,动态令牌可以将最后记录指针与读取到的日志占用的空间大小相加,将得到的结果作为更新后的最后记录指针。
步骤306,动态令牌将临时计数器的计数值设置为零,将临时指针的取值设置为最后记录指针的取值,将当前日志字节设置为新增日志的首字节。
步骤307,动态令牌判断临时指针的取值是否小于日志存储区的空间大小,如果是,则执行步骤308;否则,将临时指针的取值置为零,并执行步骤308。
步骤308,动态令牌将当前日志字节存储到临时指针对应的位置,更新临时指针和临时计数器的计数值,将当前日志字节的下一字节作为更新后的当前日志字节。
具体地,动态令牌可以将临时指针加1,将临时计数器的计数值加1。
步骤309,动态令牌判断临时计数器的计数值是否小于新增日志占用的空间大小,如果是,则返回步骤307;否则,执行步骤310。
步骤310,动态令牌将最后日志索引设置为新增日志的索引,更新日志条数,并根据新增日志占用的空间大小,更新日志存储区中的剩余空间。
具体地,动态令牌可以将日志条数加1,将日志存储区中的剩余空间减去新增日志占用的空间大小,作为更新后的日志存储区中的剩余空间。
基于上述日志存储方式,动态令牌根据当前日志索引从日志存储区中读取对应的日志的流程,如图16所示,包括以下步骤:
步骤401,动态令牌将临时指针的取值设置为最前记录指针的取值。
步骤402,动态令牌根据所述临时指针,从日志存储区中读取对应的索引,获取与该索引对应的日志所占用的空间大小。
步骤403,动态令牌判断读取到的索引是否与当前日志索引相同,如果是,则执行步骤406;否则,执行步骤404。
步骤404,动态令牌根据日志所占用的空间大小更新临时指针。
具体地,动态令牌可以将临时指针与日志所占用的空间大小相加,将得到的结果作为更新后的临时指针。
步骤405,动态令牌判断临时指针的取值是否小于日志存储区的空间大小,如果是,则返回步骤402;否则,根据日志存储区的空间大小更新临时指针,并返回步骤402。
具体地,动态令牌可以将临时指针减去日志存储区的空间大小,将得到的结果作为更新后的临时指针。
步骤406,动态令牌将临时计数器的计数值设置为日志所占用的空间大小。
步骤407,动态令牌根据临时指针,从日志存储区中读取一个字节的数据,并更新临时指针和临时计数器的计数值。
具体地,动态令牌可以将临时指针加1,将临时计数器的计数值减1。
步骤408,动态令牌判断临时指针的取值是否小于日志存储区的空间大小,如果是,则执行步骤409;否则,根据日志存储区的空间大小更新临时指针,并执行步骤409。
具体地,动态令牌可以将临时指针减去日志存储区的空间大小,将得到的结果作为更新后的临时指针。
步骤409,动态令牌判断临时计数器的计数值是否大于零,如果是,则返回步骤407;否则,确定从日志存储区中读取与当前日志索引对应的日志完毕。
基于上述工作方法流程,本发明实施例还提供了一种具有日志功能的动态令牌,如图17所示,包括:
初始化模块501,用于在上电之后,执行初始化操作,开启总中断和按键唤醒功能;
第一判断模块502,用于判断是否存在置位的中断标志;
第二判断模块503,用于在第一判断模块502判断出存在置位的中断标志之后,对置位的中断标志进行判断;
复位模块504,用于在第二判断模块503判断出置位的中断标志是定时器中断标志时,将定时器中断标志复位,并触发第一判断模块502判断是否存在置位的中断标志;
第一获取模块505,用于在第二判断模块503判断出置位的中断标志是按键中断标志时,关闭按键中断,扫描键 盘,获取第一键值;
第三判断模块506,用于根据第一获取模块505获取到的第一键值,对当前被按下的按键进行判断;
第一处理模块507,用于在第三判断模块506判断出当前被按下的按键是第一按键时,生成动态口令以及与动态口令对应的日志,将动态口令存储到显示数据缓冲区,将日志存储到日志存储区,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第二处理模块508,用于在第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,从日志存储区中读取日志,将读取到的日志存储到显示数据缓冲区,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
具体地,上述第二处理模块508,具体用于在第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合之后,执行以下操作:
T1、开启按键中断,判断是否存在置位的中断标志,如果是,则执行步骤T2;否则,继续执行步骤T1;
T2、判断出置位的中断标志是按键中断标志后,关闭按键中断,扫描键盘;
T3、根据扫描得到的键值判断出当前被按下的按键为第五按键后,从日志存储区中读取日志,将读取到的日志存储到显示数据缓冲区,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
其中,上述第一按键可以为确认键,相应地,上述动态令牌,还包括:
第三处理模块,用于在第三判断模块506判断出当前被按下的按键是数字键时,判断按键数据长度是否小于第三预设长度,如果是,则将第一键值保存到按键数据缓冲区和显示数据缓冲区中,更新按键数据长度,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;在第三判断模块506判断出当前被按下的按键是删除键时,判断按键数据长度是否为零,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,将显示数据缓冲区中最后一次存入的数据删除,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
上述第一处理模块507,包括:
第一判断子模块,用于在第三判断模块506判断出当前被按下的按键是确认键时,判断按键数据长度是否为零;
第一生成子模块,用于在第一判断子模块判断出按键数据长度为零时,根据时间因子,生成动态口令以及与动态口令对应的新增日志;
具体地,上述第一生成子模块,具体用于在第一判断子模块判断出按键数据长度为零时,根据时间因子生成时间型动态口令,为新增日志分配索引,将与时间因子对应的时间信息的长度作为新增日志的长度,对索引、新增日志的长度以及与时间因子对应的时间信息进行组合,得到新增日志。
第二生成子模块,用于在第一判断子模块判断出按键数据长度不为零时,将按键数据缓冲区中的数据作为挑战码,生成动态口令以及与动态口令对应的新增日志;
具体地,上述第二生成子模块,具体用于在第一判断子模块判断出按键数据长度不为零时,根据时间因子和挑战码,生成挑战型动态口令,为新增日志分配索引,对与挑战码对应的交易信息进行压缩,得到压缩交易数据,获取与时间因子对应的时间信息的长度和压缩交易数据的长度之和作为新增日志的长度,对索引、新增日志的长度、与时间因子对应的时间信息,以及压缩交易数据进行组合,得到新增日志。
第一存储子模块,用于将第一生成子模块和第二生成子模块生成的动态口令存储到显示数据缓冲区中;
第二存储子模块,用于将第一生成子模块和第二生成子模块生成的新增日志存储到日志存储区;
开启子模块,用于在第一生成子模块或第二生成子模块生成动态口令和新增日志后,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
具体地,上述第二存储子模块,具体用于判断日志条数是否为零,如果是,则将新增日志存储到日志存储区中,将最前日志索引和最后日志索引均设置为新增日志中的索引,更新日志条数;否则,将新增日志存储到日志存储区中,将最后日志索引设置为新增日志中的索引,更新日志条数。
进一步地,上述第二处理模块508,具体用于将当前日志索引设置为最后日志索引,根据当前日志索引从日志存储区中读取对应的日志,将读取到的日志存储到日志缓冲区中,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
相应地,上述动态令牌,还包括:
第四处理模块,用于在第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是左键时,判断当前日志索引是否等于最前日志索引,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,更新当前日志索引,根据当前日志索引从日志存储区中读取对应的日志,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第五处理模块,用于在第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是右键时,判断当前日志索引是否等于最后日志索引,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,更新当前日志索引,根据当前日志索引从日志存储区中读取对应的日志,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502 判断是否存在置位的中断标志。
进一步地,上述动态令牌,还包括:
第四判断模块,用于判断时间信息显示标志是否置位;
相应地,上述第四处理模块,具体用于在第四判断模块判断出时间信息显示标志置位、第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是左键时,判断当前日志索引是否等于最前日志索引,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,更新当前日志索引,根据当前日志索引从日志存储区中读取对应的日志,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第五处理模块,具体用于在第四判断模块判断出时间信息显示标志置位、第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是右键时,判断当前日志索引是否等于最后日志索引,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,更新当前日志索引,根据当前日志索引从日志存储区中读取对应的日志,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
上述动态令牌,还包括:
第六处理模块,具体用于在在第四判断模块判断出时间信息显示标志置位、第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是确认键时,执行以下操作:
R1)判断日志缓冲区中的日志的长度是否为第五预设长度,如果是,则执行步骤R2;否则,执行步骤R3;
R2)显示空白交易信息,将时间信息显示标志复位,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
R3)将时间信息显示标志复位,从日志缓冲区中的日志中获取压缩交易数据,对压缩交易数据进行解压,判断解压得到的当前交易信息的长度是否大于第四预设长度,如果是,则执行步骤R4;否则,执行步骤R5;
R4)从当前交易信息中选取存储位置最靠前的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的右箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;以及
R5)将当前交易信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
需要说明的是,在本发明的另一种实施方式中,上述第二处理模块508,具体用于在第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,将当前日志索引设置为最后日志索引,根据当前日志索引从日志存储区中读取对应的日志,对读取到的日志中的压缩交易数据进行解压,将解压得到的当前交易信息存储到日志缓冲区中,判断当前交易信息是否大于第四预设长度,如果是,则从当前交易信息中选取存储位置最靠前的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的右箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将当前交易信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
相应地,上述动态令牌,还包括:
第七处理模块,用于在第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是左键时,判断显示屏上的左箭头是否被点亮,如果没有被点亮,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;如果被点亮,则从当前交易信息中读取与当前显示信息相邻,且存储位置更靠前的数据作为未显示数据,判断未显示数据的长度是否大于第四预设长度,如果是,则从未显示数据中选取存储位置最靠后的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的右箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将未显示数据存储到显示数据缓冲区中,点亮显示屏上的右箭头,熄灭显示屏上的左箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第八处理模块,用于在第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是右键时,判断显示屏上的右箭头是否被点亮,如果没有被点亮,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;如果被点亮,则从当前交易信息中读取与当前显示信息相邻,且存储位置更靠后的数据作为未显示数据,判断未显示数据的长度是否大于第四预设长度,如果是,则从未显示数据中选取存储位置最靠前的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的左箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将未显示数据存储到显示数据缓冲区中,点亮显示屏上的左箭头,熄灭显示屏上的右箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
第五判断模块,用于判断时间信息显示标志是否置位;
第七处理模块,具体用于在第五判断模块判断出时间信息显示标志复位、第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是左键时,判断显示屏上的左箭头是否被点亮,如果没有被点亮,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;如果被点亮,则从当前交易信息中读取与当前显示信息相邻,且存储位置更靠前的数据作为未显示数据,判断未显示数据的 长度是否大于第四预设长度,如果是,则从未显示数据中选取存储位置最靠后的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的右箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将未显示数据存储到显示数据缓冲区中,点亮显示屏上的右箭头,熄灭显示屏上的左箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
相应地,上述第八处理模块,具体用于在第五判断模块判断出时间信息显示标志复位、第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是右键时,判断显示屏上的右箭头是否被点亮,如果没有被点亮,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;如果被点亮,则从当前交易信息中读取与当前显示信息相邻,且存储位置更靠后的数据作为未显示数据,判断未显示数据的长度是否大于第四预设长度,如果是,则从未显示数据中选取存储位置最靠前的、第四预设长度的数据作为当前显示信息,将当前显示信息存储到显示数据缓冲区中,点亮显示屏上的左箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将未显示数据存储到显示数据缓冲区中,点亮显示屏上的左箭头,熄灭显示屏上的右箭头,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
上述动态令牌,还包括:
第九处理模块,具体用于在在第四判断模块判断出时间信息显示标志复位、第二处理模块508触发第一判断模块502判断出存在置位的中断标志,且第三判断模块506判断出当前被按下的按键是确认键时,将时间信息显示标志置位,从日志缓冲区中的日志中读取时间信息,将读取到的时间信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
进一步地,上述第二存储子模块,具体用于执行以下操作:
P1)判断日志条数是否为零,如果是,则将新增日志存储到日志存储区中,将最前日志索引和最后日志索引均设置为新增日志中的索引,更新日志条数;否则,执行步骤P2;
P2)判断新增日志占用的空间是否大于日志存储区中的剩余空间,如果是,则执行步骤P3;否则,将新增日志存储到日志存储区中,更新日志条数和最后日志索引;
P3)将日志存储区中最早一次存入的日志删除,将日志存储区中剩余的日志前移,更新日志条数和最前日志索引,并返回步骤P2。
上述第二处理模块508,具体用于执行以下操作:
H1)将当前日志索引设置为最后日志索引,将读取指针设置为日志存储区的首地址;
H2)根据读取指针,从日志存储区中读取对应的日志,判断读取到的日志中的索引是否与当前日志索引相同,如果是,则将读取到的日志存储到显示数据缓冲区,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,执行步骤H3;
H3)根据读取到的日志占用的空间大小更新读取指针,并返回步骤H2。
需要说明的是,在本发明的另一种实施方式中,上述第二存储子模块,具体用于执行以下操作:
G1)判断新增日志占用的空间是否大于日志存储区中的剩余空间,如果是,则执行步骤G2;否则,执行步骤G4;
G2)根据最前记录指针,从日志存储区中读取对应的日志,根据读取到的日志占用的空间,更新最前记录指针和日志存储区中的剩余空间;
G3)根据最前记录指针,从日志存储区中读取对应的日志,将读取到的日志的索引作为最前日志索引,更新日志条数,并返回步骤G1;
G4)判断日志条数是否为零,如果是,则执行步骤G6;否则,执行步骤G5;
G5)根据最后记录指针,从日志存储区中读取对应的日志,根据读取到的日志占用的空间,更新最后记录指针,并执行步骤G6;
G6)将临时计数器的计数值设置为零,将临时指针的取值设置为最后记录指针的取值,将当前日志字节设置为新增日志的首字节;
G7)判断临时指针的取值是否小于日志存储区的空间大小,如果是,则执行步骤G8;否则,将临时指针的取值置为零,并执行步骤G8;
G8)将当前日志字节存储到临时指针对应的位置,更新临时指针和临时计数器的计数值,将当前日志字节的下一字节作为更新后的当前日志字节;
G9)判断临时计数器的计数值是否小于新增日志占用的空间大小,如果是,则返回步骤G7;否则,执行步骤G10;
G10)将最后日志索引设置为新增日志的索引,更新日志条数,并根据新增日志占用的空间大小,更新日志存储区中的剩余空间。
其中,上述第二处理模块508根据当前日志索引从日志存储区中读取对应的日志,具体为,第二处理模块508执行以下操作:
K1)将当前日志索引设置为最后日志索引,将临时指针的取值设置为最前记录指针的取值;
K2)根据临时指针,从日志存储区中读取对应的索引,获取与索引对应的日志所占用的空间大小,判断索引是否与当前日志索引相同,如果是,则执行步骤K4;否则,执行步骤K3;
K3)根据日志所占用的空间大小更新临时指针,判断临时指针的取值是否小于日志存储区的空间大小,如果是,则返回步骤K2;否则,根据日志存储区的空间大小更新临时指针,并返回步骤K2;
K4)将临时计数器的计数值设置为日志所占用的空间大小;
K5)根据临时指针,从日志存储区中读取一个字节的数据,并更新临时指针和临时计数器的计数值;
K6)判断临时指针的取值是否小于日志存储区的空间大小,如果是,则执行步骤K7;否则,根据日志存储区的空间大小更新临时指针,并执行步骤K7;
K7)判断临时计数器的计数值是否大于零,如果是,则返回步骤K5;否则,将读取到的数据存储到日志缓冲区中,将读取到的日志中的时间信息存储到显示数据缓冲区中,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
进一步地,上述动态令牌,还包括:
第二获取模块,用于在第一获取模块505获取到第一键值之后,获取按键时长;
第六判断模块,用于在第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合之后,判断第二获取模块获取到的按键时长是否小于第一预设时长;
第十处理模块,用于在第六判断模块判断出按键时长小于第一预设时长时,根据当前被按下的按键执行相应的操作,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第二处理模块508,具体用于在第六判断模块判断出按键时长不小于第一预设时长时,从日志存储区中读取日志,将读取到的日志存储到显示数据缓冲区,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
其中,上述第一预设时长为第一预设值和第二预设值之间的差值与第三预设时长的乘积;
相应地,上述复位模块504,还用于在第二判断模块503判断出置位的中断标志为按键中断标志时,将长按键标志复位;
上述第二获取模块,具体用于在第一获取模块505获取到第一键值之后,执行以下操作:
S9)延时第二预设时长,保存第一键值,扫描键盘,获取第二键值;
S10)判断第二键值是否与第一键值相同,如果是,则执行步骤S11;否则,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
S11)将定时器的溢出时间设置为第三预设时长,将溢出次数设置为第一预设值;
S12)开启总中断和定时器的计时功能,将时钟源切换至低速时钟,进入休眠模式;
S13)被唤醒后,关闭定时器的计时功能,将时钟源切换至高速时钟;
S14)判断定时器中断标志是否被置位,如果是,则执行步骤S15;否则,返回步骤S12;
S15)判断关闭总中断,将定时器中断标志复位;
S16)扫描键盘,获取第三键值,判断第三键值是否与第一键值相同,如果是,则执行步骤S17;否则,开启按键中断和总中断,并触发第一判断模块502判断是否存在置位的中断标志;
S17)对溢出次数进行更新,判断溢出次数是否为第二预设值,如果是,则将长按键标志置位;否则,返回步骤S12;
第六判断模块,具体用于在第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合后,判断长按键标志是否置位,如果是,则确定按键时长不小于第一预设时长;否则,确定按键时长小于第一预设时长。
进一步地,上述动态令牌,还包括:
第七判断模块,用于对系统状态进行判断;
第十一处理模块,用于在第三判断模块506判断出当前被按下的按键是电源键,且第七判断模块判断出系统状态不是关机状态时,将系统状态设置为关机状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;在第三判断模块506判断出当前被按下的按键是电源键,且第七判断模块判断出系统状态是关机状态时,更新系统状态;
上述第二处理模块508,包括:
更新子模块,用于在第七判断模块判断出系统状态为关机状态,且第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,更新系统状态;
处理子模块,用于在第七判断模块判断出系统状态为关机状态,且第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,从日志存储区中读取日志,将读取到的日志存储到显示数据缓冲区,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
其中,上述第十一处理模块更新系统状态,具体为:
第十一处理模块将系统状态设置为验证令牌PIN状态;
上述动态令牌,还包括:
第十二处理模块,用于在第七判断模块判断出系统状态为验证令牌PIN状态,且第三判断模块506判断出当前被按下的按键是数字键时,执行以下操作:
B2)将第一键值保存到按键数据缓冲区中,更新按键数据长度;
B3)判断按键数据长度是否小于第一预设长度,如果是,则开启按键中断,并触发第一判断模块502判断是否存 在置位的中断标志;否则,执行步骤B4;
B4)判断按键数据缓冲区中的数据是否与密码数据缓冲区中的数据相同,如果是,则执行步骤B5;否则,执行步骤B6;
B5)清空按键数据缓冲区,将令牌验证错误次数清零,将系统状态设置为令牌界面状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
B6)清空按键数据缓冲区,对令牌验证错误次数进行更新;
B7)判断令牌验证错误次数是否为第一预设次数,如果是,则执行步骤B8;否则,执行步骤B9;
B8)将系统状态设置为显示解锁挑战码状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
B9)将系统状态设置为PIN错误状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第十三处理模块,用于在第七判断模块判断出系统状态为验证令牌PIN状态,且第三判断模块506判断出当前被按下的按键是删除键时,判断按键数据长度是否为零,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
否则,将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
具体地,上述更新子模块,具体用于在第七判断模块判断出系统状态为关机状态,且第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,将系统状态设置为验证日志PIN状态;
相应地,上述动态令牌,还包括:
第十四处理模块,用于在第七判断模块判断出系统状态为验证日志PIN状态,且第三判断模块506判断出当前被按下的按键是数字键时,执行以下操作:
C2)将第一键值保存到按键数据缓冲区中,更新按键数据长度;
C3)判断按键数据长度是否小于第一预设长度,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,执行步骤C4;
C4)判断按键数据缓冲区中的数据是否与密码数据缓冲区中的数据相同,如果是,则执行步骤C5;否则,执行步骤C6;
C5)清空按键数据缓冲区,将日志验证错误次数清零,将系统状态设置为日志显示状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
C6)清空按键数据缓冲区,对日志验证错误次数进行更新;
C7)判断日志验证错误次数是否为第二预设次数,如果是,则执行步骤C8;否则,执行步骤C9;
C8)将系统状态设置为显示解锁挑战码状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
C9)将系统状态设置为PIN错误状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第十五处理模块,用于在第七判断模块判断出系统状态为验证日志PIN状态,且第三判断模块506判断出当前被按下的按键是删除键时,判断按键数据长度是否为零,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
进一步地,上述动态令牌,还包括:
标志位管理模块,用于在第三判断模块506判断出当前被按下的按键是电源键,且第七判断模块判断出系统状态不是关机状态时,将日志开机标志复位;在第七判断模块判断出系统状态为关机状态,且第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,将日志开机标志置位;
第十六处理模块,用于在第三判断模块506判断出当前被按下的按键不是电源键,且第七判断模块判断出系统状态为PIN错误状态时,判断日志开机标志是否置位,如果是,则将系统状态设置为验证日志PIN状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将系统状态设置为验证令牌PIN状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
具体地,上述第十一处理模块,具体用于在第三判断模块506判断出当前被按下的按键是电源键,且第七判断模块判断出系统状态不是关机状态时,将系统状态设置为关机状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;在第三判断模块506判断出当前被按下的按键是电源键,且第七判断模块判断出系统状态是关机状态时,判断令牌锁定标志是否置位,如果是,则将系统状态设置为显示解锁挑战码状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将系统状态设置为验证令牌PIN状态;
上述更新子模块,具体用于在第七判断模块判断出系统状态为关机状态,且第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,判断日志锁定标志是否置位,如果是,则将系统状态设置为显示解锁挑战码状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将系统状态设置为验证日志PIN状态;
上述第十二处理模块,还用于在判断出令牌验证错误次数为第一预设次数之后,将令牌锁定标志置位;
上述第十四处理模块,还用于在判断出日志验证错误次数为第二预设次数之后,将令牌锁定标志置位;
上述动态令牌,还包括:
第十七处理模块,用于在第七判断模块判断出系统状态为显示解锁挑战码状态,且第三判断模块506判断出当前被按下的按键不是电源键时,生成解锁挑战码,将系统状态设置为等待输入解锁码状态,显示解锁挑战码,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第十八处理模块,用于在第七判断模块判断出系统状态为等待输入解锁码状态,且第三判断模块506判断出当前被按下的按键是数字键时,执行以下操作:
D2)将第一键值保存到按键数据缓冲区中,更新按键数据长度,判断按键数据长度是否小于第二预设长度,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,执行步骤D3;
D3)根据解锁挑战码,对按键数据缓冲区中的数据进行验证,如果验证通过,则执行步骤D4;否则,执行步骤D5;
D4)清空按键数据缓冲区,将令牌锁定标志和日志锁定标志复位,将系统状态设置为第一设置PIN状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
D5)清空按键数据缓冲区,将系统状态设置为关机状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第十九处理模块,用于在第七判断模块判断出系统状态为等待输入解锁码状态,且第三判断模块506判断出当前被按下的按键是删除键时,判断按键数据长度是否为零,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
具体地,上述第十一处理模块,具体用于在第三判断模块506判断出当前被按下的按键是电源键,且第七判断模块判断出系统状态不是关机状态时,将系统状态设置为关机状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;在第三判断模块506判断出当前被按下的按键是电源键,且第七判断模块判断出系统状态是关机状态时,判断密码设置标志是否置位,如果是,则将系统状态设置为验证令牌PIN状态;否则,将系统状态设置为第一设置PIN状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
相应地,上述动态令牌,还包括:
第二十处理模块,用于在第七判断模块判断出系统状态为第一设置PIN状态,且第三判断模块506判断出当前被按下的按键是数字键时,将第一键值保存到按键数据缓冲区中,更新按键数据长度,判断按键数据长度是否小于第一预设长度,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将按键数据缓冲区中的数据存储到密码数据缓冲区中,清空按键数据缓冲区,将系统状态设置为第二设置PIN状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第二十一处理模块,用于在第七判断模块判断出系统状态为第一设置PIN状态,且第三判断模块506判断出当前被按下的按键是删除键时,判断按键数据长度是否为零,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第二十二处理模块,用于在第七判断模块判断出系统状态为第二设置PIN状态,且第三判断模块506判断出当前被按下的按键是数字键时,执行以下操作:
F2)将第一键值保存到按键数据缓冲区中,更新按键数据长度,判断按键数据长度是否小于第一预设长度,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,执行步骤F3;
F3)判断按键数据缓冲区中的数据是否与密码数据缓冲区中的数据相同,如果是,则执行步骤F5;否则,执行步骤F4;
F4)清空按键数据缓冲区和密码数据缓冲区,将系统状态设置为PIN设置错误状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
F5)判断日志开机标志是否置位,如果是,则执行步骤F6;否则,执行步骤F7;
F6)将密码设置标志置位,清空按键数据缓冲区,将系统状态设置为日志显示状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
F7)将密码设置标志置位,清空按键数据缓冲区,将系统状态设置为令牌界面状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第二十三处理模块,用于在第七判断模块判断出系统状态为第二设置PIN状态,且第三判断模块506判断出当前被按下的按键是删除键时,判断按键数据长度是否为零,如果是,则开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;否则,将按键数据缓冲区中最后一次存入的数据删除,更新按键数据长度,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第二十四处理模块,用于在第三判断模块506判断出当前被按下的按键不是电源键,且第七判断模块判断出系统状态为PIN设置错误状态时,将系统状态设置为第一设置PIN状态,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第一处理模块507,具体用于在第三判断模块506判断出当前被按下的按键是第一按键,且第七判断模块判断出系统状态为令牌界面状态时,生成动态口令以及与动态口令对应的日志,将动态口令存储到显示数据缓冲区,将所 述日志存储到日志存储区,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志;
第二处理模块508,具体用于在第三判断模块506判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合,且第七判断模块判断出系统状态为日志显示状态时,从日志存储区中读取日志,将读取到的日志存储到显示数据缓冲区,开启按键中断,并触发第一判断模块502判断是否存在置位的中断标志。
本发明实施例中的动态令牌在生成动态口令后,生成并记录与该动态口令对应的日志供用户查看,从而记录与已完成的身份认证相关的信息,使得用户能够复核已完成的身份认证是否为由自身完成的身份认证,提高了使用动态口令的身份认证机制以及动态令牌的安全性。
结合本文中所公开的实施例描述的方法中的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,本领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求书的保护范围为准。

Claims (20)

  1. 一种具有日志功能的动态令牌的工作方法,其特征在于,包括以下步骤:
    S1)动态令牌上电,执行初始化操作,开启总中断和按键唤醒功能;
    S2)所述动态令牌判断是否存在置位的中断标志,如果是,则执行步骤S3;否则,继续执行步骤S2;
    S3)所述动态令牌对置位的中断标志进行判断,如果是定时器中断标志,则执行步骤S4;如果是按键中断标志,则执行步骤S5;
    S4)所述动态令牌将所述定时器中断标志复位,并返回步骤S2;
    S5)所述动态令牌关闭按键中断,扫描键盘,获取第一键值;
    S6)所述动态令牌根据所述第一键值,对当前被按下的按键进行判断,如果当前被按下的按键是第一按键,则执行步骤S7;如果当前被按下的按键是第二按键,或者是第三按键和第四按键的组合,则执行步骤S8;
    S7)所述动态令牌生成动态口令以及与所述动态口令对应的日志,将所述动态口令存储到显示数据缓冲区,将所述日志存储到日志存储区,开启按键中断,并返回步骤S2;以及
    S8)所述动态令牌从所述日志存储区中读取日志,将读取到的日志存储到所述显示数据缓冲区,开启按键中断,并返回步骤S2。
  2. 如权利要求1所述的方法,其特征在于,所述动态令牌根据所述第一键值,判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合之后,还包括:
    T1)所述动态令牌开启按键中断,判断是否存在置位的中断标志,如果是,则执行步骤T2;否则,继续执行步骤T1;
    T2)所述动态令牌判断出置位的中断标志是按键中断标志后,关闭按键中断,扫描键盘;以及
    T3)所述动态令牌根据扫描得到的键值判断出当前被按下的按键为第五按键后,执行所述步骤S8。
  3. 如权利要求1所述的方法,其特征在于,所述第一按键为确认键;
    所述动态令牌根据所述第一键值,对当前被按下的按键进行判断之后,还包括:
    如果当前被按下的按键是数字键,所述动态令牌判断按键数据长度是否小于第三预设长度,如果是,则将所述第一键值保存到按键数据缓冲区和显示数据缓冲区中,更新所述按键数据长度,开启按键中断,并返回步骤S2;否则,开启按键中断,并返回步骤S2;
    如果当前被按下的按键是删除键,所述动态令牌判断按键数据长度是否为零,如果是,则开启按键中断,并返回步骤S2;否则,将所述按键数据缓冲区中最后一次存入的数据删除,更新所述按键数据长度,将所述显示数据缓冲区中最后一次存入的数据删除,开启按键中断,并返回步骤S2;
    所述步骤S7,具体包括:
    所述动态令牌判断所述按键数据长度是否为零;
    如果所述按键数据长度为零,所述动态令牌根据时间因子,生成动态口令以及与所述动态口令对应的新增日志,将所述动态口令存储到所述显示数据缓冲区中,将所述新增日志存储到所述日志存储区,开启按键中断,并返回步骤S2;
    如果所述按键数据长度不为零,所述动态令牌将所述按键数据缓冲区中的数据作为挑战码,生成动态口令以及与所述动态口令对应的新增日志,将所述动态口令存储到所述显示数据缓冲区中,将所述新增日志存储到所述日志存储区,开启按键中断,并返回步骤S2。
  4. 如权利要求3所述的方法,其特征在于,所述动态令牌根据时间因子,生成动态口令以及与所述动态口令对应的新增日志,具体为:所述动态令牌根据所述时间因子生成时间型动态口令,为新增日志分配索引,将与所述时间因子对应的时间信息的长度作为所述新增日志的长度,对所述索引、所述新增日志的长度以及与所述时间因子对应的时间信息进行组合,得到所述新增日志。
  5. 如权利要求3所述的方法,其特征在于,所述动态令牌将所述按键数据缓冲区中的数据作为挑战码,生成动态口令以及与所述动态口令对应的新增日志,具体为:所述动态令牌根据所述时间因子和所述挑战码,生成挑战型动态口令,为新增日志分配索引,对与所述挑战码对应的交易信息进行压缩,得到压缩交易数据,获取与所述时间因子对应的时间信息的长度和所述压缩交易数据的长度之和作为所述新增日志的长度,对所述索引、所述新增日志的长度、与所述时间因子对应的时间信息,以及所述压缩交易数据进行组合,得到所述新增日志。
  6. 如权利要求3所述的方法,其特征在于,所述动态令牌将所述新增日志存储到所述日志存储区,具体包括:
    所述动态令牌判断日志条数是否为零,如果是,则将所述新增日志存储到所述日志存储区中,将最前日志索引和最后日志索引均设置为所述新增日志中的索引,更新日志条数;否则,将所述新增日志存储到所述日志存储区中,将最后日志索引设置为所述新增日志中的索引,更新日志条数。
  7. 如权利要求6所述的方法,其特征在于,所述步骤S8,具体为:所述动态令牌将当前日志索引设置为所述最后日志索引,根据当前日志索引从所述日志存储区中读取对应的日志,将读取到的日志存储到日志缓冲区中,将读取到的日志中的时间信息存储到所述显示数据缓冲区中,开启按键中断,并返回步骤S2。
  8. 如权利要求6所述的方法,其特征在于,所述步骤S8,具体为:
    所述动态令牌将当前日志索引设置为所述最后日志索引,根据当前日志索引从所述日志存储区中读取对应的日 志,对读取到的日志中的压缩交易数据进行解压,将解压得到的当前交易信息存储到日志缓冲区中,判断当前交易信息是否大于第四预设长度,如果是,则从所述当前交易信息中选取存储位置最靠前的、第四预设长度的数据作为当前显示信息,将所述当前显示信息存储到所述显示数据缓冲区中,点亮显示屏上的右箭头,开启按键中断,并返回步骤S2;否则,将所述当前交易信息存储到所述显示数据缓冲区中,开启按键中断,并返回步骤S2。
  9. 如权利要求1所述的方法,其特征在于,所述动态令牌获取第一键值之后,还包括:
    所述动态令牌获取按键时长;
    所述动态令牌根据所述第一键值,判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合之后,还包括:
    所述动态令牌判断所述按键时长是否小于第一预设时长,如果是,则根据当前被按下的按键执行相应的操作,开启按键中断,并返回步骤S2;否则,执行步骤S8。
  10. 如权利要求1所述的方法,其特征在于,所述动态令牌根据所述第一键值,对当前被按下的按键进行判断之后,还包括:
    如果当前被按下的按键是电源键,且系统状态不是关机状态时,执行步骤A1;如果当前被按下的按键是电源键,且系统状态是关机状态时,执行步骤A2:
    A1)所述动态令牌将所述系统状态设置为关机状态,开启按键中断,并返回步骤S2;
    A2)所述动态令牌更新所述系统状态;
    所述步骤S8之前,还包括:
    所述动态令牌判断出所述系统状态为关机状态,并执行以下步骤:
    A3)所述动态令牌更新所述系统状态。
  11. 一种具有日志功能的动态令牌,其特征在于,包括:
    初始化模块,用于在上电之后,执行初始化操作,开启总中断和按键唤醒功能;
    第一判断模块,用于判断是否存在置位的中断标志;
    第二判断模块,用于在所述第一判断模块判断出存在置位的中断标志之后,对置位的中断标志进行判断;
    复位模块,用于在所述第二判断模块判断出所述置位的中断标志是定时器中断标志时,将定时器中断标志复位,并触发所述第一判断模块判断是否存在置位的中断标志;
    第一获取模块,用于在所述第二判断模块判断出所述置位的中断标志是按键中断标志时,关闭按键中断,扫描键盘,获取第一键值;
    第三判断模块,用于根据所述第一获取模块获取到的所述第一键值,对当前被按下的按键进行判断;
    第一处理模块,用于在所述第三判断模块判断出当前被按下的按键是第一按键时,生成动态口令以及与所述动态口令对应的日志,将所述动态口令存储到显示数据缓冲区,将所述日志存储到日志存储区,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;
    第二处理模块,用于在所述第三判断模块判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,从所述日志存储区中读取日志,将读取到的日志存储到所述显示数据缓冲区,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志。
  12. 如权利要求11所述的动态令牌,其特征在于,
    所述第二处理模块,具体用于在所述第三判断模块判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合之后,执行以下操作:
    T1)开启按键中断,判断是否存在置位的中断标志,如果是,则执行步骤T2;否则,继续执行步骤T1;
    T2)判断出置位的中断标志是按键中断标志后,关闭按键中断,扫描键盘;以及
    T3)根据扫描得到的键值判断出当前被按下的按键为第五按键后,从所述日志存储区中读取日志,将读取到的日志存储到所述显示数据缓冲区,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志。
  13. 如权利要求11所述的动态令牌,其特征在于,所述第一按键为确认键;
    所述动态令牌,还包括:
    第三处理模块,用于在所述第三判断模块判断出当前被按下的按键是数字键时,判断按键数据长度是否小于第三预设长度,如果是,则将所述第一键值保存到按键数据缓冲区和显示数据缓冲区中,更新所述按键数据长度,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;否则,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;
    在所述第三判断模块判断出当前被按下的按键是删除键时,判断按键数据长度是否为零,如果是,则开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;否则,将所述按键数据缓冲区中最后一次存入的数据删除,更新所述按键数据长度,将所述显示数据缓冲区中最后一次存入的数据删除,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;
    所述第一处理模块,包括:
    第一判断子模块,用于在所述第三判断模块判断出当前被按下的按键是确认键时,判断所述按键数据长度是否为零;
    第一生成子模块,用于在所述第一判断子模块判断出所述按键数据长度为零时,根据时间因子,生成动态口令 以及与所述动态口令对应的新增日志;
    第二生成子模块,用于在所述第一判断子模块判断出所述按键数据长度不为零时,将所述按键数据缓冲区中的数据作为挑战码,生成动态口令以及与所述动态口令对应的新增日志;
    第一存储子模块,用于将所述第一生成子模块和第二生成子模块生成的动态口令存储到所述显示数据缓冲区中;
    第二存储子模块,用于将所述第一生成子模块和第二生成子模块生成的新增日志存储到所述日志存储区;
    开启子模块,用于在所述第一生成子模块或第二生成子模块生成动态口令和新增日志后,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志。
  14. 如权利要求13所述的动态令牌,其特征在于,
    所述第一生成子模块,具体用于在所述第一判断子模块判断出所述按键数据长度为零时,根据所述时间因子生成时间型动态口令,为新增日志分配索引,将与所述时间因子对应的时间信息的长度作为新增日志的长度,对所述索引、所述新增日志的长度以及与所述时间因子对应的时间信息进行组合,得到所述新增日志。
  15. 如权利要求13所述的动态令牌,其特征在于,
    所述第二生成子模块,具体用于在所述第一判断子模块判断出所述按键数据长度不为零时,根据所述时间因子和所述挑战码,生成挑战型动态口令,为新增日志分配索引,对与所述挑战码对应的交易信息进行压缩,得到压缩交易数据,获取与所述时间因子对应的时间信息的长度和所述压缩交易数据的长度之和作为所述新增日志的长度,对所述索引、所述新增日志的长度、与所述时间因子对应的时间信息,以及所述压缩交易数据进行组合,得到所述新增日志。
  16. 如权利要求13所述的动态令牌,其特征在于,
    所述第二存储子模块,具体用于判断日志条数是否为零,如果是,则将所述新增日志存储到所述日志存储区中,将最前日志索引和最后日志索引均设置为所述新增日志中的索引,更新日志条数;否则,将所述新增日志存储到所述日志存储区中,将最后日志索引设置为所述新增日志中的索引,更新日志条数。
  17. 如权利要求16所述的动态令牌,其特征在于,
    所述第二处理模块,具体用于将当前日志索引设置为所述最后日志索引,根据当前日志索引从所述日志存储区中读取对应的日志,将读取到的日志存储到日志缓冲区中,将读取到的日志中的时间信息存储到所述显示数据缓冲区中,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志。
  18. 如权利要求16所述的动态令牌,其特征在于,
    所述第二处理模块,具体用于在所述第三判断模块判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,将当前日志索引设置为所述最后日志索引,根据当前日志索引从所述日志存储区中读取对应的日志,对读取到的日志中的压缩交易数据进行解压,将解压得到的当前交易信息存储到日志缓冲区中,判断当前交易信息是否大于第四预设长度,如果是,则从所述当前交易信息中选取存储位置最靠前的、第四预设长度的数据作为当前显示信息,将所述当前显示信息存储到所述显示数据缓冲区中,点亮显示屏上的右箭头,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;否则,将所述当前交易信息存储到所述显示数据缓冲区中,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志。
  19. 如权利要求11所述的动态令牌,其特征在于,还包括:
    第二获取模块,用于在所述第一获取模块获取到所述第一键值之后,获取按键时长;
    第六判断模块,用于在所述第三判断模块判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合之后,判断所述第二获取模块获取到的所述按键时长是否小于第一预设时长;
    第十处理模块,用于在所述第六判断模块判断出所述按键时长小于第一预设时长时,根据当前被按下的按键执行相应的操作,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;
    所述第二处理模块,具体用于在所述第六判断模块判断出所述按键时长不小于第一预设时长时,从所述日志存储区中读取日志,将读取到的日志存储到所述显示数据缓冲区,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志。
  20. 如权利要求11所述的动态令牌,其特征在于,还包括:
    第七判断模块,用于对系统状态进行判断;
    第十一处理模块,用于在所述第三判断模块判断出当前被按下的按键是电源键,且所述第七判断模块判断出所述系统状态不是关机状态时,将所述系统状态设置为关机状态,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志;
    在所述第三判断模块判断出当前被按下的按键是电源键,且所述第七判断模块判断出所述系统状态是关机状态时,更新所述系统状态;
    所述第二处理模块,包括:
    更新子模块,用于在所述第七判断模块判断出所述系统状态为关机状态,且所述第三判断模块判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,更新所述系统状态;
    处理子模块,用于在所述第七判断模块判断出所述系统状态为关机状态,且所述第三判断模块判断出当前被按下的按键是第二按键,或者是第三按键和第四按键的组合时,从所述日志存储区中读取日志,将读取到的日志存储到所述显示数据缓冲区,开启按键中断,并触发所述第一判断模块判断是否存在置位的中断标志。
PCT/CN2015/070680 2014-11-25 2015-01-14 一种具有日志功能的动态令牌及其工作方法 WO2016082317A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/502,832 US10162949B2 (en) 2014-11-25 2015-01-14 Dynamic token having log function and working method therefor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410685654.2 2014-11-25
CN201410685654.2A CN104394145B (zh) 2014-11-25 2014-11-25 一种具有日志功能的动态令牌及其工作方法

Publications (1)

Publication Number Publication Date
WO2016082317A1 true WO2016082317A1 (zh) 2016-06-02

Family

ID=52611981

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/070680 WO2016082317A1 (zh) 2014-11-25 2015-01-14 一种具有日志功能的动态令牌及其工作方法

Country Status (3)

Country Link
US (1) US10162949B2 (zh)
CN (1) CN104394145B (zh)
WO (1) WO2016082317A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271355A (zh) * 2018-08-27 2019-01-25 杭州迪普科技股份有限公司 一种清理日志文件缓存的方法及装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812127B (zh) * 2016-05-24 2019-10-08 飞天诚信科技股份有限公司 一种nfc动态令牌及其工作方法
CN106444729A (zh) * 2016-12-16 2017-02-22 普华基础软件股份有限公司 一种基于实时系统的轨迹捕捉系统
CN107707359B (zh) * 2017-11-09 2021-07-06 上海众人网络安全技术有限公司 一种电子密码器的校验方法和装置
CN109753488B (zh) * 2019-01-04 2021-03-23 烽火通信科技股份有限公司 一种基于http的服务器操作日志管理方法及系统
CN111026730A (zh) * 2019-12-20 2020-04-17 广东拓斯达科技股份有限公司 一种日志文件检测方法及装置
TWI815233B (zh) * 2021-04-28 2023-09-11 仁寶電腦工業股份有限公司 電源管理裝置以及管理方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103227720A (zh) * 2013-03-12 2013-07-31 飞天诚信科技股份有限公司 一种应用于动态令牌的按键处理方法
CN103391195A (zh) * 2013-07-01 2013-11-13 飞天诚信科技股份有限公司 一种动态令牌的工作方法
CN103684785A (zh) * 2013-12-09 2014-03-26 飞天诚信科技股份有限公司 一种具有按键保护功能的动态令牌及其工作方法

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100492966C (zh) * 2004-11-26 2009-05-27 王小矿 基于智能卡和动态密码的身份认证系统
WO2006123339A2 (en) * 2005-05-19 2006-11-23 Sandisk Il Ltd. Transaction authentication by a token, contingent on personal presence
US9137012B2 (en) * 2006-02-03 2015-09-15 Emc Corporation Wireless authentication methods and apparatus
US7779451B2 (en) * 2006-03-30 2010-08-17 Intel Corporation Securing wakeup network events
US8095368B2 (en) * 2008-12-04 2012-01-10 At&T Intellectual Property I, L.P. System and method for voice authentication over a computer network
US8756674B2 (en) * 2009-02-19 2014-06-17 Securekey Technologies Inc. System and methods for online authentication
US8549594B2 (en) * 2009-09-18 2013-10-01 Chung-Yu Lin Method of identity authentication and fraudulent phone call verification that utilizes an identification code of a communication device and a dynamic password
CN101854147B (zh) 2010-03-29 2012-04-18 飞天诚信科技股份有限公司 校正动态口令令牌温漂的方法和动态口令令牌
US8438649B2 (en) * 2010-04-16 2013-05-07 Success Factors, Inc. Streaming insertion of tokens into content to protect against CSRF
KR20120069484A (ko) * 2010-12-20 2012-06-28 삼성전자주식회사 키 입력 방법 및 장치
CN102307095B (zh) * 2011-04-27 2014-08-27 上海动联信息技术股份有限公司 一种动态令牌种子密钥注入和变形方法
US9860059B1 (en) * 2011-12-23 2018-01-02 EMC IP Holding Company LLC Distributing token records
CN102801531B (zh) * 2012-09-04 2015-03-04 飞天诚信科技股份有限公司 一种基于声音传输的动态令牌的工作方法
US9703937B2 (en) * 2013-04-10 2017-07-11 Dell Products, L.P. Method to prevent operating system digital product key activation failures
US9838385B2 (en) * 2015-06-30 2017-12-05 International Business Machines Corporation Password generation based on dynamic factors

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103227720A (zh) * 2013-03-12 2013-07-31 飞天诚信科技股份有限公司 一种应用于动态令牌的按键处理方法
CN103391195A (zh) * 2013-07-01 2013-11-13 飞天诚信科技股份有限公司 一种动态令牌的工作方法
CN103684785A (zh) * 2013-12-09 2014-03-26 飞天诚信科技股份有限公司 一种具有按键保护功能的动态令牌及其工作方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271355A (zh) * 2018-08-27 2019-01-25 杭州迪普科技股份有限公司 一种清理日志文件缓存的方法及装置

Also Published As

Publication number Publication date
US20170249449A1 (en) 2017-08-31
US10162949B2 (en) 2018-12-25
CN104394145B (zh) 2015-09-23
CN104394145A (zh) 2015-03-04

Similar Documents

Publication Publication Date Title
WO2016082317A1 (zh) 一种具有日志功能的动态令牌及其工作方法
RU2541149C2 (ru) Устройство обработки информации, способ разрезания движущегося изображения и программа разрезания движущегося изображения
TWI479883B (zh) 電視裝置及其應用程式的操作方法
CN107526509B (zh) 消息显示方法、装置及移动终端
US20160188363A1 (en) Method, apparatus, and device for managing tasks in multi-task interface
CN103092484B (zh) 解锁屏幕的方法、装置及终端
US9942942B2 (en) Wireless communication device, electronic timepiece and wireless communication method
JP2014526730A (ja) パスワード明示セレクタ
EP3940520A1 (en) Method, apparatus, and device for enabling task management interface
WO2012055309A1 (zh) 一种多媒体终端开机界面的显示方法及装置
CN107103224B (zh) 一种解锁方法及移动终端
CN107533596B (zh) 指纹识别方法及移动终端
US10126940B2 (en) Touch zones on a soft keyboard
US20130031062A1 (en) Adjustment apparatus, adjustment method, and recording medium of adjustment program
WO2016112796A1 (zh) 推送信息的处理方法及装置
WO2016000323A1 (zh) 一种运行软键盘的方法、终端及计算机可读存储介质
JP2012118731A (ja) サーバベース・コンピューティング・システムのクライアント装置、サーバ装置、およびプログラム
US20160320959A1 (en) Terminal Operation Apparatus and Terminal Operation Method
CN110379051B (zh) 解锁方法、装置、终端及存储介质
US10114518B2 (en) Information processing system, information processing device, and screen display method
WO2017000343A1 (zh) 一种指纹解锁的方法及终端
CN109241718A (zh) 密码处理方法和设备
JP2021163303A5 (zh)
JP2015005309A (ja) 制御装置及びプログラム
US9898305B2 (en) Display method for logo graphics displayed on screen and smart device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15862697

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15502832

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15862697

Country of ref document: EP

Kind code of ref document: A1