{"record":{"id":"0a44ca4d92e46232","repo":"tursodatabase/turso","slug":"unknown-remote-encryption-cipher-value","errorCode":null,"errorMessage":"Unknown remote encryption cipher: {value}","messagePattern":"Unknown remote encryption cipher: (.+?)","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoSyncDatabaseOptions.cs","lineNumber":69,"sourceCode":"        ArgumentException.ThrowIfNullOrWhiteSpace(Key);\n        _ = ReservedBytes;\n    }\n\n    internal static TursoRemoteEncryptionCipher ParseCipher(string value)\n    {\n        ArgumentException.ThrowIfNullOrWhiteSpace(value);\n        return value.Trim().ToLowerInvariant() switch\n        {\n            \"aes256gcm\" => TursoRemoteEncryptionCipher.Aes256Gcm,\n            \"aes128gcm\" => TursoRemoteEncryptionCipher.Aes128Gcm,\n            \"chacha20poly1305\" => TursoRemoteEncryptionCipher.ChaCha20Poly1305,\n            \"aegis128l\" => TursoRemoteEncryptionCipher.Aegis128L,\n            \"aegis128x2\" => TursoRemoteEncryptionCipher.Aegis128X2,\n            \"aegis128x4\" => TursoRemoteEncryptionCipher.Aegis128X4,\n            \"aegis256\" => TursoRemoteEncryptionCipher.Aegis256,\n            \"aegis256x2\" => TursoRemoteEncryptionCipher.Aegis256X2,\n            \"aegis256x4\" => TursoRemoteEncryptionCipher.Aegis256X4,\n            _ => throw new InvalidOperationException($\"Unknown remote encryption cipher: {value}\"),\n        };\n    }\n}\n\npublic sealed class TursoPartialSyncOptions\n{\n    public int? PrefixLength { get; init; }\n    public string? Query { get; init; }\n    public long? SegmentSize { get; init; }\n    public bool Prefetch { get; init; }\n\n    internal void Validate()\n    {\n        if (Query is not null)\n            ArgumentException.ThrowIfNullOrWhiteSpace(Query);\n\n        var hasPrefix = PrefixLength.HasValue;\n        var hasQuery = Query is not null;","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/tursodatabase/turso/blob/c1e59287258d99b309e362a63f48822256e2f65f/bindings/dotnet/src/Turso.Data/TursoSyncDatabaseOptions.cs#L51-L87","documentation":"ParseCipher maps a cipher name string to a TursoRemoteEncryptionCipher enum value. When configuring remote encryption, an unrecognized cipher string throws this InvalidOperationException listing the unknown value.","triggerScenarios":"Setting TursoRemoteEncryptionOptions cipher name to a string not in the accepted list: aegis128l, aegis128x2, aegis128x4, aegis256, aegis256x2, aegis256x4 — e.g. \"aes-256-gcm\", \"AES128\", or a typo like \"aegis-128l\".","commonSituations":"Confusing Turso's AEGIS ciphers with common AES-GCM names; copy-pasted config from another database's encryption settings; case/spacing mismatches or hyphenated variants.","solutions":["Use one of the supported names exactly: aegis128l, aegis128x2, aegis128x4, aegis256, aegis256x2, aegis256x4 (lowercase, no hyphens)","Pick the cipher supported by the server: aegis256 is the common Turso default — confirm with the server's encryption config","Check casing/typos: the value must be lowercase and not hyphenated"],"exampleFix":"// before\noptions.RemoteEncryption = new TursoRemoteEncryptionOptions { Cipher = \"aes-256-gcm\", Key = key };\n// after\noptions.RemoteEncryption = new TursoRemoteEncryptionOptions { Cipher = \"aegis256\", Key = key };","handlingStrategy":"validation","validationCode":"private static readonly HashSet<string> SupportedCiphers = new(StringComparer.Ordinal)\n{ \"aegis128l\", \"aegis128x2\", \"aegis128x4\", \"aegis256\", \"aegis256x2\", \"aegis256x4\" };\n// before constructing options:\n// if (!SupportedCiphers.Contains(cipherName)) throw new ArgumentException($\"Cipher must be one of: {string.Join(\", \", SupportedCiphers)}\");","typeGuard":null,"tryCatchPattern":"try\n{\n    var db = new TursoSyncDatabase(options);\n}\ncatch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Unknown remote encryption cipher\"))\n{\n    logger.LogError(ex, \"Configured cipher '{Cipher}' is not supported; use an aegis cipher name.\", cipherName);\n    throw;\n}","preventionTips":["Keep cipher names in config lowercase, unhyphenated, matching the aegis names exactly","Do not reuse AES-GCM cipher names from other products' encryption configs","Confirm the cipher against your server's remote encryption settings before rollout"],"tags":["dotnet","configuration","encryption","cipher"],"backgroundTag":"unknown-encryption-cipher","analyzedSha":"c1e59287258d99b309e362a63f48822256e2f65f","analyzedAt":"2026-08-31T11:17:35.598Z","contentChangedAt":"2026-08-31T11:17:35.598Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}