mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 22:16:13 +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 cryptography.fernet import Fernet, InvalidToken
|
||||
import base64
|
||||
from passlib.hash import pbkdf2_sha256
|
||||
|
||||
|
||||
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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue