(key_size=1024)
Generate a self-typed object with public mod_base and vacant exponent
        :param key_size: int
        :return: PohligHellmanCipherKey
Generate a self-typed object with public mod_base and vacant exponent
        :param key_size: int
        :return: PohligHellmanCipherKey
Generate a self - typed object with public mod_base and vacant exponent : param key_size : int : return : PohligHellmanCipherKey
def generate_key(key_size=1024):
        """
        Generate a self-typed object with public mod_base and vacant exponent
        :param key_size: int
        :return: PohligHellmanCipherKey
        """
        key_size_half = key_size // 2
        while True:
            mod_base_half = PohligHellmanCipherKey.generate_prime(2 ** (key_size_half - 1), 2 ** key_size_half - 1)
            mod_base = mod_base_half * 2 + 1
            if is_prime(mod_base):
                return PohligHellmanCipherKey(mod_base)
def generate_key ( key_size = 1024 ) : key_size_half = key_size // 2 while True : mod_base_half = PohligHellmanCipherKey . generate_prime ( 2 ** ( key_size_half - 1 ) , 2 ** key_size_half - 1 ) mod_base = mod_base_half * 2 + 1 if is_prime ( mod_base ) : return PohligHellmanCipherKey ( mod_base )