#NEWLINE# def __decryptAES( self , key , value , iv = ( '\x00' * 16 ) ) : #NEWLINE# #INDENT# plainText = '' #NEWLINE# if ( iv != ( '\x00' * 16 ) ) : #NEWLINE# #INDENT# aes256 = AES . new ( key , AES . MODE_CBC , iv ) #NEWLINE# #UNINDENT# for index in range ( 0 , len ( value ) , 16 ) : #NEWLINE# #INDENT# if ( iv == ( '\x00' * 16 ) ) : #NEWLINE# #INDENT# aes256 = AES . new ( key , AES . MODE_CBC , iv ) #NEWLINE# #UNINDENT# cipherBuffer = value [ index : ( index + 16 ) ] #NEWLINE# if ( len ( cipherBuffer ) < 16 ) : #NEWLINE# #INDENT# cipherBuffer += ( '\x00' * ( 16 - len ( cipherBuffer ) ) ) #NEWLINE# #UNINDENT# plainText += aes256 . decrypt ( cipherBuffer ) #NEWLINE# #UNINDENT# return plainText