mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
parent
9c4294ca68
commit
1f73d28147
2 changed files with 5 additions and 2 deletions
|
@ -1,11 +1,12 @@
|
||||||
import hashlib
|
|
||||||
from . import Journal, util
|
from . import Journal, util
|
||||||
from cryptography.fernet import Fernet, InvalidToken
|
from cryptography.fernet import Fernet, InvalidToken
|
||||||
import base64
|
import base64
|
||||||
|
from passlib.hash import pbkdf2_sha256
|
||||||
|
|
||||||
|
|
||||||
def make_key(password):
|
def make_key(password):
|
||||||
return base64.urlsafe_b64encode(hashlib.sha256(password.encode("utf-8")).digest())
|
derived_key = pbkdf2_sha256.encrypt(password.encode("utf-8"), rounds=10000, salt_size=16)
|
||||||
|
return base64.urlsafe_b64encode(derived_key)
|
||||||
|
|
||||||
|
|
||||||
class EncryptedJournal(Journal.Journal):
|
class EncryptedJournal(Journal.Journal):
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -89,6 +89,8 @@ setup(
|
||||||
"tzlocal>=1.1",
|
"tzlocal>=1.1",
|
||||||
"PyYAML>=3.11",
|
"PyYAML>=3.11",
|
||||||
"keyring>=3.3",
|
"keyring>=3.3",
|
||||||
|
"passlib>=1.6.2",
|
||||||
|
"python-dateutil>=2.2"
|
||||||
] + [p for p, cond in conditional_dependencies.items() if cond],
|
] + [p for p, cond in conditional_dependencies.items() if cond],
|
||||||
long_description=__doc__,
|
long_description=__doc__,
|
||||||
entry_points={
|
entry_points={
|
||||||
|
|
Loading…
Add table
Reference in a new issue