Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jrnl --encrypt doesn't prompt me for password change #1358

Closed
piero-vic opened this issue Oct 18, 2021 · 3 comments · Fixed by #1477
Closed

jrnl --encrypt doesn't prompt me for password change #1358

piero-vic opened this issue Oct 18, 2021 · 3 comments · Fixed by #1477
Labels
bug Something isn't working 📌 This can't go stale ready for pr Okay to start work. Feel free to ask questions.
Milestone

Comments

@piero-vic
Copy link
Contributor

Bug Report

Environment

jrnl: v2.8.3
Python: 3.9.7 (default, Oct 13 2021, 06:44:56)
[Clang 12.0.0 (clang-1200.0.32.29)]
OS: Darwin 19.6.0
  • Install method: via homebrew

Current Behavior

jrnl --encrypt doesn't change the password of an encrypted journal. It prompts me for the current password but doesn't prompt for a new one.

Expected Behavior

As the documentation states, jrnl --encrypt should prompt for the current password and then for a new one.

Repro Steps

% jrnl --debug --encrypt
DEBUG    root         Parsed args: Namespace(debug=True, preconfig_cmd=None, postconfig_cmd=<function postconfig_encrypt at 0x104732dc0>, filename=None, on_date=None, today_in_history=False, month=None, day=None, year=None, start_date=None, end_date=None, contains=None, strict=False, starred=False, limit=None, excluded=[], edit=False, delete=False, export=False, tags=False, short=False, config_override=[], text=[])
DEBUG    root         Reading configuration from file /Users/piero/.config/jrnl/jrnl.yaml
DEBUG    root         Using configuration "{'colors': {'body': 'BLUE', 'date': 'YELLOW', 'tags': 'GREEN', 'title': 'CYAN'}, 'default_hour': 9, 'default_minute': 0, 'display_format': 'boxed', 'editor': 'micro', 'encrypt': False, 'highlight': True, 'indent_character': '|', 'journals': {'default': {'encrypt': False, 'journal': '/Users/piero/Documents/Journal/journal.txt'}}, 'linewrap': 79, 'tagsymbols': '@', 'template': False, 'timeformat': '%Y-%m-%d %H:%M', 'version': 'v2.8.3'}"
DEBUG    root         Using journal name: default
DEBUG    root         Updating configuration with specific journal overrides {'encrypt': False, 'journal': '/Users/piero/Documents/Journal/journal.txt'}
DEBUG    root         opened PlainJournal with 15 entries
DEBUG    root         Imported 15 entries from PlainJournal to EncryptedJournal
Enter password for new journal:
Enter password again:
Do you want to store the password in your keychain? [Y/n] n
Journal encrypted to /Users/piero/Documents/Journal/journal.txt.

% jrnl --debug --encrypt
DEBUG    root         Parsed args: Namespace(debug=True, preconfig_cmd=None, postconfig_cmd=<function postconfig_encrypt at 0x11048fdc0>, filename=None, on_date=None, today_in_history=False, month=None, day=None, year=None, start_date=None, end_date=None, contains=None, strict=False, starred=False, limit=None, excluded=[], edit=False, delete=False, export=False, tags=False, short=False, config_override=[], text=[])
DEBUG    root         Reading configuration from file /Users/piero/.config/jrnl/jrnl.yaml
DEBUG    root         Using configuration "{'colors': {'body': 'BLUE', 'date': 'YELLOW', 'tags': 'GREEN', 'title': 'CYAN'}, 'default_hour': 9, 'default_minute': 0, 'display_format': 'boxed', 'editor': 'micro', 'encrypt': False, 'highlight': True, 'indent_character': '|', 'journals': {'default': {'encrypt': True, 'journal': '/Users/piero/Documents/Journal/journal.txt'}}, 'linewrap': 79, 'tagsymbols': '@', 'template': False, 'timeformat': '%Y-%m-%d %H:%M', 'version': 'v2.8.3'}"
DEBUG    root         Using journal name: default
DEBUG    root         Updating configuration with specific journal overrides {'encrypt': True, 'journal': '/Users/piero/Documents/Journal/journal.txt'}
Password:
DEBUG    root         opened EncryptedJournal with 15 entries
DEBUG    root         Imported 15 entries from EncryptedJournal to EncryptedJournal
Journal encrypted to /Users/piero/Documents/Journal/journal.txt.
@piero-vic piero-vic added 🆕 New! bug Something isn't working labels Oct 18, 2021
@micahellison
Copy link
Member

Thanks for filing this. I've reproduced this on my machine on well.

A resolution to this should:

  • fix the issue
  • include a BDD test for this use case

@micahellison micahellison added 📌 This can't go stale and removed 🆕 New! labels Oct 23, 2021
@micahellison micahellison added this to the Backlog milestone Oct 23, 2021
@Granddave
Copy link
Contributor

I also experienced this issue.
For the sake of documentation if someone gets the same problem;
The way to rotate password is to decrypt and encrypt.

$ jrnl --decrypt
Password:
Journal decrypted to $JRNL_PATH.
$ jrnl --encrypt
Enter password for new journal:
Enter password again:
Do you want to store the password in your keychain? [Y/n] n
Journal encrypted to $JRNL_PATH.

@micahellison micahellison added the ready for pr Okay to start work. Feel free to ask questions. label Feb 26, 2022
@mandarup
Copy link

mandarup commented May 7, 2022

I also experienced this issue. For the sake of documentation if someone gets the same problem; The way to rotate password is to decrypt and encrypt.

$ jrnl --decrypt
Password:
Journal decrypted to $JRNL_PATH.
$ jrnl --encrypt
Enter password for new journal:
Enter password again:
Do you want to store the password in your keychain? [Y/n] n
Journal encrypted to $JRNL_PATH.

This also addressed issue with storing and retrieving password from keyring on linux (if you select Y to last step)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📌 This can't go stale ready for pr Okay to start work. Feel free to ask questions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants