Skip to content

Instantly share code, notes, and snippets.

@mariano54
Last active May 13, 2022 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariano54/d5fb4cdd72fcc401265c3a35707ca8b0 to your computer and use it in GitHub Desktop.
Save mariano54/d5fb4cdd72fcc401265c3a35707ca8b0 to your computer and use it in GitHub Desktop.
Generate a secure password
# It's important to use a secure password, coming up with one from your head
# is very difficult, since algorithms can guess and predict them. A secure password
# can be generated by using 5 or 6 random words. 5 words will give you about 65
# bits of security which is extremely high (you will not get something like this
# with a manual password unless you use a bunch of random symbols, numbers, etc. However
# 5 words are much easier to remember, especially if you ONLY use these with a password
# manager that you use daily.
# Wordlist can be found here: https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt
# You can also use a 6 sided dice if you don't trust your computer :) (check the wordlist numbers on the left)
# You should either write down the password and destroy after a few days, or come up with a
# mnemonic / story that connects all 5 words together
import random
with open("eff_large_wordlist.txt", "r") as words_file:
word_pairs = words_file.readlines()
words = [wp.split("\t")[1].strip() for wp in word_pairs]
for i in range(5):
print(random.choice(words))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment