code: def build_cipher(self, alg='aes_128_cbc'):
          
          self.__class__._deprecation_notice()
          typ, bits, cmode = alg.lower().split('_')
          bits = int(bits)
          iv = _os.urandom(self.AES_BLOCK_SIZE)
  
          if len(iv) != self.AES_BLOCK_SIZE:
              raise Exception('Wrong iv size: {}'.format(len(iv)))
  
          if bits not in _ciphers.algorithms.AES.key_sizes:
              raise Exception('Unsupported key length: {}'.format(bits))
  
          if len(self.key) != bits / 8:
              raise Exception('Wrong Key length: {}'.format(len(self.key)))
  
          try:
              mode = self.POSTFIX_MODE[cmode]
          except KeyError:
              raise Exception('Unsupported chaining mode: {}'.format(cmode))
  
          cipher = _ciphers.Cipher(
                  _ciphers.algorithms.AES(self.key),
                  mode(iv),
                  backend=_backends.default_backend())
  
          return cipher, iv
docs: :param alg: cipher algorithm
          :return: A Cipher instance