xxxxxxxxxx
from random import randint
import pyperclip
allSymbols = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '- ', '=', '`', '~', '!', '@', '#', '$', '%', '^', '&', '*', ' (', ' )', ' ¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹', '⁰', '¡', '¤', '€', '¼', '½', ' ¾', '‘', '’', 'æ', '©', '®', 'þ', '«', '»', '"', "'", 'ß', '§', 'ð', 'œ', 'Æ', 'Œ', 'ø', '¶', 'Ø', '°', '¿', '£', '‘¥', '÷', '×', '/', '?' ]
password = ' '
lenSymbols = len(allSymbols)
recycleMe = int(input("how much characters do you want your password to be? "))
for i in range(recycleMe):
password = password + allSymbols[randint(0, lenSymbols)]
print(password)
#pyperclip.copy(password)
#print("copied to clipboard")
xxxxxxxxxx
import random
lower = "abcdefghijklmnopqrstuvwxyz"
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numbers = "0123456789"
symbols = "@#$&_-()=%*:/!?+."
string = lower + upper + numbers + symbols
length = int(input("How Many Characters Do You Want Your Password To Be: "))
password = "".join(random.sample(string, length))
print("Here Is Your Password:", password)
xxxxxxxxxx
import secrets
import string
characters = ''
# length
print("=============================================================")
length_input = input("Enter the length of your password (or type 'quit' to exit): ")
if length_input.lower() == 'quit':
exit("Program terminated")
try:
length = int(length_input)
except ValueError:
exit("Invalid input. Please enter a valid number or 'quit' to exit.")
# letters
print("=============================================================")
letters = input("Do you want your password to have letters? (Y/N): ").upper()
if letters == 'QUIT':
exit("Program terminated")
# numbers
print("=============================================================")
numbers = input("Do you want your password to have numbers? (Y/N): ").upper()
if numbers == 'QUIT':
exit("Program terminated")
# symbols
print("=============================================================")
symbols = input("Do you want your password to have symbols? (Y/N): ").upper()
if symbols == 'QUIT':
exit("Program terminated")
if letters == 'Y':
characters += string.ascii_letters
if numbers == 'Y':
characters += string.digits
if symbols == 'Y':
characters += string.punctuation
if characters == '':
print("=============================================================")
print("Your password must contain at least one of the individual types (letters, numbers, symbols)")
# Generate password
generated_password = ''.join(secrets.choice(characters) for _ in range(length))
if generated_password:
print("Generated Password:", generated_password)
xxxxxxxxxx
import random
print("\n")
def greeting():
print("PASSWORD GENERATOR\n")
greeting()
def passwordgen():
print("\n")
lower_case="abcdefghijklmnopqrstuvwxyz"
upper_case="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
number="0123456789"
symbols="!@#$%^&*()_+:"
jap="あいうえおかきくけこさしすせそなにぬねのたちつてとはひふへほまみむめもらりるれろやゆよ"
Use_for=lower_case+upper_case+number+symbols+jap
length_for_password=10
password="".join(random.sample(Use_for, length_for_password))
print("Your generated password is "+password)
passwordgen()
xxxxxxxxxx
from numpy import array
import random
import string
print("This is a password creator")
print("type 1 for only number password or type 2 for alphabet password or type 0 for mixed password")
y = int(input("enter"))
print("type how many digits of password you want")
x = int(input("enter"))
if y==1:
print("ok you choosed password in number")
for i in range(0,x):
k = random.randint(0,9)
print(k,end="")
elif y == 2:
print("ok you choosed alphabet password")
n = 1
for i in range(x):
randomLowerLetter = chr(random.randint(ord('a'), ord('z')))
randomUpperLetter = chr(random.randint(ord('A'), ord('Z')))
if n%2==0:
print(randomLowerLetter,end="")
elif n%2!=0:
print(randomUpperLetter,end="")
n= n + 1
elif y == 0:
print("ok you choosed mixed password of alphabet and numbers")
n=1
letter = 0
for i in range(x):
randomLowerLetter = chr(random.randint(ord('a'), ord('z')))
randomUpperLetter = chr(random.randint(ord('A'), ord('Z')))
k = random.randint(0,9)
if n%2==0:
print(randomLowerLetter,end="")
if letter +1 != x:
print(k,end="")
letter+=2
else:
letter+=1
elif n%2!=0:
print(randomUpperLetter,end="")
letter+=1
n=n+k
if letter >= x:
break
else:
print("read carefully")
print()
print("thanks")
xxxxxxxxxx
import random
strong_keys = ["@","#","$","£","π","¥","&","3","¢","3","*","?","!","%","/","G","A","B","F","W","F","H","6","9",":","^","=","|","~","∆"]
def password():
try:
n = int(input('your password contain(type in number) : '))
except:
print('type in number please')
password()
ans = ""
for i in range(n):
rand = random.choice(strong_keys)
if i == 0:
ans = rand
else:
ans += rand
print('\n\nyour password: '+ans+'\n\n')
user = input('if you dont like this?\nType \"r\" else \"q\" : ')
if user.lower() == 'r':
password()
else:
quit()
password()
xxxxxxxxxx
import random
lower_case = "abcdefghijklmnopqrstuvwxyz"
upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numbers = "0123456789"
symbols = "!#$%&()*+,-./:;<=>?@[\]^_`{|}~"
allChars = lower_case + upper_case + numbers + symbols
length = 10
password = "".join(random.sample(allChars, length))
print(password)
xxxxxxxxxx
import string
import random
chars = list(string.ascii_letters + string.digits)
lenght = int(input("Lenght: "))
password = []
random.shuffle(chars)
for i in range(lenght):
random.shuffle(chars)
password.append(random.choice(chars))
print("".join(password))
xxxxxxxxxx
import random
import string
def generate_password(length):
characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(characters) for _ in range(length))
return password
password_length = 10 # Specify the desired password length
generated_password = generate_password(password_length)
print(generated_password)
xxxxxxxxxx
from random import randint
def create_random_chars(nbr_of_chars):
return "".join(chr(randint(33,126)) for i in range(nbr_of_chars))
print(create_random_chars(10))
# I1CU>E5q;$
xxxxxxxxxx
import secrets
import string
letters = string.ascii_letters
digits = string.digits
special_chars = string.punctuation
alphabet = letters + digits + special_chars
pwd_length = 8
pwd = ''
for i in range(pwd_length):
pwd += ''.join(secrets.choice(alphabet))
print(f'first recommendation is "{pwd}"')
while True:
pwd = ''
for i in range(pwd_length):
pwd += ''.join(secrets.choice(alphabet))
if (any(char in special_chars for char in pwd) and
sum(char in digits for char in pwd) >= 2):
break
print(f'second recommendation is "{pwd}"')