主权项 |
1. A method of a dynamic token, the method being performed by a processor, a storage medium and a keyboard; the storage medium comprising a data cache for storing data and a storage region for storing a key flag, a power flag, a lock flag, a state identification and a logon password; the keyboard comprising a power key, a delete key, a first numeric key group, a second numeric key group and an OK key, the method comprising:
after the dynamic token detects that the key flag is set, (Step A) clearing the key flag, scanning the keys and determining type of the key pressed down; performing Step B in a case that the key pressed down is the power key; performing Step D in a case that the key pressed down is the delete key; performing Step E in a case that the key pressed down is a key in the first numeric key group; performing Step F in a case that the key pressed down is a key in the second numeric key group; and performing Step G in a case that the key pressed down is the OK key; (Step B) checking the power flag; in a case that the power flag is set, resetting the power flag and entering a dormant state; and in a case that the power flag is not set, setting the power flag and performing Step C; (Step C) checking the lock flag; in a case that the lock flag is set, setting the state identification to be a first predetermined value and performing Step L; and in a case that the lock flag is not set, setting the state identification to be a second predetermined value and performing Step L; (Step D) checking the power flag; in a case that the power flag is set, deleting one unit data at the end of the data cache, displaying numbers corresponding to all unit data in the data cache, and performing Step L; and in a case that the power flag is not set, entering the dormant state; (Step E) checking the power flag; in a case that the power flag is set, storing data corresponding to the key pressed down into the data cache, displaying numbers corresponding to all unit data in the data cache, and performing Step L; and in a case that the power flag is not set, entering the dormant state; (Step F) checking the power flag; in a case that the power flag is set and the state identification is a third predetermined value, determining whether time period for holding the key pressed down exceeds a predetermined time period; setting the state identification to be a fifth predetermined value and performing Step L in a case that the time period for holding the key pressed down exceeds the predetermined time period; and performing Step L directly in a case that the time period for holding the key pressed down does not exceed the predetermined time period; in a case that the power flag is set and the state identification is not the third predetermined value, storing data corresponding to the key pressed down into the data cache, displaying numbers corresponding to all unit data in the data cache, and performing Step L; in a case that the power flag is not set, entering the dormant state; (Step G) checking the power flag; in a case that the power flag is set, checking the state identification; performing Step H in a case that the state identification is the first predetermined value; performing Step I in a case that the state identification is the second predetermined value; performing Step J in a case that the state identification is the third predetermined value; and performing Step K in a case that the state identification is the fifth predetermined value; and in a case that the power flag is not set, entering the dormant state; (Step H) generating an unlock verification code by performing computing on a dynamic factor and a static factor inside the dynamic token or on data in the data cache, a dynamic factor and a static factor inside in the dynamic token; determining whether the data in the data cache is identical to the generated unlock verification code; in a case that the data in the data cache is identical to the generated unlock verification code, resetting the lock flag, setting the state identification to be the fifth predetermined value, clearing the data in the data cache, and performing Step L; and in a case that the data in the data cache is not identical to the generated unlock verification code, clearing the data in the data cache and performing Step C; (Step I) determining whether data in the data cache is identical to the logon password currently stored in the dynamic token; in a case that the data in the data cache is identical to the logon password currently stored in the dynamic token, setting the state identification to be the third predetermined value, clearing the data in the data cache, and performing Step L; and in a case that the data in the data cache is not identical to the logon password currently stored in the dynamic token, clearing the data in the data cache, setting the lock flag, and performing Step C; (Step J) generating a dynamic password by performing computing on a dynamic factor and the static factor pre-stored in the dynamic token or on a dynamic factor, data in the data cache and a static factor pre-stored in the dynamic token, displaying content corresponding to the dynamic password and performing Step L; (Step K) determining whether data in the data cache meets a predetermined condition; in a case that the data in the data cache meets the predetermined condition, replacing the logon password currently stored in the dynamic token with the data in the data cache, clearing the data in the data cache, setting the state identification to be the third predetermined value, and performing Step L; and in a case that the data in the data cache does not meet the predetermined condition, clearing the data in the data cache and performing Step L; (Step L) determining whether the key flag is detected to be set in a predetermined time period; in a case that the key flag is detected to be set in the predetermined time period, performing Step A; and in a case that the key flag is not detected to be set in the predetermined time period, resetting the power flag and entering the dormant state, wherein the method further comprises: after the key flag is detected to be set, determing whether time period for holding the key pressed down exceeds a predetermined time period; in a case that the time period for holding the key pressed down exceeds the predetermined time period, performing Step A; and in a case that the time period for holding the key pressed down does not exceed the predetermined time period, clearing the key flag, entering the dormant state and waiting for next setting of the key flag. |