Spaces:
Sleeping
Sleeping
Ahmad Hammoudeh
commited on
Commit
·
1b93da3
1
Parent(s):
f51128c
Update msg_encX.py
Browse files- msg_encX.py +5 -2
msg_encX.py
CHANGED
|
@@ -9,8 +9,11 @@ from Crypto.Cipher import AES
|
|
| 9 |
import rsa
|
| 10 |
import string
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
def seedx(path , User_passcode=
|
| 14 |
try:
|
| 15 |
with open(path +'indx.txt') as f:
|
| 16 |
old_day_index = int(f.read())
|
|
@@ -43,7 +46,7 @@ def seedx(path , User_passcode=0, N_days=int(os.environ['N_days']), encryption_d
|
|
| 43 |
return {'seed':seed,'publicKey': publicKey, 'privateKey': privateKey}
|
| 44 |
|
| 45 |
|
| 46 |
-
def AES_encrypt(User_message,seed, publicKey,encoding =
|
| 47 |
#number conversion to encrypt non-english content
|
| 48 |
User_message_numbered = (int.from_bytes(bytes(User_message, 'utf-16'), "big"))
|
| 49 |
#padding
|
|
|
|
| 9 |
import rsa
|
| 10 |
import string
|
| 11 |
|
| 12 |
+
encoding = int(os.environ['encoding'])
|
| 13 |
+
padding = int(os.environ['padding'])
|
| 14 |
+
encryption_difficulty = int(os.environ['encryption_difficulty'])
|
| 15 |
|
| 16 |
+
def seedx(path , User_passcode=int(os.environ['User_passcode']), N_days=int(os.environ['N_days']), encryption_difficulty = encryption_difficulty):
|
| 17 |
try:
|
| 18 |
with open(path +'indx.txt') as f:
|
| 19 |
old_day_index = int(f.read())
|
|
|
|
| 46 |
return {'seed':seed,'publicKey': publicKey, 'privateKey': privateKey}
|
| 47 |
|
| 48 |
|
| 49 |
+
def AES_encrypt(User_message,seed, publicKey,encoding = int(os.environ['encoding']), padding = int(os.environ['padding'])):
|
| 50 |
#number conversion to encrypt non-english content
|
| 51 |
User_message_numbered = (int.from_bytes(bytes(User_message, 'utf-16'), "big"))
|
| 52 |
#padding
|