From 8b7a37a196cf9de4a4ae1ef048631df04301660c Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Wed, 16 Apr 2014 17:03:29 -0400 Subject: [PATCH] Version bump & docs --- CHANGELOG.md | 1 + docs/encryption.rst | 4 +++- jrnl/__init__.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aff2011..14b634d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog ### 1.7 (December 22, 2013) +* __1.7.21__ jrnl now uses PKCS#7 padding. * __1.7.20__ Minor fixes when parsing DayOne journals * __1.7.19__ Creates full path to journal during installation if it doesn't exist yet * __1.7.18__ Small update to parsing regex diff --git a/docs/encryption.rst b/docs/encryption.rst index df4781f8..9d420df6 100644 --- a/docs/encryption.rst +++ b/docs/encryption.rst @@ -29,7 +29,7 @@ If you don't initially store the password in the keychain but decide to do so at Manual decryption ----------------- -Should you ever want to decrypt your journal manually, you can do so with any program that supports the AES algorithm. The key used for encryption is the SHA-256-hash of your password, and the IV (initialisation vector) is stored in the first 16 bytes of the encrypted file. So, to decrypt a journal file in python, run:: +Should you ever want to decrypt your journal manually, you can do so with any program that supports the AES algorithm in CBC. The key used for encryption is the SHA-256-hash of your password, the IV (initialisation vector) is stored in the first 16 bytes of the encrypted file. The plain text is encoded in UTF-8 and padded according to PKCS#7 before being encrypted. So, to decrypt a journal file in python, run:: import hashlib, Crypto.Cipher key = hashlib.sha256(my_password).digest() @@ -37,3 +37,5 @@ Should you ever want to decrypt your journal manually, you can do so with any pr cipher = f.read() crypto = AES.new(key, AES.MODE_CBC, iv = cipher[:16]) plain = crypto.decrypt(cipher[16:]) + plain = plain.strip(plain[-1]) + plain = plain.decode("utf-8") diff --git a/jrnl/__init__.py b/jrnl/__init__.py index 7bb44098..eef08dc0 100644 --- a/jrnl/__init__.py +++ b/jrnl/__init__.py @@ -8,7 +8,7 @@ jrnl is a simple journal application for your command line. from __future__ import absolute_import __title__ = 'jrnl' -__version__ = '1.7.20' +__version__ = '1.7.21' __author__ = 'Manuel Ebert' __license__ = 'MIT License' __copyright__ = 'Copyright 2013 - 2014 Manuel Ebert'