crypto/algorithms/aescipher.py
def encryptString(self, unencryptedMessage):
        ''' 
        pads message lenght to multiple of 16
        generates random initialization vector
        encrypts message using key and IV
        sends IV as first block and then encrypted message
        '''
        paddedMessage = self._pad(unencryptedMessage)
        iv = Random.new().read(AES.block_size)
        cipher = AES.new(self.key, AES.MODE_CBC, iv)
        encryptedMessage = iv + cipher.encrypt(paddedMessage)
        return encryptedMessage
 
        pads message lenght to multiple of 16
        generates random initialization vector
        encrypts message using key and IV
        sends IV as first block and then encrypted message
        
pads message lenght to multiple of 16
generates random initialization vector
encrypts message using key and IV
sends IV as first block and then encrypted message
pads message lenght to multiple of 16 generates random initialization vector encrypts message using key and IV sends IV as first block and then encrypted message
def encryptString(self, unencryptedMessage):
        paddedMessage = self._pad(unencryptedMessage)
        iv = Random.new().read(AES.block_size)
        cipher = AES.new(self.key, AES.MODE_CBC, iv)
        encryptedMessage = iv + cipher.encrypt(paddedMessage)
        return encryptedMessage
def encryptString ( self , unencryptedMessage ) : paddedMessage = self . _pad ( unencryptedMessage ) iv = Random . new ( ) . read ( AES . block_size ) cipher = AES . new ( self . key , AES . MODE_CBC , iv ) encryptedMessage = iv + cipher . encrypt ( paddedMessage ) return encryptedMessage
pads message lenght to multiple of 16
generates random initialization vector
encrypts message using key and IV
sends IV as first block and then encrypted message
pads message lenght to multiple of 16 generates random initialization vector encrypts message using key and IV sends IV as first block and then encrypted message
''' 
        pads message lenght to multiple of 16
        generates random initialization vector
        encrypts message using key and IV
        sends IV as first block and then encrypted message
        '''
self
unencryptedMessage