mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 11:38:32 +02:00
Add password confirmation to encryption
If the user mistypes their password, they could end up losing data when it comes time to decrypt it elsewhere. This would ask them to confirm their initial entry to safeguard against that.
This commit is contained in:
parent
8eeba1481d
commit
10570ec5dd
1 changed files with 8 additions and 1 deletions
|
@ -69,7 +69,14 @@ def install_jrnl(config_path='~/.jrnl_config'):
|
|||
|
||||
# Encrypt it?
|
||||
if module_exists("Crypto"):
|
||||
confirmed_password = False
|
||||
while confirmed_password == False:
|
||||
password = getpass.getpass("Enter password for journal (leave blank for no encryption): ")
|
||||
password_conf = getpass.getpass("Confirm password: ")
|
||||
if password == password_conf:
|
||||
confirmed_password = True
|
||||
else:
|
||||
print("Password and confirmation did not match, try again.")
|
||||
if password:
|
||||
default_config['encrypt'] = True
|
||||
if util.yesno("Do you want to store the password in your keychain?", default=True):
|
||||
|
|
Loading…
Add table
Reference in a new issue