Table of Contents

Namespace LibSodium

Classes

Base64Encoding

Provides methods for Base64 encoding and decoding.

CryptoSecretStream

The CryptoSecretStream class provides methods for performing authenticated encryption and decryption of data streams, with optional additional authenticated data. It is based on the XChaCha20-Poly1305 algorithm.

HexEncoding

Provides methods for encoding and decoding hexadecimal strings and byte buffers.

LibSodiumException

Represents errors that occur during Sodium operations.

LibraryInitializer

Static class that manages the initialization and configuration of libsodium.

LibraryVersion

Provides methods to retrieve the version information of the Sodium library.

RandomGenerator

Static class for random number generation.

SecretBox

Provides static methods for authenticated symmetric encryption and decryption using the Sodium secretbox primitives, specifically the XSalsa20 stream cipher and Poly1305 MAC for authentication. These methods offer combined encryption/authentication and detached encryption/authentication, with variations for handling nonces and Message Authentication Codes (MACs) within or separate from the ciphertext.

SecretStream

Provides high-level, stream-based authenticated encryption and decryption using the XChaCha20-Poly1305 algorithm. This class abstracts the complexity of securely processing large data streams, including chunking, authentication, and cryptographic state management.

SecureBigUnsignedInteger

Provides methods for working with arbitrary large little endian big unsigned integers in a secure way (constant time for a given length)

SecureMemory

Provides methods for secure memory management using libsodium. These methods help protect sensitive data from being swapped to disk or accessed by other processes.

SecureMemory<T>

Provides a secure unmanaged memory buffer for unmanaged types, using libsodium for memory protection. This class encapsulates secure memory allocation, read-only protection, and zeroing.

SecurePadding

Provides methods for padding and unpadding byte buffers to ensure they meet specified block sizes.

UnmanagedMemorySpanHolder<T>

Holds the pointer and length of an unmanaged memory span for later recreation. Use only with unmanaged memory.

Enums

Base64Variant

Represents Base64 encoding variants.

CryptoSecretStreamTag

The tags used in the secret stream.