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
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_
Code is not fully showed. Sad...
Please show the full code
VS use karty hoo Yaa koi aur Q k VS py ni run hota try kiya hai meen ny plz tell Mee bro
what backround song?
@@takashimitsuya1343 Unfortunately, anyone not know.
python programmers be like how to create minecraft in python: import minecraft
😂
So how you did this work then??
rand() in cpp
@@red-hathacker8343he got all the letters and symbols
Than import random
Randomized it (but it's not quite random)
And print it
@@FahadKinqBtdbBs nah mt19937 would be better
Man made a program that simulates keyboard smashing
My pass be like haha
or he got so triggered by his program not working and decided to smash it on mic
that smashing does not even synchronize what he is typing.
🤣🤣
I stopped watching when I saw you imported random
Yeah, I know I have done a mistake with this project.
I mean it is quite good. At least it is not "import randomPassGen"
@@GyanPrakash-xo5gs Horrible
@@charles7722 Python's random is not random enough when security is a priority
NABL, I support you
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!
As if he can do that?
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...
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!
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.
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.
Shuffle will be better option
or just use ascii + ord()/chr()
@@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
Imagine this guy finding out about the string import ascii upper and lower lmao
first thing i thought of lol
and all symbol too, right ?
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.
Thanks for your suggestion
Noob
Is this "secured random" or "more random random"
@@yaspermcglott3403 secured random random randomness.
Try watching this secured password generator video ruclips.net/user/shorts2P6CwhJKX_Y?feature=share
You won't caught me dead typing all the letters by myself writing code.
You can just import string and not use abcd... It's very useful👍
Yeah
Can we really hack using this the wifi password ?
@SomeoneRandom yeah, I have hacked NASA like that
@SomeoneRandom nasaplaysroblox2022
@@Qtaro-oh
import Adam W
reply = can i use this pw....
if u don't mind (Adam W_style)
Everyone looking at the fact he imported random but man he even forgot to escape backslash
was abt to say that actly
Niice
Was about to say the same but double checked that \? gives indeed the two characters! 😂
And he actually typed out all the characters instead of the using the string module lmao
As a SW engineer, I find this excruciating
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.
Exactly.
I mean the guy made this video for beginners he made a more advanced version with secrets in another video
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
@@harshitbhaihackerxguy I prefer to do some research before saying something ridiculous 😂
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.
As a C programer, I was ironically like
Come on, there is a lib for this
It’s about the satisfaction you get when you yourself write the code
As a Linux user, there is a tool for this - pwgen. All password managers have generator feature.
@@ThatGuyFerny and it's an even bigger satisfaction when someone buffer overflows your program or when it causes memory leaks on servers
@@dan00b8 mCoding?
Love the typing noises you added in post for no reason
Get over yourself lol
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.
That's not true
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
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.
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.
i don't think 8 characters are enough to stop a sophisticated brute force anymore...
nothing can stop real hacker just break your pc and phone and live your life
Fifteen years ago they wanted us to have a four-word passphrase or longer
Per NIST, an character password with upper and lower case, numbers, and special characters can be brute forced in 39 minutes LMAO "unhackable"
Who else almost cried when he typed up the uppercase letters instead of getting them from the lowercase letters
are you dumb?
.UPPER
You can use ascii_uppercase, ascii_lowercase, digits and punctuation from string
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
I stopped watching when you starter writing ABCD... instead of lower_case.upper()
It hurts 😬
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.
@@zekihvh import string...
@@ReBoot-c ?
@@zekihvh import string
string.ascii_lowercase
string.ascii_uppercase
string.digits
string.punctuation
string.printable
Finally, I reached the level of knowledge that I can write code without video
You can also import string and then just use string.ascii_letters, string.digits and string.puncuation
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.
Oh yes, how to not have a safe password 101
Google password generator source code leaked
🤣
@@SuddenlySubtle 🤣
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
I have used strings here in this video, check it out once ruclips.net/user/shorts2P6CwhJKX_Y?feature=share
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.
Polish people be like: why generate random passwords if I speak them already?
wtfdym, all we have new is ąęśćłóżźń meanwhile russia's every char is a fuckin hieroglyph
@@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).
Everything is hackable, but this idea / video is really good
Nah I’ll keep my go to still..,”whoeverThroughThatPencilYourMomsAHoe!”
Lmao
My account now
Through? You mean threw? Jesus Chris
@@clutch44444 lol that was the point, I bet you blow on Hot Cheetos
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.
Not a safe password generator. Does not guarantee a password contains uppercase, lowercase, number and symbols at the same time
yes! I was looking for this comment
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 👍
It is doable in python. ord() returns the ASCII value of a character and chr() returns the character associated with the value
@@imTyp0_ meaning if I would do like chr(78) I would get the char at the 78 place in the ASCII table?
this keyboards sound are killing me xDDDD
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!
POV: you don't know about "import string" and "import secrets"
POV : You should check channel's content first. Video includes strings and secrets. ruclips.net/user/shorts2P6CwhJKX_Y?feature=share
@@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.
No man, the link I have given is of none other than my own video
Password like "Fucking pink pony fucks another pink pony" actually has greater entropy and easier to remember.
As a python beginner, this was useful to me. 🙏
How much python you have learn
Next time, import string and use it. It's way better than typing all that stuff.
Why did you save the characters as strings and then convert them to lists when you could have started out with lists
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.
Don't use random for password generation, always use cryptography
I have imported that in my other video, check out my channel videos list. You will find there.
I could mash my keyboard for better results.
I like your comment
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
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…
Pythonic standards in naming?
@@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
@@jurajbeno2046 the latter is called snake case. But this dude mixed snake case with camel case
Wow... A program that randomly mixes symbols... How skilled
I’m only in my second programming class ever and I’m just happy I understand this
😺 I know the feeling
i would suggest adding a intiger input so that way the user can change the length of the password to their will
You used "k" Double times in break eg-breakk this will affect program right na?
Yes, it will affect. Any wrong spelling or Syntex will not help to run the program
@@harshitbhaihackerxguy breakk was in the comment. So it wouldn’t affect the program
He said example.
When your homework comes to you😂😂
I wish you knew ASCII. Wouldn't have had to type that shit out 😭
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
@@MultiTsunamiX just comment the code
Hackers to this youtuber : thanks mate ❤️❤️keep supporting 😂😂
Now make a GUI for this lol 👍🏼😂
Ez
# 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=' ')
Django/flask and html
would only have to be a few extra lines
You can import string module and use ready-made character sets, rather than manually prescribing the alphabet.
Close your eyes and start hitting your keyboard 😊 boom super strong password generated
The password will be so strong that even you wont know it
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.
Me when you can use ASCII package to get upper and lower case chars
What does this even mean? “Me when…” You when what?!
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.
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.
why are you so confidently wrong
@@ryan-arora How is he wrong?
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.
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
*Him singing the ABC's song while typing...*
me when i first signed up for a cs major
Lol
Never needed this, all we needed was a Notepad to copy paste our passwords in case we forgot
But, what if someone hacked your PC or in case get access by chance they can see all your passwords
?? this is not a password manager, but generator, did you even watch the video, or read the title?
To include \ you need to type \\ in the String.
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.
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.
@@xinyangqing9071 Both use the same type of algorithm to generate numbers based on a seed.
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)?
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)
You better have to run this in C++ .
It's difficult language to learn.
@@harshitbhaihackerxguy This is not hard to do in C++. Since there are no memory management C++ isn't hard.
@@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
@@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.
Good for beginners to learn, but not effective in real life though. I would suggest KeePass
"Tough to break", but also not so easy to remember :)
Easy to break, hard to remember
@@holowise3663 Thanks :)
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.
"Hard to break into"
creates an 8 character password that can be cracked in like 2 hours max by a thinkpad.
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.
645,753,531,245,761 (71^8) are the number of combinations possible if its exactly 8 caracters
@@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.
@@explodatedfaces that's why people crack the leaked password dumps instead and then hope people reuse passwords.
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
Doesn't matter how random you want to be, your password will never contain "
You can just put it at symbols tho
Overral, good explanation without words
Tell this person about pep8, string and secret modules.
I have used strings and secrets module in my other video, check out channel once to view them.
I literally thought this was a joke video
Please provide song name 🙏
Resurrection
Michael Jackson - Black or White 😊
i might be late but it’s:
табор уходит в небо - Kaspiyskiy Gruz
length is better than complexity. Password phrases are better than anything generated by this and easier to remember.
Don’t ever use a library to generate a password.
If you’re using random for password generation python recommends you use the secrets library instead
This can create very easily hackable passwords containing only letters, ❌
What if it contains capital letters, small letters, numbers, symbols, arithmetic operators 😎
@@harshitbhaihackerxguy that's not the point, when you select random chars, all the selected can be a letter
Okk man
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.
tough to break and impossible to remember
you can get upper from lowercase. Also pythons random isn't random, it can be predicted.
use password in hindi tamil etc noone even expect
It will work
@@harshitbhaihackerxguy which program or app you do this html tags please help i also want to do please
@@SanataniHindu16969 where did you find html tags?
@@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!
'just 5 lines'
the 10+ lines you used:
I want to be MRX with more of this
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.
People's password : "12345678"
My password : " 12345678"
put space in your password and hashes it making it highly impossible to bruteforce
Thank you for your password
Nice Info
That second password looks like a keeper, I’ll be replacing all my passwords with that one from now on thanks! 😊
No, thank YOU
“5” lines of code
No it can be more 😅😅 Sorry if I hurt you
@@harshitbhaihackerxguy You didn’t I was just confused
@The 2004 i know, but that will look very bad
Please consider removing the music from a couple of these. It was awesome just listening to you type.
« import random » bruh really?
Yup
You can also set uppercase to lower.upper instead of writing it twice manually
To improve you can use min and max like 3 cap letters etc
Hope this is helpful
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)
Is that hard to learn coding because my course is like coding can you tell is that hard to learn or not
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} ")
He: types lower and uppercase letters
AscII: left the chat