Cyber security has become a serious concern as the internet penetrates every corner of our life over the last two decades. The rapidly developing human-machine interfacing calls for an effective and continuous authentication solution. Herein, we developed a two-factor, pressure-enhanced keystroke-dynamics-based security system that is capable of authenticating and even identifying users through their unique typing behavior. The system consists of a rationally designed triboelectric keystroke device that converts typing motions into analog electrical signals, and a support vector machine (SVM) algorithm-based software platform for user classification. This unconventional keystroke device is self-powered, stretchable and water/dust proof, which makes it highly mobile and applicable to versatile working environments. The promising application of this novel system in the financial and computing industry can push cyber security to the next level, where leaked passwords would possibly be of no concern.