GithubHelp home page GithubHelp logo

niyaz2498 / npass-backend Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.18 MB

This is the backend for NPass - password manager. NPass is a password manager which has it's backend in flask.

Python 100.00%

npass-backend's Introduction

NPass - Backend for a password manager

Overview

NPass is a backend for a password manager written in flask. It uses a MySql DB hosted locally for storing user secrets. The user secrets is encrypted using AES (a symmetric key encryption algorithm) and can be decrypted only if Master Password is known.

Technology

Language : Python
Framework : Flask
Encryption : AES -ECB mode
ORM: SQLAlchemy

Prerequisite

Set up a MySql DB before following these installation steps.

Installation

  1. Clone the repository: git clone https://github.com/Niyaz2498/NPass-backend.git
  2. Create a virtual environment (recommended).
  3. Install dependencies:ย pip install -r requirements.txt
  4. Export the following values in terminal.
    1. mysqluser
    2. mysqlpass
    3. mysqlport
    4. dbname

Running the app

flask run command runs the app. if you run the app in some machine connected in network and want to access it in your machine, use the flag --host=0.0.0.0

Routes

Route Method Description
/users/create POST This is the method to create new users.
/secret/query POST This returns a stringified JSON of user Secrets
/secret/add POST This is used to add a new secret for specified user
/secret/update POST This method is to modify a secret specified by user
/secret/delete POST This method is to delete a stored secret

Database Structure

ERD-NPass.png

The user table contains the list of all users using this application. we don't store master password anywhere . If we have to check whether the master password is right, we can decrypt the HashedMessage of the user and check if it returns Test Message .

A separate table is created for each user with the UserID as table name where the secrets of each user is stored. The secrets are encrypted with the master password and should be decrypted with master password before sending back to user.

The following images can provide a bit more clarity on DB

Table list and user table.png

User_secret table.png

This is how the values looks when decrypted

Decrypted user_secrets table.png

npass-backend's People

Contributors

niyaz2498 avatar

Watchers

 avatar

npass-backend's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.