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
Used python functional programming to make this Ai assistant

Python-based-AI-Assistant I have used python functional programming to make this Ai assistant. Inspiration of project : we have seen in our daily life

Durgesh Kumar 2 Dec 26, 2021
Authentication provider using Synology DSM users for Home Assistant

Authentication provider using Synology DSM users for Home Assistant The Synology authentication provider lets you authenticate using the users in your

Sam Debruyn 5 Oct 06, 2022
Python para microcontroladores com MicroPyhton

MicroPython - PyBR2021 Python para microcontroladores com MicroPyhton Repositório de exemplos para tutorial "Python para microcontroladores com MicroP

gabriel aragão 1 Oct 18, 2021
DNP3 Stalker is a project to analyze and interact with DNP3 devices

DNP3 Stalker Purpose DNP3 Stalker is a project to analyze and interact with DNP3

Cutaway Security, LLC. 2 Feb 10, 2022
DOS-like OS for RP2040 basic microcontroller boards

Micropython DOS-like OS for RP2040 microcontroller boards. Check out the demo video at https://www.youtube.com/watch?v=Az_oiq8GE4Y To start the OS typ

RetiredWizard 58 Dec 27, 2022
Python code written to utilize the Korlan usb2can hardware to send and receive data over the can-bus on a 2008 Nissan 350z

nissan_ecu_hacking Python code written to utilize the Korlan usb2can hardware to send and receive data over the can-bus on a 2008 Nissan 350z My goal

Liam Goss 11 Sep 24, 2022
Monitor Live USB Plug In & Plug Out Events

I/O - Live USB Monitoring Author: Jonathan Scott @jonathandata1 Date: 3/13/2021 CURRENT VERSION 1.0 This is just a simple bash script that calls a pyt

Jonathan Scott 17 Dec 03, 2022
Create a low powered, renewable generation forecast display with a Raspberry Pi Zero & Inky wHAT.

GB Renewable Forecast Display This Raspberry Pi powered eInk display aims to give you a quick way to time your home energy usage to help balance the g

Andy Brace 32 Jul 02, 2022
View your medication from Medisafe Cloud in Home Assistant

Medisafe View your medication from Medisafe Cloud in Home Assistant. This integration adds sensors for today's upcoming, taken, skipped, and missed do

Sam Steele 12 Dec 27, 2022
A python script to poll RPi GPIO pins and subscribe and publish their state via MQTT

MQTT-GPIO A python script to poll RPi GPIO pins and subscribe and publish their state via MQTT using TLS. This script is short and meant to be edited

23 Oct 12, 2021
CircuitPython Driver for Adafruit 24LC32 I2C EEPROM Breakout 32Kbit / 4 KB

Introduction CircuitPython driver for Adafruit 24LC32 I2C EEPROM Breakout Dependencies This driver depends on: Adafruit CircuitPython Bus Device Regis

foamyguy 0 Dec 20, 2021
A raspberrypi tools for python

raspberrypi-tools how to install: first clone this project: git clone https://github.com/Ardumine/rpi-tools.git then go to the folder cd rpi-tools and

1 Jan 04, 2022
Home Assistant custom components MPK-Lodz

MPK Łódź sensor This sensor uses unofficial API provided by MPK Łódź. Configuration options Key Type Required Default Description name string False MP

Piotr Machowski 3 Nov 01, 2022
Home assiatant Custom component: Camera Archiver

Camera archiver Archive your ftp camera meadia files on other ftp with files renaming and event creation. Event can be used for send information to el

1 Jan 06, 2022
A simple non-official manager interface I'm using for my Raspberry Pis.

My Raspberry Pi Manager Overview I have two Raspberry Pi 4 Model B devices that I hooked up to my two TVs (one in my bedroom and the other in my new g

Christian Deacon 21 Jan 04, 2023
BMP180 sensor driver for Home Assistant used in Raspberry Pi

BMP180 sensor driver for Home Assistant used in Raspberry Pi Custom component BMP180 sensor for Home Assistant. Copy the content of this directory to

747Developments 1 Dec 17, 2021
Designed a system that can efficiently sort recyclables and transfer them to corresponding bins using Python, a Raspberry Pi, and Quanser Labs.

System for Sorting and Recycling Containers - Project 3 Table of contents Overview The challenge Screenshot My process Built with Code snippets What I

Mit Patel 2 Dec 02, 2022
Simple python3 implementation of microKanren with lots of type annotations for clarity

MicroKanren-py This is (yet another) python implementation of microKanren. It's a reasonably 1:1 translation of the code provided in the paper, but ev

Erik Derohanian 3 Dec 10, 2022
Raspberry Pi & Accelerometer with Losant's EEA

Raspberry Pi & Accelerometer with Losant's EEA This is a repository that contains companion code to this EEA How To guide. Each folder is named accord

Losant 1 Oct 29, 2021
This Home Assistant custom component adding support for controlling Midea dehumidifiers on local network.

This custom component for Home assistant adds support for Midea dehumidifier appliances via the local area network. homeassistant-midea-dehumidifier-l

Nenad Bogojevic 91 Dec 28, 2022