Return the host key public modulus

Returns, by default, the base-10 representation.  If $raw_output is set to true, returns, instead,
the raw bytes.  This behavior is similar to PHP's md5() function.

@param bool $raw_output
@return string
@access public
492547
function getHostKeyPublicModulus($raw_output = false)
    {
        return $raw_output ? $this->host_key_public_modulus->toBytes() : $this->host_key_public_modulus->toString();
    }
270523
public function decryptByPublicKey_data($data, $publickey = '')
	{
		$RSACrypt = new RSACrypt();

		if ($publickey != "") {
			$RSACrypt->pubkey = $publickey;
		}
		$decrypt_res = "";
		$datas = explode('@', $data);
		foreach ($datas as $value) {
			$decrypt_res = $decrypt_res . $RSACrypt->decryptByPublicKey($value);
		}
		return $decrypt_res;
	}
620007
public function hmac($algo, $data, $key, $raw_output = false)
    {
        return hash_hmac($algo, $data, $key, $raw_output);
    }
149476
public function getHash(
        bool $raw = false,
        int $outputSize = \SODIUM_CRYPTO_GENERICHASH_BYTES,
        string $personalization = ''
    ): string {
        if ($raw) {
            return Util::raw_hash(
                $personalization . $this->data,
                $outputSize
            );
        }
        return Util::hash(
            $personalization . $this->data,
            $outputSize
        );
    }
521671
private function simplexor()
    {
        $KeyList = array();
        $output = "";

        // Convert $Key into array of ASCII values
        for ($i = 0; $i < strlen($this->hash); $i++) {
            $KeyList[$i] = ord(substr($this->hash, $i, 1));
        }

        // Step through string a character at a time
        for ($i = 0; $i < strlen($this->data); $i++) {
            $output.= chr(ord(substr($this->data, $i, 1)) ^ ($KeyList[$i % strlen($this->hash)]));
        }

        // Return the result
        return $output;
    }
225228
public function getPublicKey($client_id = null)
    {
        if (isset($this->keys[$client_id])) {
            return $this->keys[$client_id]['public_key'];
        }

        // use a global encryption pair
        if (isset($this->keys['public_key'])) {
            return $this->keys['public_key'];
        }

        return false;
    }
775938
def sha256_fingerprint_from_raw_ssh_pub_key(raw_key):
    
    digest = hashlib.sha256(raw_key).digest()
    h = base64.b64encode(digest).decode('utf-8')
    h = h.rstrip().rstrip('=')  # drop newline and possible base64 padding
    return 'SHA256:' + h
60100
public function sha1($format = null, $raw_output = false)
	{
		return hash('sha1', parent::format($format === null ? static::$format : $format), $raw_output);
	}
419074
def serialize(self, raw=False):
        '''
        '''
        if raw:
            return self._key.encode()
        return self._key.encode(nacl.encoding.Base64Encoder)
740260
private function parseHeaders($raw_headers)
    {
        $raw_headers = preg_split('/\r\n/', $raw_headers, null, PREG_SPLIT_NO_EMPTY);
        $http_headers = [];

        $raw_headers_count = count($raw_headers);
        for ($i = 1; $i < $raw_headers_count; $i++) {
            list($key, $value) = explode(':', $raw_headers[$i], 2);
            $key = trim($key);
            $value = trim($value);
            // Use isset() as array_key_exists() and ArrayAccess are not compatible.
            if (isset($http_headers[$key])) {
                $http_headers[$key] .= ',' . $value;
            } else {
                $http_headers[$key] = $value;
            }
        }

        return array(isset($raw_headers['0']) ? $raw_headers['0'] : '', $http_headers);
    }
36702
def public_key64_to_address(base64_public_key):
    """"""
    ed25519_public_key = public_key_from_base64(base64_public_key)
    encoded_public_key = amino_encoded_public_key(ed25519_public_key)
    return hashlib.new('ripemd160', encoded_public_key).hexdigest().upper()
1118564
def get_key(raw=False):
    
    while True:
        try:
            if kbhit():
                char = getch()
                ordinal = ord(char)
                if ordinal in (0, 224):
                    extention = ord(getch())
                    scan_code = ordinal + extention * 256
                    result = scan_codes.get(scan_code)
                    break
                else:
                    result = char.decode()
                    break
        except KeyboardInterrupt:
            return "ctrl-c"
    return result if raw else keys_flipped.get(result, result)
513693
public function getRoot(bool $raw = false): string
    {
        if (!$this->rootCalculated) {
            $this->root = $this->calculateRoot();
        }
        return $raw
            ? $this->root
            : Hex::encode($this->root);
    }
130281
def _get_pubkey_hash(cert):
    '''
    
    '''
    sha_hash = hashlib.sha1(cert.get_pubkey().get_modulus()).hexdigest()
    return _pretty_hex(sha_hash)
987288
public function raw($key, $default = null)
    {
        if (strpos($key, '[') === false) {
            return Accessor::get($this->data, $key, $default);
        }
        $found = $this->parseRaw($key);
        if (!is_null($found)) {
            return $found;
        }
        return $default;
    }
103819
def _get_raw_key(self, key_id):
        
        try:
            static_key = self._static_keys[key_id]
        except KeyError:
            static_key = os.urandom(32)
            self._static_keys[key_id] = static_key
        return WrappingKey(
            wrapping_algorithm=WrappingAlgorithm.AES_256_GCM_IV12_TAG16_NO_PADDING,
            wrapping_key=static_key,
            wrapping_key_type=EncryptionKeyType.SYMMETRIC,
        )
690859
public function parseCompressedPublicKey($pubkey, $returnHex = false)
    {
        $prefix = substr($pubkey, 0, 2);

        if ($prefix !== '02' && $prefix !== '03') {
            return $this->prepAndClean($pubkey);
        }

        $pointX = substr($pubkey, 2);
        $pointY = substr($this->calcYfromX($pointX, $prefix), 2);

        $parsedValue = $this->prepAndClean($pointX . $pointY);

        return ($returnHex === false) ? $parsedValue : $this->encodeHex($parsedValue);
    }