def load_data():
global DATA, encrypt, decrypt
key = md5(input('security code:'))
iv = key[8:24]
encrypt = lambda text : b2a_hex(
AES.new(key, AES.MODE_CBC, iv).encrypt(padding(text)))
decrypt = lambda text : AES.new(
key, AES.MODE_CBC, iv).decrypt(a2b_hex(text)).decode().rstrip('\0')
if os.path.isfile(FILE_NAME):
with open(FILE_NAME, 'rb') as f:
try:
DATA = pickle.load(f)
except pickle.UnpicklingError:
print('file error!')
return False
except:
print('loading error!')
return False
评论列表
文章目录