10.1.1.3. dcsim.utils package¶
10.1.1.3.1. Submodules¶
10.1.1.3.2. dcsim.utils.FSignHash module¶
-
class
dcsim.utils.FSignHash.
FSignHash
(name)¶ Bases:
dcsim.framework.TrustedThirdPartyBase.TrustedThirdPartyBase
A authentication service based on hash with secret keys
- each node has one secret key and the signature is generated by
- signature = SHA256(node’s secret key || message)
where || is concatenation operator of bytes
-
register
(caller: <function NewType.<locals>.new_type at 0x1087282f0>) → None¶
-
round_action
(round: int) → None¶
-
sign
(caller: <function NewType.<locals>.new_type at 0x1087282f0>, message: bytes) → str¶
-
verify
(caller: <function NewType.<locals>.new_type at 0x1087282f0>, signature: str, message: bytes, sender_id: <function NewType.<locals>.new_type at 0x1087282f0>) → bool¶
10.1.1.3.3. dcsim.utils.FSignRSA module¶
-
class
dcsim.utils.FSignRSA.
FSignRSA
(name)¶ Bases:
dcsim.framework.TrustedThirdPartyBase.TrustedThirdPartyBase
a authentication service based on RSA public key algorithm
each node has a key pair, private key for sign and public key for verify
The performance is much worse than hash-based authentication service. It is a example to illustrate how to use AuthenticationServiceBase to
implement a public key algorithm based authentication serivce.-
register
(caller: <function NewType.<locals>.new_type at 0x1087282f0>) → None¶
-
round_action
(round: int) → None¶
-
sign
(caller: <function NewType.<locals>.new_type at 0x1087282f0>, message: bytes) → str¶
-
verify
(caller: <function NewType.<locals>.new_type at 0x1087282f0>, signature: str, message: bytes, sender_id: <function NewType.<locals>.new_type at 0x1087282f0>) → bool¶
-