Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,11 +47,13 @@ def encrypt(passw=None,mes=None,img=None,doc=None):
|
|
| 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()
|
| 54 |
-
enc_doc = fernet.encrypt(
|
| 55 |
enc_file=f'{doc}.ocrpt'
|
| 56 |
with open(enc_file, "wb") as file:
|
| 57 |
file.write(enc_doc)
|
|
|
|
| 47 |
enc_mes = f'{im_bytes}+bbb+'
|
| 48 |
|
| 49 |
if doc != None:
|
| 50 |
+
bytes_d = doc.encode()
|
| 51 |
+
|
| 52 |
#doc = Path(doc)
|
| 53 |
#with open(doc, "rb") as file:
|
| 54 |
# read all file data
|
| 55 |
#file_data = file.read()
|
| 56 |
+
enc_doc = fernet.encrypt(bytes_d)
|
| 57 |
enc_file=f'{doc}.ocrpt'
|
| 58 |
with open(enc_file, "wb") as file:
|
| 59 |
file.write(enc_doc)
|