def encrypt(self, value): iv = Random.get_random_bytes(AES.block_size) cipher = self.get_cipher(self.key, iv) return iv + cipher.encrypt(value)