mirror of
https://github.com/kevinveenbirkenbach/splitted-secret.git
synced 2024-11-22 10:11:05 +01:00
Optimized cleanup for encryption
This commit is contained in:
parent
a0c17c9fd6
commit
09bb6d1e31
29
README.md
29
README.md
@ -27,7 +27,7 @@ python scripts/main.py --mode cleanup
|
|||||||
```
|
```
|
||||||
|
|
||||||
### delete decrypted data
|
### delete decrypted data
|
||||||
To delete all encrypted data execute:
|
To delete all decrypted data execute:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python scripts/main.py --mode cleanup --file-types decrypted
|
python scripts/main.py --mode cleanup --file-types decrypted
|
||||||
@ -65,7 +65,7 @@ python scripts/main.py --mode decrypt --user "<<user_id>>"
|
|||||||
```
|
```
|
||||||
|
|
||||||
### addtional instructions
|
### addtional instructions
|
||||||
In the [INSTRUCTIONS.md](./Instruction.md) file the master encrypter can leave additional instructions.
|
In the [INSTRUCTIONS.md](./INSTRUCTIONS.md) file the master encrypter can leave additional instructions.
|
||||||
|
|
||||||
## encrypt
|
## encrypt
|
||||||
|
|
||||||
@ -74,9 +74,32 @@ In the [INSTRUCTIONS.md](./Instruction.md) file the master encrypter can leave a
|
|||||||
python scripts/main.py --secret-holders-amount "<<amount>>" --quota "<<quota>>" --mode encrypt --master-password "<<master_password>>" --input-directory "<<input_directory>>"
|
python scripts/main.py --secret-holders-amount "<<amount>>" --quota "<<quota>>" --mode encrypt --master-password "<<master_password>>" --input-directory "<<input_directory>>"
|
||||||
```
|
```
|
||||||
|
|
||||||
### encrypt master password
|
### generate encryption data
|
||||||
To encrypt the master-password file and to create the neccessary encrypted meta data execute:
|
To encrypt the master-password file and to create the neccessary encrypted meta data execute:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python scripts/main.py --secret-holders-amount "<<amount>>" --quota "<<quota>>" --mode encrypt --add-user-information --master-password "<<master_password>>" --meta
|
python scripts/main.py --secret-holders-amount "<<amount>>" --quota "<<quota>>" --mode encrypt --add-user-information --master-password "<<master_password>>" --meta
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### generate encryption data with user info
|
||||||
|
To encrypt the master-password file and to create the neccessary encrypted meta data with additional user infos data execute:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python scripts/main.py --secret-holders-amount "3" --quota "50" --mode encrypt --add-user-information --master-password "<<master_password>>" --meta --add-user-information << EOL
|
||||||
|
Nutzer 1
|
||||||
|
+123456-1
|
||||||
|
test@test1.de
|
||||||
|
Addresse Nutzer 1
|
||||||
|
Zusätzliche Notizen Nutzer 1
|
||||||
|
Nutzer 2
|
||||||
|
+123456-2
|
||||||
|
test@test2.de
|
||||||
|
Addresse Nutzer 2
|
||||||
|
Zusätzliche Notizen Nutzer 2
|
||||||
|
Nutzer 3
|
||||||
|
+123456-3
|
||||||
|
test@test3.de
|
||||||
|
Addresse Nutzer 3
|
||||||
|
Zusätzliche Notizen Nutzer 3
|
||||||
|
EOL
|
||||||
|
```
|
||||||
|
@ -5,12 +5,15 @@ class Cleanup():
|
|||||||
self.cli = cli
|
self.cli = cli
|
||||||
self.paths = paths
|
self.paths = paths
|
||||||
|
|
||||||
def getAllFilePaths(self,file_type):
|
def getMetaFilePaths(self,file_type):
|
||||||
all_file_paths = [
|
return [
|
||||||
self.paths.getGroupFilesFolderPath(file_type),
|
self.paths.getGroupFilesFolderPath(file_type),
|
||||||
self.paths.getUserFilesPath(file_type),
|
self.paths.getUserFilesPath(file_type),
|
||||||
self.paths.getAccumulatedFilePath(file_type)
|
self.paths.getAccumulatedFilePath(file_type)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def getAllFilePaths(self,file_type):
|
||||||
|
all_file_paths = self.getMetaFilePaths(file_type)
|
||||||
if file_type == Paths.TYPE_DECRYPTED:
|
if file_type == Paths.TYPE_DECRYPTED:
|
||||||
all_file_paths.append(self.paths.getDecryptedMainDataStandartFolder())
|
all_file_paths.append(self.paths.getDecryptedMainDataStandartFolder())
|
||||||
return all_file_paths
|
return all_file_paths
|
||||||
@ -32,6 +35,10 @@ class Cleanup():
|
|||||||
pass
|
pass
|
||||||
self.cleanupFiles(Paths.TYPE_DECRYPTED)
|
self.cleanupFiles(Paths.TYPE_DECRYPTED)
|
||||||
|
|
||||||
|
def cleanupMetaData(self,file_type):
|
||||||
|
for folder_path in self.getMetaFilePaths(file_type):
|
||||||
|
self.deleteAllFilesInFolder(folder_path)
|
||||||
|
|
||||||
def deleteAll(self):
|
def deleteAll(self):
|
||||||
self.cleanupFiles(Paths.TYPE_ENCRYPTED)
|
self.cleanupFiles(Paths.TYPE_ENCRYPTED)
|
||||||
self.cleanupFiles(Paths.TYPE_DECRYPTED)
|
self.cleanupFiles(Paths.TYPE_DECRYPTED)
|
@ -166,6 +166,8 @@ try:
|
|||||||
encrypt.addInformationToUser(user_id, label, str(input()))
|
encrypt.addInformationToUser(user_id, label, str(input()))
|
||||||
encrypt.compileData()
|
encrypt.compileData()
|
||||||
if args.meta_data is True:
|
if args.meta_data is True:
|
||||||
|
print('Cleaning up encrypted meta data.')
|
||||||
|
cleanup.cleanupMetaData(Paths.TYPE_ENCRYPTED)
|
||||||
print("Create and encrypt meta data.")
|
print("Create and encrypt meta data.")
|
||||||
encrypt.encryptMetaData()
|
encrypt.encryptMetaData()
|
||||||
if args.input_directory is not None:
|
if args.input_directory is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user