2.12.ipv8.messaging.anonymization.tunnelcrypto
Module Contents
Classes
- exception 2.12.ipv8.messaging.anonymization.tunnelcrypto.CryptoException
Bases:
Exception
Exception for when anything goes wrong with sessions, encoding, and decoding.
- class 2.12.ipv8.messaging.anonymization.tunnelcrypto.SessionKeys
Session keys to communicate between hops.
- class 2.12.ipv8.messaging.anonymization.tunnelcrypto.TunnelCrypto
Bases:
2.12.ipv8.keyvault.crypto.ECCrypto
Add Diffie-Hellman key establishment logic to ECCrypto.
- initialize(key: 2.12.ipv8.keyvault.crypto.LibNaCLPK) None
Make this ECCrypto fit for key establishment based on the given public key.
- is_key_compatible(key: 2.12.ipv8.types.PublicKey) bool
Whether the given key is a
LibNaCLPK
instance.
- generate_diffie_secret() tuple[2.12.ipv8.keyvault.private.libnaclkey.LibNaCLSK, 2.12.ipv8.keyvault.crypto.LibNaCLPK]
Create a a new private-public keypair.
Generate the shared secret from the received string and the given key.
Generate the shared secret based on the response to the shared string and our own key.
- generate_session_keys(shared_secret: bytes) SessionKeys
Generate new session keys based on the shared secret.
- get_session_keys(keys: SessionKeys, direction: int) tuple[bytes, bytes, int]
Get the session keys for forward (0) or backward (1) communication.