diff --git a/monkey/monkey_island/cc/server_utils/encryption/__init__.py b/monkey/monkey_island/cc/server_utils/encryption/__init__.py index f39c9c603..4d9306950 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/__init__.py +++ b/monkey/monkey_island/cc/server_utils/encryption/__init__.py @@ -15,4 +15,3 @@ from .data_store_encryptor import ( reset_datastore_encryptor, ) from .field_encryptors.i_field_encryptor import IFieldEncryptor -from .field_encryptors.string_encryptor import StringEncryptor diff --git a/monkey/monkey_island/cc/server_utils/encryption/field_encryptors/__init__.py b/monkey/monkey_island/cc/server_utils/encryption/field_encryptors/__init__.py index ccbd75331..96c7f3f18 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/field_encryptors/__init__.py +++ b/monkey/monkey_island/cc/server_utils/encryption/field_encryptors/__init__.py @@ -1,2 +1 @@ from .i_field_encryptor import IFieldEncryptor -from .string_encryptor import StringEncryptor diff --git a/monkey/monkey_island/cc/server_utils/encryption/field_encryptors/string_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/field_encryptors/string_encryptor.py deleted file mode 100644 index 6de6cb385..000000000 --- a/monkey/monkey_island/cc/server_utils/encryption/field_encryptors/string_encryptor.py +++ /dev/null @@ -1,12 +0,0 @@ -from ..data_store_encryptor import get_datastore_encryptor -from . import IFieldEncryptor - - -class StringEncryptor(IFieldEncryptor): - @staticmethod - def encrypt(value: str): - return get_datastore_encryptor().encrypt(value.encode()) - - @staticmethod - def decrypt(value: str): - return get_datastore_encryptor().decrypt(value).decode() diff --git a/monkey/tests/unit_tests/monkey_island/cc/server_utils/encryption/test_string_encryptor.py b/monkey/tests/unit_tests/monkey_island/cc/server_utils/encryption/test_string_encryptor.py deleted file mode 100644 index 637ab1da1..000000000 --- a/monkey/tests/unit_tests/monkey_island/cc/server_utils/encryption/test_string_encryptor.py +++ /dev/null @@ -1,17 +0,0 @@ -from monkey_island.cc.server_utils.encryption import StringEncryptor - -MOCK_STRING = "m0nk3y" -EMPTY_STRING = "" - - -def test_encryptor(uses_encryptor): - encrypted_string = StringEncryptor.encrypt(MOCK_STRING) - assert not encrypted_string == MOCK_STRING - decrypted_string = StringEncryptor.decrypt(encrypted_string) - assert decrypted_string == MOCK_STRING - - -def test_empty_string(uses_encryptor): - # Tests that no erros are raised - encrypted_string = StringEncryptor.encrypt(EMPTY_STRING) - StringEncryptor.decrypt(encrypted_string)