diff --git a/packages/syft/src/syft/server/credentials.py b/packages/syft/src/syft/server/credentials.py index 4b811aa0db5..f4615f083e8 100644 --- a/packages/syft/src/syft/server/credentials.py +++ b/packages/syft/src/syft/server/credentials.py @@ -2,6 +2,7 @@ from __future__ import annotations # stdlib +import hashlib from typing import Any # third party @@ -58,6 +59,9 @@ class SyftSigningKey(SyftBaseModel): def make_signing_key(cls, v: Any) -> Any: return SigningKey(bytes.fromhex(v)) if isinstance(v, str) else v + def deterministic_hash(self) -> str: + return hashlib.sha256(self.signing_key._seed).hexdigest() + @property def verify_key(self) -> SyftVerifyKey: return SyftVerifyKey(verify_key=self.signing_key.verify_key) diff --git a/packages/syft/src/syft/server/server.py b/packages/syft/src/syft/server/server.py index b94e98aac35..5d3a9deb075 100644 --- a/packages/syft/src/syft/server/server.py +++ b/packages/syft/src/syft/server/server.py @@ -274,6 +274,10 @@ def __init__( skey = signing_key self.signing_key = skey or SyftSigningKey.generate() + logger.critical( + f"Hash of the signing key '{self.signing_key.deterministic_hash()[:5]}...'" + ) + self.association_request_auto_approval = association_request_auto_approval consumer_type = (