Flexible and stretchable human-machine Interfacing devices have attracted great attention due to the need for portable, ergonomic, and geometrically compatible devices in the new era of computer technology. Triboelectric nanogenerators (TENG) have shown promising potential for self-powered human–machine interacting devices. In this paper, a flexible, stretchable and self-powered keyboard is developed based on vertical contact-separation mode TENG. The keyboard is fabricated using urethane, silicone rubbers and Carbon Nanotubes (CNTs) electrodes. The structure shows a highly flexible, stretchable, and mechanically durable behavior, which can be conformal on different surfaces. The keyboard is capable of converting mechanical energy of finger tapping to electrical energy based on contact electrification, which can eliminate the need of external power source. The device can be utilized for wireless communication with computers owing to the self-powering mechanism. The keyboards also demonstrate consistent behavior in generating voltage signals regardless of touching objects’ materials and environmental effects like humidity. In addition, the proposed system can be used for keystroke dynamic-based authentication. Therefore, highly secured accessibility to the computers can be achieved owing to the keyboard’s high sensitivity and accurate selectivity of different users.