Enum CryptoAlgorithm
Specifies the cryptographic algorithm to use for encryption and decryption operations performed by ScyllaCrypto and the underlying ICryptoProvider implementations.
Namespace: Scylla.Core.Util.Crypto
Assembly: ScyllaCore.dll
Syntax
public enum CryptoAlgorithm
Remarks
All three algorithms are Authenticated Encryption with Associated Data (AEAD) schemes, meaning they provide both confidentiality (the contents are secret) and integrity (any tampering is detected and rejected during decryption).
Not all algorithms are available on every Unity platform. Use IsAlgorithmSupported(CryptoAlgorithm) to check availability at runtime, or call GetBestAvailableAlgorithm() to let the framework pick the optimal choice for the current platform automatically.
Fields
| Name | Description |
|---|---|
| AESCBCHMAC | AES in Cipher Block Chaining (CBC) mode combined with HMAC-SHA256 authentication, following the Encrypt-then-MAC construction. This algorithm is the primary fallback for platforms where AES-GCM hardware support is unavailable (e.g., certain WebGL configurations). |
| AESGCM | AES in Galois/Counter Mode (GCM) providing authenticated encryption with associated data (AEAD). This is the recommended algorithm for most platforms, offering hardware-accelerated performance on modern CPUs alongside strong confidentiality and integrity guarantees. |
| CHACHA20POLY1305 | ChaCha20-Poly1305 stream cipher with Poly1305 authentication tag, standardised in RFC 8439. A modern AEAD cipher that is particularly well-suited to devices lacking hardware AES acceleration (e.g., older mobile SoCs), where it can outperform AES-GCM in software-only implementations. |