Python Password Generator | Get unhackable passwords with just 5 lines of python

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • This is the video where I taught how get passwords using python codes, i have used maximum 6-8 lines of code, to generate unhackable passwords.
    Thats really hardworking, Please like the video #password #python

Комментарии • 1,9 тыс.

  • @harshitbhaihackerxguy
    @harshitbhaihackerxguy  2 года назад +269

    Password Generator using Secrets and strings used, full video - ruclips.net/video/ptazcXl7FKg/видео.html
    Ask your doubts on
    Instagram - instagram.com/not_anonymous_01/
    Twitter - twitter.com/harshit_bhai_

    • @celalrehmanov7052
      @celalrehmanov7052 2 года назад +6

      Code is not fully showed. Sad...

    • @JUSTIN.SHORTS
      @JUSTIN.SHORTS 2 года назад +2

      Please show the full code

    • @slowReverb-q2q
      @slowReverb-q2q 2 года назад

      VS use karty hoo Yaa koi aur Q k VS py ni run hota try kiya hai meen ny plz tell Mee bro

    • @takashimitsuya1343
      @takashimitsuya1343 2 года назад

      what backround song?

    • @bdenizb01_quorox
      @bdenizb01_quorox 2 года назад

      @@takashimitsuya1343 Unfortunately, anyone not know.

  • @ErniLandia
    @ErniLandia 2 года назад +866

    python programmers be like how to create minecraft in python: import minecraft

  • @Breadurite
    @Breadurite Год назад +849

    Man made a program that simulates keyboard smashing

    • @kurty8420
      @kurty8420 Год назад +5

      My pass be like haha

    • @Pizzajoint2303
      @Pizzajoint2303 Год назад

      or he got so triggered by his program not working and decided to smash it on mic

    • @gmbrother
      @gmbrother Год назад +2

      that smashing does not even synchronize what he is typing.

    • @TheAimTrainer
      @TheAimTrainer Месяц назад

      🤣🤣

  • @nabl8397
    @nabl8397 2 года назад +5863

    I stopped watching when I saw you imported random

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +404

      Yeah, I know I have done a mistake with this project.

    • @GyanPrakash-xo5gs
      @GyanPrakash-xo5gs 2 года назад +458

      I mean it is quite good. At least it is not "import randomPassGen"

    • @nabl8397
      @nabl8397 2 года назад +70

      @@GyanPrakash-xo5gs Horrible

    • @nabl8397
      @nabl8397 2 года назад +468

      @@charles7722 Python's random is not random enough when security is a priority

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +77

      NABL, I support you

  • @aecgem
    @aecgem Год назад +50

    Not a bad first try! Some constructive criticism though: 1. Random isn't secure for password generation due to it not being *truly* random, but if you added some form of seeding to it, it would be secure enough to generate the odd password! Try seeing if you can incorporate the system time, device info, or some other data as a next step! 2. You don't have to type out all those strings haha, you can import the ASCII character sets and work with them directly.
    3. Try and see if you can implement an algorithm to filter passwords somehow. Ex: easily readable(no similar characters next to eachother, or alternation of caps like l and L.) Easily speakable ( only use very common symbols and regular upper/lower characters. Also try and see if you can let the user decide whether to have uppers/lowers/numbers/symbols.
    Otherwise good job, keep it up!

    • @catriverr
      @catriverr Год назад

      As if he can do that?

    • @arthic2589
      @arthic2589 Год назад

      After that, let's attach It to an UI and 2 more input areas for site name and login info.
      Maybe add a warning to write that down...

  • @mossdem
    @mossdem 2 года назад +869

    1. Random is predictable overtime, secrets provides a better randomisation functionality by using seeds. 2. Under the strings library I believe, there are a bunch of ways you can import the alphabet in all cases and with numbers etc. Good video for beginners tho as they can use this as a baseline!

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +39

      Yes, this video is for beginners and I have also created this same video but that is advanced as I have imported there secrets instead of random also strings for characters.

    • @zekihvh
      @zekihvh 2 года назад +15

      Random is predictable over a long ass time and a very large dataset of previously generated values. You can't predict the next generated password without knowing a very large dataset of previously generated ones. You don't have access to the information needed to actually use pseudorandom prediction, which by itself is not worth your time. Any password using a mix of capital, lower case and symbols is more than enough to prevent brute force attacks. The big issue people have with passwords is data leaks, where their passwords are leaked and become part of huge user:pass databases, where if you use the same user and password somewhere else, that account is probably going to be compromised too.

    • @uniq6318
      @uniq6318 2 года назад +1

      Shuffle will be better option

    • @OmarBirjas
      @OmarBirjas Год назад

      or just use ascii + ord()/chr()

    • @sjkkkkklammmmnnnnjnij
      @sjkkkkklammmmnnnnjnij Год назад +1

      @@zekihvh then make it more like an algorithm, you generate two passwords with the best method as some of you seemed mention, cut them in half put them together, change the index of all or even some chars you see what I mean, you make it so the predictable part is much harder to predict since now, and I didnt tell all my ideas but that would be just some good starting steps, enough to get atlrast real random and use as many chars as you can that makes a password too long to try to guess or so long the you are probably not worth years of some hacker to try to guess 1 password that you might even change

  • @enriquebos196
    @enriquebos196 Год назад +301

    Imagine this guy finding out about the string import ascii upper and lower lmao

    • @Arnichoutoutou
      @Arnichoutoutou Год назад +2

      first thing i thought of lol

    • @o_y_e_h
      @o_y_e_h Год назад +1

      and all symbol too, right ?

  • @gumball_9010
    @gumball_9010 2 года назад +208

    Using random is not great for password encryption or whatever you should use "secret" module, it is used for generating random numbers for managing important data such as passwords, account authentication, security tokens, and related secrets, that are cryptographically strong. This module is responsible for providing access to the most secure source of randomness.

  • @sailor5853
    @sailor5853 Год назад +62

    You won't caught me dead typing all the letters by myself writing code.

  • @karendof2469
    @karendof2469 2 года назад +158

    You can just import string and not use abcd... It's very useful👍

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +6

      Yeah

    • @ayushpratap8301
      @ayushpratap8301 2 года назад +1

      Can we really hack using this the wifi password ?

    • @chessone3469
      @chessone3469 2 года назад +3

      @SomeoneRandom yeah, I have hacked NASA like that

    • @Qtaro-oh
      @Qtaro-oh 2 года назад +1

      @SomeoneRandom nasaplaysroblox2022

    • @azusagawasakuta5510
      @azusagawasakuta5510 Год назад +1

      ​@@Qtaro-oh
      import Adam W
      reply = can i use this pw....
      if u don't mind (Adam W_style)

  • @granie300
    @granie300 Год назад +177

    Everyone looking at the fact he imported random but man he even forgot to escape backslash

    • @gXLg
      @gXLg Год назад

      was abt to say that actly

    • @cayler_x6718
      @cayler_x6718 Год назад

      Niice

    • @M-F-H
      @M-F-H Год назад

      Was about to say the same but double checked that \? gives indeed the two characters! 😂

    • @jacoblee6079
      @jacoblee6079 Год назад

      And he actually typed out all the characters instead of the using the string module lmao

  • @michaelsid2323
    @michaelsid2323 2 года назад +193

    As a SW engineer, I find this excruciating

    • @philippebaillargeon5204
      @philippebaillargeon5204 2 года назад +11

      True. I'm sure there are some libraries out there that meets security standards that you can use to generate secure passwords and prob took one line to write.

    • @DimitriMoreira
      @DimitriMoreira 2 года назад

      Exactly.

    • @anglinoutdoors1307
      @anglinoutdoors1307 2 года назад +11

      I mean the guy made this video for beginners he made a more advanced version with secrets in another video

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +14

      Hey, man i just like your attitude. No, one care about my other videos made little advance than the running one, they don't even check out my channel's videos list. But, you have checked out. Thank you

    • @anglinoutdoors1307
      @anglinoutdoors1307 2 года назад +10

      @@harshitbhaihackerxguy I prefer to do some research before saying something ridiculous 😂

  • @TheNotSoRandomDude
    @TheNotSoRandomDude Год назад +8

    Don't write all the letters, digits and numbers manually, use the string module instead, then from string import digits, ascii lower/upper functions. Then use the random.choice or seed to pick a random value every time. Also, you don't need to write join to concatenate all the values, just use a formatted string then concatenate manually.

  • @olivierlanvert6548
    @olivierlanvert6548 2 года назад +58

    As a C programer, I was ironically like
    Come on, there is a lib for this

    • @ThatGuyFerny
      @ThatGuyFerny 2 года назад +9

      It’s about the satisfaction you get when you yourself write the code

    • @maximkulkin2351
      @maximkulkin2351 2 года назад +2

      As a Linux user, there is a tool for this - pwgen. All password managers have generator feature.

    • @dan00b8
      @dan00b8 Год назад +2

      @@ThatGuyFerny and it's an even bigger satisfaction when someone buffer overflows your program or when it causes memory leaks on servers

    • @chotai
      @chotai Год назад

      @@dan00b8 mCoding?

  • @cyan6483
    @cyan6483 Год назад +38

    Love the typing noises you added in post for no reason

  • @joey3354
    @joey3354 2 года назад +10

    You should use time as an input for the random module. I can remember that random isn't really randow without some external changing input.
    When you run the code again you will get the same exact passwords.

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад

      That's not true

    • @realEchoz
      @realEchoz Год назад

      it's seeded automatically with the system time and/or randomness sources from the system
      but you're right that it's not really random, just pseudorandom

  • @mihirshah1717
    @mihirshah1717 2 года назад +5

    Good start for beginner project, but if you really wanna make a strong password, we can use restrictions like atleast 5 symbols, 5 numbers,3 uppercase and 3 lower case something like that.

    • @cc3
      @cc3 Год назад

      if you really want to make a strong password you just set the length to 32 and use this same codebase with the secure random (or the python equivalent). even a string of numbers would be impossible to guess at that length.

  • @vincnt0169
    @vincnt0169 Год назад +18

    i don't think 8 characters are enough to stop a sophisticated brute force anymore...

    • @genclik6146
      @genclik6146 Год назад +2

      nothing can stop real hacker just break your pc and phone and live your life

    • @geoffroi-le-Hook
      @geoffroi-le-Hook Год назад +1

      Fifteen years ago they wanted us to have a four-word passphrase or longer

    • @nicolaskerkau2221
      @nicolaskerkau2221 Год назад +1

      Per NIST, an character password with upper and lower case, numbers, and special characters can be brute forced in 39 minutes LMAO "unhackable"

  • @PranavSNair-qf4lo
    @PranavSNair-qf4lo Год назад +46

    Who else almost cried when he typed up the uppercase letters instead of getting them from the lowercase letters

  • @m8cher885
    @m8cher885 2 года назад +7

    You can use ascii_uppercase, ascii_lowercase, digits and punctuation from string

  • @studiospan6426
    @studiospan6426 2 года назад +1

    The best thing about python is that it has all the modules pre defined that one can possibly need , like random bs4 etc... You won't need to do any work like in other programs but in python you can just use a wide predefined libraries

  • @celebert1
    @celebert1 2 года назад +52

    I stopped watching when you starter writing ABCD... instead of lower_case.upper()

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +1

      It hurts 😬

    • @zekihvh
      @zekihvh 2 года назад +2

      Just use a range in hex and get random Unicode characters based on the generated hex. Make sure the range will always point to valid characters in password fields tho.

    • @ReBoot-c
      @ReBoot-c 2 года назад +1

      @@zekihvh import string...

    • @zekihvh
      @zekihvh 2 года назад

      @@ReBoot-c ?

    • @ReBoot-c
      @ReBoot-c 2 года назад

      @@zekihvh import string
      string.ascii_lowercase
      string.ascii_uppercase
      string.digits
      string.punctuation
      string.printable

  • @msminiml7218
    @msminiml7218 Год назад

    Finally, I reached the level of knowledge that I can write code without video

  • @randomnickname00
    @randomnickname00 2 года назад +5

    You can also import string and then just use string.ascii_letters, string.digits and string.puncuation

  • @thedatajunky987
    @thedatajunky987 Год назад +2

    If you want to be helpful instead of hating, provide an alternative, atleast this person is brave enough to put it online. We all keep learning.

  • @maf6695
    @maf6695 2 года назад +15

    Oh yes, how to not have a safe password 101

  • @TheBoeingCompany-h9z
    @TheBoeingCompany-h9z Год назад +122

    Google password generator source code leaked

  • @infinitespace1982
    @infinitespace1982 2 года назад +6

    Just a tip, you can also get all printable uppercase and lowercase letters, numbers and all printable symbols and characters at once and store them all in a single variable by using the string module.
    What you do is:
    import string
    Var= string.printable
    Somewhere along those lines

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад

      I have used strings here in this video, check it out once ruclips.net/user/shorts2P6CwhJKX_Y?feature=share

  • @chemicalcompound7839
    @chemicalcompound7839 Год назад +2

    Looks normal on first sight, but my head was mashing the keyboard so hard I got better Passwords.
    Next time use UTF8 to make fast strings, you won't need to put lowercase and uppercase strings anywhere since everythink has its own UTF8 number.

  • @virenor
    @virenor 2 года назад +31

    Polish people be like: why generate random passwords if I speak them already?

    • @xar55
      @xar55 Год назад +1

      wtfdym, all we have new is ąęśćłóżźń meanwhile russia's every char is a fuckin hieroglyph

    • @virenor
      @virenor Год назад +1

      @@xar55 I mean our consonant clusters reaching the length of 4 or even 5. For example "nieszczęśliwy chrząszcz bezwzględnie gryzł źdźbło trawy" (the unhappy beetle ruthlessly bit a blade of grass).

  • @fixer4307
    @fixer4307 2 года назад

    Everything is hackable, but this idea / video is really good

  • @im_not_a_bot_4048
    @im_not_a_bot_4048 2 года назад +26

    Nah I’ll keep my go to still..,”whoeverThroughThatPencilYourMomsAHoe!”

    • @NewtonMD
      @NewtonMD 2 года назад

      Lmao

    • @eupi9098
      @eupi9098 Год назад +1

      My account now

    • @clutch44444
      @clutch44444 Год назад +3

      Through? You mean threw? Jesus Chris

    • @im_not_a_bot_4048
      @im_not_a_bot_4048 Год назад

      @@clutch44444 lol that was the point, I bet you blow on Hot Cheetos

  • @suomynona4051
    @suomynona4051 Год назад

    For the people complaining about the use of random. Context matters. An attacker doesn't care how the password was generated because an attacker isn't going to reverse engineer the password. It would matter for a salt and hash system where you are storing passwords in an encrypted manner, where if you got a hold of the database, you could decrypt it.

  • @tutunmayan
    @tutunmayan 2 года назад +12

    Not a safe password generator. Does not guarantee a password contains uppercase, lowercase, number and symbols at the same time

  • @Renschi.
    @Renschi. Год назад +1

    I dont know if this works in python but in C# you can just get a random number that is contained in the ASCII table and convert it to a char this would pick any symbol out of the table. Still good to know how to do it in Python tho 👍

    • @imTyp0_
      @imTyp0_ Год назад

      It is doable in python. ord() returns the ASCII value of a character and chr() returns the character associated with the value

    • @Renschi.
      @Renschi. Год назад

      @@imTyp0_ meaning if I would do like chr(78) I would get the char at the 78 place in the ASCII table?

  • @Akariiinnn
    @Akariiinnn Год назад +3

    this keyboards sound are killing me xDDDD

  • @JonDoe-oy8bt
    @JonDoe-oy8bt Год назад

    bro. 1. there is no need to type out the letters/symbols. just use strings. 2. Probably not necessary for a small thing like this, but random is predictable; instead, you should use the secrets module. good first concept!

  • @роскомнадзор-д8я
    @роскомнадзор-д8я 2 года назад +48

    POV: you don't know about "import string" and "import secrets"

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +4

      POV : You should check channel's content first. Video includes strings and secrets. ruclips.net/user/shorts2P6CwhJKX_Y?feature=share

    • @shhdev
      @shhdev 2 года назад

      @@harshitbhaihackerxguy no he shouldn't. this video literally doesn't import those 2 libraries and no one has to check an entire channel just to learn about those.

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад

      No man, the link I have given is of none other than my own video

  • @Ma_X64
    @Ma_X64 Год назад

    Password like "Fucking pink pony fucks another pink pony" actually has greater entropy and easier to remember.

  • @kanekiken9119
    @kanekiken9119 2 года назад +11

    As a python beginner, this was useful to me. 🙏

  • @praizdev
    @praizdev 2 года назад +1

    Next time, import string and use it. It's way better than typing all that stuff.

  • @DesertDingle
    @DesertDingle 2 года назад +14

    Why did you save the characters as strings and then convert them to lists when you could have started out with lists

  • @wabloWattsy
    @wabloWattsy Год назад

    Loving how this is in my feed, not because it's good but because thousands of people are pointing out just how bad it is.

  • @endredimarci
    @endredimarci 2 года назад +12

    Don't use random for password generation, always use cryptography

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +1

      I have imported that in my other video, check out my channel videos list. You will find there.

  • @elimoto8157
    @elimoto8157 2 года назад +34

    I could mash my keyboard for better results.

  • @CrimsonDoveKarting
    @CrimsonDoveKarting Год назад

    The ASCII values are in order, you don't need to spell out your maps. You can just convert the number to the char and instead add the ranges. Would technically work faster than parsing strings.
    Also random isn't truly random :p

  • @jurajbeno2046
    @jurajbeno2046 2 года назад +39

    Bruh teacher on my programing class would be screaming, random for crypting and code spread out just like that, no pythonic standard in naming variables…

    • @jeltje50
      @jeltje50 2 года назад

      Pythonic standards in naming?

    • @jurajbeno2046
      @jurajbeno2046 2 года назад +1

      @@jeltje50 technically symbols and letters in file aren’t variables but constants so their call name is supposed to be eg.: “LOWER_CASSE”, “SYMBOLS”… and variable called “Use_for” is supposed to be lover case: “use_for” because this (unlike above) is variable, not mentioning its call name rly don’t express what it rly do

    • @madagascar9407
      @madagascar9407 2 года назад

      @@jurajbeno2046 the latter is called snake case. But this dude mixed snake case with camel case

  • @pitched7401
    @pitched7401 Год назад

    Wow... A program that randomly mixes symbols... How skilled

  • @JOPBEAR
    @JOPBEAR Год назад +6

    I’m only in my second programming class ever and I’m just happy I understand this

  • @KaziiTheAvali_inactive
    @KaziiTheAvali_inactive Год назад

    i would suggest adding a intiger input so that way the user can change the length of the password to their will

  • @HyperKK
    @HyperKK 2 года назад +4

    You used "k" Double times in break eg-breakk this will affect program right na?

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +5

      Yes, it will affect. Any wrong spelling or Syntex will not help to run the program

    • @bradleywalton970
      @bradleywalton970 2 года назад

      @@harshitbhaihackerxguy breakk was in the comment. So it wouldn’t affect the program

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +1

      He said example.

  • @cemricardo2002
    @cemricardo2002 Год назад +1

    When your homework comes to you😂😂

  • @trainwithguneet
    @trainwithguneet 2 года назад +7

    I wish you knew ASCII. Wouldn't have had to type that shit out 😭

    • @MultiTsunamiX
      @MultiTsunamiX 2 года назад

      This Is much clearer tho. Imagine returning to the code after few months. You would be thinking, what does this ascii mapping does here. With it like that you clearly know. But hey, he could have imported from string or what is the library called

    • @ytdl
      @ytdl Год назад +3

      @@MultiTsunamiX just comment the code

  • @xdgama5032
    @xdgama5032 Год назад

    Hackers to this youtuber : thanks mate ❤️❤️keep supporting 😂😂

  • @aslantech52
    @aslantech52 2 года назад +26

    Now make a GUI for this lol 👍🏼😂

    • @wolfstar6055
      @wolfstar6055 2 года назад +2

      Ez

    • @ervispycoder5057
      @ervispycoder5057 2 года назад

      # ready 😅😁
      from PySimpleGUI import*;popup('Password is:
      '+''.join(set(set(iter(map(chr,range(32,127))))))[:int(popup_get_text('Please enter the
      length of password: ',size=(20,None),title=' ')or 20)],title=' ')

    • @rian0xFFF
      @rian0xFFF Год назад +1

      Django/flask and html

    • @realEchoz
      @realEchoz Год назад +1

      would only have to be a few extra lines

  • @YanchikDev
    @YanchikDev Год назад

    You can import string module and use ready-made character sets, rather than manually prescribing the alphabet.

  • @deepaksharma6164
    @deepaksharma6164 Год назад +13

    Close your eyes and start hitting your keyboard 😊 boom super strong password generated

  • @kekw7793
    @kekw7793 Год назад

    Its often called „passphrase“ not „password“ and thats the security thing in it. Just take a longer password. This shortens the case that you can get bruteforced.

  • @goner474
    @goner474 Год назад +3

    Me when you can use ASCII package to get upper and lower case chars

    • @jamestaylor5417
      @jamestaylor5417 Год назад

      What does this even mean? “Me when…” You when what?!

  • @JackHarriscr4zy5pacec0w80y
    @JackHarriscr4zy5pacec0w80y Год назад

    I watched this video and it changed my life. My neighbor came over and watch it and it changed his life too. We had to share this with the whole village, so we put up a sheet and projector in a field. Everyonewatched and is so grateful for you sharing this wonderful information. We are truly touched by this wisdom.

  • @butterdawg1918
    @butterdawg1918 Год назад +6

    The funny thing is, passwords like these are hard for people to remember but easy for computers to guess. But if you have a passwors which is easy to remember for a human eg. "my dogs name is fluffy" a computer has a much harder time to guess that.

    • @ryan-arora
      @ryan-arora Год назад +2

      why are you so confidently wrong

    • @omegazze7817
      @omegazze7817 Год назад +3

      @@ryan-arora How is he wrong?

    • @holowise3663
      @holowise3663 Год назад +2

      If password cracker is the type that has a database of common words then your particular example would not be safe. But you have the right idea ofc.

    • @ihatemynameornot7460
      @ihatemynameornot7460 Год назад +1

      Pretty sure most bruteforce algorithm don't try sentences by combining 4 common nouns and a proper noun before just testing every length 8 passwords

  • @ryoukboy1010
    @ryoukboy1010 2 года назад +2

    *Him singing the ABC's song while typing...*

  • @equinte5344
    @equinte5344 2 года назад +14

    me when i first signed up for a cs major

  • @bawabro
    @bawabro Год назад

    Never needed this, all we needed was a Notepad to copy paste our passwords in case we forgot

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  Год назад

      But, what if someone hacked your PC or in case get access by chance they can see all your passwords

    • @M1szS
      @M1szS 10 месяцев назад

      ?? this is not a password manager, but generator, did you even watch the video, or read the title?

  • @z.zsamad5603
    @z.zsamad5603 2 года назад +3

    To include \ you need to type \\ in the String.

  • @zekihvh
    @zekihvh 2 года назад +2

    Just thought I'd explain something to the big ass software engineers popping up here and thinking this is excruciating to watch because of the use of Math.random().
    For generating a single password in a random point of time, this is more than enough. Predicting the next value of Math.random() requires a dataset of previously generated values, which is something a hacker has no access to.
    If you want something to be truly random, not even open Crypto APIs will be truly random. If there's no physical entropy, it'll never be random. Use decimal point precise temperatures of your computer's internals as entropy, then you'll have randomness.
    Math.random() is not secure at all to generate cryptography, as you can easily build a database of generated hashes to predict the next one. In this case you don't have access to any generated strings, a hacker can't use that against you.

    • @xinyangqing9071
      @xinyangqing9071 2 года назад

      I just want to point out that Math.random() is different from python’s random library.
      You’re thinking about the complete wrong language, Math.random() is Java, random.sample() is from the random python library. As far as I’m aware they have different ways of generating the numbers.

    • @zekihvh
      @zekihvh 2 года назад

      @@xinyangqing9071 Both use the same type of algorithm to generate numbers based on a seed.

  • @AbhijeetKumar-ju6st
    @AbhijeetKumar-ju6st 2 года назад

    so I've been learning python for just 2 days from utube and i understand mostly all of the things in this....like attaching strings and all......just one thing i didn't know about yet!...import random and using " ".join(random.sample(blah blah))....,i haven't learned about this yet.....and i don't know what library is yet and the way to use secret in library instead of random which is used in this vid.....so what i wanted to convey was i can learn all this just in 2 days if you can go on an on for 4..5 months with only 2 hrs a day you can learn python even faster than 3..4 months if you're dedicated enough although this is just (cream of the top) .....those who got this far reading my comment please do tell me how long will it take for me to learn python ( enough to , for i can say i know python)?

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +1

      I think you already have good knowledge in Python, and to be more better it can take you about 3-4 months.
      (I read your full comment)

  • @Akese315
    @Akese315 2 года назад +5

    You better have to run this in C++ .

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад

      It's difficult language to learn.

    • @Akese315
      @Akese315 2 года назад

      @@harshitbhaihackerxguy This is not hard to do in C++. Since there are no memory management C++ isn't hard.

    • @cihansariyildiz1748
      @cihansariyildiz1748 Год назад

      @@Akese315 what do you mean by there are no mem managment in C++? You don’t have to deal memory management in python because compiler already manages that for ya

    • @Akese315
      @Akese315 Год назад

      @@cihansariyildiz1748 I mean that, in this kind of program you don't have to deal with memory. So writing this program in C++ is not hard.

  • @ind4mnl4t0r
    @ind4mnl4t0r Год назад

    Good for beginners to learn, but not effective in real life though. I would suggest KeePass

  • @frusnemish
    @frusnemish 2 года назад +7

    "Tough to break", but also not so easy to remember :)

    • @holowise3663
      @holowise3663 Год назад +1

      Easy to break, hard to remember

    • @frusnemish
      @frusnemish Год назад

      @@holowise3663 Thanks :)

  • @justanaveragebalkan
    @justanaveragebalkan 2 года назад

    The reason why we study algorithms is not because some of us we can't invent them. it's because they work and this is defiantly not any safer then picking a random password generated publicly available on the internet that logs the result each time you click and associates it with your ip.

  • @impolitedirector3595
    @impolitedirector3595 2 года назад +8

    "Hard to break into"
    creates an 8 character password that can be cracked in like 2 hours max by a thinkpad.

    • @explodatedfaces
      @explodatedfaces 2 года назад +1

      Fun fact: no 8 character password generated with the code provided would take longer than 24 seconds to crack with brute force on a Ryzen 9 5950x if you didn't know the passwords length (less than a second if you do). That being said, its not like Facebook or Wells Fargo is going to allow someone to test up to 11,969,016,345 passwords on a single account in 24 seconds... which is the number of combinations possible at up to* 8 characters in this code. In fact, they will probably lock your account at 3 in a day or 5 ever.

    • @noyou174
      @noyou174 2 года назад +1

      645,753,531,245,761 (71^8) are the number of combinations possible if its exactly 8 caracters

    • @explodatedfaces
      @explodatedfaces 2 года назад

      @@noyou174 thats the number of possible entries. Combination is calculated nCr = n! / ((n - r)! r!), although you are correct that you can have that many possible passwords. That being said, its still a terrible idea to generate passwords randomly.

    • @zeonos
      @zeonos 2 года назад

      @@explodatedfaces that's why people crack the leaked password dumps instead and then hope people reuse passwords.

  • @andreatorriglia8010
    @andreatorriglia8010 Год назад

    guys if he'd used other libraries the video would have been more complicated for a beginner to follow. though i do agree using random is probably not the best solution, but at least you get the idea of what he's trying to accomplish

  • @smith4591
    @smith4591 2 года назад +3

    Doesn't matter how random you want to be, your password will never contain "

  • @foxknoxgabi7109
    @foxknoxgabi7109 Год назад

    Overral, good explanation without words

  • @kirilldd2
    @kirilldd2 2 года назад +6

    Tell this person about pep8, string and secret modules.

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +1

      I have used strings and secrets module in my other video, check out channel once to view them.

  • @shadowwolf12398
    @shadowwolf12398 Год назад +2

    I literally thought this was a joke video

  • @I_Cronk
    @I_Cronk Год назад +4

    Please provide song name 🙏

    • @Manohar25
      @Manohar25 Год назад

      Resurrection

    • @olimchick
      @olimchick Год назад

      Michael Jackson - Black or White 😊

    • @vasyaoh5054
      @vasyaoh5054 Год назад

      i might be late but it’s:
      табор уходит в небо - Kaspiyskiy Gruz

  • @dangerfox1776
    @dangerfox1776 Год назад

    length is better than complexity. Password phrases are better than anything generated by this and easier to remember.

  • @franziscoschmidt
    @franziscoschmidt Год назад +15

    Don’t ever use a library to generate a password.

  • @nathanaeltrimm2720
    @nathanaeltrimm2720 2 года назад +1

    If you’re using random for password generation python recommends you use the secrets library instead

  • @amandinelevecq6664
    @amandinelevecq6664 2 года назад +5

    This can create very easily hackable passwords containing only letters, ❌

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +1

      What if it contains capital letters, small letters, numbers, symbols, arithmetic operators 😎

    • @marioay4762
      @marioay4762 2 года назад +1

      @@harshitbhaihackerxguy that's not the point, when you select random chars, all the selected can be a letter

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +1

      Okk man

  • @tetra.
    @tetra. Год назад

    Don’t make separate variables for lower and upper, you can just import them from string. Also, random module isn’t random and it’s not secure.

  • @sudo597
    @sudo597 Год назад +3

    tough to break and impossible to remember

  • @Gurpret
    @Gurpret Год назад

    you can get upper from lowercase. Also pythons random isn't random, it can be predicted.

  • @hitesh8715
    @hitesh8715 2 года назад +7

    use password in hindi tamil etc noone even expect

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +2

      It will work

    • @SanataniHindu16969
      @SanataniHindu16969 2 года назад

      @@harshitbhaihackerxguy which program or app you do this html tags please help i also want to do please

    • @StevenDevYT
      @StevenDevYT 2 года назад

      @@SanataniHindu16969 where did you find html tags?

    • @calcio437
      @calcio437 2 года назад +1

      @@SanataniHindu16969 this guy
      he is not even knowing
      what he is talking about!
      I will suggest you to not watching complex concepts just to create things if you don't know the basics
      I was in the same situation as you!
      after the basic courses,
      now I can follow the complex tutorials understanding what I am seeing!

  • @trucookieq4469
    @trucookieq4469 Год назад +2

    'just 5 lines'
    the 10+ lines you used:

  • @achotiaboris6385
    @achotiaboris6385 2 года назад +5

    I want to be MRX with more of this

  • @mage3690
    @mage3690 2 года назад +1

    Does the "random" or "secret" functions actually use the true random assembly instruction, or is there a way to access that instruction via Python? Because IIRC computers can generate truly random numbers, but instruction is very slow to repeat.

  • @TheBoeingCompany-h9z
    @TheBoeingCompany-h9z Год назад +6

    People's password : "12345678"
    My password : " 12345678"
    put space in your password and hashes it making it highly impossible to bruteforce

  • @icommentedthetitlelulw503
    @icommentedthetitlelulw503 Год назад +2

    That second password looks like a keeper, I’ll be replacing all my passwords with that one from now on thanks! 😊

  • @bubbaboyx
    @bubbaboyx 2 года назад +4

    “5” lines of code

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +3

      No it can be more 😅😅 Sorry if I hurt you

    • @bubbaboyx
      @bubbaboyx 2 года назад +1

      @@harshitbhaihackerxguy You didn’t I was just confused

    • @harshitbhaihackerxguy
      @harshitbhaihackerxguy  2 года назад +1

      @The 2004 i know, but that will look very bad

  • @phillipbell5235
    @phillipbell5235 Год назад

    Please consider removing the music from a couple of these. It was awesome just listening to you type.

  • @mesalytic
    @mesalytic 2 года назад +4

    « import random » bruh really?

  • @ormenachem341
    @ormenachem341 Год назад

    You can also set uppercase to lower.upper instead of writing it twice manually

  • @jasssaini7003
    @jasssaini7003 Год назад +1

    To improve you can use min and max like 3 cap letters etc
    Hope this is helpful

  • @QckSGaming
    @QckSGaming Год назад

    You could skip 90% of the code with `from string import printable` -> `print("".join([random.choice(printable) for _ in range(password_length)])` :) It's 3 lines of code basically. Also, seed the random with something so it's more secure (like it would matter)

  • @joshmarmasacayan8468
    @joshmarmasacayan8468 2 года назад +1

    Is that hard to learn coding because my course is like coding can you tell is that hard to learn or not

  • @alonsoanil
    @alonsoanil Год назад +1

    Nice work! but u can use secret and strings try this
    import secrets
    import string
    letters = string.ascii_letters
    digits = string.digits
    special_chars = string.punctuation
    alphabet = letters + digits + special_chars
    pwd_length = 12
    pwd = '' ''
    for i in range(pwd_length):
    pwd += '''.join(secrets.choice(alphabet))
    print(f"Here is the password : {pwd} ")

  • @farlavendi
    @farlavendi Год назад +2

    He: types lower and uppercase letters
    AscII: left the chat