# PersonalDataNode

The cipher of `PersonalData` on `node:crypto`. WebCrypto, the default, is asynchronous, which makes each personal field cost a trip through the event loop. This one encrypts and decrypts synchronously, in the same format, so data written with either reads with the other.

```ts
const Keys = PersonalData.layerSql().pipe(
  Layer.provide(PersonalData.layerMasterKeyConfig()),
  Layer.provide(PersonalDataNode.layerCipher)
)
```

It lives in a module of its own so that code for browsers never imports `node:crypto`.

## Variables

### cipher

> `const` **cipher**: [`Cipher`](https://effect-cqrs.dambox.ch/reference/api/personaldata/#cipher)

Defined in: [src/PersonalDataNode.ts:27](https://github.com/davidnussio/effect-cqrs/blob/9d66af7141782f3f89655e6868abe3f141c97632/src/PersonalDataNode.ts#L27)

AES-256-GCM on `node:crypto`.

***

### layerCipher

> `const` **layerCipher**: `Layer.Layer`<`never`>

Defined in: [src/PersonalDataNode.ts:68](https://github.com/davidnussio/effect-cqrs/blob/9d66af7141782f3f89655e6868abe3f141c97632/src/PersonalDataNode.ts#L68)

Provides [cipher](https://effect-cqrs.dambox.ch/reference/api/personaldatanode/#cipher) to the keys and master keys built with it.
