Secure Login System in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 100

  • @hussainbabonji4207
    @hussainbabonji4207 2 ปีที่แล้ว +23

    I forgot to tell you that I started to love python more because of you thank you and keep going I love your projects

  • @chrism6880
    @chrism6880 2 ปีที่แล้ว +28

    You should be using something like bcrypt (or anything beyond a simple sha256 hash) for passwords. Sha is a general purpose hash, not the best for password hashing.

    • @HuskkM8
      @HuskkM8 2 ปีที่แล้ว +2

      That’s right 👍

    • @pobkuk
      @pobkuk 2 ปีที่แล้ว +8

      Or doing it properly and using something like Passlib to manage the hashing... This is just negligent programming calling this car-crash "secure"

    • @vmajed7103
      @vmajed7103 ปีที่แล้ว

      @@pobkuk nerd

    • @federalcheesegrater556
      @federalcheesegrater556 11 หลายเดือนก่อน +2

      This is just an example video though, if you're going to use this tutorial in any professional environment, you shouldn't be in your position...

  • @sherazmalik5155
    @sherazmalik5155 5 หลายเดือนก่อน +1

    your presentation of the code is amazing, learning a lot from your channel. Thanks.

  • @bsuarez3455
    @bsuarez3455 ปีที่แล้ว +1

    i love all these under 20 minutes projects. Lets you gets hands on quick

  • @alessandrog498
    @alessandrog498 ปีที่แล้ว +2

    This channel deserves more subscribers!

  • @fredericoamigo
    @fredericoamigo ปีที่แล้ว +5

    Nice vid! How did you make your pycharm format the SQL?

  • @PaulSmith-zs5je
    @PaulSmith-zs5je 2 ปีที่แล้ว +3

    Enjoying the python content.. keep up the great work.

  • @dmitrykononenko6411
    @dmitrykononenko6411 2 ปีที่แล้ว +2

    What do you think of password salt?

  • @johnecott7429
    @johnecott7429 2 ปีที่แล้ว +3

    thanks for the video! I love all your content and you make python very fun to learn.

  • @rougebarbu
    @rougebarbu 2 ปีที่แล้ว +4

    You should build the hash from password AND username (for example username + password), not only password so the hashes would be different for 2 users having the same password.

    • @dslnoob7140
      @dslnoob7140 ปีที่แล้ว

      Or instead of building the salt from username and password, maybe just generate a random salt and store the hashed salted password in the DB along with the salt. Perhaps use bcrypt so as to generate the salt and save the salt in the same field as the password

    • @MnMEminem
      @MnMEminem ปีที่แล้ว +1

      @@dslnoob7140 you are mistaking hashing with encrypting, hashing is more secure for passwords

    • @dslnoob7140
      @dslnoob7140 ปีที่แล้ว

      @@MnMEminem nope. I am indeed talking about hashing and not encrypting. But with my strategy, even if two users share the same password, their hashes would still be different since we added salt to the password.

  • @servetbirgul
    @servetbirgul 2 ปีที่แล้ว +1

    Hi I've been following you for a long time and I like all your videos

    • @servetbirgul
      @servetbirgul 2 ปีที่แล้ว

      I want to generate invoice with UBL 2.1 using python but there is nothing about it in python, can you help me with this please

    • @servetbirgul
      @servetbirgul 2 ปีที่แล้ว

      There is not much information about xml files, please help this follower

  • @פלוניפלוני-צ2ט
    @פלוניפלוני-צ2ט 2 ปีที่แล้ว +2

    Did you uploaded these project files to your github?

  • @sahilgarg94
    @sahilgarg94 2 ปีที่แล้ว +2

    Always quality content

  • @kushaldevkota3016
    @kushaldevkota3016 ปีที่แล้ว +1

    can we use sqlite 3 and hash libraries for our minor
    academic project?

  • @suntzu5376
    @suntzu5376 ปีที่แล้ว

    i'm learning python but instead of watching 6 hours of "print types" watching this. i don't really understand the whole thing but i wanna create something. am i doing good or should i go for beginners guide?

  • @tishajindal5684
    @tishajindal5684 3 หลายเดือนก่อน +1

    how u implement the command in userdata.db at 5:09

  • @paulthomas1052
    @paulthomas1052 2 ปีที่แล้ว +1

    Great video, cheers.

  • @IlyesCodes
    @IlyesCodes ปีที่แล้ว

    Thanks for always teaching us useful stuff
    Please make a video about sys and subsystem modules

  • @Tijnnnn
    @Tijnnnn ปีที่แล้ว

    Could you add expiration system so after a specific amount of time the key becomes invalid?

  • @OldKing11100
    @OldKing11100 2 ปีที่แล้ว +2

    I wouldn't use SHA256 or BLAKE3 for password encryption. The reason why we like to use those is that it's computationally inexpensive to check. This means that if your database gets compromised it won't take too long to break short unsalted SHA256 hashes. Still this is good for generating Cookies and Bearer Tokens because they are easy to verify on every request. bcrypt or argon2 is much better for generating passwords.

    • @OldKing11100
      @OldKing11100 2 ปีที่แล้ว

      @@__Brandon__ I agree with the TLS part which is standard, but not the client password hashing. It's perfectly fine sending a plaintext password over TLS v1.2 and up. If you are storing the argon2id password (which includes the salt) then the client would need to know what the argon2id scheme is before hand. You can actually cause a bigger issue since the client would know the pw + salt + hash which would all be captured with a bad clientside javascript library giving inside details into the server.

    • @OldKing11100
      @OldKing11100 2 ปีที่แล้ว

      @@__Brandon__ I'm essentially relying on TLS to be secure through AES-256 (ChaCha20) after the RSA handshake to receive the password then have the server store it with argon then decipher it with argon. If you can't trust TLS to be secure then any PII data sent is insecure. Your method makes it impossible to enforce any password complexity requirements at the API layer and you can't rely on the client to be honest.

    • @OldKing11100
      @OldKing11100 2 ปีที่แล้ว

      ​@@__Brandon__ I see what you're saying. Chances aren't that your DB gets compromised so much as your DNS or and ISPs BGP router gets changed to trick users in which case the attacker is still going to get the passwords anyway since their app won't hash anything. Still if the hacker get into the server they will still be able to see all JSON objects that pass through the server so what's the point of encrypting the password if they get your SSN, DOB, F/L, and all that good stuff anyway. All they have to do is send the has password anyway? It's kind of hard to shield users from leaking passwords if their computer is compromised also or click a bad link. I don't think the extra hash really helps to be honest. Maybe here is to hoping that passwordless implementations will be better?

    • @OldKing11100
      @OldKing11100 2 ปีที่แล้ว

      @@__Brandon__ You just now said that it's hard to forge a cert (MITM) yet you are trying to protect against it...?
      EDIT: You're standardizing your PW length and characters so it's still vulnerable to dictionary attacks and it really doesn't matter since the hash just becomes the password. Very little value add; just make your passwords passphrases with a 16 character minimum. Also don't quote standards to me if you don't tell me the standard like HIPAA FERPA COPPA. What industry standard are you referring to, CISPA?

    • @OldKing11100
      @OldKing11100 2 ปีที่แล้ว

      @@__Brandon__ I'm sorry I'm going to forward this to my Frontend SA. She is going to get a kick out of this in that she's trying to avoid the Discover hack. Take it easy my dude. We are arguing over the smallest thing.

  • @cyb3ersounds
    @cyb3ersounds 5 หลายเดือนก่อน

    please i am having this error: cur.execute("""
    AttributeError: 'builtin_function_or_method' object has no attribute 'execute'

  • @HitmansRealm
    @HitmansRealm 10 หลายเดือนก่อน

    but how to keep session, user logged in and transfer data? big data?

  • @craab9utube
    @craab9utube ปีที่แล้ว

    what is the theme you have your pycharm set up with here

  • @sanunitwaibu529
    @sanunitwaibu529 ปีที่แล้ว

    hello...your tutorials are extraordinary. can you please create a tutorial on python built-in functions(all built in functions there are 71). i hope you will work on it. thank you.

  • @trailerhighlights8349
    @trailerhighlights8349 ปีที่แล้ว +1

    Can you make a #2 video that adds the function to create new accounts

    • @juleslevy3662
      @juleslevy3662 8 หลายเดือนก่อน

      hi he could have made a second video for that but its very simple thing just replace the username name 1 and password 1 from your sample.py by an input and make it a function with def ...(): and implement it like the login systeme or if you dont want a input in commmand line like me you can use PyQt5 to make an app and replace the input() by self.NAME OF TEXT BOX.text()

  • @NicksOnTheStyx
    @NicksOnTheStyx ปีที่แล้ว +1

    I can't get the username and password prompts to pop up in the terminal :/ I'm running the server first then the client and the server runs but client does nothing. Any idea what the issue could be?

    • @dazewaker262
      @dazewaker262 ปีที่แล้ว

      If you got any errors like no connection could be made,Change your port number as it could be used by another service. Change 9999 to something like 3000 or anything.

  • @TBT_ZHV
    @TBT_ZHV ปีที่แล้ว

    how do you see all those functions etc even in strings??

  • @youssefalkhodary
    @youssefalkhodary 2 ปีที่แล้ว +1

    you are awesome ❤️

  • @servetbirgul
    @servetbirgul 2 ปีที่แล้ว

    I want to generate invoice with UBL 2.1 using python but there is nothing about it in python, can you help me with this please

  • @jackfr0st486
    @jackfr0st486 2 ปีที่แล้ว +2

    How to encrypt the database itself?
    Like setting a password to username.db so that no one read it even if they somehow got to download the file(database) itself?

    • @photoballa
      @photoballa 2 ปีที่แล้ว +1

      Hash the password, so that when the user enters the password you apply the hash function, check if that’s in the database, if it is for that user, let them in, if it’s wrong well you know. And this way since a hash function is only one way, they’ll know which username has which hash password but they can never figure out the password as it is hashed. Don’t store the password in the database, only person who’ll know password is person who enters it

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 2 ปีที่แล้ว

      The trouble with hashed passwords is that the authentication can only be one-way. If you are operating over an untrusted connection (e.g. the Internet), then you need authentication to be two-way: not only must the server be sure the client/user is genuine, but the client/user must also be sure the server is genuine.

    • @jackfr0st486
      @jackfr0st486 2 ปีที่แล้ว

      @@photoballa Thanks for the reply, but what i meant to ask was how do i set authentication for the sqlite3 database itself, like in mysql.

  • @AliHamza-en8cn
    @AliHamza-en8cn 2 ปีที่แล้ว +1

    I love your videos.

  • @kellywalfgan8767
    @kellywalfgan8767 ปีที่แล้ว

    Nice one bro

  • @bsmonkey6036
    @bsmonkey6036 ปีที่แล้ว

    [vscode-sqlite][ERROR] Failed to open database 'c:\...\...': file is not a database
    i dont know where to put my files so it finds the db

  • @njanirudh
    @njanirudh ปีที่แล้ว

    I would suggest a unique salt added to the passwords

  • @ttaylor9916
    @ttaylor9916 ปีที่แล้ว +1

    [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted

  • @Mjuziks
    @Mjuziks ปีที่แล้ว

    thank you

  • @okwuteizuchukwu7547
    @okwuteizuchukwu7547 ปีที่แล้ว

    I get as far as 5:10 but when I run it I get this error message ' sqlite3.OperationalError: table userdata has no column named password ' Does anyone have any solutions?

  • @MOVIESHORT854
    @MOVIESHORT854 2 ปีที่แล้ว +1

    pythone is so simple in context

  • @spiceplayz8035
    @spiceplayz8035 ปีที่แล้ว +1

    how did you get that thing to show up for the database? ive never really used sql before and its saying that the file is not displayed in the editor because its either binary or an unsupported text encoding

    • @patriciomondragon-db5mb
      @patriciomondragon-db5mb ปีที่แล้ว

      Go to extensions, write SQlite, Install the extension, right click on the data base and click open database, An SQlite explorer button will appear on the bottom left, click it and it should show the database, click the name of the database it will show you the tables.
      If you want to do a query, right click it an select new query

  • @georgebas1605
    @georgebas1605 ปีที่แล้ว

    intro song name?

  • @ShreyasBhosle-y2k
    @ShreyasBhosle-y2k ปีที่แล้ว

    even i type correct password and username login failed is shown

  • @Wavyrezzz
    @Wavyrezzz ปีที่แล้ว

    How do we add this to our exe

  • @mikepenprogrammer2652
    @mikepenprogrammer2652 2 ปีที่แล้ว

    You should have an entire book on login systems and databases. I'd buy it. EDIT: Already purchased some of your books.

  • @RayHorn5128088056
    @RayHorn5128088056 2 ปีที่แล้ว +20

    Calling unsalted sha256 secure is a joke. Lol.

    • @amosrocha6793
      @amosrocha6793 10 หลายเดือนก่อน +1

      How Can I learn about this top more. ?

    • @thelastbreaths
      @thelastbreaths 4 หลายเดือนก่อน

      fact 😂😂

  • @YakupCanPak
    @YakupCanPak ปีที่แล้ว +1

    "Secure"
    SQL Injection laughing at the corner:

  • @HingalshDealer
    @HingalshDealer 8 หลายเดือนก่อน

    didn't get anything but thank ya)

  • @mateusz7612
    @mateusz7612 ปีที่แล้ว

    Hello i did everything like in the video but in the end i have message ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it. I tried to find in on the internet but i couldn't :( maybe someone know how to fix it?

    • @dazewaker262
      @dazewaker262 ปีที่แล้ว

      Change your port number as it could be used by another service. Change 9999 to something like 3000 or anything.

  • @dhruvkumarpal2631
    @dhruvkumarpal2631 ปีที่แล้ว

    It is showing error

  • @tcgvsocg1458
    @tcgvsocg1458 2 ปีที่แล้ว +1

    interesting

  • @ironislife9857
    @ironislife9857 2 ปีที่แล้ว

    Can you show how to host a socket server for free?

  • @TheWeiserhelge
    @TheWeiserhelge หลายเดือนก่อน

    Nothing of this is actually working, thats sad and even that you dont tell what kind of extras we need to this is just..... i was joyfull coding and when i tried to run always problems appear and i did it same was as you ...

  • @bigschweetie
    @bigschweetie 2 ปีที่แล้ว

    Would be safer to salt the password before hashing it

    • @dslnoob7140
      @dslnoob7140 ปีที่แล้ว

      The answer is definitely yes.

  • @pobkuk
    @pobkuk 2 ปีที่แล้ว +1

    Interesting. Comments critical of the security of the techniques posted to this video seem to disappear. Methinks the author is deleting said critical commentary.

    • @dazewaker262
      @dazewaker262 ปีที่แล้ว

      He isnt.They all are there.Revisit whole section.

  • @philtoa334
    @philtoa334 2 ปีที่แล้ว +1

    Thx_.

  • @essa88371
    @essa88371 ปีที่แล้ว

    wow

  • @Dragonforge-Studios
    @Dragonforge-Studios 8 หลายเดือนก่อน

    Hashlib was yanked bruh

  • @talalkhan7189
    @talalkhan7189 2 ปีที่แล้ว +1

    1st one bro

  • @manofqwerty
    @manofqwerty ปีที่แล้ว

    It looks like hashlib has been deprecated now

  • @arielspalter7425
    @arielspalter7425 2 ปีที่แล้ว

    I couldn’t understand how server.py and client.py are related to each other…

    • @temal32
      @temal32 2 ปีที่แล้ว

      client.py sends the information to server.py, server.py then sends the information to the database.

    • @arielspalter7425
      @arielspalter7425 2 ปีที่แล้ว

      @@temal32 My confusion was that client.py was not imported into server.py and the connection is made through the tcp connection.

    • @samsepiol6052
      @samsepiol6052 2 ปีที่แล้ว

      @@arielspalter7425 It doesn't need to be. The point of networking is having 2 devices talk to each other. He is doing this, but the 2 computers are the same computer but different applications on the computer. And also, why would server.py need to import client.py? All the applications need to do is connect.

  • @kanwaradnan4849
    @kanwaradnan4849 2 ปีที่แล้ว

    Yes first😅

  • @talalkhan7189
    @talalkhan7189 2 ปีที่แล้ว

    1st comment

  • @dgh25
    @dgh25 ปีที่แล้ว

    wtf just happened?

    • @alexlee3402
      @alexlee3402 6 หลายเดือนก่อน

      This is what happened every time you use the website to register and later login.

  • @kanwaradnan4849
    @kanwaradnan4849 2 ปีที่แล้ว

    First?

  • @franklynchukwu3480
    @franklynchukwu3480 8 หลายเดือนก่อน

    It just seems like your teaching yourself..your a bad teacher

  • @jackolantern6172
    @jackolantern6172 ปีที่แล้ว

    Client didn’t work. Just says
    _AttributeError: module ‘socket’ has no attribute ‘connect’_
    Does it have something to do with the server number? I hate this computer ish for this very reason but I want to learn it so I’m not at such a disadvantage moving. I know once it clicks I’ll be golden.