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.
You might also like...
Micropython-wifimanager-esp8266 - Simple Wifi Manager for ESP8266 using MicroPython

micropython-wifimanager-esp8266 Simple Wifi Manager for ESP8266 using MicroPytho

A simple non-official manager interface I'm using for my Raspberry Pis.
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

Universal Xiaomi MIoT integration for Home Assistant
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

Home Assistant custom integration for e-distribución
Home Assistant custom integration for e-distribución

e-Distribución is an energy distribution company that covers most of South Spain area. If you live in this area, you probably are able to register into their website to get some information about your power demand, energy consumption, or even cycle billing (in terms of consumptions).

Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API.

Hildebrand Glow (DCC) Integration Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API. T

Electrolux Pure i9 robot vacuum integration for Home Assistant.

Home Assistant Pure i9 This repository integrates your Electrolux Pure i9 robot vacuum with the smart home platform Home Assistant. The integration co

GUI wrapper designed for convenient service work with TI CC1352/CC2538/CC2652 based Zigbee sticks or gateways. Packed into single executable file
GUI wrapper designed for convenient service work with TI CC1352/CC2538/CC2652 based Zigbee sticks or gateways. Packed into single executable file

ZigStar GW Multi tool is GUI wrapper firtsly designed for convenient service work with Zig Star LAN GW, but now supports any TI CC1352/CC2538/CC2652 b

Water quality integration for Home Assistant with data provided by Budapest FVM
Water quality integration for Home Assistant with data provided by Budapest FVM

Water Quality FVM (Budapest, HU) custom integration for Home Assistant This custom component integrates water quality information provided by Budapest

An open source operating system designed primarily for the Raspberry Pi Pico, written entirely in MicroPython
An open source operating system designed primarily for the Raspberry Pi Pico, written entirely in MicroPython

PycOS An open source operating system designed primarily for the Raspberry Pi Pico, written entirely in MicroPython. "PycOS" is an combination of the

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
ArduinoWaterHeaterIOT - IoT Probe of a solar PV water heating system - Arduino, Python, MQTT, MySQL

ArduinoWaterHeaterIOT IoT Probe of a solar PV water heating system - Arduino, Raspberry Pi, Python, MQTT, MySQL The Arduino sends the AC and DC watts

Jacques Fourie 1 Jan 11, 2022
A script and GUI for controlling stepper motors from an arduino

A script and GUI for controlling stepper motors from an arduino (nema 23 in my case but should work for others in general)

Pip 2 Aug 1, 2022
A IC scan test interface for Arduino

ICSCAN_ARDUINO Prerequisites Python 3.6 or higher arduino uno or nano what is this It is a bitstream tranceiver to test IC chip It sends bitstream to

Nifty Chips Laboratory 0 Sep 15, 2022
Doughskript interpreter for converting simple command sequences into executable Arduino C++ code.

Doughskript interpreter for converting simple command sequences into executable Arduino C++ code.

Svjatoslav 2 Jan 11, 2022
An arduino/ESP project that can play back G-Force data previously recorded

An arduino/ESP project that can play back G-Force data previously recorded

null 7 Apr 12, 2022
A Raspberry Pi Pico plant sensor hub coded in Micropython

plantsensor A Raspberry Pi Pico plant sensor hub coded in Micropython I used: 1x Raspberry Pi Pico - microcontroller 1x Waveshare Pico OLED 1.3 - scre

null 78 Sep 20, 2022
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 2, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 3, 2023
OpenStickFirmware is open source software designed to handle any and all tasks required in a custom Fight Stick

OpenStickFirmware is open source software designed to handle any and all tasks required in a custom Fight Stick. It can handle being the brains of your entire stick, or just handling the bells and whistles while your Brook board talks to your console.

Sleep Unit 23 Nov 24, 2022
A script that publishes power usage data of iDrac enabled servers to an MQTT broker for integration into automation and power monitoring systems

iDracPowerMonitorMQTT This script publishes iDrac power draw data for iDrac 6 enabled servers to an MQTT broker. This can be used to integrate the pow

Lucas Zanchetta 10 Oct 6, 2022