From c5fe21719af60a6544b40f3b6e7e5dd1e252287e Mon Sep 17 00:00:00 2001 From: Nich Date: Tue, 12 Apr 2016 19:05:53 -0400 Subject: [PATCH] Salt remains the same across sessions For Fernet to work correctly, the salt must be the same when re-encrypting the project after a successful decryption. This is because the key for decryption and encryption must be the same during a single session. So if the project was decrypted with one salt, the we want to generate a new salt to re-encrypt the file with a new key, Fernet will cough up an exception. Presumably this problem won't exist with other crypto-systems (e.g. AES-GCM). --- pappyproxy/crypto.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pappyproxy/crypto.py b/pappyproxy/crypto.py index 7540090..725606f 100644 --- a/pappyproxy/crypto.py +++ b/pappyproxy/crypto.py @@ -101,6 +101,7 @@ class Crypto(object): # Quit pappy if user doesn't retry # or if all retries exhuasted if not self.confirm_password_retry() or retries <= 0: + os.remove(self.config.archive) return False else: self.password = None