diff --git a/Readme.md b/Readme.md index b30a495..39b2988 100644 --- a/Readme.md +++ b/Readme.md @@ -4,6 +4,11 @@ The purpose of this software is to splitt a secret over multiple people. Just if # testing ```bash python scripts/main.py --mode cleanup && +echo "werewrw" > data/decrypted/main_data/test123.txt +echo "werewrw" > data/decrypted/main_data/test124.txt +mkdir data/decrypted/main_data/folder +echo "werewrw" > data/decrypted/main_data/folder/test124.txt + python scripts/main.py --amount 3 --quota 50 --mode encrypt --add-user-information --master-password "ewrwerwerew" << END_OF_INPUTS alpha bravo 123123812908 @@ -21,9 +26,10 @@ END_OF_INPUTS python scripts/main.py --mode decrypt --master-password "ewrwerwerew" -python scripts/main.py --mode cleanup --file-types decrypted && python scripts/main.py --mode decrypt --user "1" --user-password "DDB2QYHP4X0PDR0ZX9LBLACNL6VAXLXMNEZJDOOGUTENSI6UDYGPOR5CV01YLI49" << END_OF_INPUTS +python scripts/main.py --mode cleanup --file-types decrypted && +python scripts/main.py --mode decrypt --user "1" --user-password "Y4GYTEW80SCQQDTIKOJ6YNCIP6MBBEM68SCKBAA1VWAQFRSPNGHEBKHSFZQENDRB" << END_OF_INPUTS 2 -EOQXCYGEY2IMKAJP5VOCRVRH9LPYAPK9IC0ID0GMSJ5KXNXJHPNUBUKEVLE2WHQJ +VGCQPW2LIKJ7SDFFLUZXBXGFPZ6L8RGPTS7TLCNN9GLR82RPHRSN34YZUXF0L27V END_OF_INPUTS ``` # Requirements to know @@ -48,6 +54,7 @@ END_OF_INPUTS - implement tails setup script - add data-input attribut - add data-output attribut +- write scenario test ## Further Information - https://www.tutorialspoint.com/python/python_command_line_arguments.htm diff --git a/scripts/classes/Decryption.py b/scripts/classes/Decryption.py index 453353f..bd76c46 100644 --- a/scripts/classes/Decryption.py +++ b/scripts/classes/Decryption.py @@ -114,4 +114,6 @@ class Decryption(): self.decryptFile(self.user_password, input_file_path, output_file_path) def decryptMainData(self): - self.cli.executeCommand('gpg --batch --passphrase "' + self.getMasterPassword() + '" -d "' + self.paths.getEncryptedMainDataFile() + '" | tar -xvzf - "' + self.paths.getDecryptedMainDataStandartFolder() + '"') \ No newline at end of file + self.cli.executeCommand('gpg --batch --passphrase "' + self.getMasterPassword() + '" -d "' + self.paths.getEncryptedMainDataFile() + '" | tar --one-top-level="' + self.paths.getDecryptedMainDataStandartFolder() + '" -xvzf -') + print(self.cli.getCommandString()) + print(self.cli.getOutputString()) \ No newline at end of file diff --git a/scripts/classes/Encryption.py b/scripts/classes/Encryption.py index a41bdfb..58bb669 100644 --- a/scripts/classes/Encryption.py +++ b/scripts/classes/Encryption.py @@ -127,7 +127,9 @@ class Encryption(): self.encryptToJsonFile(data,file_path,self.master_password) def encryptMainData(self): - self.cli.executeCommand('tar -cvzf - "' + self.paths.getDecryptedMainDataStandartFolder() + '" | gpg -c --batch --passphrase "' + self.master_password +'" > "' + self.paths.getEncryptedMainDataFile() + '"'); + self.cli.executeCommand('tar -C"' + self.paths.getDecryptedMainDataStandartFolder() + '" -cvzf - ./ | gpg -c --batch --passphrase "' + self.master_password +'" > "' + self.paths.getEncryptedMainDataFile() + '"') + print(self.cli.getCommandString()) + print(self.cli.getOutputString()) def encryptAll(self): self.encryptUserFile() diff --git a/scripts/main.py b/scripts/main.py index 139b3c6..d01c5a9 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -148,7 +148,6 @@ try: encrypt.addInformationToUser(user_id, label, str(input())) encrypt.compileData() encrypt.encryptAll() - dirty_exit() except KeyboardInterrupt: print("Program interrupted by user.")