Keyboard Injection/Auto Type Your Password With One Click!




Introduction: Keyboard Injection/Auto Type Your Password With One Click!

Passwords are hard... and remembering a secure one is even harder! On top of that if you have along, convoluted password it will take time to type.

But fear not my friends, I have a solution to this! I Created a little auto-typing machine that will output the passwords into the computer. Now there is no need to remember stuff or being a fast typer.

Step 1: What You Need.


2x 10k resistors (never mind the picture where there is only one)

1x Pro Micro (or any Arduino/Arduino clone with the 32u4 chip)

1x Matchbox (Now, don't get the wrong idea, it is not in a matchbox to be sneaky it is built in one because i think it looks good).

2x Pushbuttons.

Some cables, preferably different colours.

Tools used:

Soldering iron.

Glue gun

Step 2: Putting It Together

For the wiring you'll need to connect the VCC and/or RAW on the Pro Micro via a resistor to the button. The cable that goes to the digital pins on the Pro Micro will go to the same pin as the power on the button. Lastly, return to ground (GND).

Or make it easy for yourself and look at the images to see how I connected things. The Fritzing image is to help make it clear where everything will go, I know it is a Leonardo on that image but there were no Pro Micro in Fritzing.

Use the glue gun to secure everything in the matchbox.

Step 3: The Code

#include <Keyboard.h>
#define buttonPin 7 // Permanently makes buttonPin's value 7. #define buttonPin2 5 // Permanently makes buttonPin2's value 5.

void setup() { pinMode(buttonPin,INPUT); // Set the pins as inputs. pinMode(buttonPin2,INPUT); Serial.begin(9600); Keyboard.begin(); // Start the keayboard funktions


void loop() { int buttonState = digitalRead(buttonPin); //read the state of the button input int buttonState2 = digitalRead(buttonPin2); //read the state of the button input if (buttonState == LOW) { //pressing the button will produce a LOW state 0V

Serial.println(buttonState); Keyboard.print ("m05Ts3cUR3Pa55W0rDewWa"); //Enter your password here delay (1000); } if (buttonState2 == LOW) { //pressing the button will produce a LOW state 0V Keyboard.print ("5eConDm05Ts3cUR3Pa55W0rDewWa"); //Enter your second password here delay (1000); }


If you want, you could make it type in your usernam/email then tab to password and enter that as well. Just put this piece of code in instead of just the Keyboard.print().

<Keyboard.print("Your username");//type username
delay(100);;//this will press the tab key
Keyboard.print("Your password"); //type password

Step 4: All Done!

Connect it to your computer and start using it!

Safe and Secure Challenge

Participated in the
Safe and Secure Challenge

1 Person Made This Project!


  • Big and Small Contest

    Big and Small Contest
  • Make It Bridge

    Make It Bridge
  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge


You could make it more secure by adding a rfid reader or fingerprint scanner to prevent others from using it


Question 4 years ago

Does it work with arduino nano


Question 4 years ago on Step 4

Is it possible to use an Attiny 85? This would be so awesome, I want to implement it to an ordinary USB-Stick cover :)
Nice project, I voted for you ;)
Greetings from Germany :)


Question 4 years ago on Introduction

sir,do you have a video on this project ,video that can prove that this project works well. thanks


Answer 4 years ago

Proof? You have the code and then how to set it up. It uses pull-up switches, a well known library for the 32u4 and the code is pretty easy. There's nothing to prove.

If you want me to explain something more in depth or go through the code with you I'm more than happy to help.


4 years ago

very cool! Why is one button sourced by the 5V and the other 3,3V?


Reply 4 years ago

Because I'm a noob ;)

No but seriously, I had an idea that i could use one resistor for both buttons (that's why there is only one resistor on the part image).But after I had connected everything I noticed that having both buttons coming from 5v made them both go low when any of them got pressed. You can do that, but then you need one diod/button.

Here is a thread about it on Arduino.c:c
There is one good instructable about buttons as well:

The problem was that i didn't test before soldering and tryed to save the project in the end, a bit wonky but functional.

DIY Hacks and How Tos

Cool idea. How hard do you think that it would be to set this up for multiple passwords for different applications.


Reply 4 years ago

I have it set up to handle two passwords and there is a ways to make it work with more.

Read this thread about how you do this with only the 5v out on the Arduino here, . After you connect everything that way you just need to copy-paste the code to make more buttons.