Expand description
Utility functions for the application.
This module provides various utility functions for generating keys, encrypting/decrypting data, and handling tunnels. It also includes functions for parsing tunnel definitions and handling bidirectional data transfer.
Functionsยง
- decrypt
- Decrypts the given ciphertext using the shared secret.
- decrypt_
in_ place - Decrypts the data in place.
- encrypt
- Encrypts the given plaintext using the shared secret.
- encrypt_
into - Encrypts the data in place and appends the tag to the end of the buffer. The nonce is generated randomly.
- generate_
challenge - Generates a random challenge for a peer to sign.
- generate_
ephemeral_ key_ pair - Generates an ephemeral key pair for key exchange.
- generate_
key_ pair - Generates a random alphanumeric string of the specified length.
- generate_
key_ pair_ from_ key - Generates a key pair from a given private key.
- generate_
shared_ secret - Derives a shared secret for encrypting and decrypting data.
- handle_
tcp_ pump - Handles bidirectional data transfer between two streams.
- handle_
udp_ pump - Handles bidirectional data transfer between a UDP socket and a TCP stream.
- parse_
tunnel_ definition - Parses the tunnel definition from the given input string.
- parse_
tunnel_ definitions - Parses a list of tunnel definitions from the given input strings.
- random_
string - Generates a random alphanumeric string of the specified length.
- sign_
challenge - Signs a challenge using the provided private key.
- validate_
signed_ challenge - Validates a signed challenge using the provided public key.