Enum 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.
Namespace: Scylla.Core.Util.Crypto
Assembly: ScyllaCore.dll
Syntax
public enum CryptoErrorCode
Fields
| Name | Description |
|---|---|
| AuthenticationFailed | The AEAD authentication tag verification step failed during decryption. This is the most common error when decrypting with the wrong key or password, or when the ciphertext bytes have been modified after encryption (e.g., partial writes, network corruption, or deliberate tampering). Do not attempt to use any output produced when this code is raised. |
| CorruptedData | The ciphertext buffer has an invalid structure - for example, it is too short to contain the provider-specific metadata header (nonce, IV, tag), or the format version byte embedded in the password-encrypted wire format is not recognised. Typically caused by passing an unrelated byte array, a truncated buffer, or data produced by a different encryption system. |
| DecryptionFailed | Decryption failed due to an internal error that is not an authentication failure or
data corruption issue. This may indicate an internal platform-level failure in the
underlying .NET cryptographic primitive. Inspect |
| InvalidIterationCount | The PBKDF2 iteration count is below the minimum threshold enforced by
MIN_ITERATIONS (currently 10,000). Raised by
Validate() and Validate()
to prevent use of iteration counts too weak to resist brute-force attacks.
Increase Iterations or
Iterations to at least |
| InvalidKey | The provided encryption or decryption key is |
| InvalidKeySize | The requested key size in bits is not supported by the selected algorithm.
Valid standard values are |
| InvalidPassword | The password supplied to a password-based encryption or key derivation method is
|
| NullData | A required byte array parameter (plaintext, ciphertext, key, salt, or similar) was
|
| OperationCancelled | The asynchronous encryption, decryption, or key derivation operation was cancelled via the supplied CancellationToken before it could complete. The operation produced no output; any partially derived key material has been securely cleared before this exception is thrown. |
| Unknown | An unknown or unspecified cryptographic error occurred that does not map to any other
error code. This value is used as the default in switch expressions when no specific
code matches. If encountered, inspect the exception |
| UnsupportedAlgorithm | The algorithm specified in Algorithm (or passed directly to an overload) is not available on the current Unity platform or .NET runtime. Use IsAlgorithmSupported(CryptoAlgorithm) before requesting a specific algorithm, or use GetBestAvailableAlgorithm() to obtain one that is guaranteed to work. |