def instantiateCipher(self, mode, message):
     self.alg, self.key_len = AES, 16
     # hash GT msg into a hex string
     key = sha1(message)[0:self.key_len]
     iv  = '6543210987654321' # static IV (for testing)    
     PRP_method = selectPRP(self.alg, (key, mode, iv))        
     return PRP_method
Exemple #2
0
 def instantiateCipher(self, mode, message):
     self.alg, self.key_len = AES, 16
     # hash GT msg into a hex string
     key = sha1(message)[0:self.key_len]
     iv = '6543210987654321'  # static IV (for testing)
     PRP_method = selectPRP(self.alg, (key, mode, iv))
     return PRP_method
Exemple #3
0
 def _initCipher(self,IV = None):
     if IV == None :
         IV =  OpenSSLRand().getRandomBytes(self._block_size)
     self._IV = IV
     return selectPRP(self._alg,(self._key,self._mode,self._IV))