Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
|
|
| 6 |
import os
|
| 7 |
import base64
|
| 8 |
import hashlib
|
| 9 |
-
|
| 10 |
|
| 11 |
|
| 12 |
def create_key(passw):
|
|
@@ -47,6 +47,7 @@ def encrypt(passw=None,mes=None,img=None,doc=None):
|
|
| 47 |
enc_mes = f'{im_bytes}+bbb+'
|
| 48 |
|
| 49 |
if doc != None:
|
|
|
|
| 50 |
with open(doc, "rb") as file:
|
| 51 |
# read all file data
|
| 52 |
file_data = file.read()
|
|
|
|
| 6 |
import os
|
| 7 |
import base64
|
| 8 |
import hashlib
|
| 9 |
+
from pathlib import Path
|
| 10 |
|
| 11 |
|
| 12 |
def create_key(passw):
|
|
|
|
| 47 |
enc_mes = f'{im_bytes}+bbb+'
|
| 48 |
|
| 49 |
if doc != None:
|
| 50 |
+
doc = Path(doc)
|
| 51 |
with open(doc, "rb") as file:
|
| 52 |
# read all file data
|
| 53 |
file_data = file.read()
|