diff --git a/.gitignore b/.gitignore index 23732ca..e2ab9fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -data/decrypted/splitted_password_files/* -data/decrypted/password_files/* -data/encrypted/splitted_password_files/* -data/encrypted/password_files/* +data/decrypted/group_files/* +data/decrypted/user_files/* +data/encrypted/group_files/* +data/encrypted/user_files/* +accumulated.json* __pycache__ \ No newline at end of file diff --git a/scripts/classes/AbstractSplittedSecret.py b/scripts/classes/AbstractSplittedSecret.py index fd3cfd0..2368b82 100644 --- a/scripts/classes/AbstractSplittedSecret.py +++ b/scripts/classes/AbstractSplittedSecret.py @@ -3,7 +3,9 @@ from .Cli import Cli class AbstractSplittedSecret(Cli): def __init__(self): super(Cli, self).__init__() - self.encrypted_splitted_password_files_folder = "data/encrypted/splitted_password_files/" - self.encrypted_password_files_folder = "data/encrypted/password_files/" - self.encrypted_password_files_folder = "data/encrypted/password_files/" - self.decrypted_password_files_folder="data/decrypted/password_files/" \ No newline at end of file + self.encrypted_folder="data/encrypted/" + self.decrypted_folder="data/encrypted/" + self.encrypted_group_files_folder = self.encrypted_folder + "group_files/" + self.decrypted_group_files_folder = self.decrypted_folder + "group_files/" + self.encrypted_user_files_folder = self.encrypted_folder + "user_files/" + self.decrypted_user_files_folder = self.encrypted_folder + "user_files/" \ No newline at end of file diff --git a/scripts/classes/Cleanup.py b/scripts/classes/Cleanup.py index f54b095..a49f325 100644 --- a/scripts/classes/Cleanup.py +++ b/scripts/classes/Cleanup.py @@ -2,8 +2,8 @@ from .AbstractSplittedSecret import AbstractSplittedSecret class Cleanup(AbstractSplittedSecret): def __init__(self): super(Cleanup, self).__init__() - self.encrypted_files_folders = [self.decrypted_password_files_folder,self.decrypted_password_files_folder] - self.decrypted_files_folders = [self.encrypted_splitted_password_files_folder,self.encrypted_password_files_folder] + self.encrypted_files_folders = [self.decrypted_group_files_folder,self.decrypted_user_files_folder] + self.decrypted_files_folders = [self.encrypted_group_files_folder,self.encrypted_user_files_folder] def deleteAllFilesInFolder(self,folder_path): try: diff --git a/scripts/classes/Generate.py b/scripts/classes/Generate.py index 06bd96c..5830065 100644 --- a/scripts/classes/Generate.py +++ b/scripts/classes/Generate.py @@ -89,7 +89,7 @@ class Generate(AbstractSplittedSecret): def generateEncryptedGroupFiles(self): for password_group_index_int in self.group_mapped_data: - encrypted_splitted_password_file = AbstractSplittedSecret().encrypted_splitted_password_files_folder + str(password_group_index_int) + ".txt" + encrypted_splitted_password_file = AbstractSplittedSecret().encrypted_group_files_folder + str(password_group_index_int) + ".txt" self.encryptStringToFile(self.master_password,encrypted_splitted_password_file,self.group_mapped_data[password_group_index_int]['password']) def encryptToJsonFile(self,data,file_path,password): @@ -97,11 +97,11 @@ class Generate(AbstractSplittedSecret): def encryptUserMappedData(self): for user_id in self.user_mapped_data: - file_path=self.encrypted_password_files_folder+user_id+'.json' + file_path=self.encrypted_user_files_folder+user_id+'.json' self.encryptToJsonFile(self.user_mapped_data[user_id]['groups'],file_path,self.user_mapped_data[user_id]['user_password']) def encryptAccumulatedMappedData(self): - file_path=self.encrypted_password_files_folder+'accumulated.json' + file_path=self.encrypted_folder+'accumulated.json' data={"user_mapped": self.user_mapped_data, "group_mapped": self.group_mapped_data} self.encryptToJsonFile(data,file_path,self.master_password)