Project showcase

Automated Password Typer © LGPL

Now you don't have to remember any of your passwords, and they are still safe and ready to use!

  • 6,975 views
  • 20 comments
  • 22 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

Hi everyone!

Most of us use loads of services where a login is required. Therefore we have passwords that we have to remember. As it is bad practise to use the same password everywhere, it might become difficult to remember all the difficult combinations. So I decided to use an Arduino to automate the password-typing process and stored the password securely in the microcontroller. Note that once a microcontroller has a sketch in it, it is impossible to access any information within the uploaded sketch and so hackers can't get access to the passwords stored in the microcontroller's memory.

The device looks like this:

It doesn't have any power source inside, which is not necessary, because it only works in combination with the computer. In this project I have used the Arduino Pro Micro because of the ATmega32U4 chip that already has built in USB.

To connect the device to the computer we need a standard smartphone charging cable (USB micro).

Once connected you have to type in only one password to get access to the other ones. You can change it in the sketch. The password is the rotation clicks of the encoder in the right direction the right number of times. It is difficult to understand, just watch the video to see what I am writing about)

Use the encoder to navigate through the menu and press the encoder to enter password into the computer.

Here is the video where I am building it. Watch it please and leave a like!

This really supports me.

For the components check out my website: https://www.allmakers.net/

Join my Facebook group: https://www.facebook.com/groups/1135972269910811/

I am open for any kind of questions and suggestions. Feel free to comment!

Code

The codeC/C++
#include <Keyboard.h>                                 // 
#include <LiquidCrystal_I2C.h>                        // 
#include <EEPROM.h>
#define pinA 5                                        //  
#define pinB 6                                        //  
#define btnPin 4                                      // 

byte aState;                                          //   
byte bState;                                          //   
byte aLastState;                                      //    
int dir;                                              //-1 -  . ., 1 -  . .
byte attempt = 0;                                     //-   
int pos = 0;                                          //   
byte typed = 0;                                       //  
bool accepted = false;                                //   

String code = "101";                                  //  : 101 -- 110011
int codeLen = 0;                                      // 
String enter = "";                                    //  

int a = 0;                                                //   
int len = 0;                                              // 
int counter;

byte address = 0;
long currentTime;

String passwords[][2] {
  {"Admin", "eyamplepassword"},
  {"EPN", ""},
  {"Mail", ""},
  {"YouTube", ""},
  {"Asus", ";"},
  {"GMX", ""}
};

LiquidCrystal_I2C lcd(0x3B, 16, 2);                   // 

int lcdClear(byte x) {                                //   
  if (x == 2) {                                       //2 clear all, 0 clear first line, 1 clear second line
    for (int i = 0; i < 2; ++i) {
      lcd.setCursor(0, i);
      lcd.print("                ");
    }
  }
  else {
    lcd.setCursor(0, x);
    lcd.print("                ");
  }
}

void setup() {
  pinMode(pinA, INPUT);                               //  - 
  pinMode(pinB, INPUT);                               //  - 
  pinMode(btnPin, INPUT);                             // - 
  Serial.begin(9600);                                 // 
  Keyboard.begin();                                   // 
  aLastState = digitalRead(pinA);                     //  .   
  lcd.init();                                         // 
  lcd.backlight();                                    // 
  lcd.setCursor(0, 0);
  lcd.print("<Password Typer>");
  lcd.setCursor(1, 1);
  lcd.print("Version 1.6 PM");
  delay(3000);
  lcdClear(2);
  while (passwords[a][0] != NULL) {
    a++;
    len++;
  }
  //Serial.println(len);
}

void getDirection() {
  aState = digitalRead(pinA);                         //   
  if (aState != aLastState) {                         // ...
    if (aState == digitalRead(pinB)) {                           //  ...
      //Serial.println("CCW 0");                        //   
      dir = -1;                                       //  . .
    }
    else {
      //Serial.println("CW 1");                         //   
      dir = 1;                                        //  . .
    }
  }
  aLastState = aState;                                //  . 
}

void convert() {                                      //   ,   
  for (int k = 0; k < codeLen; k++) {
    enter.remove(k, 1);
  }
}

void check() {
  if (enter == code) {
    accepted = true;                                //   
    lcdClear(2);
    lcd.setCursor(4, 0);
    lcd.print("Welcome!");
    delay(2000);
    lcdClear(2);
    enter = "";
    typed = 0;
    lcd.setCursor(0, 0);
    lcd.print(">");
    lcd.print(passwords[pos][0]);
    if (len > 1) {
      lcd.setCursor(1, 1);
      lcd.print(passwords[pos + 1][0]);
    }
  }
  else {
    attempt += 1;                                    //-  
    if (attempt == 3) {
      lcdClear(2);
      lcd.setCursor(0, 0);
      lcd.print("Wrong password!");
      lcd.setCursor(0, 1);
      lcd.print("Wait 1 minute!");
      currentTime = millis();
      while (millis() - currentTime < 1000 * 60) {
        currentTime = millis();
        EEPROM.update(address, 1);
      }
      EEPROM.update(address, 0);
      attempt = 0;
      lcdClear(2);
      typed = 0;
    }
    else {
      lcd.setCursor(7, 0);
      lcd.print("         ");
      lcd.setCursor(15, 1);
      lcd.print(3 - attempt);
      lcd.setCursor(7, 0);
    }
    accepted = false;                                //  
    enter = "";
  }
}

void loop() {
  if (accepted == false) {
    if (EEPROM.read(address) == 1) { 
        lcdClear(2);
        lcd.setCursor(0,0);
        lcd.print("      WAIT      ");
        delay(1000 * 30);
        lcdClear(2);
        EEPROM.update(address, 0); 
        delay(1000);
    }
    getDirection();                                 //  
    if (typed == 0) {
      lcd.setCursor(0, 0);
      lcd.print("Unlock:");
      lcd.setCursor(0, 1);
      lcd.print("Attempts left: 3");
      typed = 1;
      lcd.setCursor(7, 0);
    }
    if (dir != 0) {
      if (dir == -1) {
        enter = enter + "0";
      }
      else {
        enter = enter + "1";
      }
      codeLen = enter.length();                         //   
      if (codeLen % 2 == 0) {
        lcd.print("*");
      }
      dir = 0;
    }
    if (digitalRead(btnPin) == 0) {                       //  ...
      delay(300);
      convert();
      check();
    }
  }

  else {
    getDirection();
    if (dir == 1 || dir == -1) {
      counter++;
      if (counter % 2 == 0) {
        counter = 0;
        if (dir == 1) {
          if (pos + 1 < len) {
            if (pos % 2 == 0) {
              pos++;
              lcd.setCursor(0, 0);
              lcd.print(" ");
              lcd.setCursor(0, 1);
              lcd.print(">");
            }
            else {
              pos++;
              lcdClear(2);
              lcd.setCursor(0, 0);
              lcd.print(">");
              lcd.print(passwords[pos][0]);
              if (pos + 1 <= len) {
                lcd.setCursor(1, 1);
                lcd.print(passwords[pos + 1][0]);
              }
            }
          }
        }
        else {
          if (pos - 1 >= 0) {
            if (pos % 2 == 0) {
              pos--;
              lcdClear(2);
              lcd.setCursor(0, 1);
              lcd.print(">");
              lcd.print(passwords[pos][0]);
              lcd.setCursor(1, 0);
              lcd.print(passwords[pos - 1][0]);
            }
            else {
              pos--;
              lcd.setCursor(0, 1);
              lcd.print(" ");
              lcd.setCursor(0, 0);
              lcd.print(">");
            }
          }
        }
      }
      dir = 0;
    }
    if (digitalRead(btnPin) == 0) {
      delay(300);
      Keyboard.print(passwords[pos][1]);
    }
  }
}

Custom parts and enclosures

Enclosure
Enclosure top

Schematics

Schematic
Schematic uljgkimh6r

Comments

Similar projects you might like

Arduino Bluetooth Basic Tutorial

by Mayoogh Girish

  • 454,706 views
  • 42 comments
  • 237 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,521 views
  • 95 comments
  • 671 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 229,353 views
  • 38 comments
  • 236 respects

OpenCat

Project in progress by Team Petoi

  • 195,984 views
  • 154 comments
  • 1,363 respects
Add projectSign up / Login