Ahmad Hammoudeh commited on
Commit
2ec2a9e
·
1 Parent(s): d1d2ecf

Update msg_encX.py

Browse files
Files changed (1) hide show
  1. msg_encX.py +2 -2
msg_encX.py CHANGED
@@ -10,7 +10,7 @@ import rsa
10
  import string
11
 
12
 
13
- def seedx(path , User_passcode=0, N_days=1, encryption_difficulty = 2**10):
14
  try:
15
  with open(path +'indx.txt') as f:
16
  old_day_index = int(f.read())
@@ -113,7 +113,7 @@ def AES_decrypt(encMessage,seed,publicKey, encoding = 1, encryption_difficulty =
113
 
114
  def Encrypt_msg(User_message,user_password,path):
115
  User_passcode = (int.from_bytes(bytes(str(user_password), 'utf-8'), "little"))
116
- Num_dict_enc = seedx(path, User_passcode, N_days)
117
  encMessage_i = AES_encrypt(User_message,Num_dict_enc['seed'], Num_dict_enc['publicKey'],encoding = 1, padding = 30)
118
  #print(encMessage_i)
119
  return encMessage_i
 
10
  import string
11
 
12
 
13
+ def seedx(path , User_passcode=0, N_days=os.environ['N_days'], encryption_difficulty = os.environ['encryption_difficulty']):
14
  try:
15
  with open(path +'indx.txt') as f:
16
  old_day_index = int(f.read())
 
113
 
114
  def Encrypt_msg(User_message,user_password,path):
115
  User_passcode = (int.from_bytes(bytes(str(user_password), 'utf-8'), "little"))
116
+ Num_dict_enc = seedx(path, User_passcode)
117
  encMessage_i = AES_encrypt(User_message,Num_dict_enc['seed'], Num_dict_enc['publicKey'],encoding = 1, padding = 30)
118
  #print(encMessage_i)
119
  return encMessage_i