Namespace Scylla.Core.Util.Crypto
Classes
CryptoException
Exception thrown by ScyllaCrypto and the internal provider layer when a cryptographic operation fails. Carries a structured ErrorCode value of type CryptoErrorCode that identifies the specific failure category, enabling callers to distinguish between, for example, a wrong-key authentication failure and an unsupported-platform error without parsing the message string.
CryptoExtensions
Provides extension methods for cryptographic operations on byte arrays and strings, enabling a fluent API for encryption, decryption, and Base64 encoding.
CryptoSettings
Configuration settings for cryptographic encryption and decryption operations performed by ScyllaCrypto. Controls the choice of algorithm, key size, and password-based key derivation parameters (PBKDF2 iteration count, salt size, and hash).
KeyDerivationSettings
Configuration settings for the PBKDF2 key derivation function (KDF) used by DeriveKey(string, byte[], KeyDerivationSettings) and the async equivalent DeriveKeyAsync(string, byte[], KeyDerivationSettings, CancellationToken). Controls iteration count, hash algorithm, and the size of the derived key.
ScyllaCrypto
Provides authenticated encryption and decryption operations for the Scylla framework. Supports three algorithms - AESGCM (recommended), AESCBCHMAC, and CHACHA20POLY1305 - across two modes: password-based (with PBKDF2 key derivation) and key-based (pre-derived key supplied by caller).
Interfaces
ICryptoProvider
Defines the contract for all cryptographic algorithm providers used internally by ScyllaCrypto. Each provider encapsulates a single authenticated encryption algorithm and is responsible for generating nonces, computing authentication tags, and producing a self-contained wire format that embeds all metadata required for decryption.
Enums
CryptoAlgorithm
Specifies the cryptographic algorithm to use for encryption and decryption operations performed by ScyllaCrypto and the underlying ICryptoProvider implementations.
CryptoErrorCode
Specifies structured error codes for cryptographic operation failures reported via CryptoException. Inspect ErrorCode to determine the specific failure cause and take appropriate action programmatically.
KeyDerivationHash
Specifies the underlying hash algorithm used by the PBKDF2 key derivation function when deriving symmetric keys from passwords. Controls both the internal hash state size and the throughput of the iterative hashing process.