From 80bfd9007445609ab03cd8b042bf60a4f8443857 Mon Sep 17 00:00:00 2001 From: Shreya Date: Tue, 15 Jun 2021 19:29:49 +0530 Subject: [PATCH] island: Specify mode to open new secure file in, in encryptor.py --- monkey/monkey_island/cc/server_utils/encryptor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/server_utils/encryptor.py b/monkey/monkey_island/cc/server_utils/encryptor.py index 4f376532c..83292be8a 100644 --- a/monkey/monkey_island/cc/server_utils/encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryptor.py @@ -27,7 +27,7 @@ class Encryptor: def _init_key(self, password_file): self._cipher_key = Random.new().read(self._BLOCK_SIZE) - with open(get_file_descriptor_for_new_secure_file(path=password_file)) as f: + with open(get_file_descriptor_for_new_secure_file(path=password_file), "wb") as f: f.write(self._cipher_key) def _load_existing_key(self, password_file):