keychain-uses-objects
quadrismegistus 4 years ago
parent 0fbfd94b19
commit 588b410a1b

@ -183,9 +183,18 @@ def hashish(binary_data):
import hashlib
return hashlib.sha256(binary_data).hexdigest()
def create_secret():
if not os.path.exists(PATH_CRYPT_SECRET):
secret = get_random_binary_id()
from komrade.backend.keymaker import make_key_discreet
print('shhh! creating secret:',make_key_discreet(secret))
with open(PATH_CRYPT_SECRET,'wb') as of:
of.write(secret)
def hasher(dat,secret=None):
import hashlib
if not secret:
create_secret()
with open(PATH_CRYPT_SECRET,'rb') as f:
secret = f.read()
if type(dat)==str:

Loading…
Cancel
Save