Skip to content

refactor: Improve security scripts #2191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions TowerOfHanoi.py

This file was deleted.

125 changes: 125 additions & 0 deletions password_programs_multiple/passwordGenerator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# PasswordGenerator GGearing 314 01/10/19
# modified Prince Gangurde 4/4/2020

from random import randint
import pycountry

case = randint(1, 2)
number = randint(1, 999)

# TODO: Pick random country from it

countries = list(pycountry.countries)
country_names = [country.name for country in countries]

print(country_names)

# TODO: Try to add languages, too.

specialCharacters = (
"!",
"@",
"#",
"$",
"%",
"/",
"?",
":",
"<",
">",
"|",
"&",
"*",
"-",
"=",
"+",
"_",
)

animals = (
"ant",
"alligator",
"baboon",
"badger",
"barb",
"bat",
"beagle",
"bear",
"beaver",
"bird",
"bison",
"bombay",
"bongo",
"booby",
"butterfly",
"bee",
"camel",
"cat",
"caterpillar",
"catfish",
"cheetah",
"chicken",
"chipmunk",
"cow",
"crab",
"deer",
"dingo",
"dodo",
"dog",
"dolphin",
"donkey",
"duck",
"eagle",
"earwig",
"elephant",
"emu",
"falcon",
"ferret",
"fish",
"flamingo",
"fly",
"fox",
"frog",
"gecko",
"gibbon",
"giraffe",
"goat",
"goose",
"gorilla",
)

colour = (
"red",
"orange",
"yellow",
"green",
"blue",
"indigo",
"violet",
"purple",
"magenta",
"cyan",
"pink",
"brown",
"white",
"grey",
"black",
)

chosenanimal = animals[
randint(0, len(animals) - 1)
] # randint will return max lenght but , tuple has index from 0 to len-1
chosencolour = colour[randint(0, len(colour) - 1)]
chosenSpecialCharacter = specialCharacters[randint(0, len(specialCharacters) - 1)]

if case == 1:
chosenanimal = chosenanimal.upper()
print(chosencolour + str(number) + chosenanimal + chosenSpecialCharacter)
else:
chosencolour = chosencolour.upper()
print(chosenanimal + str(number) + chosencolour + chosenSpecialCharacter)

# Try to consolidate unify the characters.


# The program can be further improved.
43 changes: 0 additions & 43 deletions tower_of_hanoi.py

This file was deleted.

Loading