Progress
Problems with database access and subdirectories still
This commit is contained in:
1 parent
89788550fb
commit
8946e3eaf3
6 files changed
+168
-6
No files matched your search
@@ -0,0 +1,19 @@
|
||||
from ..data import data
|
||||
from cryptography.fernet import Fernet
|
||||
|
||||
def load_key():
|
||||
with open(f'./{data}/.encryption.key', 'rb') as keyfile: return keyfile.read()
|
||||
|
||||
def decrypt(input:str):
|
||||
encryption_key = load_key()
|
||||
fernet = Fernet(encryption_key)
|
||||
input = input.encode()
|
||||
output = fernet.decrypt(input)
|
||||
return output.decode()
|
||||
|
||||
def encrypt(input:str):
|
||||
encryption_key = load_key()
|
||||
fernet = Fernet(encryption_key)
|
||||
input = input.encode()
|
||||
output = fernet.encrypt(input)
|
||||
return output.decode()
|
||||
Reference in new issue
Block a user