def decrypt_files(self, others): self.get_encup_key() all_encrypted_file_paths = Utils.get_all_files_in_paths([Utils.remove_ending_slash(self.ENCRYPTED_DATA_PATH)]) all_encrypted_folder_paths = Utils.all_folder_upto_file_depth(all_encrypted_file_paths) all_data_folder_paths = map(self.get_data_file_path, all_encrypted_folder_paths) Utils.make_nested_directories(all_data_folder_paths) # print(map(lambda x: self.remove_init_folder_from_file_path(x), all_files)) for file in all_encrypted_file_paths: out_file_path = self.get_data_file_path(self.remove_encrypted_extension(file)) df(self.key, file, out_file_path)
def encrypt_files(self, path_for_files_and_folders): self.get_encup_key() while not self.confirm_password(self.key): print("Does not match. Please enter the Key again!") self.get_encup_key() abs_path_for_files_and_folders = self.check_user_input_validity(path_for_files_and_folders) all_files = Utils.get_all_files_in_paths(abs_path_for_files_and_folders) all_folders = Utils.all_folder_upto_file_depth(all_files) encrypted_path_for_all_folders = map(self.get_encrypted_file_or_folder_path, all_folders) Utils.make_nested_directories(encrypted_path_for_all_folders) for file in all_files: out_file_path = self.add_encryption_extension(self.get_encrypted_file_or_folder_path(file)) ef(self.key, file, out_file_path)