implemented encyption

This commit is contained in:
2022-10-09 15:14:14 +02:00
parent 274549f04b
commit 048eea106e
4 changed files with 56 additions and 51 deletions

View File

@@ -1,4 +1,6 @@
class Encryption:
ENCRYTPION_KEY = "MASTER_KEY"
@staticmethod
def vigenere(text: str, key: str, encrypt=True):
result = ''
@@ -17,9 +19,9 @@ class Encryption:
return result
@staticmethod
def encrypt(text: str, key: str):
return Encryption.vigenere(text=text, key=key, encrypt=True)
def encrypt(text: str):
return Encryption.vigenere(text=text, key=Encryption.ENCRYTPION_KEY, encrypt=True)
@staticmethod
def decrypt(text: str, key: str):
return Encryption.vigenere(text=text, key=key, encrypt=False)
def decrypt(text: str):
return Encryption.vigenere(text=text, key=Encryption.ENCRYTPION_KEY, encrypt=False)