#NEWLINE# def encryptor( key , message ) : #NEWLINE# #INDENT# 'Cipher a message using a key' #NEWLINE# IV = '' . join ( ( chr ( random . randint ( 0 , 255 ) ) for i in range ( 16 ) ) ) #NEWLINE# encrypto = AES . new ( key , mode , IV = IV ) #NEWLINE# crypt_message = encrypto . encrypt ( message ) #NEWLINE# cipher = ( crypt_message + IV ) #NEWLINE# return base64 . b64encode ( cipher )