repl.it
@ebest/

Crypt of Ebestalization

Python

No description

fork
loading
Files
  • main.py
  • decrypteddata.txt
  • encrypteddata.aes
  • toencryptdata.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
import pyAesCrypt
def run():
	bufferSize = 64 * 1024
	dore = "er"
	while dore.lower() not in ["e", "d"]:
		dore = input("Encrypt or Decrypt?")
		if dore.lower() in ["d", "decrypt"]:
			dore = "d"
		elif dore.lower() in ["e", "encrypt"]:
			dore = "e"
		else:
			print("That isn't valid!")
	if dore == "e":
		encryptcode = list(input("Encrypt code (Less then 17 characters)? "))
		while len(encryptcode) > 16:
			encryptcode = list(input("That's too long! Please try again."))
		while len(encryptcode) < 16:
			encryptcode.append("E")
		pyAesCrypt.encryptFile("toencryptdata.txt", "encrypteddata.aes", "".join(encryptcode), bufferSize)
	if dore == "d":
		decryptcode = list(input("Decrypt code (should be less then 17 characters)? "))
		while len(decryptcode) > 16:
			decryptcode = list(input("That's too long! Please try again."))
		while len(decryptcode) < 16:
			decryptcode.append("E")
		pyAesCrypt.decryptFile("encrypteddata.aes", "decrypteddata.txt", "".join(decryptcode), bufferSize)
if __name__ == "__main__":
	run()
?