MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / get_private_key

Method get_private_key

ciphers/diffie_hellman.py:222–223  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

220 self.__private_key = int(hexlify(urandom(32)), base=16)
221
222 def get_private_key(self) -> str:
223 return hex(self.__private_key)[2:]
224
225 def generate_public_key(self) -> str:
226 public_key = pow(self.generator, self.__private_key, self.prime)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected