adding files to git
This commit is contained in:
commit
d34b872ca4
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,24 @@
|
|||
# The leetspeak dictionary, containing common substitutions
|
||||
leetspeak = {
|
||||
"a": "4",
|
||||
"b": "8",
|
||||
"c": "(",
|
||||
"e": "3",
|
||||
"g": "6",
|
||||
"i": "1",
|
||||
"l": "1",
|
||||
"o": "0",
|
||||
"s": "5",
|
||||
"t": "7",
|
||||
"z": "2",
|
||||
"h": "#",
|
||||
"s": "$",
|
||||
"a": "&",
|
||||
"j": ")",
|
||||
"v": "^",
|
||||
"w": "^",
|
||||
"a": "@",
|
||||
"l": "!",
|
||||
"i": "!",
|
||||
"x": "%"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,58 @@
|
|||
import random
|
||||
from dictionaries import *
|
||||
|
||||
options = {
|
||||
"minimum_length": 18,
|
||||
"capitalize_first_letter": True,
|
||||
"leet_it": True,
|
||||
"add_number_to_end": False,
|
||||
"add_special_to_end": False,
|
||||
}
|
||||
|
||||
def leetspeak_substitutions(string, num_substitutions):
|
||||
for i in range(num_substitutions):
|
||||
while True:
|
||||
index = random.randint(0, len(string)-1)
|
||||
letter = string[index]
|
||||
|
||||
if letter.lower() in leetspeak:
|
||||
string = string[:index] + leetspeak[letter.lower()] + string[index + 1:]
|
||||
break
|
||||
return string
|
||||
|
||||
def add_random_number(string):
|
||||
rand_num = random.randint(0, 9)
|
||||
return string + str(rand_num)
|
||||
|
||||
def add_random_special_char(string):
|
||||
special_chars = ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+"]
|
||||
rand_index = random.randint(0, len(special_chars) - 1)
|
||||
return string + special_chars[rand_index]
|
||||
|
||||
password = ""
|
||||
|
||||
# ENTRY
|
||||
with open("diceware.txt") as f:
|
||||
diceware = [x[:-1] for x in f.readlines()]
|
||||
|
||||
while len(password) <= options["minimum_length"]:
|
||||
index = random.randint(0, len(diceware))
|
||||
chosen_word = diceware[index]
|
||||
if(options["capitalize_first_letter"] == True):
|
||||
chosen_word = chosen_word.capitalize()
|
||||
password += chosen_word
|
||||
|
||||
print("Standard Password:\t" + password)
|
||||
|
||||
if options["leet_it"]:
|
||||
password = leetspeak_substitutions(password, 3)
|
||||
|
||||
if options["add_number_to_end"]:
|
||||
password = add_random_number(password)
|
||||
|
||||
if options["add_special_to_end"]:
|
||||
password = add_random_special_char(password)
|
||||
|
||||
# Print the generated password
|
||||
print("Funky Password: \t"+password)
|
||||
|
||||
Loading…
Reference in New Issue