Skip to content

Commit

Permalink
fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidatorCoder committed Nov 27, 2021
1 parent d4b1c29 commit 3f4c687
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/services/encryption_service.dart
Expand Up @@ -14,6 +14,7 @@ class EncryptionService {
final crypt = AesCrypt();
final password = _randomService.getRandomString(16);
crypt.setPassword(password);
crypt.setOverwriteMode(AesCryptOwMode.rename);
final encryptedFilePath =
join(file.parent.path, basename(file.path) + '.odin');
crypt.encryptFileSync(file.path, encryptedFilePath);
Expand All @@ -26,6 +27,7 @@ class EncryptionService {
logger.d('Started Deryption');
final crypt = AesCrypt();
crypt.setPassword(password);
crypt.setOverwriteMode(AesCryptOwMode.rename);
file = await file
.rename(file.path.substring(0, file.path.length - 5) + ".aes");
final decryptedFilePath = crypt.decryptFileSync(
Expand Down

0 comments on commit 3f4c687

Please sign in to comment.