Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

aes in django

from aesfield.field import AESField

class SomeModel(...):
    key = AESField()
Comment

aes in django


>>> 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
'xd6x83x8dd!VTx92xaa`Ax05xe0x9bx8bxf1'
>>> obj2 = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
>>> obj2.decrypt(ciphertext)
'The answer is no'

Comment

PREVIOUS NEXT
Code Example
Python :: fix misspelled in Wikipedia library on python 
Python :: print hello in python 
Python :: how to get rid of an instance variable python 
Python :: plt force axis numbers 
Python :: python csv row index is empty 
Python :: python redirect console output to devnull 
Python :: python average function program 
Python :: where are spacy models stored 
Python :: tkl to pkr 
Python :: pd datetime 
Python :: .all() python numpy 
Python :: python open application windows 
Python :: numpy array to int type 
Python :: python index 
Python :: pdf to jpg 
Python :: pandas integer to date 
Python :: scikit decision tree regressor 
Python :: c to python converter 
Python :: pygame buttons 
Python :: install python 3.7 
Python :: id() python 
Python :: optional arguments python 
Python :: python check if character in string 
Python :: how to make capitalize text in python 
Python :: match in python 
Python :: how to find last element in array python 
Python :: pandas remove duplicates 
Python :: python script to read qr code 
Python :: raspbian run a python script at startup 
Python :: user passes test django 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =