From 627a31c902a2a34e07591acd94b3de7f18c32df1 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 21 Sep 2021 13:56:19 -0400 Subject: [PATCH] Island: Remove string_encryptor.py --- .../utils/field_encryptors/string_list_encryptor.py | 6 +++--- .../cc/server_utils/encryption/string_encryptor.py | 9 --------- 2 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 monkey/monkey_island/cc/server_utils/encryption/string_encryptor.py diff --git a/monkey/monkey_island/cc/models/utils/field_encryptors/string_list_encryptor.py b/monkey/monkey_island/cc/models/utils/field_encryptors/string_list_encryptor.py index 4c3fce7ee..63801cf69 100644 --- a/monkey/monkey_island/cc/models/utils/field_encryptors/string_list_encryptor.py +++ b/monkey/monkey_island/cc/models/utils/field_encryptors/string_list_encryptor.py @@ -1,14 +1,14 @@ from typing import List from monkey_island.cc.models.utils.field_encryptors.i_field_encryptor import IFieldEncryptor -from monkey_island.cc.server_utils.encryption import string_encryptor +from monkey_island.cc.server_utils.encryptor import get_encryptor class StringListEncryptor(IFieldEncryptor): @staticmethod def encrypt(value: List[str]): - return [string_encryptor.encrypt(string) for string in value] + return [get_encryptor().enc(string) for string in value] @staticmethod def decrypt(value: List[str]): - return [string_encryptor.decrypt(string) for string in value] + return [get_encryptor().dec(string) for string in value] diff --git a/monkey/monkey_island/cc/server_utils/encryption/string_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/string_encryptor.py deleted file mode 100644 index 64bde517c..000000000 --- a/monkey/monkey_island/cc/server_utils/encryption/string_encryptor.py +++ /dev/null @@ -1,9 +0,0 @@ -from monkey_island.cc.server_utils.encryptor import get_encryptor - - -def encrypt(cleartext: str) -> str: - return get_encryptor().enc(cleartext) - - -def decrypt(cyphertext: str) -> str: - return get_encryptor().dec(cyphertext)