Question : aes in django
Answered by : outrageous-owl-f5dhrfgxigft
from aesfield.field import AESField
class SomeModel(...): key = AESField()
Source : https://pypi.org/project/django-aesfield/ | Last Update : Wed, 17 Nov 21
Question : aes in django
Answered by : graceful-gibbon-fgb26llnzhuv
>>> from Crypto.Cipher import AES
>>> obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
>>> message = "The answer is no"
>>> ciphertext = obj.encrypt(message)
>>> ciphertext
'\xd6\x83\x8dd!VT\x92\xaa`A\x05\xe0\x9b\x8b\xf1'
>>> obj2 = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
>>> obj2.decrypt(ciphertext)
'The answer is no'
Source : https://devarama.com/questions/44285094/python-AES-Encrypt | Last Update : Thu, 07 Apr 22