# decryptWith

> **decryptWith**(`unwrapper`): `ReadableWritablePair`\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>, [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\>

Defined in: [packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts:472](https://github.com/FilOzone/synapse-sdk/blob/30608dd46e68d704a96d7ed7c24717c948ec4e4b/packages/filecoin-encryption-envelope/src/aes-gcm-stream.ts#L472)

Decrypt a scheme-2 object using a CEK recovered by `unwrapper`.

For tag 96, the unwrapper is called once with isolated copies of all
recipients in wire order. A tag-16 object has no recipients and fails
without calling it. The returned CEK is validated before any chunk is
decrypted. As with `decrypt`, discard plaintext already read if the stream fails.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `unwrapper` | [`Unwrapper`](/reference/filoz/filecoin-encryption-envelope/namespaces/recipients/type-aliases/unwrapper/) |

## Returns

`ReadableWritablePair`\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>, [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\>