Найти - Пользователи
Полная версия: Шифрование dict
Начало » Python для новичков » Шифрование dict
1
Fedy1661
Как зашифровать словарь с помощью rsa,чтобы при расшифровке словарь оставался в точности таким же?
Rodegast
 >>> import rsa
>>> (pubkey, privkey) = rsa.newkeys(512)
>>> import simplejson
>>> txt = simplejson.dumps({1:2222})
>>> shifrovka = rsa.encrypt(txt, pubkey)
>>> simplejson.loads(rsa.decrypt(shifrovka, privkey))
{'1': 2222}
Fedy1661
Rodegast
simplejson.loads
Спасибо большое
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB