beaconcrypt 0.3.11

Cryptographic transport for C2 channels
Documentation
from collections.abc import Sequence
from typing import final

@final
class BeaconCryptBeacon:
    def __new__(cls, /, server_kid: int, server_id_pk: bytes) -> BeaconCryptBeacon: ...
    def decrypt_server_message(self, /, data: Sequence[int]) -> bytes |None: ...
    def decrypt_server_message_signed(self, /, data: Sequence[int]) -> bytes |None: ...
    def encrypt_message_to_server(self, /, data: Sequence[int]) -> bytes |None: ...
    def encrypt_to_server_signed(self, /, data: Sequence[int]) -> bytes |None: ...
    def generate_registration(self, /) -> bytes |None:
        """
        Begin the beacon registration process. The output buffer should be sent as-is over the network.
        """
    def process_initial_message(self, /, data: Sequence[int]) -> bytes |None:
        """
        Process the registration response and optional initial data. The raw buffer sent by the server must be passed as-is as `data`. The response contains the contents of the initial message, or nothing if there was none. Once this function returns, the beacon is registered
        """

@final
class BeaconCryptServer:
    def __new__(cls, /, kid: int, id_seed: bytes |None) -> BeaconCryptServer: ...
    def decrypt_beacon_message(self, /, data: Sequence[int], kid: int) -> bytes |None: ...
    def decrypt_beacon_message_signed(self, /, data: Sequence[int]) -> bytes |None: ...
    def encrypt_to_beacon(self, /, data: Sequence[int], kid: int) -> bytes |None: ...
    def encrypt_to_beacon_signed(self, /, data: Sequence[int], kid: int) -> bytes |None: ...
    def id_pk(self, /) -> bytes: ...
    def register_beacon(self, /, reg_buffer: bytes, initial_message: bytes |None) -> RegResponse |None: ...

@final
class RegResponse:
    def key_id(self, /) -> int: ...
    def serialized(self, /) -> bytes: ...