repl.it
@ArjunSS1/

PasswordEncryption

Python

No description

fork
loading
Files
  • main.py
  • key
  • secret_key.pickle
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import os, time, pickle
from cryptography.fernet import Fernet


pickle_in = open("secret_key.pickle","rb")
raw_key = pickle.load(pickle_in)
KEY = raw_key['key']
def clear():
  os.system('clear')

def printslow(text):
  text = str(text)
  duration = 0
  while(duration < len(text)): 
    time.sleep(0.04)
    print((text[duration]),end = "", flush = True)
    duration = duration+1

def encrypt(string):
  string = str.encode(string)
  f = Fernet((KEY))
  returnval = f.encrypt(string)
  return returnval

def run():
  clear()
  printslow("Welcome to the password encryption code, enter your password into the input and then send me the output \n Enter your username: ")
  raw_user = input("")
  printslow("\n Enter your password: ")
  raw_pass = input("")
  printslow("\n Do you want to enter you email or phone number? (email/number): ")
  inputval = ((input("")).strip()).replace(" ","")
  inputval = inputval.lower()
  if(inputval == 'email'):
    printslow("\n Email it is!\n Enter the email you want to be notified with: ")
    raw_email = input("")
    carrier = ""
  else:
    printslow("\n Phone Number it is!\n Enter the phone number you want to get notified with: ")
    raw_email = input("")
    printslow("\n Now enter your carrier (T-Mobile, AT&T, etc): ")
    carrier = input("")
  
  #Encrypting you normies
  encrypted_pass = encrypt(raw_pass)
  clear()
  print("Order matters\n",raw_user,end=" ")
  print(b''+encrypted_pass,end="")
  print("",raw_email,carrier)
 
run()
?