Coder Social home page Coder Social logo

trident's Introduction

Trident Password Manager (TPM)

We use a serverless database to store your passwords and then we secure them using Xor encryption.


Important instructions

  1. Please note your pin and username after signup.
  2. Do not share your pin / password with anyone.
  3. Install all the required modules in requirments.txt for hasle free experience.
  4. To run the program use main.py .
  5. Have fun and give us your valuable feedback for improvement.

How this works?

1. Generating key and encrypting passwords

def makekey(self): 
    key =str(self.pin) + self.username 
    _key = Cryptograph.binthis(self,tri=key)
    return _key

We take two inputs from user that is username and pin then we join them and make a single string as shown in the above funtion.

def binthis(self,tri): 
    return "".join(f"{ord(i):08b}" for i in tri)

Character string of the key is then converted into a binary string using binthis() function

    def xorthese(self,password,key):
        result = ""
        password = Cryptograph.binthis(self,tri=password)
        if len(password) > len(key):
            lenfor0 = len(password) - len(key)
            key +='0'*lenfor0
            for i in range(len(key)):
                if key[i]==password[i]:
                    result += "0"
                else:
                    result += "1"
        elif len(password)<len(key):
            lenfor0 = len(key)-len(password)
            password += '0'*lenfor0
            for i in range(len(key)-1):
                if key[i]==password[i]:
                    result += "0"
                else:
                    result += "1"
        return result

Finally the password entered by user is encrypted using XOR encryption by xorthese()

2. Saving your passwords.

def createtable(self):
        self.cur.execute('CREATE TABLE "user" ("Sno" int PRIMARY KEY,"website_name" text,"username" text, "password" text)')

When user creates their account a database file is created for the user using createtable() from models class and after each successful save the passwords are written into the user table of database using intovalue() function of models class

    def intovalue(self,sno,websitename,_username,password):
        self.cur.execute(f'INSERT INTO "user" VALUES({sno},"{websitename}","{_username}","{password}")')
        self.conn.commit()

3. Master password

Username and pin are combined and converted into hash which is stored in the masterpassword table of database, this is later used for the authentication purposes.

trident's People

Contributors

ayan-ambesh avatar ayushhgoel avatar ranaansh46 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.