| name | fle-ruby |
| summary | Field-Level Encryption is not supported by the Couchbase Ruby SDK 3.x — alternatives and workarounds |
| description | Field-Level Encryption is not supported by the Couchbase Ruby SDK 3.x — alternatives and workarounds |
| compatibility | Ruby SDK 3.x. FLE not supported. |
| metadata | {"last_verified":"2026-05","handoff":[{"condition":"user asks about FLE concepts or supported SDKs","skill":"fle"},{"condition":"user asks about server-side encryption at rest","skill":"security"}]} |
Field-Level Encryption — Ruby
Ruby SDK 3.x does not support Field-Level Encryption. There is no CryptoManager API.
Alternatives
Option 1 — Encrypt in application code before writing:
require 'openssl'
require 'base64'
def encrypt_field(plaintext, key)
cipher = OpenSSL::Cipher.new('AES-256-GCM')
cipher.encrypt
cipher.key = key
iv = cipher.random_iv
ciphertext = cipher.update(plaintext) + cipher.final
tag = cipher.auth_tag
Base64.strict_encode64(iv + tag + ciphertext)
end
key = OpenSSL::Random.random_bytes(32)
doc = {
name: 'Alice',
ssn: encrypt_field('123-45-6789', key)
}
collection.upsert('user::alice', doc)
Option 2 — Server-side encryption at rest (Couchbase Server 8.x):
See the security skill.