[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Protocol](https://evolu.dev/docs/api-reference/common/local-first/Protocol) › decryptAndDecodeDbChange

```ts
function decryptAndDecodeDbChange(
  message: EncryptedCrdtMessage,
  key: Uint8Array<ArrayBufferLike> &
    Brand<"Entropy"> &
    Brand<"Length32"> &
    Brand<"EncryptionKey">,
): Result<
  DbChange,
  | DecryptWithXChaCha20Poly1305Error
  | ProtocolInvalidDataError
  | ProtocolTimestampMismatchError
>;
```

Defined in: [packages/common/src/local-first/Protocol.ts:1905](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/local-first/Protocol.ts#L1905)

Decrypts and decodes an [EncryptedCrdtMessage](https://evolu.dev/docs/api-reference/common/local-first/Storage/interfaces/EncryptedCrdtMessage) using the provided
owner's encryption key. Verifies that the embedded timestamp matches the
expected timestamp to ensure message integrity.