Password Manager in Python

Поділитися
Вставка
  • Опубліковано 1 жов 2024
  • Today we learn how to build a simple password manager in Python.
    ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
    📚 Programming Books & Merch 📚
    🐍 The Python Bible Book: www.neuralnine...
    💻 The Algorithm Bible Book: www.neuralnine...
    👕 Programming Merch: www.neuralnine...
    🌐 Social Media & Contact 🌐
    📱 Website: www.neuralnine...
    📷 Instagram: / neuralnine
    🐦 Twitter: / neuralnine
    🤵 LinkedIn: / neuralnine
    📁 GitHub: github.com/Neu...
    🎙 Discord: / discord
    🎵 Outro Music From: www.bensound.com/

КОМЕНТАРІ • 66

  • @jaspreetsingh4362
    @jaspreetsingh4362 2 роки тому +12

    Wow its amazing please make a video for gui password manager

  • @sussy7123
    @sussy7123 11 місяців тому +4

    I'm getting an error at line 25 it says unresolved attribute reference 'add_password' for class 'PasswordManager' edit: I found out that tabnine typed 'add_password_file' instead of 'add_password'

  • @redouanha
    @redouanha 2 роки тому +13

    Great video, but I have one question, isn't that password manager vulnerable? I mean anyone with access to the .key and the .password files will be able to simply decrypt and read the password right? or maybe i'm missing something here ..

    • @Bl0xxy
      @Bl0xxy 2 роки тому +1

      turn it into .exe by comping all the files. all files will be hidden and turned into one

    • @jeka1030
      @jeka1030 Рік тому

      @@Bl0xxy that would make the program use the same key for any user...

    • @Bl0xxy
      @Bl0xxy Рік тому

      ​@@jeka1030 but what if you use a randomizer for first launch?

    • @KyXnline
      @KyXnline Рік тому

      You're right. You want to use hashing instead if you want to make this secure

    • @Felipe_Ribeir0
      @Felipe_Ribeir0 11 місяців тому

      You must secure the code/key/password files too.

  • @mr.whiteboard6357
    @mr.whiteboard6357 2 роки тому +5

    Wooow, so good video with even great explantion. Thank you so much neural nine.

  • @JarppaGuru
    @JarppaGuru 7 місяців тому

    and there bug.
    create key
    create file. need add password before file saved?
    and when files are loaded
    create key
    create file
    all sites and password + default ones go new file so you have duplicates
    def create_password_file(self,path, initial_values=None):
    self.password_dict = {} #fix same when load file
    also pimped to have default.key default.file on start if not exist it create it with default values. so we are quickly business xD
    added list sites so not need quess when there no error check
    also added remove site and change password. now its kinda manager with when load key its print keys on folder also on file
    quickly ca choose without write name

  • @maxtuck6820
    @maxtuck6820 10 місяців тому +1

    Great Video! When I decode the passwords I'm getting " b' " preceding the password so I had to import codecs and then wrap the decode statement into codecs.decode(Fernet(self.key).decrypt(encrypted.encode()) in order to eliminate the prefix. This converted the passwords to string instead of byte type

  • @JarppaGuru
    @JarppaGuru 7 місяців тому

    good practical programming,but nothing todo managing. managing is notepad then encrypt file
    this not even change password or site and not delete
    and key should be protected by password otherwise anyone who launch script can manage even there nothing to manage just add

  • @MortenSMortenS
    @MortenSMortenS Рік тому

    I don't get this.. So in this program I have to literally write all my passwords into the script in the dictionary? How is that safe, and all the encryption and decryption and stuff seems pointless to me then.. I don't get it, why not just have a textfile with all the sites and passwords? What does this do? I feel dumb

  • @data9051
    @data9051 2 роки тому +1

    I completed everything, but now I am stuck with a NameError when I do #5 in the cli it says that name 'password' is not deefined. Any help? I can post the code if need be.

    • @Nobody-yp7ob
      @Nobody-yp7ob 2 місяці тому

      Somewhere in your code it says password = … well there’s your error in there. Probably tells you what line also

  • @Gr1ovee
    @Gr1ovee 7 місяців тому

    Nice tutorial for a simple passwort manager but for the real world its not worth using bc can easily be hacked

  • @vk56722
    @vk56722 Рік тому +1

    Hi, great video..but Im getting an error for whenever i load the password file. This is what it looks like:
    Enter your choice: 4
    Enter path: pass.pass
    Traceback (most recent call last):
    File "/Users/---/Documents/vsc_projs/practice.py", line 99, in
    main()
    File "/Users/---/Documents/vsc_projs/practice.py", line 83, in main
    pm.load_password_file(path)
    File "/Users/---/Documents/vsc_projs/practice.py", line 32, in load_password_file
    site, encrypted = line.split(":")
    TypeError: a bytes-like object is required, not 'str'
    This is the code for that part:
    def load_password_file(self, path):
    self.password_file = path
    with open(path, 'rb') as f:
    for line in f:
    site, encrypted = line.split(":")
    self.password_dict[site] = Fernet(self.key).decrypt(encrypted.encode()).decode()
    I was hoping you could help tell me what I did wrong.

  • @caseyhrt
    @caseyhrt 11 місяців тому

    When running choice 3 I get this error:
    "Traceback (most recent call last):
    File: . . . line 99, in
    main()
    File: . . .line 80, in main pm.create_password_file(path, password)
    File: . . .line 25, in create_password_file self.add_password(key, value)
    File: . . .line 36, in add_password
    self.password_dict[site] = password
    ^^^^^^^^^^^^^^^^^^
    AttributeError: 'PasswordManager' object has no attribute 'password_dict'. Did you mean: 'password_file'? "
    I re-watched the video, looking for errors on my part, but couldn't find any. Could this be that I am missing a plugin or am overlooking something? Let me know what you all think. Thanks

    • @caseyhrt
      @caseyhrt 10 місяців тому

      I fixed the bug!

  • @UndyingEDM
    @UndyingEDM 9 місяців тому

    What is the most reliable python cryptography module or modules?

  • @wznzgq1354
    @wznzgq1354 10 місяців тому

    how would u implement it so that key is derived each time form the passphrase? generating same key for the same passphrase each time

  • @Jay716
    @Jay716 2 роки тому +1

    When you entered if __name__ == "__main__":
    main() I get main is not defined. what am I missing?

    • @Jay716
      @Jay716 2 роки тому +1

      Figured it out had wrong ident spacing

    • @fulbertkoffi5640
      @fulbertkoffi5640 2 роки тому

      @Jay716, i get the same problem. Please help me to fix it. I don't understand what you mean to fix yours.

    • @Jay716
      @Jay716 Рік тому

      @@fulbertkoffi5640 make sure that if __name__ == "__main__":
      main() is outside of the if statement hope that helps.

    • @Empire_games_08
      @Empire_games_08 Рік тому

      Write like this
      If __name__ == "__main__" :
      Main()

    • @Empire_games_08
      @Empire_games_08 Рік тому

      You missed underscore

  • @canadianbeast8671
    @canadianbeast8671 2 роки тому +1

    great!

  • @luggas1392
    @luggas1392 Рік тому

    When I try to print the key like u did at 4:58, it gibes me the error message : 'PasswordManager' object has no attribute 'create_key'. Any ideas?

    • @alexsloan2814
      @alexsloan2814 Рік тому

      Having the same problem. Trying to slove it now.

  • @kyawzinlatt3434
    @kyawzinlatt3434 Рік тому

    Hello thank you….how can I add hashing?

  • @charlesdixon1950
    @charlesdixon1950 2 роки тому

    Wich video did you do the "__main__" thing that is mentioned?

  • @thomasgoodwin2648
    @thomasgoodwin2648 2 роки тому +4

    Seems that so much of programming requires constant Internet access these days. Is there any advice you can give on coding when given very limited or perhaps even non-existent inet access?
    (In my case it's limited by the fact I have to use my cellphone for all my inet.)
    Take care of yourself. Your health is far more important than educating my dumb a... ... self.
    Hope you feel better soon! ❤️

    • @techgoat618
      @techgoat618 2 роки тому

      if using python 3.10.x I think hashlib and crypt are part of the standard python library, so no need to import an external like cryptography; both hashlib and crypt have been in python since 3.6.x; i don't know how yet to use them but they are referenced in some UA-cam videos

    • @thomasgoodwin2648
      @thomasgoodwin2648 2 роки тому

      @@techgoat618 How does that help reduce the need for inet access? Wrong thread? jus askin..

    • @techgoat618
      @techgoat618 2 роки тому

      @@thomasgoodwin2648 there was a reference to use of a cell phone for internet access, if coding in Python the presumption is python is loaded locally already, pip'ing external modules then is reliance on the net, so a local library that is native to Python already installed wont need internet access to retrieve it. So browse the net on the cell, for research, but then you'd need to hot-spot the cell phone and connect the laptop to download, i.e. 'pip install...' jus sayin

    • @thomasgoodwin2648
      @thomasgoodwin2648 2 роки тому

      @@techgoat618 Ok. Gotcha. Actually I am tethering on my cell now. Problem is, even the 'unlimited' plans seem to come with a lot of limitations that amount to caps.
      I appreciate your response and though it it doesn't apply directly in my case, perhaps it will help someone else in a different but similar situation.
      Good lookin' out! 👍

  • @baileyyea1638
    @baileyyea1638 Рік тому

    the main at the bottum line is having a problem

  • @adityaranigaon
    @adityaranigaon 2 роки тому +1

    Good job

  • @subhankarchakraborty3866
    @subhankarchakraborty3866 2 роки тому +1

    Amazing brother

  • @VedaVoyager
    @VedaVoyager 2 роки тому

    🤩! Awesome! Please create a video to create a mobile app and connect to any Python program to work on backend!

  • @-MePix-
    @-MePix- 2 роки тому

    mine says could not be resolved from source

  • @AliKhandi
    @AliKhandi 2 роки тому

    you don't like virtualenv?

  • @austinnunez2031
    @austinnunez2031 2 роки тому

    Hi, i'm facing a really odd issue, for some reason, even though i have testkey.key in my folder with my password.py file, when i press option 2 and then type testkey.key, it says no such file or directory found, even though the file is right there, why is this so? thank you

    • @austinnunez2031
      @austinnunez2031 2 роки тому

      nevermind, i figured out i have to direct it to the specific folder it's in first, despite it all being in the same folder...weird, so for me its not just "testkey.key" but "Project\testkey.key", and same applied to mypassword.pass

    • @kishankushwaha4933
      @kishankushwaha4933 2 роки тому

      @@austinnunez2031 hey bro i have same problem what did you do?

    • @mr.bumblebee890
      @mr.bumblebee890 2 роки тому

      @@kishankushwaha4933 Specify the directory of the "testkey.key" file, e.g "Testproject\testkey.key" and if that won't work use the full directory of the file

  • @Stufy76
    @Stufy76 Рік тому

    Could I add 2fa onto this ?

  • @avenotrius4340
    @avenotrius4340 2 роки тому

    time stamps to myself: 0:25

  • @blkkitty27
    @blkkitty27 Рік тому

    does anyone know what style guide he uses when coding?

  • @sennlich
    @sennlich 7 місяців тому

    Top Top

  • @moimiess
    @moimiess 2 роки тому

    pretty cool

  • @denbompa
    @denbompa 2 роки тому

    Great video! learned a lot

  • @fulbertkoffi5640
    @fulbertkoffi5640 2 роки тому

    Hello! thank you a lot for this. Very good job. But i get this error when i try it :
    NameError: name 'main' is not defined. Did you mean: 'min'?
    Please help to fix

  • @tcgvsocg1458
    @tcgvsocg1458 2 роки тому

    please do a recorder video but python no import only python vanilla please

  • @hajimenagao8806
    @hajimenagao8806 2 роки тому

    Thank you! this is not so difficult for me.

  • @profsor5008
    @profsor5008 2 роки тому

    In my opinion, this video is unuseful. Why? Password manager MUST BE comfortable. When I open steam, email, VPN and another app then my password manager must automatically fill text fields to replace my routine. Here is simple app which write and read text from file + encrypt and decrypt text by ready python module + simple menu based on if statements.. why not match (pythonic switch)?

    • @techgoat618
      @techgoat618 2 роки тому +4

      I found NeuralNine's password manager very "comfortable" because it educated me about how to create a functional password manager; plus the use case appears to be oriented toward the command line rather than an app that auto-fills password in your gaming app or wherever. I have and use LastPass and other apps for my auto-fill needs, but with respect to learning python NeuralNine''s example was well presented, IMHO

    • @multiarray2320
      @multiarray2320 2 роки тому +1

      are you really too lazy to copy and paste a password?

    • @techgoat618
      @techgoat618 2 роки тому

      @@multiarray2320 where is the fun in that? my goals include learning how to write code in Python that allows me to use hand-crafted CLI tools. All the apps I already have all have saved passwords, and browsers have saved passwords, so i would really only ever cut and paste once. I *could* do it that way, but it defeats my purposes, of learning... there is an elegance to crafting an app for the command line that accesses credentials stored securely in a file, rather than the throw-back neo-caveman way of cutting and pasting...IMHO

    • @kristof4514
      @kristof4514 2 роки тому

      @@techgoat618 same here, it's not that i cant remember my passwords, its more like i want to learn how to do encryption and file managing from a close to practical standpoint