From 032fd0f8849802aefd966535b91df242433c01ca Mon Sep 17 00:00:00 2001 From: tmeissner Date: Tue, 26 Aug 2014 11:26:25 +0200 Subject: [PATCH] added return when note with given id not exists in modify_note(); increased iterations of kdf to 10.000 --- python_3_oop/chapter02/menu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python_3_oop/chapter02/menu.py b/python_3_oop/chapter02/menu.py index 4f9b73c..eed5430 100644 --- a/python_3_oop/chapter02/menu.py +++ b/python_3_oop/chapter02/menu.py @@ -79,6 +79,7 @@ Notebook Menu if memo: if not self.notebook.modify_memo(id, memo): print("Note with id {0} doesn't exist.".format(id)) + return if tags: if not self.notebook.modify_tags(id, tags): print("Note with id {0} doesn't exist.".format(id)) @@ -120,7 +121,7 @@ Notebook Menu algorithm = hashes.SHA256(), length = 32, salt = self.salt.encode('utf-8'), - iterations = 1000, + iterations = 10000, backend = default_backend() ) return base64.urlsafe_b64encode(kdf.derive(passphrase.encode('utf-8')))