Designed and coded a password manager in Python with Arduino integration

Overview

Python-Password-Manger-NJRC

Designed and coded a password manager in Python with Arduino integration. The Program uses a master user to login, and stores account data such as usernames and passwords to the master user. While logging into the program with the master user the Arduino was used as a two-factor authentication key. The program detects a connection to the Arduino and checks if certain parameters are met before completing the login procedure.

Introduction

The Password Manager, creates and stores a master user profile, where an Arduino is used as part of a Two-Factor Authentication method, using Arduino inputs and outputs as part of the process. It stores the data for accounts by their names, where it stores the account name, username/e-mail, and password. This can be used whenever you need to store a password you want to remember on your device.

Final Design

The details of design for the different components are described within the notes about their implementation. As a part of the overall design 4 functions were designed:

• sign_in(user_dir), to ask for username, password, and security question answer. Then checks inputs against stored values to verify they are correct if not, it will continually loop until correct user details are entered.

• create_table(), to create a table in a sqlite3 database.

• store_data(), to store inputted data in a sqlite3 table.

• lookup_data(), to retrieve stored inputs, from a sqlite3 table using an inputted string that is compared against currently stored strings.

Implementation

Imported engi1020.ardunio, random, sleep, pickle and sqlite3 modules.

Created a class User, to store user objects for later use and created an empty user dictionary, user_dir, also created a class Account for later use.

Created variables conn = sqlite3.connect(‘sqldata.db’) and c = conn.cursor(), to connect to an sqlite3 data base.

Worked on sign_in(user_dir)

• Create a variable that opens and reads pickle file with the stored User object, then created variable stored_user, which loads stored User from the pickle file, then added stored_user in the user_dir dictionary.

• While loop for while true, print “What is your username?”

o	Store input in variable acc_username.

o	Then compared acc_username against stored username in the user_dir.

o	If acc_username = stored username, break out of loop.

o	Else print “username does not exist”.

• While loop for while true, print “What is your password?”

o	Store input in variable acc_password.

o	Then compared acc_password against stored password in the user_dir.

o	If acc_password = stored password, break out of loop.

o	Else print “You have entered the incorrect password try again”.

Worked on create_table()

• Used c.execute, to add a new table accounts to the sqlite3 database.

Worked on store_data()

• Used c.execute, to insert values for account name, username/email and password, to the created accounts table.

Worked on lookup_data(acc_name)

• Created tuple data = (‘Account Name: ‘, ‘Username/E-Mail: ‘, ‘Password: ‘)

• Used c.execute to lookup accounts where the account name is equal to the input argument acc_name.

• Set variable find = list(c.fetchall()) to store looked up account.

• If no account is found print “This account does not exist, RETRY”

• Else, created for loop where account name, username/email, and password, print right after the counterparts of the tuple data.

Once functions were created, worked on creating a user and storing a user and using the create table to start the data storing.

Worked on sign in process

• While loop for while true, print “Create User? Or Sign In?”

o	Set variable to inputted answer

o	If inputted answer equals create user, print "WARNING! Creating a new account will DELETE the current account! Are you sure you want to proceed?"

o	Set variable to inputted answer
 
  	If inputted answer equals yes, continue with user creation.
  
  	Then asked for name, username, password, and confirmed password, and stored inputs to variables.

• While loop for while password does not equal confirmed password, continuously runs until both strings are equal.

• Else continue with user creation and create security question and answer.

o	Save all inputted user info to new_user object, then add to user_dir dictionary. 

o	Create a variable that opens and writes pickle file that stores the new_user object.

o	Used c.execute to check if a table accounts exists, if it does use c.execute to delete table.

o	Then create new table accounts, for new data.

o	Then used sign_in(user_dir) to sign in for first time. After signed in break original while loop.
 
  	Else, anything other than Yes inputted, pass so while loop repeats.

o	Elif inputted answer equals sign in, then use sign_in(user_dir) to sign in. After signed in break original while loop.

o	Else anything other than create user, or sign in inputted print “Error” and original while loop repeats.

Worked on security question and answer check

• While loop for while true, prints security question stored in user object in dictionary.

• Set variable for inputted answer.

o	If inputted answer is equal to stored answer break loop.

o	Else print “Security question answer wrong, RETRY”, and while loop repeats.

Worked on Two-Factor Authentication, Step One

• While loop for while true, print “Two-Factor Authentication, Step One”

o	Used Arduino, printed to lcd screen 5, 4, 3, 2, 1. With sleep(1) between each number and after 1 to count down from 5 to 0.

o	Then used digital_read(2) for the button, and digital_read(7) for the touch sensor.

o	If button and touch sensor reads equal to 1, print “Step One successful!”, and break while loop.

o	Else, print ”Step One failed, RETRY”, and while loop repeats.

Worked on Two-Factor Authentication, Step Two

• While loop for while true, print “Two-Factor Authentication, Step Two”

o	Used random.randint() to produce a random 4-digit number from 1000-9999 and set it to a variable.

o	Printed variable to lcd screen, and user must input 4-digit number seen on lcd screen to console.

o	If inputted 4-digit number is qual to random 4-digit number, print "Step Two successful!" and print "Two-Factor Authentication complete!". Then break while loop.

o	Else, print ”Step Two failed, RETRY”, and while loop repeats.

Print “Welcome ‘name of user’! You have signed in successfully”.

Worked on, account storing, account lookup and logging out of program

• While loop for while true, print "Would you like to Store an account?, Lookup an account?, or LogOut?".

• Set variable for user input

o	If user input is equal to store, ask and store inputs to variables for account name, username/email, and password, of the account you would like to store.
  
  	The store collected data in Account object and set it to a varible acc_data.
  
  	Used store_data() to store collected account data using Account object.

o	Elif user input is equal to lookup, print "What is the name of the account you would like to Lookup?".
  
  	Set a variable acc_name to store user input.
  
  	Used lookup_data(acc_name) to lookup account.

o	Elif user input is equal to logout, print "LogOut successful! Goodbye ‘name of user ‘"), and used exit() to quit program.

o	Else, print “Error”, and while loop repeats.
Owner
Noah Colbourne
I am a first year Engineering student at Memorial University of Newfoundland, with a strong interest in coding and software development
Noah Colbourne
A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.

PyUserInput PyUserInput is a group project so we've moved the project over to a group organization: https://github.com/PyUserInput/PyUserInput . That

Paul Barton 1k Dec 27, 2022
A modular sequencer based on Pi Pico & EuroPi

PicoSequencer A modular sequencer based on Pi Pico & EuroPi by Zeno Van Moerkerke / Keurslager Kurt For now it is 'only' a trigger sequencer, but I si

5 Oct 27, 2022
🐱 Petkit feeder components for HomeAssistant

Petkit for HomeAssistant Installing Download and copy custom_components/xiaomi_miot folder to custom_components folder in your HomeAssistant config fo

62 Dec 29, 2022
Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;)

TMorse Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;) Compatible with python3.9+. No third-party library is required

Mahyar 2 Jul 11, 2022
Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Hirokazu Ishida 12 Nov 19, 2022
Example code and projects for FeatherS2 and FeatherS2 Neo

FeatherS2 & FeatherS2 Neo This repo is a collection of code, firmware, and files

Unexpected Maker 5 Jan 01, 2023
A python script for Homeassistant that counts down the days to birthdays, anniversaries etc

Date Countdown A python script for Homeassistant that counts down the days to birthdays, anniversaries etc Important note I no longer use homeassistan

Marc Forth 21 Mar 12, 2022
My 500 LED xmas tree

xmastree2020 This repository contains the code used for Matt's Christmas tree, as featured in "I wired my tree with 500 LED lights and calculated thei

Stand-up Maths 581 Jan 07, 2023
This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction.

Structured-light-stereo This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction. . How to use: STEP 1:

FEI 20 Dec 31, 2022
Python Client for ESPHome native API. Used by Home Assistant.

aioesphomeapi aioesphomeapi allows you to interact with devices flashed with ESPHome. Installation The module is available from the Python Package Ind

ESPHome 76 Jan 04, 2023
New armachat based on Raspberry Pi PICO an Circuitpython code

Armachat-circuitpython New Armachat based on Raspberry Pi PICO an Circuitpython code Software working features: send message with header and store to

Peter Misenko 44 Dec 24, 2022
Self Driving Car Prototype

Package Delivery Rover 🚀 This project is a prototype of Self Driving Car. It's based on embedded systems, to meet the current requirement of delivery

Abhishek Pawar 1 Oct 31, 2021
A Home Assistant sensor that tells you what holiday is next

Next Holiday Sensor This sensor tells you what holiday is coming up next. You can use it to set holiday light colors or other scenes. The state of the

Nick Touran 20 Dec 04, 2022
The goal of this project is for anyone with an old printer to be able to double-sided printing.

Welcome to PDF-double-side! Hi! I'm 15. I have a old printer so I can't print double-sided outs. The goal of this project is for anyone with an old pr

DejaVu 4 Dec 28, 2021
Samples for robotics, node, python, and bash

RaspberryPi Robot Project Technologies: Render: intent Currently designed to act as programmable sentry.

Martin George 1 May 31, 2022
Python library for the Phomemo m02s bluetooth thermal printer

Phomemo M02S Python library This is a basic Python library for controlling the Phomemo M02S bluetooth thermal printer. It probably only works on Mac &

Stargirl Flowers 28 Nov 07, 2022
A circle of LEDs

This repository contains all the design files, production files and example code for a simple circular LED display.

Pim de Groot 15 Aug 21, 2022
Automatically draw a KiCad schematic for a circuit prototyped on a breadboard.

Schematic-o-matic Schematic-o-matic automatically draws a KiCad schematic for a circuit prototyped on a breadboard. How It Works The first step in the

Nick Bild 22 Oct 11, 2022
Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi).

Candy Home Assistant component Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi). This

Olivér Falvai 61 Dec 29, 2022
Extremely simple PyBadge examples to demonstrate different aspects of CircuitPython using PyBadge hardware.

BeginnerPyBadge I purchased a PyBadge recently. I'm new to hardware. I was surprised how hard it was to find easy examples demonstrating how different

Rubini LaForest 2 Oct 21, 2021