I want to make a password storage program that spits out a random password and then encrypt it to store in a text file. To which I will then be able to enter the encrypted form (in another program) and get the original password back to use.
I’ll add my current code below:
import string
from random import *
import pyperclip
characters = string.ascii_letters + string.punctuation + string.digits
password = "".join(choice(characters) for x in range(randint(16, 32)))
def mess_up_pass(password):
messed = password
# This is where I am trying to encrypt or ‘mess up' the password
def get_orig(messed):
# This is where I would like to take the messed up password and spit out the original form
return # ???
with open('pass.txt', 'a') as x:
x.write("\n")
x.write(input("What is the service? ") + ": ")
x.write(" " + password)
x.write("\n")