An authentication device having the shape of a credit card, and hence featuring a major front face parallel to a major back face, comprising: a. a key switch and a photosensor, wherein said key switch is electrically connected in such a way that a voltage pulse is generated when a keystroke is applied to said key switch by a user of the authentication device, said voltage pulse having a start and an end; b. a battery or a photovoltaic element for powering the authentication device; c. a microprocessor unit, whereby said microprocessor unit is arranged so that it is awakened from sleep mode by the start of a keystroke's voltage pulse, and after the end of said keystroke voltage pulse it verifies the output from said photosensor and in case of positive verification it generates a one time password, while in all cases the microprocessor unit switches back to sleep mode within predetermined lengths of time; d. a display device for displaying the one time password heretofore; the authentication device being characterized in that it comprises a photosensitive input key (1, 2) consisting of said key switch paired with said photosensor, wherein said photosensor is disposed sufficiently close to said key switch so that when the user of the authentication device applies a keystroke by pressing said key switch with a finger, or between two fingers pressing from the two opposite faces of the authentication device, one finger also covers the photosensor substantially reducing the amount of light reaching said photosensor and in that when verifying the output from said photosensor, said microprocessor unit is arranged to verify whether a predetermined increase of the amount of light reaching the photosensor heretofore has taken place substantially at the same time as the end of said keystroke's voltage pulse. a. a key switch and a photosensor, wherein said key switch is electrically connected in such a way that a voltage pulse is generated when a keystroke is applied to said key switch by a user of the authentication device, said voltage pulse having a start and an end; b. a battery or a photovoltaic element for powering the authentication device; c. a microprocessor unit, whereby said microprocessor unit is arranged so that it is awakened from sleep mode by the start of a keystroke's voltage pulse, and after the end of said keystroke voltage pulse it verifies the output from said photosensor and in case of positive verification it generates a one time password, while in all cases the microprocessor unit switches back to sleep mode within predetermined lengths of time; d. a display device for displaying the one time password heretofore; the authentication device being characterized in that it comprises a photosensitive input key (1, 2) consisting of said key switch paired with said photosensor, wherein said photosensor is disposed sufficiently close to said key switch so that when the user of the authentication device applies a keystroke by pressing said key switch with a finger, or between two fingers pressing from the two opposite faces of the authentication device, one finger also covers the photosensor substantially reducing the amount of light reaching said photosensor and in that when verifying the output from said photosensor, said microprocessor unit is arranged to verify whether a predetermined increase of the amount of light reaching the photosensor heretofore has taken place substantially at the same time as the end of said keystroke's voltage pulse.