HID PASSWORD TYPER
Passwords are stored into the flash memory of the attiny85 to prevent RAM issues. Once plugged into an usb port the device will be recognized as a HID keyboard, clocking itself via the computer bus, and, with a simple button press, it will type the stored data into any text editor or other program. A secret button press sequence can be added for improved security.
In the photo the little HID keychain can be seen, i have used solder traces as a fast build for the usb connector.
#include "DigiKeyboard.h"
#include <avr/pgmspace.h>
#define NO 20
const char t0[] PROGMEM ="account1";
const char t1[] PROGMEM ="account2";
const char t2[] PROGMEM ="account3";
const char t3[] PROGMEM ="account4";
const char t4[] PROGMEM ="account5";
const char t5[] PROGMEM ="account6";
const char t6[] PROGMEM ="account7";
const char t7[] PROGMEM ="account8";
const char t8[] PROGMEM ="account9";
const char t9[] PROGMEM ="account10";
const char t10[] PROGMEM ="account11";
const char t11[] PROGMEM ="account12";
const char t12[] PROGMEM ="account13";
const char t13[] PROGMEM ="account14";
const char t14[] PROGMEM ="account15";
const char t15[] PROGMEM ="account16";
const char t16[] PROGMEM ="account17";
const char t17[] PROGMEM ="account18";
const char t18[] PROGMEM ="account19";
const char t19[] PROGMEM ="account20";
const char s0[] PROGMEM ="username1";
const char s1[] PROGMEM ="username2";
const char s2[] PROGMEM ="username3";
const char s3[] PROGMEM ="username4";
const char s4[] PROGMEM ="username5";
const char s5[] PROGMEM ="username6";
const char s6[] PROGMEM ="username7";
const char s7[] PROGMEM ="username8";
const char s8[] PROGMEM ="username9";
const char s9[] PROGMEM ="username10";
const char s10[] PROGMEM ="username11";
const char s11[] PROGMEM ="username12";
const char s12[] PROGMEM ="username13";
const char s13[] PROGMEM ="username14";
const char s14[] PROGMEM ="username15";
const char s15[] PROGMEM ="username16";
const char s16[] PROGMEM ="username17";
const char s17[] PROGMEM ="username18";
const char s18[] PROGMEM ="username19";
const char s19[] PROGMEM ="username20";
const char p0[] PROGMEM ="password1";
const char p1[] PROGMEM ="password2";
const char p2[] PROGMEM ="password3";
const char p3[] PROGMEM ="password4";
const char p4[] PROGMEM ="password5";
const char p5[] PROGMEM ="password6";
const char p6[] PROGMEM ="password7";
const char p7[] PROGMEM ="password8";
const char p8[] PROGMEM ="password9";
const char p9[] PROGMEM ="password10";
const char p10[] PROGMEM ="password11";
const char p11[] PROGMEM ="password12";
const char p12[] PROGMEM ="password13";
const char p13[] PROGMEM ="password14";
const char p14[] PROGMEM ="password15";
const char p15[] PROGMEM ="password16";
const char p16[] PROGMEM ="password17";
const char p17[] PROGMEM ="password18";
const char p18[] PROGMEM ="password19";
const char p19[] PROGMEM ="password20";
const char* const t[] PROGMEM = {
t0,
t1,
t2,
t3,
t4,
t5,
t6,
t7,
t8,
t9,
t10,
t11,
t12,
t13,
t14,
t15,
t16,
t17,
t18,
t19};
const char* const s[] PROGMEM = {
s0,
s1,
s2,
s3,
s4,
s5,
s6,
s7,
s8,
s9,
s10,
s11,
s12,
s13,
s14,
s15,
s16,
s17,
s18,
s19};
const char* const p[] PROGMEM = {
p0,
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8,
p9,
p10,
p11,
p12,
p13,
p14,
p15,
p16,
p17,
p18,
p19};
const char a0[] PROGMEM = "....START....";
const char a1[] PROGMEM = ".....END.....";
const char a2[] PROGMEM = " USERNAME ";
const char a3[] PROGMEM = " PASSWORD ";
const char a4[] PROGMEM = "ACCOUNT ";
const char a5[] PROGMEM = "..............";
const char* const a[] PROGMEM = {a0, a1, a2, a3, a4, a5};
void setup() {pinMode(0, INPUT);}
void loop() {while(digitalRead(0) == LOW) {
DigiKeyboard.delay(20);}
DigiKeyboard.sendKeyStroke(0);
char buf[16];
strcpy_P(buf,(char*)pgm_read_word(&(a[5])));
DigiKeyboard.print(buf);
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(a[0])));
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(a[5])));
DigiKeyboard.print(buf);
DigiKeyboard.println(buf);
DigiKeyboard.print(buf);
DigiKeyboard.print(buf);
DigiKeyboard.print(buf);
DigiKeyboard.print(buf);
DigiKeyboard.println(buf);
free(buf);
for (int i=0; i<NO; i++) {
strcpy_P(buf,(char*)pgm_read_word(&(a[4])));
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(t[i])));
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(a[2])));
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(s[i])));
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(a[3])));
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(p[i])));
DigiKeyboard.println(buf);
free(buf);}
strcpy_P(buf,(char*)pgm_read_word(&(a[5])));
DigiKeyboard.print(buf);
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(a[1])));
DigiKeyboard.print(buf);
free(buf);
strcpy_P(buf,(char*)pgm_read_word(&(a[5])));
DigiKeyboard.print(buf);
DigiKeyboard.println(buf);
free(buf);
}